Follow Vue 3 best practices using Composition API, script setup, and modern reactivity patterns.

Install

mkdir -p .claude/skills/vue-elonehoo && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14291" && unzip -o skill.zip -d .claude/skills/vue-elonehoo && rm skill.zip

Installs to .claude/skills/vue-elonehoo

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
210 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Write Vue SFCs using Composition API
  • Define props with `defineProps`
  • Define emits with `defineEmits`
  • Define models with `defineModel`
  • Implement watchers for reactivity
  • Use built-in components like Transition, Teleport, Suspense, KeepAlive

How it works

This skill guides the creation of Vue 3 components using the Composition API and script setup macros, emphasizing TypeScript and specific reactivity patterns.

Inputs & outputs

You give it
Vue component requirements, data, and logic
You get back
Vue 3 Single File Components (SFCs) using Composition API and script setup macros

When to use vue

  • Write Vue SFCs
  • Define props and emits
  • Implement watchers
  • Use Teleport/Suspense

About this skill

Vue

Based on Vue 3.5. 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

TopicDescriptionReference
Script Setup & Macros<script setup>, 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

<script setup lang="ts">
import { computed, onMounted, ref, watch } 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 { computed, reactive, readonly, ref, shallowRef, toRef, toRefs, toValue } from 'vue'

// Watchers
import { onWatcherCleanup, watch, watchEffect, watchPostEffect } from 'vue'

// Lifecycle
import { onBeforeMount, onBeforeUnmount, onBeforeUpdate, onMounted, onUnmounted, onUpdated } from 'vue'

// Utilities
import { defineAsyncComponent, defineComponent, nextTick } from 'vue'

When not to use it

  • When using Options API
  • When deep reactivity is not needed and `shallowRef` is not preferred
  • When using Reactive Props Destructure

Limitations

  • Based on Vue 3.5
  • Prefers TypeScript over JavaScript

How it compares

This skill enforces modern Vue 3 Composition API patterns with script setup, providing a structured approach over traditional Options API or unguided development.

Compared to similar skills

vue side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vue (this skill)05moNo flagsIntermediate
screenshot-to-code2042moNo flagsBeginner
vue-best-practices195moNo flagsIntermediate
web-component-design55moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry