Scaffold component
Skill TarasTsavolyk/claude-code-frontend/.claude/skills/scaffold-component
Create a new Vue 3 component the project's way — props/emits contracts (typed in TS), correct placement, styling with tokens, a11y baseline, and a unit test. Use when adding a new component or UI element.From its SKILL.md
npx -y skills add TarasTsavolyk/claude-code-frontend --skill scaffold-componentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.3 KB, as published. Nobody here has run it
Scaffold a component
Read the rules first, don't scaffold from memory. Path-scoped rules fire when you read a matching file, so a create-first pass can run with none of them loaded. Open
architecture.md,styling.md, andaccessibility.mdbefore step 2, andtesting.mdbefore step 5.
- Decide placement. Put it where your layout keeps components —
src/components/(layer-first), a feature'scomponents/(feature-first), or a sharedcomponents/if it's reused widely. Confirm a similar component doesn't already exist (search first; reuse beats rebuild). - Create
<Name>.vuewith<script setup>(addlang="ts"in TS projects):- TS: define a
Propstype anddefineProps<Props>(), defaults via reactive props destructure; type emits withdefineEmits<{ ... }>(). JS: use runtime validators —defineProps({ ... })withtype/required/default/validator— anddefineEmits([...]). (Full form incode-style.md→ Vue SFC.) - Keep it presentational: state in, events out. No data fetching here.
- TS: define a
- Template — semantic native elements; labels for any control; keyboard-operable; visible focus. Style with the project's design tokens — no magic values (Tailwind utilities by default; Sass variables or
var(--token)custom properties otherwise). - Logic — if there's non-trivial logic, extract a
useXcomposable instead of inlining it. - Test — add
<Name>.test.ts(.test.jsin JS projects): render with props, assert visible output and emitted events, cover an edge/error state. Query by role/label/text (seetesting.md). - Verify —
<pm> run lint && <pm> run test(add<pm> run typecheckin TS projects). Run a quick axe check if interactive. - Export if it's a shared component (barrel/index per project convention).
Keep it focused: split on a decomposition signal — ≥3 responsibilities, prop/boolean explosion, deep template nesting, logic dwarfing the template, or a repeated block — not on a line count alone (see architecture.md → Decomposition & reuse).