skills/team/vue-component-scaffolder/SKILL.md
Scaffolds a single Vue / TypeScript single-file component (SFC) or route with typed props via defineProps, a co-located Vue Testing Library test, an accessibility baseline, and an optional Storybook story. Vue analog of fastapi-scaffolder — the SFC/route is the front-end "unit". Use when creating a new Vue component, adding a route/page, generating a typed presentational or container SFC, or standing up a component with its test and story.
npx skillsauth add michaelalber/ai-toolkit vue-component-scaffolderInstall 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.
"A component is a contract. Make its props explicit, its output accessible, its behavior tested." -- Adapted from API design practice
"Accessibility by default means the inaccessible path requires more work than the accessible one." -- Adapted from OWASP Secure Design Principles
A Vue SFC is the front-end unit the way an endpoint is the back-end unit. Like an endpoint, it has a
contract (its props/emits), an output that must be safe and well-formed (accessible, escaped template
interpolation), and a test that proves it behaves. A component shipped without typed defineProps, a
test, and an accessibility baseline is a black box that future changes will break silently.
Accessibility by default means semantic HTML and keyboard support are the scaffold, not a follow-up
ticket. The inaccessible <div @click> must be the path that requires extra justification.
Grounding note: the KB has a Vue 2/3 corpus under
collection="javascript"(alongside TS). Usecollection="ui_ux"for WCAG/ARIA and cite vuejs.org for component/composable patterns. Never invent avuecollection.
Non-Negotiable Constraints:
defineProps<Props>(); no implicit any*.test.ts is created with the component, not aftereslint-plugin-vuejs-accessibility cleancomputedWhat this skill is NOT:
vue-feature-slice to organize many componentsvue-app-scaffolder to create the project skeletonThe 10 domain principles, KB lookup queries, AI discipline rules, anti-patterns, and error-recovery
procedures live in references/conventions.md.
# Vue + TS + test runner + storybook
grep -E '"(vue|typescript|vitest|@testing-library/vue|@storybook)"' package.json
# Where components live and the existing convention
find src -type d -name components | head
ls src/features 2>/dev/null
# Test + story file conventions already in use
find src -name "*.test.ts" | head -3
find src -name "*.stories.ts" | head -3
Record: Vue version, test runner (Vitest), whether Storybook is present, naming/location convention.
Objective: Create the component with its typed props, test, and (optional) story.
See references/component-template.md for full skeletons (presentational, container, form).
src/<location>/<Name>/
<Name>.vue # the component (presentational by default)
<Name>.test.ts # component test (co-located, required)
<Name>.stories.ts # Storybook story (optional)
index.ts # re-export
Objective: Meet the a11y baseline. See references/accessibility-baseline.md.
npx eslint src/<location>/<Name> --plugin vuejs-accessibility
npx vue-tsc --noEmit
npx eslint src/<location>/<Name>
npx vitest run src/<location>/<Name>
# Story renders (if Storybook present):
npx storybook build --quiet >/dev/null 2>&1 && echo "stories build OK"
<vue-component-scaffold-state>
phase: DETECT | SCAFFOLD | ACCESSIBILITY | VERIFY | COMPLETE
component_name: [name]
kind: presentational | container | form | route
test_runner: vitest
storybook_present: true | false
props_typed: true | false
test_created: true | false
a11y_clean: true | false | not_run
last_action: [description]
next_action: [description]
</vue-component-scaffold-state>
The scaffold checklist (Contract / Accessibility / Tests / Story / Verification) lives in
references/conventions.md under "Output: Scaffold Checklist". Emit it filled-in at COMPLETE.
| Skill | Relationship |
|-------|-------------|
| vue-feature-slice | Provides the feature structure; this skill generates the individual components inside a slice. |
| vue-app-scaffolder | Stands up the project (Vite + TS + Vitest + Storybook) this skill scaffolds components into. |
| vue-security-review | After scaffolding, audit link/URL handling and any v-html usage in the component. |
| vue-architecture-checklist | Quality gate for reactivity discipline and render performance across components. |
| tdd | Drive the component test-first (RED → GREEN → REFACTOR) instead of scaffolding code ahead of the test. |
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.