一键导入
test-driven-development
Use when implementing new features or fixing bugs - follows RED-GREEN-REFACTOR cycle
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing new features or fixing bugs - follows RED-GREEN-REFACTOR cycle
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when creating, modifying, or reviewing a cliagents provider adapter for a CLI tool such as Codex, Claude Code, Gemini CLI, Qwen CLI, or OpenCode.
Use when operating as a supervised root that delegates work to child sessions through cliagents
Use when reducing prompt size for roots and child sessions without losing the information needed to execute well
Use when passing work between agents with context preservation
Use when exploring design options or solving open-ended problems
Use when reviewing code for quality, bugs, security, and maintainability
| name | test-driven-development |
| description | Use when implementing new features or fixing bugs - follows RED-GREEN-REFACTOR cycle |
| tags | ["testing","workflow","quality"] |
Follow the RED-GREEN-REFACTOR cycle for reliable, well-designed code.
Before writing any implementation code:
Example:
"I need to add a validateEmail function"
→ Write: test('validateEmail returns true for valid email', () => {...})
→ Run tests
→ See: "validateEmail is not defined" (RED - expected failure)
Write the simplest code that makes the test pass:
Example:
→ Write: function validateEmail(email) { return email.includes('@'); }
→ Run tests
→ See: All tests passing (GREEN)
Now that tests are green, improve the code:
Example:
→ Improve: Add proper regex validation
→ Run tests: Still GREEN
→ Add edge case tests: Empty string, missing domain
→ Implement edge cases: Keep GREEN