test-driven-development
Red-green-refactor TDD implementation cycle
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Red-green-refactor TDD implementation cycle
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
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
| 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: