| name | tdd |
| description | Run TDD workflow actions — generate test specs, write failing tests, implement, refactor, check coverage. |
| disable-model-invocation | true |
| argument-hint | [{"action":"spec|red|green|refactor|coverage|status"}] |
TDD Workflow Skill
Actions
spec — Generate Test Case List
Given a feature or story, produce a list of test cases (behavioral descriptions):
- Read the story/feature description
- Identify happy path, edge cases, and error conditions
- Output a numbered list of
it('...') descriptions
- Include which test file each should go in
red — Write Failing Test
- Create or update the test file with a new test case
- Use shared helpers:
makeTestContext(), makeWritableContext(), useTempDir(), createTestRegistry()
- Run:
npm test -- --testPathPattern=<test-file>
- Verify the test FAILS (red)
green — Implement to Pass
- Write the minimal code to make the failing test pass
- Run:
npm test -- --testPathPattern=<test-file>
- Verify the test PASSES (green)
- Do NOT add extra functionality
refactor — Clean Up
- Improve code structure without changing behavior
- Run:
npm test (full suite)
- Verify ALL tests still pass
- Apply project conventions from CLAUDE.md
coverage — Check Coverage
- Run:
npm run test:coverage
- Compare against thresholds in
jest.config.mjs coverageThreshold.global (never hardcode)
- Identify uncovered lines/branches
status — TDD Progress
- Count tests by status (passing, failing, todo, skipped)
- Report test-to-source file mapping completeness
- Show current coverage summary
Test Helpers Reference
tests/helpers/context-factory.ts — makeTestContext(), makeWritableContext(), DEFAULT_CONTEXT
tests/helpers/temp-dir.ts — useTempDir(), createTempDir(), removeTempDir()
tests/helpers/registry-factory.ts — createTestRegistry()