vue
by antfuvue skill for Vue 3 code generation with Composition API, <script setup lang="ts">, macros, reactivity, and built-in components. Use it to install guidance and improve vue usage for SFCs, defineProps, defineEmits, defineModel, watchers, Transition, Teleport, Suspense, and KeepAlive.
This skill scores 78/100, which means it is a solid directory listing candidate: agents get a clear trigger surface for Vue 3 work, strong API-specific reference material, and opinionated defaults that reduce guesswork, though users should expect reference-heavy guidance rather than a step-by-step workflow.
- Very clear triggerability: the description explicitly names Vue 3 Composition API, `<script setup lang="ts">`, macros like `defineProps`/`defineEmits`/`defineModel`, watchers, and built-in components.
- Good operational leverage through concrete examples and linked references covering script setup macros, reactivity/lifecycle APIs, and advanced built-ins like Transition, Teleport, Suspense, and KeepAlive.
- Trustworthy and current framing: frontmatter cites generation from vuejs/docs, includes source metadata, and states a Vue 3.5 baseline with explicit coding preferences.
- Workflow guidance is limited: structural signals show no explicit workflow section, scripts, rules, or install command, so execution still depends on the agent translating reference material into task-specific steps.
- The skill is opinionated rather than neutral, for example insisting on Composition API and discouraging Reactive Props Destructure, which may not fit teams using Options API or different conventions.
Overview of vue skill
What the vue skill is for
The vue skill is a focused guide for generating and reviewing Vue 3 code with current best practices, especially Composition API, <script setup lang="ts">, compiler macros, reactivity APIs, and built-in components like Transition, Teleport, Suspense, and KeepAlive. It is most useful when you want an AI agent to produce Vue Single File Components that already follow a modern Vue style instead of falling back to older Options API patterns.
Who should install this vue skill
This vue skill fits frontend developers, full-stack developers, and AI users who regularly ask for Vue components, composables, or refactors. It is especially valuable if you want outputs that are TypeScript-first, macro-aware, and aligned with Vue 3.5-era docs rather than mixed Vue 2 / early Vue 3 habits.
Real job-to-be-done
Most users do not need a generic framework summary. They need the agent to reliably write Vue code that:
- uses Composition API by default
- prefers
<script setup lang="ts"> - handles
defineProps,defineEmits, anddefineModelcorrectly - chooses
ref,shallowRef,computed, andwatchmore carefully - reaches for advanced built-ins only when they actually fit
That is the practical value of vue for Frontend Development: reducing cleanup after AI-generated code.
What makes this skill meaningfully different
The strongest differentiator is opinionated guidance. The source explicitly prefers TypeScript, <script setup lang="ts">, and Composition API, and it discourages Reactive Props Destructure. It also includes focused references for:
- script setup macros
- reactivity and newer core APIs
- advanced built-in components and directives
That makes the skill better for implementation work than a broad “teach me Vue” prompt.
What this skill does not try to cover
This is not a full Vue ecosystem map. It is not a replacement for deep docs on routing, state libraries, SSR frameworks, testing, or build tooling. If your main task is Nuxt architecture, Vue Router setup, Pinia design, or deployment pipelines, the vue skill helps with component-level code style but should not be your only source.
How to Use vue skill
Install context for vue
Install the skill into your skills-enabled environment with:
npx skills add antfu/skills --skill vue
The repository evidence shows the skill lives under skills/vue in antfu/skills. There is no separate package install for Vue itself here; this is guidance for better AI-assisted Vue generation, not the framework runtime.
Read these files first
If you want the highest-signal path before using the vue skill, read these in order:
skills/vue/SKILL.mdskills/vue/references/script-setup-macros.mdskills/vue/references/core-new-apis.mdskills/vue/references/advanced-patterns.mdskills/vue/GENERATION.md
Why this order:
SKILL.mdgives the operating preferences and scope.- The three reference files hold the practical details the agent is likely to apply.
GENERATION.mdtells you the material is generated from Vue docs and tracks a recent snapshot.
What inputs the vue skill needs
The vue usage quality depends heavily on the request you pass in. Give the agent:
- component purpose
- props and emitted events
- whether you need
v-model - expected state shape
- async data needs
- whether the output should be a component, composable, or pattern example
- Vue version constraints if you are not on recent Vue 3
- TypeScript requirement
- any UI or performance constraints
Weak input:
- “Make a Vue component for search.”
Strong input:
- “Create a Vue 3.5 SFC using
<script setup lang="ts">for a searchable product list. Props:items,loading,modelValue. Emitupdate:modelValueandselect. UsedefineModelif appropriate, debounce local search input, and prefershallowReffor large item arrays.”
Turn rough goals into strong vue prompts
To invoke the vue skill well, ask for implementation choices explicitly. Good prompt structure:
- state the artifact
- state the Vue conventions
- define inputs and outputs
- add behavior and constraints
- ask for reasoning where tradeoffs matter
Example:
“Using the vue skill style, write a Vue 3 component with <script setup lang="ts">. Use Composition API only. Define typed props and emits, avoid Options API, and explain whether ref or shallowRef is the better fit for the main state. Include template and minimal styles.”
This works better than a generic “write Vue” request because it matches the skill’s built-in preferences.
Default coding style the skill will push toward
The source material strongly nudges the agent toward:
- Vue 3.5
- Composition API
<script setup lang="ts">- macro-based component definitions
- typed props and emits
- selective use of
shallowReffor performance-sensitive data
If you want Options API, plain JavaScript, or legacy Vue patterns, say so explicitly because the skill is biased away from them.
Best use cases for vue usage
This vue guide is strongest for:
- authoring new Vue SFCs
- refactoring old components into
<script setup> - defining typed props, emits, and models
- choosing between
ref,reactive,computed, and watchers - using
Transition,Teleport,Suspense, orKeepAlive - producing composable examples that follow modern Vue patterns
It is less useful for purely visual design work or framework-agnostic frontend tasks.
Practical workflow for first output
A reliable workflow is:
- Ask for a first-pass Vue SFC with explicit props, emits, and state shape.
- Review whether the generated API matches your real component contract.
- Ask for a second pass that tightens reactivity choices, typing, and edge cases.
- Only then ask for advanced features like transitions or suspense boundaries.
This sequence matters because advanced Vue features are easy to overuse if the basic state flow is still unclear.
Repository-backed details that affect output quality
Useful details surfaced from the skill source:
defineModelis treated as available in Vue 3.4+withDefaultsremains relevant for Vue 3.4 and belowreactive()loses reactivity on destructuringshallowRefis preferred when deep reactivity is unnecessary- built-ins such as
TransitionandSuspenseare covered with practical patterns
These are exactly the kinds of details that improve generated code beyond a shallow repo skim.
Example requests that fit the skill well
Good vue usage requests:
- “Refactor this Options API component into
<script setup lang="ts">.” - “Generate typed
definePropsanddefineEmitsfor this form component.” - “Show a Vue 3 example using
Teleportfor a modal.” - “Explain whether to use
watch,watchEffect, orcomputedhere.” - “Rewrite this component to use
defineModelon Vue 3.4+.”
Common mismatch cases before you install
Do not expect the vue skill alone to solve:
- project scaffolding
- router architecture
- state store design across a large app
- SSR or Nuxt-specific decisions
- test runner setup
- CSS framework integration details
If those are your main blockers, install this for component generation quality, not as your complete Vue stack guide.
vue skill FAQ
Is this vue skill good for beginners?
Yes, if you are already building with Vue 3 and want cleaner AI output. It is not a beginner curriculum, but it does reduce confusion by favoring one clear style: Composition API with <script setup lang="ts">. That consistency helps newer users avoid mixed patterns.
Does the vue skill support older Vue patterns?
Not as a first choice. The source says to always use Composition API over Options API. If your codebase is legacy-heavy, you can still use the skill, but you should explicitly request compatibility constraints and review migrations carefully.
How is this different from a normal prompt about Vue?
A normal prompt often produces inconsistent Vue code: mixed APIs, weaker typing, or outdated macros. The vue skill gives the agent a narrower playbook, including preferences, modern macro usage, and targeted references. That usually means less manual correction.
Is vue install enough if I work with Nuxt or a larger stack?
No. vue install helps with component and reactivity guidance, but larger stack concerns still need Nuxt, routing, state, data fetching, and deployment knowledge. Use this as a Vue code-generation layer, not a whole application architecture skill.
When should I not use the vue skill?
Skip it when your task is:
- framework-neutral UI code
- React/Angular/Svelte work
- backend-only implementation
- heavy Nuxt-specific conventions with little raw Vue component work
- strict legacy Options API maintenance where modern patterns are not allowed
Does it cover advanced Vue features?
Yes, but selectively. The included references cover Transition, Teleport, Suspense, KeepAlive, directives, reactivity APIs, lifecycle hooks, and macros. That is enough for many real frontend tasks without becoming a full Vue encyclopedia.
How to Improve vue skill
Give the agent version and compatibility boundaries
The skill is based on Vue 3.5-era guidance. If your app uses Vue 3.3, 3.4, or has older macro support limits, say that up front. This is especially important for features like defineModel and for how defaults are handled in props.
Specify component contracts, not just UI ideas
The fastest way to improve vue output is to provide:
- prop names and types
- emitted events
- model bindings
- async states
- empty and error states
- parent-child responsibilities
The skill is strong at implementation once the contract is clear. It is weaker when asked to infer a complete API from a vague UI description.
Ask for reactivity choices explicitly
Many Vue mistakes come from state modeling, not template syntax. Prompt for tradeoffs like:
- “Use
shallowRefif deep tracking is unnecessary.” - “Explain whether
computedorwatchis more appropriate.” - “Avoid destructuring reactive objects unless using
toRefs.”
This aligns with the strongest material in the references and improves code quality more than asking for “best practices” in the abstract.
Catch common failure modes early
Review first outputs for these issues:
- Options API appearing when you wanted Composition API
- plain
<script>instead of<script setup lang="ts"> - untyped
definePropsordefineEmits - unnecessary deep reactivity
- misuse of watchers where
computedwould be simpler - advanced built-ins added without a real need
These are the most likely ways generic generation drifts away from the skill’s intended quality bar.
Iterate on one concern at a time
After the first answer, do not ask for everything at once. Improve in passes:
- API shape
- typing and macros
- reactivity correctness
- rendering states
- advanced UX patterns
That makes it easier to verify each change and keeps the agent anchored to the vue guide rather than regenerating the whole component unpredictably.
Use the reference files as escalation paths
When the first result is close but not solid, direct the agent toward the skill’s own references:
references/script-setup-macros.mdfor props, emits, models, slots, and macro syntaxreferences/core-new-apis.mdfor reactivity, watchers, and composablesreferences/advanced-patterns.mdfor built-in components and directives
This is one of the most practical ways to improve vue for Frontend Development outputs without rewriting your prompt from scratch.
Ask for a minimal and a production pass
A high-yield pattern is:
- first request: minimal working SFC
- second request: production pass with typing, states, accessibility, and performance choices
This avoids bloated first drafts and surfaces where Vue-specific decisions actually matter.
Keep the skill aligned with your codebase rules
If your team has conventions that differ from the skill’s defaults, state them directly. For example:
- JavaScript only
- no
defineModel - avoid
Suspense - use explicit prop objects instead of type-only declarations
- no advanced built-ins unless requested
The vue skill is opinionated, which is useful, but you will get the best results when its defaults are adjusted to your real repository constraints.
