Create Adaptable Composable

Create a library-grade Vue composable that accepts maybe-reactive inputs (MaybeRef / MaybeRefOrGetter) so callers can pass a plain value, ref, or getter. Normalize inputs with toValue()/toRef() inside reactive effects (watch/watchEffect) to keep behavior predictable and reactive. Use this skill when user asks for creating adaptable or reusable composables.

3,356 stars 199 forksFrontend & Design Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add vuejs-ai/skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add vuejs-ai/skills --skill create-adaptable-composable
Manual install
git clone --depth 1 https://github.com/vuejs-ai/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/create-adaptable-composable ~/.claude/skills/create-adaptable-composable

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 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

```ts
/**
 * 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

- Read-only, computed-friendly input: use `MaybeRefOrGetter`
- Needs to be writable / two-way input: use `MaybeRef`
- Parameter might be a function value (callback/predicate/comparator): do not use `MaybeRefOrGetter`, or you may accidentally invoke it as a getter.
- DOM/Element targets: if you want computed/derived targets, use `MaybeRefOrGetter`.

When `MaybeRefOrGetter` or `MaybeRef` is used: 
- resolve reactive value using `toRef()` (e.g. watcher source)
- resolve non-reactive value using `toValue()`
Read the full skill on GitHub

Details

Skill name
create-adaptable-composable
Path
skills/create-adaptable-composable/SKILL.md
License
MIT
Repo updated
23 October 2026

FAQ

What does the Create Adaptable Composable skill do?

Create a library-grade Vue composable that accepts maybe-reactive inputs (MaybeRef / MaybeRefOrGetter) so callers can pass a plain value, ref, or getter. Normalize inputs with toValue()/toRef() inside reactive effects (watch/watchEffect) to keep behavior predictable and reactive. Use this skill when user asks for creating adaptable or reusable composables.

How do I install the Create Adaptable Composable skill?

Claude Code plugin: /plugin marketplace add vuejs-ai/skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Create Adaptable Composable popular?

It lives in vuejs-ai/skills, which has 3,356 GitHub stars and 199 forks.

Related skills

Vue Best Practices

3.4k

vuejs-ai/skills

MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.

Frontend & Design199

Vue Router Best Practices

3.4k

vuejs-ai/skills

Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.

Frontend & Design199

Vue Testing Best Practices

3.4k

vuejs-ai/skills

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.

Testing & QA199

Vue Debug Guides

3.4k

vuejs-ai/skills

Vue 3 debugging and error handling for runtime errors, warnings, async failures, and SSR/hydration issues. Use when diagnosing or fixing Vue issues.

Frontend & Design199

UI Styling

2.2k

mrgoonie/claudekit-skills

Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.

Frontend & DesignIn 2 lists418

Vue Jsx Best Practices

3.4k

vuejs-ai/skills

JSX syntax in Vue (e.g., class vs className, JSX plugin config).

Frontend & Design199

Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.