Build tdd
Red-Green-Refactor cycle. Active when methodology=tdd (default). No production code without a failing test. tdd-guard hook enforces.From its SKILL.md
npx -y skills add sh-ai-x/dev-harness-kit --skill build-tddAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.1 KB, as published. Nobody here has run it
build-tdd — Red-Green-Refactor
Iron Law
No production code without a failing test.
You cannot know the test fails without running it.
Cycle
RED → Write a failing test
↓ Run it and confirm RED directly
GREEN → Write minimum implementation to pass
↓ Confirm all tests GREEN
REFACTOR → Clean up without changing behavior
↓ Confirm tests still GREEN
↓ Next cycle
Hook integration
tdd-guard.sh (PreToolUse Write|Edit|MultiEdit) blocks writes under lib/, src/lib, src/utils, app/api/services/domain/ unless a test exists (co-located or in tests/).
Rules (no exceptions)
- Code written before the test → delete and restart.
- "Just for reference" / "It's simple" → rationalization. Reject all.
- RED confirmation is required (run the test, see it fail as intended).
- One cycle at a time. Cycle N+1 only after cycle N is GREEN.
Red Flags — stop immediately
| Thought | Reality |
|---|---|
| "Skip just this once" | Rationalization. Stop. |
| "Add tests later" | Tests-after are not TDD |
| "Too simple to test" | Simple code breaks too |
| "Refactor without tests" | Refactor also needs TDD |
Exceptions (only with explicit user approval)
- Throwaway prototype / one-off script
- Auto-generated code (migrations, generated clients)
- Config files / type definitions / static assets
Workflow
- Requirement in one sentence
- Write test file first — at least one failing case
- Confirm RED (run)
- Write GREEN — minimum code to pass
- REFACTOR — remove duplication, improve naming
- Next cycle