Tdd

From epicsagas/epic-harness · View interactive version

Tdd is an AI agent skill from the GitHub repository epicsagas/epic-harness. Test-Driven Development enforcer. Red→Green→Refactor cycle with no production code without a failing test first. Use for new features and bug fixes.

How to use this skill

Skill file

TDD — Test-Driven Development

Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST. Violating the letter of this process is violating the spirit of this process.

Process

Red → Green → Refactor

  1. Red: Write a failing test that describes the desired behavior
  1. Green: Write the minimum code to make the test pass
  1. Refactor: Clean up without changing behavior

Cycle

Repeat for each behavior. One test, one behavior, one cycle — because scope creep in a single test cycle leads to unverified code.

When to Trigger

Anti-Rationalization

| Excuse | Rebuttal | What to do instead |

|--------|----------|--------------------|

| "This is too simple for tests" | Simple code still breaks. The Beyonce Rule applies: if you liked it, you should have put a test on it. | Write the test anyway — it takes 30 seconds and catches edge cases. |

| "I'll write tests after" | That's documentation, not specification. Tests written after confirm what you built; tests written before define what you should build. | Write the test first. If you can't describe the behavior, you don't understand the requirement. |

| "Tests slow me down" | 15 minutes of TDD saves hours of debugging regression bugs later. | Time the cycle — Red-Green-Refactor is usually faster than debug-after-deploy. |

| "I'll just test manually" | Manual tests don't catch regressions. Automate it once, save hours forever. | Write an automated test that runs on every commit. |

| "The types guarantee correctness" | Types check shape, not logic. add(a,b) can still return a-b. | Write a test that verifies the actual business rule, not just the type signature. |

| "I need to see the API shape first" | Spike freely, then delete and rebuild test-first. A throwaway spike is research, not implementation. | Spike, discard, then TDD the real implementation from what you learned. |

Evidence Required

Before claiming TDD is done, show ALL of these:

No evidence = not done. "I wrote tests" without showing output is not TDD.

Red Flags

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.