skills/vue/SKILL.md
Vue 3 Composition API — <script setup>, reactivity (shallowRef/ref), props without destructure, computed, watch, provide/inject, and composables. Use when the project uses modern Vue 3 Composition API style.
npx skillsauth add vuluu2k/skills vueInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill focuses on the Composition API and
<script setup>explicitly strongly typed with TypeScript.
<script setup lang="ts">).<script setup> over explicit setup() functions.shallowRef over ref for performance if deep reactivity is not used.props.myProp instead).| Topic | Description | Reference |
|-------|-------------|-----------|
| State & Reactivity | shallowRef, ref, computed, watch | state |
| Props & Emits | defineProps (no destructuring), defineEmits | props-emits |
| Lifecycle Hooks | onMounted, onUpdated, onUnmounted | lifecycle |
| Topic | Description | Reference | |-------|-------------|-----------| | Composables | State logic reuse (instead of Mixins) | composables | | Provide / Inject | Dependency injection across deep component trees | provide-inject |
<script setup>)<script setup lang="ts">
import { shallowRef, computed, watch, onMounted } from 'vue'
// -- Props & Emits --
interface Props {
title: string
count?: number
}
// ❌ Do NOT destructure props, keep the `props` object
const props = withDefaults(defineProps<Props>(), {
count: 0
})
const emit = defineEmits<{
update: [newCount: number]
}>()
// -- State --
// ✅ Prefer shallowRef if deep tracking isn't needed
const localCount = shallowRef(props.count)
// -- Computed --
const doubled = computed(() => localCount.value * 2)
// -- Watchers --
watch(() => props.count, (newVal) => {
localCount.value = newVal
})
// -- Methods --
function increment() {
localCount.value++
emit('update', localCount.value)
}
// -- Lifecycle --
onMounted(() => {
console.log('Component mounted')
})
</script>
<template>
<div>
<h1>{{ props.title }}</h1>
<p>Count: {{ localCount }} | Doubled: {{ doubled }}</p>
<button @click="increment">Increment</button>
</div>
</template>
development
Vue 3 Options API — data, props, computed, methods, watch, emits, provide/inject, lifecycle hooks, and mixins. Use when the project uses Options API style (Vue 2 legacy or explicit Vue 3 Options API preference).
tools
Best practices for mixing Ant Design Vue components with Tailwind CSS utility classes. Use this skill to keep styling consistent without custom CSS files.
development
Pinia state management for Vue 3 using Composition API (Setup Stores) — TypeScript-first, storeToRefs for reactivity, focused stores, and API calls in composables. Use when the project uses Vue 3 Composition API / <script setup>.
development
Pinia state management for Vue using Options API style — define stores with state, getters, actions, and use them in Options API components via mapState/mapWritableState/mapActions.