tdd
Test-Driven Development enforcement skill - write tests first, always
Best use case
tdd is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Test-Driven Development enforcement skill - write tests first, always
Teams using tdd should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/tdd/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How tdd Compares
| Feature / Agent | tdd | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Test-Driven Development enforcement skill - write tests first, always
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# TDD Mode
[TDD MODE ACTIVATED]
## The Iron Law
**NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST**
Write code before test? DELETE IT. Start over. No exceptions.
## Red-Green-Refactor Cycle
### 1. RED: Write Failing Test
- Write test for the NEXT piece of functionality
- Run test - MUST FAIL
- If it passes, your test is wrong
### 2. GREEN: Minimal Implementation
- Write ONLY enough code to pass the test
- No extras. No "while I'm here."
- Run test - MUST PASS
### 3. REFACTOR: Clean Up
- Improve code quality
- Run tests after EVERY change
- Must stay green
### 4. REPEAT
- Next failing test
- Continue cycle
## Enforcement Rules
| If You See | Action |
|------------|--------|
| Code written before test | STOP. Delete code. Write test first. |
| Test passes on first run | Test is wrong. Fix it to fail first. |
| Multiple features in one cycle | STOP. One test, one feature. |
| Skipping refactor | Go back. Clean up before next feature. |
## Commands
Before each implementation:
```bash
# Run the project's test command - should have ONE new failure
```
After implementation:
```bash
# Run the project's test command - new test should pass, all others still pass
```
## Output Format
When guiding TDD:
```
## TDD Cycle: [Feature Name]
### RED Phase
Test: [test code]
Expected failure: [what error you expect]
Actual: [run result showing failure]
### GREEN Phase
Implementation: [minimal code]
Result: [run result showing pass]
### REFACTOR Phase
Changes: [what was cleaned up]
Result: [tests still pass]
```
## External Model Consultation (Preferred)
The tdd-guide agent SHOULD consult Codex for test strategy validation.
### Protocol
1. **Form your OWN test strategy FIRST** - Design tests independently
2. **Consult for validation** - Cross-check test coverage strategy
3. **Critically evaluate** - Never blindly adopt external suggestions
4. **Graceful fallback** - Never block if tools unavailable
### When to Consult
- Complex domain logic requiring comprehensive test coverage
- Edge case identification for critical paths
- Test architecture for large features
- Unfamiliar testing patterns
### When to Skip
- Simple unit tests
- Well-understood testing patterns
- Time-critical TDD cycles
- Small, isolated functionality
### Tool Usage
Before first MCP tool use, call `ToolSearch("mcp")` to discover deferred MCP tools.
Use `mcp__x__ask_codex` with `agent_role: "tdd-guide"`.
If ToolSearch finds no MCP tools, fall back to the `test-engineer` agent.
**Remember:** The discipline IS the value. Shortcuts destroy the benefit.Related Skills
worker
Team worker protocol (ACK, mailbox, task lifecycle) for tmux-based OMX teams
web-clone
URL-driven website cloning with visual + functional verification
visual-verdict
Structured visual QA verdict for screenshot-to-reference comparisons
ultrawork
Parallel execution engine for high-throughput task completion
ultraqa
QA cycling workflow - test, verify, fix, repeat until goal met
trace
Show agent flow trace timeline and summary
team
N coordinated agents on shared task list using tmux-based orchestration
swarm
N coordinated agents on shared task list (compatibility facade over team)
skill
Manage local skills - list, add, remove, search, edit, setup wizard
ralplan
Alias for $plan --consensus
ralph
Self-referential loop until task completion with architect verification
ralph-init
Initialize a PRD (Product Requirements Document) for structured ralph-loop execution