Index of every page on this site: llms.txt
All skills
antfu avatar

/vue

@7de210b official
by Anthony Fuantfu/skills6k stars
342
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/antfu/skills/vue

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈54 tokens for metadata: the name and description. ≈519 when used: this file. ≈4.1k more on demand in 4 files.

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈216 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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
Reactivity & Lifecycle ref, shallowRef, computed, watch, watchEffect, effectScope, lifecycle hooks, composables core-new-apis

Features

Topic Description Reference
Built-in Components & Directives Transition, Teleport, Suspense, KeepAlive, v-memo, custom directives advanced-patterns

Quick Reference

Component Template

<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

// 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'

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides comprehensive guidelines and references for Vue 3 Composition API and <script setup>. It contains standard code examples and documentation from reputable sources. No security risks were identified.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer8mo

    1/5 files flagged

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7de210b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated last month
Other metadata
metadata
{
  "author": "Anthony Fu",
  "version": "2026.9.25",
  "source": "Generated from https://github.com/vuejs/docs, scripts at https://github.com/antfu/skills"
}
  • Vue
  • TypeScript
  • vue3
  • composition-api
  • script-setup
  • reactivity
  • components
  • sfc

README badge

README badge for antfu/skills/vue

Provides Vue 3 Composition API patterns, script setup macros (defineProps, defineEmits, defineModel), reactivity utilities (ref, computed, watch), and built-in components (Transition, Teleport, Suspense, KeepAlive). Use when writing Vue SFCs with TypeScript and <script setup> syntax.

Generated from the current SKILL.md.

Does this skill cover Vue 2 or Vue 3?
This skill is based on Vue 3.5 and uses the Composition API exclusively. It does not cover Vue 2 or the Options API.
Should I use script setup or the traditional script block?
Always use `<script setup lang="ts">`. The skill discourages the traditional `<script>` block in favor of the more concise setup macro syntax.
Does this skill cover advanced patterns like Transition and Suspense?
Yes. The skill includes Vue's built-in components (Transition, Teleport, Suspense, KeepAlive) and directives like v-memo and custom directives.
When should I use shallowRef instead of ref?
Use shallowRef when deep reactivity is not needed, as it offers better performance than ref for large objects or arrays.
Does this skill recommend TypeScript?
Yes. The skill prefers TypeScript over JavaScript and all examples use `lang="ts"`.

Generated from the current SKILL.md. These answers refresh after source changes.