Claude-skill-registry app-component
Generates src/App.vue root component with unit test. Creates both App.vue and App.spec.ts files.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/app-component" ~/.claude/skills/majiayu000-claude-skill-registry-app-component && rm -rf "$T"
skills/data/app-component/SKILL.mdApp Component Skill
Purpose
Generate the
src/App.vue root component WITH UNIT TEST. The component MUST have a corresponding .spec.ts file created at the same time.
CRITICAL: This skill requires creating BOTH the App.vue component file AND its App.spec.ts test file. Do not skip test file creation.
🚨 MANDATORY FILE COUNT
Total Required: 2 files
(1 file) +src/App.vue
(1 file) = 2 filessrc/App.spec.ts
If you create fewer than 2 files, you have FAILED this skill.
Output
- Create the file:
src/App.vue - Create the unit test file:
⚠️ REQUIREDsrc/App.spec.ts
Execution Order (Test-Driven Development)
IMPORTANT: Follow this order strictly to ensure tests are never forgotten:
- Create
FIRST with failing testssrc/App.spec.ts - Then create
to make tests passsrc/App.vue
This TDD approach ensures you never create a component without its test.
Requirements
- Simple root component with router-view
- The
attribute should use theid
constant from global constantsappId - Imports theme variables for global styling
- No scoped styles to allow global CSS
- Component should be minimal and serve as a container for the router view
- MUST have a unit test file in the same directory
- Unit tests MUST cover:
- Component rendering
- Router-view presence
- Props (if any)
- Methods and computed properties (if any)
- Lifecycle hooks (created, mounted, etc.)
- Global store initialization (if applicable)
Test Coverage Requirements
The App.spec.ts file should include:
- Basic rendering test
- Router-view component verification
- DOM element verification (root div with correct id)
- Lifecycle hook execution tests
- Store initialization tests (if using Pinia/Vuex)
- Minimum 80% code coverage
Execution Checklist
Use this checklist to ensure all required files are created:
- Create
with comprehensive tests FIRSTsrc/App.spec.ts - Create
componentsrc/App.vue - Verify both files exist in src/ directory
- Run unit test to ensure tests pass
- Verify test output shows tests for App component
🛑 BLOCKING VALIDATION CHECKPOINT
STOP AND VERIFY before proceeding to the next skill:
Automated Verification
Run this command to verify test file exists:
# Check for App.spec.ts if [ ! -f "src/App.spec.ts" ]; then echo "❌ MISSING: src/App.spec.ts" exit 1 fi echo "✅ App.spec.ts present"
Manual Verification
- ✓ Count files: Must be exactly 2 files (App.vue + App.spec.ts)
- ✓
exists in src/ directorysrc/App.vue - ✓
exists alongsidesrc/App.spec.tssrc/App.vue - ✓ Running
confirms all tests passnpm test - ✓ Test output shows at least 3-5 tests for App component
- ✓ No test files are skipped or marked as pending
If Validation Fails
DO NOT PROCEED to the next skill. Go back and create the missing test file immediately.
Validation
After creating all files, validate:
- ✓ App.vue exists in src/ directory
- ✓ App.spec.ts exists alongside App.vue
- ✓ Running unit test confirms all tests pass
- ✓ Test output shows at least 3-5 tests for App component
- ✓ No test files are skipped or marked as pending