tdd-loop
Skill1 starsChanged 6 days agoMITView on GitHub
Test-first fixes. Use when fixing a reproducible bug or failing test, adding behavior with a runnable test suite, or when asked for TDD, a regression test, or to verify a fix.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- milad-ahmd/agent-skillstheir own version, first seen Nov 8, 2026
- OrionArchitekton/orion-skillstheir own version, first seen Nov 2, 2026
- michaelalber/ai-toolkittheir own version, first seen Nov 1, 2026
- daniel-kindl/dkstacktheir own version, first seen Nov 1, 2026
- sbradl/claude-skillstheir own version, first seen Oct 15, 2026
- dagarre00/claude-code-templatetheir own version, first seen Oct 15, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- khuynh22/agent-dev-team★ 9same name
- milad-ahmd/agent-skills★ 7same name
- ramboz/jig★ 6same name
- michaelalber/ai-toolkit★ 3same name
- OrionArchitekton/orion-skills★ 2same name
- qyndex/claude-init★ 2same name
- dagarre00/claude-code-template★ 1same name
- daniel-kindl/dkstack★ 1same name
- itsmuskanagarwal/claude-pack★ 0same name
- sbradl/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- ask-smartSkill
- debug-scientificallySkill
- edge-case-securitySkill
- engineering-principlesSkill
- lean-navigationSkill
- plan-workSkill
- review-changesSkill
- session-handoffSkill
- task-ledgerSkill
- ui-designSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Read the nearest implementation and tests.
- Distinctive: line 15
Write the smallest implementation that makes it pass.
- Distinctive: line 27
Prefer one meaningful test over many redundant ones.
- Distinctive: line 31
If a test is impractical, say why and use the closest honest check.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TDD Loop
Turn the intended behavior into a failing test before writing the implementation. Keep each loop small enough that every failure is easy to explain.
Red, green, refactor
- Read the nearest implementation and tests. Find the project's test command and conventions. If the suite prints a lot, run it as
python ${CLAUDE_SKILL_DIR}/../lean-navigation/scripts/squeeze.py -- <test command>so only failures and the summary come back. - State the behavior and its important boundaries. Name the production change that would make the test fail; if none would, the test is useless.
- Write one focused test at the layer that owns the behavior. Run it before touching production code. It must fail because the behavior is missing, not because of a typo, fixture, or environment problem. Optionally record the red run as evidence:
python ${CLAUDE_SKILL_DIR}/../task-ledger/scripts/ledger.py fact "red: <behavior>" --run "<test command>" --expect-exit 1. If it already passes, rethink the test. - Write the smallest implementation that makes it pass. No unrelated cleanup or speculative abstraction.
- Rerun the focused test and see it pass (
python ${CLAUDE_SKILL_DIR}/../task-ledger/scripts/ledger.py fact "green: <behavior>" --run "<test command>" --proves <req id>). Then run the suite for the code you touched, or the full suite when a shared contract changed. - Refactor only to improve clarity or remove duplication, and rerun the same checks.
Work in vertical slices: one test, then its code, then the next. Never write all the tests first.
Test quality
- No tautologies: the expected value must come from the requirement or a hand-worked example, never from the same formula the code uses.
- Mock only at system boundaries (network, clock, payment provider, filesystem when needed). Never mock the behavior under test.
- Regression proof for a bug fix: temporarily revert the fix and confirm the new test fails, then restore it.
- A test that is hard to write often signals an unclear design; say so rather than forcing it.
- Prefer one meaningful test over many redundant ones.
When TDD doesn't fit
If a test is impractical, say why and use the closest honest check. If the user asks not to run tests, respect it and report the behavior as unverified. Never report an unrun test as passing.
Report
The behavior covered, the exact test command, and its observed result (red, then green), plus any remaining gap.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

