vue-options-api-best-practices — Claude Code Vue 3 skill
Guidance for Vue 3 Options API components, covering TypeScript, method context, and lifecycle hook pitfalls. Useful when reviewing or writing Options API code.
npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a claude-codeWhat vue-options-api-best-practices does
The skill collects guidance on Options API typing, including component properties, this, event handlers, complex props, and computed return types. Its linked references show Options API solutions only.
It also covers methods and lifecycle hooks that lose component context, plus debounced methods whose state is shared across component instances. That shared state is worth checking when a component has multiple instances. Install it for Claude Code with npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a claude-code; the skill file is at ~/.claude/skills/vue-options-api-best-practices/SKILL.md.
What it helps with
- infer component property types
- type the Options API
thiscontext - fix lost context in methods and lifecycle hooks
- check shared state in debounced methods
- document types for complex props and computed values
Example prompts for the agent
- Review this Vue 3 component for Options API typing issues, especially in `props` and `this`.
- Explain why this component method loses its instance context and suggest an Options API fix.
- Check whether this lifecycle hook and debounced method behave correctly across multiple component instances.
How to install vue-options-api-best-practices
1Skills CLI (Vercel)
npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a claude-code2Manually: put the files in place
~/.claude/skills/vue-options-api-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vue-options-api-best-practices/
1Skills CLI (Vercel)
npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a codex2Manually: put the files in place
.agents/skills/vue-options-api-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a cursor2Manually: put the files in place
.cursor/skills/vue-options-api-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vuejs-ai/skills vue-options-api-best-practices2Manually: put the files in place
.github/skills/vue-options-api-best-practices/SKILL.md1Skills CLI (Vercel)
npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a gemini-cli2Platform CLI
gemini skills install https://github.com/vuejs-ai/skills --path skills/vue-options-api-best-practicesManually: put the files in place
.devin/skills/vue-options-api-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set7
The whole set →Similar
Questions about vue-options-api-best-practices
How do I install vue-options-api-best-practices in Claude Code?
Run npx skills add vuejs-ai/skills --skill vue-options-api-best-practices -a claude-code. The skill file is located at ~/.claude/skills/vue-options-api-best-practices/SKILL.md.
What does vue-options-api-best-practices do?
It provides Vue 3 Options API guidance for TypeScript, component method context, and lifecycle hooks. Its reference solutions use Options API.
What TypeScript topics does the skill cover?
It points to references on component property inference, event handler types, complex props, injected properties, and computed return types.
Source text
SKILL.md · MIT
--- name: vue-options-api-best-practices description: "Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only." version: 2.0.0 license: MIT author: github.com/vuejs-ai --- Vue.js Options API best practices, TypeScript integration, and common gotchas. ### TypeScript - Need to enable TypeScript type inference for component properties → See [ts-options-api-use-definecomponent](reference/ts-options-api-use-definecomponent.md) - Enabling type safety for Options API this context → See [ts-strict-mode-options-api](reference/ts-strict-mode-options-api.md) - Using old TypeScript versions with prop validators → See [ts-options-api-arrow-functions-validators](reference/ts-options-api-arrow-functions-validators.md) - Event handler parameters need proper type safety → See [ts-options-api-type-event-handlers](reference/ts-options-api-type-event-handlers.md) - Need to type object or array props with interfaces → See [ts-options-api-proptype-complex-types](reference/ts-options-api-proptype-complex-types.md) - Injected properties missing TypeScript types completely → See [ts-options-api-provide-inject-limitations](reference/ts-options-api-provide-inject-limitations.md) - Complex computed properties lack clear type documentation → See [ts-options-api-computed-return-types](reference/ts-options-api-computed-return-types.md) ### Methods & Lifecycle - Methods aren't binding to component instance context → See [no-arrow-functions-in-methods](reference/no-arrow-functions-in-methods.md) - Lifecycle hooks losing access to component data → See [no-arrow-functions-in-lifecycle-hooks](reference/no-arrow-functions-in-lifecycle-hooks.md) - Debounced functions sharing state across component instances → See [stateful-methods-lifecycle](reference/stateful-methods-lifecycle.md)
© github.com/vuejs-ai · MIT · vuejs-ai/skills