tdd

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tdd" with this command: npx skills add yeachan-heo/oh-my-claudecode/yeachan-heo-oh-my-claudecode-tdd

TDD Mode

[TDD MODE ACTIVATED]

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before test? DELETE IT. Start over. No exceptions.

Red-Green-Refactor Cycle

  1. RED: Write Failing Test
  • Write test for the NEXT piece of functionality

  • Run test - MUST FAIL

  • If it passes, your test is wrong

  1. GREEN: Minimal Implementation
  • Write ONLY enough code to pass the test

  • No extras. No "while I'm here."

  • Run test - MUST PASS

  1. REFACTOR: Clean Up
  • Improve code quality

  • Run tests after EVERY change

  • Must stay green

  1. REPEAT
  • Next failing test

  • Continue cycle

Enforcement Rules

If You See Action

Code written before test STOP. Delete code. Write test first.

Test passes on first run Test is wrong. Fix it to fail first.

Multiple features in one cycle STOP. One test, one feature.

Skipping refactor Go back. Clean up before next feature.

Commands

Before each implementation:

Run the project's test command - should have ONE new failure

After implementation:

Run the project's test command - new test should pass, all others still pass

Output Format

When guiding TDD:

TDD Cycle: [Feature Name]

RED Phase

Test: [test code] Expected failure: [what error you expect] Actual: [run result showing failure]

GREEN Phase

Implementation: [minimal code] Result: [run result showing pass]

REFACTOR Phase

Changes: [what was cleaned up] Result: [tests still pass]

External Consultation (Optional)

The test-engineer agent MAY consult a Claude Task agent for test strategy validation.

Protocol

  • Form your OWN test strategy FIRST - Design tests independently

  • Consult for validation - Cross-check test coverage strategy via a Claude Task agent

  • Critically evaluate - Never blindly adopt external suggestions

  • Graceful fallback - Never block if delegation is unavailable

When to Consult

  • Complex domain logic requiring comprehensive test coverage

  • Edge case identification for critical paths

  • Test architecture for large features

  • Unfamiliar testing patterns

When to Skip

  • Simple unit tests

  • Well-understood testing patterns

  • Time-critical TDD cycles

  • Small, isolated functionality

Tool Usage

Use Task(subagent_type="oh-my-claudecode:test-engineer", ...) for test strategy cross-validation.

Remember: The discipline IS the value. Shortcuts destroy the benefit.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

ralph

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

deepinit

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

autopilot

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

hud

No summary provided by upstream source.

Repository SourceNeeds Review