skills/vue-components/SKILL.md
Vue 3 + TypeScript component conventions for `.vue` SFC work. Use for Vue UI tasks that change component APIs/templates/styling/accessibility/composables/template refs/v-model or related component behavior. For Nuxt/Pinia/routing/E2E/Vitest tasks apply only to component-layer code and combine with the more specific local skill.
npx skillsauth add perdolique/workflow vue-componentsInstall 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.
Use this skill for concrete, idiomatic Vue component work. Project-local instructions, AGENTS.md, lint rules, nearby components, and framework-specific skills take priority.
v-for, extra computed state, or generic abstractions for a small fixed set of known elements.<template>, <script>, <style>.<script setup lang="ts"> for component logic unless the project uses a different established pattern.<script lang="ts"> block above the setup block.ref, computed, watch, onMounted, and useTemplateRef from vue when explicit imports are used.@vueuse/core only when the project already uses VueUse or has it installed.Props interface or type for non-trivial prop sets.readonly to prop interface fields unless the local codebase already requires it.defineProps<Props>() for TypeScript components.interface Props {
label: string;
tone?: 'neutral' | 'danger';
}
const {
tone = 'neutral',
label
} = defineProps<Props>()
= false for optional Boolean props; absent Boolean props are already false in Vue.withDefaults(defineProps<Props>(), { ... }).withDefaults, use factory functions.use. Example: useDisclosure(), useForm(), useTooltip().const { isOpen, close, triggerId } = useDisclosure()
toValue().isPanelOpen, selectedId, openPanel, and closePanel over vague names such as state, data, or handler.Emits type or interface for non-trivial emits.type Emits = (event: 'confirm' | 'cancel') => void
interface Emits {
change: [value: string];
submit: [data: FormData, validated: boolean];
}
defineModel() only for actual two-way v-model contracts.defineEmits() for regular events such as submit, cancel, or analytics notifications.defineModel({ default: ... }); it can desync from an undefined parent value.cnt, curr, md, or sm unless they are part of an existing design-token API.useTemplateRef('name') for static refs; do not pass a generic unless inference fails.ref<T | null>(null) template ref pattern instead of forcing an upgrade-specific API.document, window, navigator, or element refs during setup in SSR/test-sensitive code.aria-label, or aria-labelledby.aria-hidden="true"; give informative images meaningful alt text.<style module>, <style scoped>, plain CSS, or SCSS just because this skill mentions a pattern. Match nearby components. Otherwise, prefer <style module> because of its encapsulation and maintainability benefits..component class on styled components when that is the local convention or when it clarifies style ownership.$style class per styled template element; use global modifier classes and define them nested with :global(.modifier).<template>
<button :class="[$style.button, { isActive }]">
Save
</button>
</template>
<style module>
.button {
color: var(--text-primary);
&:global(.isActive) {
color: var(--accent);
}
}
</style>
useFetch, useAsyncData, $fetch, or runtime config, use a Nuxt-specific skill or the local Nuxt conventions. This skill covers only the Vue component surface.tools
Create or draft GitHub releases from existing tags and repository history. Use this whenever the user asks to publish a GitHub release, create release notes for a new version, mirror previous GitHub releases, release a tag/version, or says they have already released a new package version and need the matching GitHub release.
development
Plan and drive non-trivial coding work from ambiguous request to scoped implementation and verification. Use when the user asks to plan before coding, plan then implement, split work into iterations or PR-sized tasks, tackle a risky multi-file feature, refactor, migration, or recover after failed work. Do not use for simple one-step edits, commit or PR creation, pure framework/domain conventions, or repo-specific roadmap docs where a more specific planning skill applies.
development
TypeScript coding conventions for writing, reviewing, and refactoring typed code. Use when working on `.ts`, `.tsx`, or files that embed TypeScript such as Vue, Astro, or Svelte components. Also use for TypeScript snippets, typed refactors, and review comments about code organization or function structure.
development
Write and maintain Vitest unit tests for TypeScript code. Use when the user needs unit coverage for utilities, services, or stores, or asks for Vitest-based tests with mocks, spies, and assertions.