kmshihab7878/claude-code-setup/test-driven-development
Claude Code and agent skill by kmshihab7878/claude-code-setup
- community
Checking that the SKILL.md file is still in the repository.
Guidance for using a red-green-refactor cycle before changing production behavior.
Install
npx vskill@latest install kmshihab7878/claude-code-setup/test-driven-developmentSKILL.md
Test-Driven Development
No production code without a failing test. RED-GREEN-REFACTOR, every time.
Triggers
- User asks to implement a feature, function, or component
- User asks to add behavior to existing code
- Any task that produces production code
HARD GATE: Failing Test Required
Before writing ANY production code, you MUST:
- Write a test that describes the desired behavior
- Run the test and show the failure output
- Only then write the production code
If you catch yourself writing production code first, STOP immediately, delete it, and write the test.
The RED-GREEN-REFACTOR Cycle
RED Phase: Write a Failing Test
What to test: The public interface, not implementation details. Test behavior, not structure.
GREEN Phase: Make It Pass
Minimum means minimum: If a hardcoded return value makes the test pass, that's valid for GREEN. The next RED cycle will force generalization.
REFACTOR Phase: Clean Up
Anti-Rationalization Table
| Excuse | Response | |
|---|---|---|
| "It's too small for a test" | If it's too small for a test, it's too small to get wrong. Write the test. | |
| "I'll add tests after" | Tests written after are verification, not design. Write the test first. | |
| "The code is obvious" | Obvious code still needs a test to prevent regression. Write the test. | |
| "Testing this is hard" | Hard-to-test code is a design smell. Refactor for testability. | |
| "There's no test framework set up" | Set it up. That's part of the task. | |
| "The user didn't ask for tests" | TDD is a Non-Negotiable (#6). Tests are not optional. |
Integration with Existing Tools
- Use
context7MCP to look up framework-specific testing patterns (pytest, jest, vitest, etc.) - Use
testing-methodologyskill for test strategy decisions (unit vs integration) - Use
confidence-checkskill before starting TDD if approach is uncertain - Tests written here satisfy the
verification-before-completionevidence requirement
Cycle Size
Each RED-GREEN-REFACTOR cycle should be 2-5 minutes. If a cycle takes longer:
- The unit of behavior is too large. Break it down.
- You're writing too much code in GREEN. Only write the minimum.
Exceptions
TDD applies to production code. It does NOT apply to:
- Exploratory/spike code (explicitly marked as throwaway)
- Configuration files (YAML, JSON, TOML)
- Documentation
- One-off scripts the user explicitly labels as scratch work
The user can override with explicit instruction: "skip TDD for this" or --skip-gate.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/test-driven-development/SKILL.md
Popularity
- Repository stars
- 6
- Repository forks
- 1
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kmshihab7878/claude-code-setup/test-driven-development)