Agent skill · Testing & QA

test-driven-development

TDD: enforce RED-GREEN-REFACTOR, tests before code.

HezaoHezaogithub.com/HezaoHezaoGitHub ↗
claude-codecan modify filesMIT
Install
npx skills add HezaoHezao/poirot --skill test-driven-development --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 7 KB
Bundled scripts: none
Declared author: Adapted from hermes-agent (Nous Research, MIT); obra/superpowers
Allowed tools: -bash-write_file-read_file-str_replace
Path: poirot/backend/agents/skill/builtin_skills/core/test-driven-development/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 139
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Test-Driven Development (TDD) ## Overview Write the test first. Watch it fail. Write minimal code to pass. **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing. ## When to Use **Always:** - New features - Bug fixes - Refactoring - Behavior changes **Exceptions (ask the user first):** - Throwaway prototypes - Generated code - Configuration files Thinking "skip TDD just this once"? Stop. That's rationalization. ## The Iron Law ``` NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST ``` Write code before the test? Delete it. Start over. **No exceptions:** - Don't keep it as "reference" - Don't "adapt" it while writing tests - Don't look at it - Delete means delete Implement fresh from tests. Period. ## Red-Green-Refactor Cycle ### RED — Write Failing Test Write one minimal test showing what should happen. **Good test:** ```python def test_retries_failed_operations_3_times(): attempts = 0 def operation(): nonlocal attempts attempts += 1 if attempts < 3: raise Exception('fail') return 'success' result = retry_operation(operation) assert result == 'success' assert attempts == 3 ``` Clear name, tests real behavior, one thing. **Bad test:** ```pyt

What's inside
Steps it walks through
  1. Overview
  2. When to Use
  3. The Iron Law
  4. Red-Green-Refactor Cycle
  5. RED — Write Failing Test
  6. Verify RED — Watch It Fail
  7. GREEN — Minimal Code
  8. Verify GREEN — Watch It Pass
  9. REFACTOR — Clean Up
  10. Repeat
  11. Avoid Horizontal Slices
  12. Why Order Matters
  13. Common Rationalizations
  14. Red Flags — STOP and Start Over
Commands it runs
pytest tests/test_feature.py::test_specific_behavior -v
Run the specific test
Then run ALL tests to check for regressions
pytest tests/ -q
More from poirot
All skills →
About this skill
What does the test-driven-development skill do?

TDD: enforce RED-GREEN-REFACTOR, tests before code.

How do I install it?

Run `npx skills add HezaoHezao/poirot --skill test-driven-development --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From HezaoHezao/poirot, a repository with 139 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going