Skills
Skill 14 of 19
MUST be used for Vue.js tasks. Strongly recommends Composition API with <script setup> and TypeScript as the standard approach.
4 minutes · 921 words · 16 sections
Install
npx skills add antfu/skills --skill vue-best-practicesnpx skills add antfu/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Use this skill as an instruction set. Follow the workflow in order unless the user explicitly asks for a different order.
<script setup lang="ts">.vue-options-api-best-practices skill if available.vue-jsx-best-practices skill if available.references/reactivity.mdreferences/sfc.mdreferences/component-data-flow.mdreferences/composables.mdCreate a brief component map before implementation for any non-trivial feature.
components/<feature>/..., composables/use<Feature>.ts) when adding more than one component.These are essential, must-know foundations. Apply all of them in every Vue task using the core references already loaded in section 1.1.
1.1: reactivity (opens in a new tab)ref/reactive), derive everything possible with computed.1.1: sfc (opens in a new tab)<script> → <template> → <style>.v-html, list rendering, conditional rendering choices).Split a component when it has more than one clear responsibility (e.g. data orchestration + UI, or multiple independent UI sections).
useXxx()).Apply objective split triggers. Split the component if any condition is true:
Entry/root and route view rule:
1.1: component-data-flow (opens in a new tab)v-model only for true two-way component contracts.defineProps, defineEmits, and InjectionKey as needed.1.1: composables (opens in a new tab)Do not add these by default. Load the matching reference only when the requirement exists.
<KeepAlive> for stateful view caching -> component-keep-alive (opens in a new tab)<Teleport> for overlays/portals -> component-teleport (opens in a new tab)<Suspense> for async subtree fallback boundaries -> component-suspense (opens in a new tab)<Transition> for enter/leave effects -> transition (opens in a new tab)<TransitionGroup> for animated list mutations -> transition-group (opens in a new tab)Use these only when there is explicit product or technical need.
Performance work is a post-functionality pass. Do not optimize before core behavior is implemented and verified.
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.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
skills/vue-best-practices/SKILL.mdmain, last pushed 23 June 2026.SKILL.md, not by matching a directory convention. One layout observed: skills/*/SKILL.md.h1 and no skipped levels:/antfu/skills.md, and each skill at its own .md URL.24 files · 101 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 14.
Documentation the agent loads on demand, rather than up front.
Everything else published alongside the skill.