vuejs-ai avatar

Create Adaptable Composable

The create-adaptable-composable skill guides developers in building reusable Vue composables that accept both reactive and non-reactive inputs (values, refs, or getters) through MaybeRef and MaybeRefOrGetter type utilities. It's designed for Vue 3+ developers who need to create library-grade composables that work flexibly across different contexts by normalizing inputs with toValue() and toRef() inside reactive effects. This skill solves the problem of creating composables with inconsistent APIs by establishing clear patterns for handling inputs that may or may not be reactive.

skills.sh installs
14.8K
GitHub stars
3.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add vuejs-ai/skills --skill create-adaptable-composable --agent claude-code

Installs into .claude/skills of the current project.

Files

Create Adaptable Composable

Adaptable composables are reusable functions that can accept both reactive and non-reactive inputs. This allows developers to use the composable in a variety of contexts without worrying about the reactivity of the inputs.

Steps to design an adaptable composable in Vue.js:

  1. Confirm the composable's purpose and API design and expected inputs/outputs.
  2. Identify inputs params that should be reactive (MaybeRef / MaybeRefOrGetter).
  3. Use toValue() or toRef() to normalize inputs inside reactive effects.
  4. Implement the core logic of the composable using Vue's reactivity APIs.

Core Type Concepts

Type Utilities

/**
 * value or writable ref (value/ref/shallowRef/writable computed)
 */
export type MaybeRef<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T>;

/**
 * MaybeRef<T> + ComputedRef<T> + () => T
 */
export type MaybeRefOrGetter<T = any> = MaybeRef<T> | ComputedRef<T> | (() => T);

Policy and Rules

Sponsors

Details

Repository
github.com/vuejs-ai/skills
Category
Frontend Development

More from vuejs-ai/skills

All 9
1jeffallan avatarflutter-expertjeffallan/claude-skillsUse when building cross-platform applications with Flutter 3+ and Dart. Invoke for widget development, Riverpod/Bloc state management, GoRouter navigation, plat14.7Kskills.sh installs
2tavily-ai avatartavily-dynamic-searchtavily-ai/skillsProgrammatic web search with context isolation. Use this skill for any research task where you need to search the web, filter results, and extract specific info14Kskills.sh installs
3backnotprop avatarplannotator-visual-explainerbacknotprop/plannotatorGenerate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide dec13.9Kskills.sh installs
4openai avatarpdfopenai/skillsUse when tasks involve reading, creating, or reviewing PDF files where rendering and layout matter; prefer visual checks by rendering pages (Poppler) and use Py13.7Kskills.sh installs
5shopify avatarshopify-storefront-graphqlshopify/shopify-ai-toolkitUse for custom storefronts requiring direct GraphQL queries/mutations for data fetching and cart operations. Choose this when you need full control over data fe13.7Kskills.sh installs
6dart-lang avatardart-setup-ffi-assetsdart-lang/skillsGuides agents in compiling and packaging C/C++ source code into dynamic or static libraries (Code Assets) using Dart's Native Assets hook system (via hook/build13.1Kskills.sh installs