Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add OKHP3/skillz --skill tdd-best-practicesgit clone --depth 1 https://github.com/OKHP3/skillzWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/okhp3/skillz/tdd-best-practices)<a href="https://agentmods.dev/skills/okhp3/skillz/tdd-best-practices"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/tdd-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/okhp3/skillz/tdd-best-practices"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/tdd-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00089 | $0.02094 |
| Opus 5 | $0.00044 | $0.01047 |
| Sonnet 5 | $0.00018 | $0.00419 |
| Haiku 4.5 | $0.00009 | $0.00209 |
Grade A, and why
tdd-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TDD Best Practices
Use this skill when the main question is how to drive implementation from tests, how to structure a test suite, or how to recover discipline in a codebase where tests were written after the fact.
Working Style
- Write one failing test, then make it pass with the minimum code needed.
- Refactor only when all tests are green.
- Test behaviors, not implementations — the public API, not private methods.
- Keep tests as simple as the production code they verify.
- A test suite that is hard to change is as expensive as production code that is hard to change.
The Red-Green-Refactor Cycle
RED → Write a failing test that describes the next behavior.
GREEN → Write the minimum code to make it pass.
REFACTOR → Clean up both the code and the test — no new behavior.
The discipline is in the order. Never refactor on Red. On Green, add only the behavior demanded by the current failing test.
The 3 Laws (Uncle Bob)
- You may not write production code unless you have a failing unit test.
- You may not write more of a unit test than is sufficient to fail. An intentionally missing public API/type can be a valid first Red; unrelated compilation or setup failures are not.
- You may not write more production code than is sufficient to make the currently failing test pass.
Design Workflow
- Describe the behavior — what should the system do? Write the test name first.
- Write a failing test — make it fail for the right reason (assertion, not setup error).
- Make it pass — take the simplest path; you can clean up after.
- Refactor — remove duplication, improve names, reduce complexity.
- Repeat — the next test should be the smallest step forward.
Choosing Test Granularity
| Level | Tests | Speed | Confidence |
|---|---|---|---|
| Unit | Single class/function in isolation | Milliseconds | Behavior of one unit |
| Integration | Multiple real collaborators | Seconds | Module boundaries work |
| Acceptance / E2E | Full system from user perspective | Minutes | Feature works end-to-end |
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/aggregate-testing.md 8.5 KB
- references/cache-testing.md 3.2 KB
- references/criteria-testing.md 2.8 KB
- references/domain-error-testing.md 2.5 KB
- references/domain-event-testing.md 9.2 KB
- references/migration-testing.md 2.6 KB
- references/projection-testing.md 3.3 KB
- references/tdd-anti-patterns.md 9.2 KB
- references/tdd-core-practices.md 5.8 KB
- references/tdd-language-examples.md 20 KB
- references/tdd-schools.md 7.0 KB
- references/test-doubles.md 6.3 KB
- references/transaction-testing.md 2.6 KB
- references/value-object-testing.md 6.3 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 133 lines · 89 tokens per session scan A dc2804a69220
tdd-best-practices is a skill published in the GitHub repository OKHP3/skillz (3 stars, last pushed yesterday), licensed MIT. It adds 89 tokens to every session and 2,094 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
tdd-workflow
A test-first development workflow, commonly called TDD, where a failing test is written before the code that should make it pass. The cycle then adds the smallest working change and cleans it up.
user-story
Create user stories with Mike Cohn format and Gherkin acceptance criteria. Use when turning user needs into development-ready work with clear outcomes and testable conditions.
absolute-work
End-to-end, phase-gated SDLC for AI coding agents: relentless design interview → reviewed spec → dependency-graphed task board → safe-wave TDD execution → verification → converge. Handles features, bugs, refactors, greenfield projects, planning breakdowns, and migrations. Triggers on "absolute work", "build this…
tdd
Use when writing production code that needs tests -- new features, bug fixes, refactoring. Enforces RED-GREEN-REFACTOR before implementation.
execute
Dispatch and execute implementation plans with TDD and checkpoints. Use when plan is ready. Parallel by default for independent tasks.
tdd
Strict test-driven development for behavior changes. Requires verified RED before production code, minimal GREEN, and refactor only after passing tests.