AGENT SKILL

test-driven-development

RED-GREEN-REFACTOR cycle for new behavior. Use when implementing any feature, fix, or endpoint before writing production code.

License 许可
MIT
最近更新
2026-10-20
Stars
★ 0
Forks
0

01 前言 Front Matter

name
test-driven-development
license
MIT
description
RED-GREEN-REFACTOR cycle for new behavior. Use when implementing any feature, fix, or endpoint before writing production code.
compatibility
opencode

03 SKILL.md 正文

What I do

  • Force the failing-first discipline so tests prove behavior instead of decorating it.

When to use me

Use when implementing any feature, fix, or endpoint — before writing production code.

Cycle

  1. RED: write one failing test that captures the required behavior. Run it, watch it fail for the right reason.
  2. RED the failure path too: each behavior ships success AND failure-path RED tests (invalid input, missing id, unauthorized); happy-path-only suites fail review.
  3. GREEN: write the minimal production code that makes it pass. No extra generality.
  4. REFACTOR: clean up duplication while the suite stays green.
  5. Repeat per behavior, not per file. Delete production code that was written before its test.

04 同仓库更多 Skills