test-driven-development
Red-green-refactor TDD implementation cycle
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Red-green-refactor TDD implementation cycle
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | test-driven-development |
| description | Red-green-refactor TDD implementation cycle |
| methodology | tdd |
Implement code using the red-green-refactor cycle. This skill is used by the Implementer to write code driven by failing tests.
Write the MINIMUM code to make a failing test pass. No more. Then refactor to improve quality without changing behavior.
Follow table-driven tests for multiple scenarios:
func TestFunctionName(t *testing.T) {
tests := []struct {
name string
input InputType
want OutputType
wantErr bool
}{
{name: "happy path", input: ..., want: ..., wantErr: false},
{name: "empty input", input: ..., want: ..., wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := FunctionName(tt.input)
if (err != nil) != tt.wantErr {
t.Errorf("unexpected error: %v", err)
}
if got != tt.want {
t.Errorf("got %v, want %v", got, tt.want)
}
})
}
}
For each RED-GREEN-REFACTOR cycle, produce:
Structured code review
Find and load available skills
PR description generation
Spec-faithful implementation for spec-driven development
Architecture and interface design for spec-driven development
Codebase analysis and context gathering for spec-driven development