Guide for building Vue 3 components with NuxtUI using strict Test-Driven Development (TDD) methodology enforced by a TDD guard hook. Use this skill when implementing new UI components (atoms, molecules, organisms) for the Poche project, creating Storybook stories with interaction tests, or working within the RED-GREEN-REFACTOR cycle. Particularly useful when the user mentions "TDD", "test-first", "create a component", "build a component", "implement [ComponentName]", or when adding UI functionality.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Guide for building Vue 3 components with NuxtUI using strict Test-Driven Development (TDD) methodology enforced by a TDD guard hook. Use this skill when implementing new UI components (atoms, molecules, organisms) for the Poche project, creating Storybook stories with interaction tests, or working within the RED-GREEN-REFACTOR cycle. Particularly useful when the user mentions "TDD", "test-first", "create a component", "build a component", "implement [ComponentName]", or when adding UI functionality.
NuxtUI TDD Component Development
Overview
Build Vue 3 components with NuxtUI following strict Test-Driven Development (TDD) methodology. This skill provides workflows, templates, and guardrails for creating well-tested, reusable UI components using the Atomic Design pattern.
When to Use This Skill
Use this skill when:
Building new Vue components (atoms, molecules, organisms)
Creating components that wrap NuxtUI base components (UButton, UInput, UFormField, etc.)
Working with Storybook interaction tests
Following TDD methodology with the TDD guard hook
User requests involve "implement [ComponentName]", "create a component", "build with TDD"
Core Workflow
1. Determine Component Level
Before starting, identify the atomic design level. Consult references/naming-conventions.md for detailed guidance.
Quick Reference:
Atoms: Single UI elements (Button, Input, Label, Icon)
Problem: Tests fail with "failed to fetch" after creating component
Solution: Kill and restart Storybook server, wait for full rebuild
Pitfall 2: Invalid querySelector Syntax
Problem: querySelector('.iconify.i-lucide\\:icon') fails
Solution: Use attribute selectors: [class*="i-lucide"][class*="icon"]
Pitfall 3: Vue Prop Forwarding
Problem: Props work without explicit declaration
Solution: Leverage Vue's forwarding when appropriate, add explicit props when tests require them
Pitfall 4: TDD Guard Blocks Refactoring
Problem: Guard blocks even reasonable code improvements
Solution: Only refactor tested code; add new tests before new features
Running Tests
# Run all Storybook tests
pnpm test:storybook:run
# Run specific component tests
pnpm test:storybook:run -- ComponentName
# Run in watch mode (development)
pnpm test:storybook
# Run with coverage
pnpm test:storybook:run --coverage
Success Criteria
A component is complete when:
All planned tests pass (100% GREEN)
Component follows naming conventions
Props are properly typed with JSDoc comments
Storybook autodocs enabled
Atomic design level is correct
Minimum test coverage achieved
Resources
References
references/naming-conventions.md - Complete component naming and organizational guide following Atomic Design principles
references/tdd-workflow.md - Detailed TDD workflow documentation with troubleshooting, patterns, and test.json management
Assets
assets/story-template.ts - Storybook story file template with TDD comments and common patterns
assets/component-template.vue - Vue component template with NuxtUI patterns and prop examples
Quick Start Checklist
For each new component:
Determine atomic level (atom/molecule/organism)
Create story file with ONE Default test
Run test to confirm failure (RED)
Save failure output to /tmp
Update test.json with RED phase evidence
Implement minimal component code
Run test to confirm success (GREEN)
Update test.json with GREEN phase
Repeat for next test
Integration with Other Skills
This skill works well with:
nuxt-ui - For NuxtUI component documentation and patterns