sb-write-vitest
Installation
SKILL.md
Write Vitest Unit Tests
For code that already exists. If the user is writing tests before the implementation, stop and use the tdd skill instead — this skill is for backfilling.
File conventions
- One test file per source file, beside the source:
src/cart.ts→src/cart.test.ts. - Use
*.test.*, never*.spec.*. In this project.spec.is reserved for integration/e2e tests. - Mirror the source extension:
.ts→.test.ts,.tsx→.test.tsx. - One
describeper exported symbol; nestdescribefor sub-cases when it improves readability.