/frontend-vue:sfc-conventionsfrom frontend-vue
Use when writing, editing or reviewing a Vue single-file component — the <script setup lang="ts"> block, props and emits and their types, defineModel, slots, template syntax, refs and computeds, watchers, lifecycle, the order of blocks in the .vue file, component and file naming. Also for converting an Options API or a JavaScript component to Composition API with TypeScript. NOT for where a component lives (frontend-vue:component-architecture), its styles (frontend-vue:bem-styles), a Pinia store (frontend-vue:state-pinia), or a reusable composable (frontend-vue:composables-vueuse).
Ships in frontend-vue. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
In: a .vue file being written, edited or reviewed, in a Vue 3.4+ project with TypeScript.
Out: the component holds the house shape: <script setup lang="ts"> with Composition API only,
typed props and emits, defineModel for two-way state, a template that reads top to bottom with no
logic beyond a condition or a loop, scoped styles, and the house JS/TS style from
frontend-js:conventions. The checkable expectations are in evals/rubric.json.
<script setup lang="ts">
// One sentence: what this component is for, and the one decision a reader would ask about.
import { computed, ref } from 'vue';
import type { Ticket } from '@/types/ticket';
const props = defineProps<{ ticket: Ticket; dense?: boolean }>();
const emit = defineEmits<{ open: [ticket: Ticket]; mark: [id: string, handled: boolean] }>();
const query = defineModel<string>('query', { default: '' });
const title = computed(() => `${props.ticket.key} · ${props.ticket.summary}`);
const expanded = ref(false);
</script>
<template>
<article class="ticket-card" :class="{ 'ticket-card--dense': props.dense }">
<h3 class="ticket-card__title">{{ title }}</h3>
<button type="button" class="ticket-card__open" @click="emit('open', props.ticket)">Open</button>
</article>
</template>
<style scoped lang="scss">
.ticket-card { /* see frontend-vue:bem-styles */ }
</style>
Blocks in this order: script setup, template, style scoped. One component per file; the file
and the component are PascalCase (TicketCard.vue), used in templates as <TicketCard>.
<script setup lang="ts"> only. No Options API, no defineComponent
except at a boundary that needs it (a library expecting an options object). No export default.defineProps<{ … }>() with withDefaults when defaults are needed, defineEmits<{ event: [payload] }>().
A prop is read through props.x in the script; in the template x alone is fine.defineModel for two-way state (v-model, named models), never a manual update:value emit pair.ref for a value, computed for anything derivable, shallowRef for a large
snapshot replaced wholesale, reactive only for a small bag of related fields. Derive, do not
store twice.watch is for side effects (a request, a scroll, a save), not
for keeping one piece of state equal to another; that is a computed. watchEffect only for
effects whose dependencies are read inside.v-if/v-for with a :key, no inline arrow functions with logic,
no method calls that do work in a binding; move it to a computed or a named function.
v-for and v-if never on the same element.defineSlots when a
consumer needs them.onMounted/onUnmounted for DOM and subscriptions only; anything with a cleanup
is a composable (frontend-vue:composables-vueuse), and VueUse already has most of them.@click.stop, @keydown.enter.prevent modifiers over code in the handler; a
<button type="button"> over a <span role="button"> so Enter and Space come for free.<Suspense> with an async setup only when the project already uses it; otherwise a
loading state in the component.selectedTicket, not selT), is/has for booleans, on for handlers,
use only for composables.Reuse before writing: a component that needs a well-known behaviour (positioning, focus trap,
virtual list, drag) walks meta:reuse-first before any of it is coded here.
grep -n "export default\|defineComponent\|data()\|methods:" <file> → nothing, unless at a
documented library boundary.grep -n "defineProps(\|defineEmits(" <file> → every call uses the generic form (<{).v-for has a :key, no v-if shares an element with v-for, no binding
calls a function that does work.vue-tsc --noEmit is clean for the file.What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/bem-stylesBEM in scoped stylesUse when writing or reviewing the styles of a Vue component — the <style scoped> block, BEM class names for its block, elements and modifiers, state classes bound from the template, design tokens as CSS variables, SCSS inside the component, Stylelint complaints about selector patterns, or moving rules from a global stylesheet into a component. Also when two components share a class name by accident. NOT for the SCSS token system itself or rem sizing (frontend-css:scss-modules, frontend-css:rem), nor for React components (frontend-react:component-structure)./component-architectureComponent architectureUse before creating a Vue component or when deciding where one lives and what it may know — a reusable UI primitive, a feature component bound to the domain, a layout piece of the app chrome, a page or view, a component that only exists for one parent. Also when a component grew into two, when a feature reaches into another feature's component, when a page holds logic, or when asked "where does X go" in a Vue project. NOT for the inside of the .vue file (frontend-vue:sfc-conventions), nor for React (frontend-react:component-placement).Other plugins' skills for the same job
npx claudepluginhub aquivalabs/bladeforge --plugin frontend-vue