create-adaptable-composable
by vuejs-aicreate-adaptable-composable helps Vue 3 and Nuxt 3 developers design reusable composables that accept plain values, refs, computed values, and getters. It focuses on choosing MaybeRef or MaybeRefOrGetter and normalizing with toValue() or toRef() inside watch() or watchEffect() for predictable reactivity.
This skill scores 71/100, which means it is acceptable to list for directory users who want a focused Vue composable pattern, but they should expect moderate implementation guesswork. The repository gives a clear trigger and a real workflow around MaybeRef/MaybeRefOrGetter plus toValue()/toRef() normalization, so it offers more agent leverage than a generic prompt. However, the install-decision page is limited by the lack of support files, runnable examples, and explicit setup guidance.
- Strong triggerability: the description clearly targets creating reusable Vue composables that accept plain values, refs, or getters.
- Operationally useful core guidance: it outlines a concrete workflow for identifying reactive params and normalizing them with toValue()/toRef() inside watch/watchEffect.
- Good conceptual leverage for Vue 3/Nuxt 3 work: it includes explicit type utility definitions and policy guidance for MaybeRef and MaybeRefOrGetter usage.
- Adoption clarity is limited because the skill has no install command, support files, or referenced examples beyond the SKILL.md content.
- The evidence suggests a pattern guide more than a full workflow asset, so agents may still need to infer edge cases and final implementation details.
Overview of create-adaptable-composable skill
The create-adaptable-composable skill helps you design Vue composables that work cleanly with plain values, refs, shallow refs, writable computed values, computed refs, and getters. In practice, that means callers can pass either static or reactive inputs without you maintaining separate APIs.
What create-adaptable-composable actually solves
The real job-to-be-done is not “write any composable,” but “write a reusable composable API that stays ergonomic across app code, shared libraries, and mixed reactivity contexts.” If you build Vue utilities for other developers, this matters more than the implementation details.
Best-fit users and projects
This skill is best for:
- Vue 3 or Nuxt 3 developers
- library and design-system authors
- teams standardizing composable patterns
- frontend developers refactoring rigid composables into more flexible APIs
It is especially useful when your composable should accept a value today but may need to accept a ref or getter tomorrow.
Core idea behind the skill
The key pattern in create-adaptable-composable is to accept MaybeRef or MaybeRefOrGetter inputs, then normalize them with toValue() or toRef() inside reactive effects such as watch() or watchEffect(). That keeps behavior reactive without forcing every caller into the same input style.
Why this skill is different from a generic Vue prompt
A generic prompt may produce a composable that works for one demo case. The create-adaptable-composable skill is narrower and more useful: it centers API adaptability, type choices, and normalization rules that directly affect whether the composable is library-grade or brittle.
Main adoption constraint
This skill is intentionally narrow. It does not give you a full architecture, testing setup, or packaging workflow. If you need end-to-end library scaffolding, treat create-adaptable-composable as a focused design aid for the composable API layer, not a complete project generator.
How to Use create-adaptable-composable skill
Install context for create-adaptable-composable
Use this skill from the vuejs-ai/skills collection:
npx skills add vuejs-ai/skills --skill create-adaptable-composable
Because the repository evidence shows only a single SKILL.md file, installation is lightweight but also means you should expect concise guidance rather than a large support system of examples or helper scripts.
Read this file first
Start with:
skills/create-adaptable-composable/SKILL.md
There are no extra resources/, rules/, or example folders surfaced here, so the core skill file is the source of truth.
Know when to invoke the skill
Call create-adaptable-composable when your request sounds like any of these:
- “Make this composable accept both refs and plain values”
- “Refactor this Vue composable to be reusable in more contexts”
- “Design a composable API for library consumers”
- “Support getters and computed inputs without breaking reactivity”
Do not reach for it if your problem is mainly routing, SSR data fetching, state architecture, or component rendering.
The minimum input the skill needs
To get a useful result, provide:
- the composable name
- the purpose of the composable
- each input parameter
- which inputs may be reactive
- expected return shape
- whether consumers should be allowed to pass getters
- any constraints around writable vs read-only inputs
Without that, the model may default to broad Vue patterns instead of the adaptable-input pattern this skill is built for.
Turn a rough request into a strong prompt
Weak prompt:
- “Create a Vue composable for filtering items.”
Better prompt:
- “Use create-adaptable-composable to design a Vue 3 composable named
useFilteredItems. Inputs:itemsmay be an array, ref, or getter returning an array;querymay be a string, ref, computed, or getter; output should expose a computed filtered list and be read-only from the caller perspective. PreferMaybeRefOrGetterfor read-only inputs and normalize withtoValue()inside reactive logic.”
That stronger prompt works better because it defines API intent, input variability, and reactivity policy up front.
Input design rules that materially affect output quality
The most important decision is input category:
- Use
MaybeRefOrGetter<T>for read-only, computed-friendly inputs - Use
MaybeRef<T>when writable ref semantics matter - Normalize values inside
watch()orwatchEffect()withtoValue()ortoRef()
If you do not specify whether an input must be writable, the result may expose the wrong contract.
Suggested workflow for create-adaptable-composable usage
- Define the composable’s public API.
- Mark each parameter as plain-only, maybe-reactive, or writable-reactive.
- Ask the skill to choose between
MaybeRefandMaybeRefOrGetter. - Ask for normalization points, not just final code.
- Review whether
watch,watchEffect,toValue, andtoRefare used in the right places. - Test the generated composable with a plain value, a
ref, and a getter.
This workflow is more reliable than asking for “a flexible composable” in one sentence.
What to look for in the generated code
Good create-adaptable-composable usage should produce code that:
- accepts mixed input styles without duplicate branches
- keeps reactive tracking intact
- avoids premature unwrapping outside reactive contexts
- uses clear TypeScript utility types
- preserves a stable, understandable caller API
If the output unwraps values too early at function entry, it may lose reactivity.
Practical prompt pattern for Frontend Development
For create-adaptable-composable for Frontend Development, ask for both API and reasoning:
- composable purpose
- example caller variants
- chosen type utility per param
- where normalization happens
- why that choice preserves reactivity
- one or two usage examples
This helps you review the design, not just paste code.
Example prompt you can reuse
“Use the create-adaptable-composable skill to design a Vue 3 composable named usePagination. page may be a number, ref, computed, or getter. pageSize may be a number or ref. total is read-only and may be a getter. Return derived pagination state and navigation helpers. Explain which params should use MaybeRef vs MaybeRefOrGetter, and normalize inputs with toValue() or toRef() only where reactivity is preserved.”
create-adaptable-composable skill FAQ
Is create-adaptable-composable only for library authors?
No. It is most valuable for shared libraries, but app teams also benefit when composables are reused across pages, features, or teams. If you expect mixed caller input types, this skill is worth using.
Is this better than an ordinary prompt?
Usually yes, when adaptability is the real requirement. Ordinary prompts often generate composables that assume ref inputs only, or plain values only. The create-adaptable-composable skill keeps the design centered on flexible input contracts.
Does it require Vue 3 or Nuxt 3?
Yes. The repository compatibility states Vue 3+ or Nuxt 3+. The guidance relies on APIs and typing patterns from the modern Vue reactivity model.
When should I not use create-adaptable-composable?
Skip it when:
- the composable is intentionally private and single-use
- all inputs are guaranteed static
- your main problem is networking, caching, or framework integration
- flexibility would make the API harder to understand than the use case justifies
Not every composable needs maybe-reactive inputs.
Is it beginner-friendly?
Moderately. Beginners can use it, but it helps if you already understand ref, computed, and watch. The tricky part is not syntax; it is choosing when an input should be writable, read-only, or getter-friendly.
Does the skill provide many examples?
No. Based on the surfaced repository structure, the guidance is compact and mostly contained in SKILL.md. Expect principles and patterns rather than a large cookbook.
How to Improve create-adaptable-composable skill
Give clearer API intent before asking for code
The fastest way to improve create-adaptable-composable results is to describe the caller contract, not just the feature. Say what each parameter represents, whether callers may mutate it, and which caller forms must be supported.
Specify parameter-by-parameter reactivity
Instead of:
- “Inputs can be reactive”
Use:
- “
sourcecan be a getter or computed” - “
selectedIdcan be writable” - “
optionsshould stay plain and non-reactive”
This prevents over-generalized typing and unnecessary reactivity wrappers.
Ask the model to justify MaybeRef vs MaybeRefOrGetter
A strong iteration prompt is:
- “For each parameter, explain why you chose
MaybeReforMaybeRefOrGetter.”
That exposes weak assumptions early and improves trust in the final API.
Watch for the main failure modes
Common problems include:
- unwrapping values once at the top of the composable
- using
MaybeRefwhere getter support is needed - exposing writable semantics accidentally
- returning values that no longer update reactively
- adding flexibility to every parameter even when it hurts clarity
These are exactly the points to review after first output.
Provide caller examples to improve the generated design
If you show three invocation styles, output quality usually improves:
- plain value usage
refusage- getter or computed usage
That forces the API to prove it is genuinely adaptable, not just typed loosely.
Iterate on the first draft with edge cases
After the first result, ask:
- “Will this still track updates if
queryis a getter?” - “Should this parameter be read-only?”
- “What happens if the caller passes a plain value first and later changes to a ref-based usage pattern?”
- “Can you simplify the API without losing adaptability?”
These questions produce better refinement than asking for a total rewrite.
Keep create-adaptable-composable focused
The skill works best when scoped tightly to adaptable composable design. If you combine it with unrelated asks like testing, docs, publishing, and SSR behavior in one prompt, the output may become generic. For better create-adaptable-composable guide results, solve the adaptable API first, then layer on the rest.
