This enforces strict TDD discipline: red, green, refactor, in that order, every time. It won't let you write production code without a failing test first. If you already wrote the code, it tells you to delete it and start over. The cycle is rigid but the guidance is practical: test one behavior at a time, write the minimum code to pass, refactor only when green. It includes a table of anti-patterns like test-after and gold-plating, plus a list of common rationalizations and why they're wrong. Use this when you want guardrails against skipping steps or when you're teaching TDD and need something more prescriptive than a style guide.

GitHub stars
1.3K
last updated
Jun 11, 2026

Install

$ npx -y skills add codeaholicguy/ai-devkit --skill tdd --agent claude-code

Installs into .claude/skills of the current project.

Files

TDD

Red. Green. Refactor. In that order, every time.

Hard Rules

  • No production code without a failing test first.
  • If production code was written before its test, delete it and start over with a failing test.
  • Never skip the red step. A test that has never failed proves nothing.

Cycle

For each unit of behavior:

  1. Red — Write a test for the next behavior. Run it. It must fail. Read the failure message — it should describe the missing behavior.
  2. Green — Write the minimum production code to make the test pass. Nothing more. Run the test. Apply the verify skill.
  3. Refactor — Clean up both test and production code. Run the test again. Still green? Done. Apply the verify skill.

Then pick the next behavior and repeat.

Rules for Each Step

Red:

  • Test one behavior, not one function. Name the test after what the system should do, not what the function is called.
  • The test must fail for the right reason — a missing method, wrong return value, unmet condition. Not a syntax error or import failure.
  • If the test passes immediately, it's not testing new behavior. Delete it or pick a different behavior.

Sponsors

Details

Repository
github.com/codeaholicguy/ai-devkit
Categories
Testing & QA, Documentation, AI & Agent Building
First seen
Jun 11, 2026

More from codeaholicguy/ai-devkit

All 12
1davila7 avatarAWS Penetration Testingdavila7/claude-code-templatesThis skill should be used when the user asks to "pentest AWS", "test AWS security", "enumerate IAM", "exploit cloud infrastructure", "AWS privilege escalation",0skills.sh installs
2davila7 avatarBroken Authentication Testingdavila7/claude-code-templatesThis skill should be used when the user asks to "test for broken authentication vulnerabilities", "assess session management security", "perform credential stuf0skills.sh installs
3davila7 avatarBurp Suite Web Application Testingdavila7/claude-code-templatesThis skill should be used when the user asks to "intercept HTTP traffic", "modify web requests", "use Burp Suite for testing", "perform web vulnerability scanni0skills.sh installs
4davila7 avatarCloud Penetration Testingdavila7/claude-code-templatesThis skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploi0skills.sh installs
5davila7 avatarCross-Site Scripting and HTML Injection Testingdavila7/claude-code-templatesThis skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exploi0skills.sh installs
6davila7 avatarFile Path Traversal Testingdavila7/claude-code-templatesThis skill should be used when the user asks to "test for directory traversal", "exploit path traversal vulnerabilities", "read arbitrary files through web appl0skills.sh installs