vue — Claude Code skill: what it does, how to install
This skill guides agents through Vue 3 Composition API, script setup, and reactivity. Use it when writing Vue SFCs or built-in component flows.
npx skills add antfu/skills --skill vue -a claude-codeWhat vue does
The skill directs agents toward Vue 3 Composition API and <script setup lang="ts">. It covers defineProps, defineEmits, defineModel, defineExpose, defineOptions, defineSlots, generics, ref, shallowRef, computed, watch, watchEffect, lifecycle hooks, and composables.
Its reference material is grouped around script setup macros, core reactivity APIs, and advanced patterns. The advanced section covers Transition, Teleport, Suspense, KeepAlive, v-memo, and custom directives. It also recommends TypeScript and shallowRef when deep reactivity is unnecessary.
For a codebase built around the Options API, check whether these recommendations fit before applying them. The skill is available for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode.
What it helps with
- write Vue SFCs with Composition API
- type props, emits, and model bindings
- configure watchers and component lifecycle hooks
- choose between
refandshallowRef - add
Transition,Teleport, orSuspense
Example prompts for the agent
- Create a Vue SFC for a user profile with `<script setup lang="ts">`, typed `defineProps`, and `defineEmits`.
- Review this Vue component, move it from Options API to Composition API, and explain where `shallowRef` fits.
- Add `defineModel`, `watch`, and `onMounted` to this component, then use `Teleport` for its modal.
How to install vue
1Skills CLI (Vercel)
npx skills add antfu/skills --skill vue -a claude-code2Manually: put the files in place
~/.claude/skills/vue/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vue/
1Skills CLI (Vercel)
npx skills add antfu/skills --skill vue -a codex2Manually: put the files in place
.agents/skills/vue/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add antfu/skills --skill vue -a cursor2Manually: put the files in place
.cursor/skills/vue/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install antfu/skills vue2Manually: put the files in place
.github/skills/vue/SKILL.md1Skills CLI (Vercel)
npx skills add antfu/skills --skill vue -a gemini-cli2Platform CLI
gemini skills install https://github.com/antfu/skills --path skills/vueManually: put the files in place
.devin/skills/vue/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add antfu/skills --skill vue -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set7
The whole set →Similar
Questions about vue
How do I install vue in Claude Code?
Run npx skills add antfu/skills --skill vue -a claude-code, then run npx skills add antfu/skills --skill vue -a claude-code again. The skill file will be placed at ~/.claude/skills/vue/SKILL.md.
What does the vue skill do?
It gives an agent guidance for Vue 3 Composition API, script setup, reactivity, watchers, lifecycle hooks, and built-in components.
Which Vue built-in components does vue cover?
The skill covers Transition, Teleport, Suspense, and KeepAlive, along with v-memo and custom directives.
Source text
SKILL.md · MIT
---
name: vue
description: Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
metadata:
author: Anthony Fu
version: "2026.9.25"
source: Generated from https://github.com/vuejs/docs, scripts at https://github.com/antfu/skills
---
# Vue
> Based on Vue 3.5, generated at 2026-09-25. Always use Composition API with `<script setup lang="ts">`.
## Preferences
- Prefer TypeScript over JavaScript
- Prefer `<script setup lang="ts">` over `<script>`
- For performance, prefer `shallowRef` over `ref` if deep reactivity is not needed
- Always use Composition API over Options API
- Discourage using Reactive Props Destructure
## Core
| Topic | Description | Reference |
|-------|-------------|-----------|
| Script Setup & Macros | `<script setup>`, defineProps, defineEmits, defineModel, defineExpose, defineOptions, defineSlots, generics | [script-setup-macros](references/script-setup-macros.md) |
| Reactivity & Lifecycle | ref, shallowRef, computed, watch, watchEffect, effectScope, lifecycle hooks, composables | [core-new-apis](references/core-new-apis.md) |
## Features
| Topic | Description | Reference |
|-------|-------------|-----------|
| Built-in Components & Directives | Transition, Teleport, Suspense, KeepAlive, v-memo, custom directives | [advanced-patterns](references/advanced-patterns.md) |
## Quick Reference
### Component Template
```vue
<script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue'
const props = defineProps<{
title: string
count?: number
}>()
const emit = defineEmits<{
update: [value: string]
}>()
const model = defineModel<string>()
const doubled = computed(() => (props.count ?? 0) * 2)
watch(() => props.title, (newVal) => {
console.log('Title changed:', newVal)
})
onMounted(() => {
console.log('Component mounted')
})
</script>
<template>
<div>{{ title }} - {{ doubled }}</div>
</template>
```
### Key Imports
```ts
// Reactivity
import { ref, shallowRef, computed, reactive, readonly, toRef, toRefs, toValue } from 'vue'
// Watchers
import { watch, watchEffect, watchPostEffect, onWatcherCleanup } from 'vue'
// Lifecycle
import { onMounted, onUpdated, onUnmounted, onBeforeMount, onBeforeUpdate, onBeforeUnmount } from 'vue'
// Utilities
import { nextTick, defineComponent, defineAsyncComponent } from 'vue'
```
© Anthony Fu · MIT · antfu/skills