AgentSkillsCN

tdd

引导红绿重构的测试驱动开发

SKILL.md
--- frontmatter
name: tdd
description: Guide Test-Driven Development with Red-Green-Refactor discipline
version: 2.0.0
omc_delegate: oh-my-claudecode:tdd
omc_agents:
  - tdd-guide
  - tdd-guide-low
triggers:
  keywords:
    - "tdd"
    - "TDD"
    - "테스트 먼저"
    - "test first"
    - "Red-Green"

/tdd - Test-Driven Development

OMC Integration

This skill delegates to the OMC tdd skill.

How to Run

python
Skill(skill="oh-my-claudecode:tdd", args="feature-name")

# Or invoke agent directly
Task(subagent_type="oh-my-claudecode:tdd-guide", model="sonnet",
     prompt="Run TDD workflow: [feature description]")

OMC Agents

AgentModelPurpose
tdd-guidesonnetStandard TDD workflow
tdd-guide-lowhaikuSimple test suggestions

Causality (CRITICAL - must be preserved)

code
/auto Tier 5 AUTONOMOUS
    └── /tdd <feature> (when code without tests is detected)

/work --loop Tier 3
    └── /tdd <feature> (on new feature implementation request)

This causality is preserved regardless of OMC delegation.

Red-Green-Refactor Cycle

🔴 Red: Write a Failing Test

bash
# Write test file first
pytest tests/test_feature.py -v
# ❌ FAILED - expected behavior

git commit -m "test: Add feature test (RED) 🔴"

🟢 Green: Minimal Implementation

bash
# Minimal code to pass the test
pytest tests/test_feature.py -v
# ✅ PASSED

git commit -m "feat: Implement feature (GREEN) 🟢"

♻️ Refactor: Improve Code

bash
# Improve while keeping tests green
pytest tests/test_feature.py -v
# ✅ PASSED (maintained)

git commit -m "refactor: Improve feature ♻️"

Usage

bash
/tdd <feature-name>

# Examples
/tdd user-authentication
/tdd payment-processing

Command File Reference

Detailed workflow: .claude/commands/tdd.md