Back

Vue

Writing & docs36.5K installs

What it does

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.

Install

npx skills add https://github.com/antfu/skills --skill vue

Website

www.skills.sh/antfu/skills/vue

Details

From the skill’s SKILL.md or README, by its authors. View the original

Vue

> Based on Vue 3.5, generated at 2026-09-25. Always use Composition API with ``.

Preferences

  • Prefer TypeScript over JavaScript
  • Prefer ` over `
  • 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

TopicDescriptionReference
Script Setup & Macros``, defineProps, defineEmits, defineModel, defineExpose, defineOptions, defineSlots, genericsscript-setup-macros
Reactivity & Lifecycleref, shallowRef, computed, watch, watchEffect, effectScope, lifecycle hooks, composablescore-new-apis

Features

TopicDescriptionReference
Built-in Components & DirectivesTransition, Teleport, Suspense, KeepAlive, v-memo, custom directivesadvanced-patterns

Quick Reference

Component Template

import { ref, computed, watch, onMounted } from 'vue'

const props = defineProps<{
  title: string
  count?: number
}>()

const emit = defineEmits<{
  update: [value: string]
}>()

const model = defineModel()

const doubled = computed(() => (props.count ?? 0) * 2)

watch(() => props.title, (newVal) => {
  console.log('Title changed:', newVal)
})

onMounted(() => {
  console.log('Component mounted')
})

  {{ title }} - {{ doubled }}

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'
See all
  • Writing & docs

    A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

    npx skills add https://github.com/mattpocock/skills --skill grill-with-docs
    1.3M installs
  • Writing & docs

    Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

    npx skills add https://github.com/mattpocock/skills --skill triage
    1.1M installs
  • Writing & docs

    Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

    npx skills add https://github.com/mattpocock/skills --skill domain-modeling
    952.2K installs
  • Writing & docs

    Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

    npx skills add https://github.com/mattpocock/skills --skill writing-beats
    528.6K installs

Skills are shared by members and not reviewed by us. Read a skill’s code before you install it.