test-driven-development
Skill1 starsChanged 3 months agoMITView on GitHub
Drives behavior changes through a failing test before implementation. Use when any behavior is added, changed, fixed, or preserved — features, fixes, refactors, migrations, generators, or configuration — even if the user never mentions tests or TDD. Skip throwaway spikes and nonbehavioral content or configuration.
190 other projects use a version of this.
Adopted by
Most recently taken up by
- DemonDamon/AgenticXtheir own version, first seen Nov 9, 2026
- chrysogonus/power-agentstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- roundpilot/superpowers-antigravitytheir own version, first seen Nov 8, 2026
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- lingyired/status-triotheir own version, first seen Nov 8, 2026
Used with
Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 projects that use this
Leodorareluctant259Skillchinese-commit-conventions
中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
Also in 8 projects that use this
obraSkilldiagnosing-superpowers
Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.
Also in 19 projects that use this
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 39 projects that use this
LLl0k0laDSkillgit-workflow-and-versioning
Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.
Also in 47 projects that use this
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 15 projects that use this
- +3 more from Leodorareluctant259
- +3 more from LLl0k0laD
Other versions190 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 190
- obra/superpowers★ 314ksame name
- NousResearch/hermes-agent★ 262ksame name
- addyosmani/agent-skills★ 114ksame name
- cloudflare/computer★ 9.9ksame name
- jnMetaCode/superpowers-zh★ 8.4ksame name
- openai/plugins★ 7.8ksame name
- farm-fe/farm★ 5.6ksame name
- microsoft/FluidFramework★ 4.9ksame name
- mikeyobrien/ralph-orchestrator★ 3.2ksame name
- crbnos/carbon★ 2.8ksame name
180 more not listed
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 repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- working-from-a-ticketSkill
- writing-specsSkill
- clarifying-intentSkill
- dispatching-parallel-agentsSkill
- handoffSkill
- mapping-the-codebaseSkill
- prototypingSkill
- using-git-worktreesSkill
- using-sdlc-skillsSkill
- viewing-artifactsSkill
- writing-skillsSkill
- yagniSkill
- finishing-a-branchSkill
- release-readinessSkill
- architecture-decisionsSkill
- coding-standardsSkill
- data-modelSkill
- migration-strategySkill
- reviewing-plansSkill
- system-architectureSkill
- ui-ux-designSkill
- writing-plansSkill
- adding-observabilitySkill
- changing-a-live-schemaSkill
- executing-plansSkill
- rollout-controlsSkill
- subagent-driven-developmentSkill
- complexity-auditSkill
- containing-an-incidentSkill
- debuggingSkill
- deprecating-an-apiSkill
- diagnosing-a-sessionSkill
- eliminating-correctionsSkill
- large-scale-changesSkill
- post-mortemSkill
- refactor-architectureSkill
- brainstormingSkill
- define-goalsSkill
- feasibility-checkSkill
- scopingSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- reviewing-a-prSkill
- security-auditsSkill
- verification-before-completionSkill
- verification-strategySkill
- visual-ui-verificationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 178 edited versions we read keep these.
12
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
- Distinctive: line 24
If the test command reaches outside the repository (a shared service, a real database, the network, a path outside the worktree), write …
- Distinctive: line 43
Never invent a failure for behavior that already works.
- Distinctive: line 55
Write one test for the next approved behavior.
- Distinctive: line 57
If the behavior is a detector (a lint rule, validator, or scanner), pin, in the same test, an input it must flag and a near-miss it must …
- Distinctive: line 61
If the change adds an in-progress flag or lock, run one Step 2 cycle per public method that touches the state it guards, calling it while …
- Distinctive: line 65
Run it through the project's real test command.
- Distinctive: line 66
Read the failure. Confirm it is the right one: the test was discovered, executed, and failed at the intended assertion.
- Distinctive: line 75
If the wrong reason is a missing symbol, add the smallest stub that cannot pass (it raises or returns a wrong value) and rerun, so the …
- Distinctive: line 89
Write only the code that makes this test pass.
- Distinctive: line 90
Run the new test, then the project's whole test command.
- Distinctive: line 103
Run it on the current behavior.
- Distinctive: line 113
If chronology is part of the claim, use an external observer or immutable checkpoints that the evaluator reruns.
- Very specific: line 117
Leave anything else pending for finishing-a-branch.
“Common” is measured: kept by at least 6 in 10 of the 178 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
Test-Driven Development
Make an executable check fail for the right reason before the code exists, or make an existing check fail on purpose before you preserve behavior through a change. Watch it happen; keep the output.
When to use
- Any feature, fix, refactor, migration, generator, or config that changes behavior.
- Skip disposable spikes and non-behavioral content or config. Behavior from a spike that is then accepted gets rebuilt under a check.
- High-risk target code waits for its approved migration and assurance contracts and their entry gates. Work authorized only to build a check cannot edit the target or satisfy entry on its own.
Step 1: Before the first test command
- If the test command reaches outside the repository (a shared service, a real database, the network, a path outside the worktree), write down what it touches: the environment and data, the effects, the time and resources, the cleanup, and your authority for each. Never aim a test at a shared or production surface not written here. If it stays entirely inside the repository, write no record.
- Pin down the public interface and the behavior it promises, from the task,
the spec, or the approved design. If the meaning is unresolved, invoke
clarifying-intent. Never guess it into a test. Pick the cycle:
- For new or intentionally changed behavior, go to Step 2.
- For behavior that must survive a change unchanged, go to Step 3.
- For a bugfix, go to Step 2, starting from its runnable reproduction.
- For a task whose deliverable is tests for behavior that already works,
go to Step 3 with the new tests as its check, run items 1 to 4, read
references/preservation-cycle.mdwhen you pick the oracle, then continue at Step 4: the deliberate divergence the suite must catch stands in for RED.
Never invent a failure for behavior that already works.
A task: move
parse_priceinto themoneymodule, keeping its old import working, and make it reject a negative amount, which it accepts today. That is two cycles. The move is behavior that must survive unchanged: Step 3, with the existing green tests as the check once they are accepted as Step 3.1 requires. The rejection is new behavior: Step 2, with its own RED first. One test that fails because the import path moved proves neither.
Step 2: New behavior, RED then GREEN
Write one test for the next approved behavior.
If the behavior is a detector (a lint rule, validator, or scanner), pin, in the same test, an input it must flag and a near-miss it must pass; a separate near-miss test gets its RED from a detector that over-matches.
If the change adds an in-progress flag or lock, run one Step 2 cycle per public method that touches the state it guards, calling it while the operation is in flight. Take that list from the state, not from the misuse you expect.
- Run it through the project's real test command.
Read the failure. Confirm it is the right one: the test was discovered, executed, and failed at the intended assertion.
RED, right reason: FAIL test_rejects_expired_token — AssertionError: expected 401, got 200 RED, wrong reason: ERROR test_rejects_expired_token — ImportError: cannot import name 'verify' Not RED: 1 skipped, 0 failedIf the wrong reason is a missing symbol, add the smallest stub that cannot pass (it raises or returns a wrong value) and rerun, so the failure is at the intended assertion. If a stub cannot be added, confirm the runner collected exactly the tests you wrote before reading the failure.
On a wrong reason whose cause is not directly visible, or an unexplained result, invoke
debuggingbefore any product code, passing back the attempt count its ledger recorded for this cycle when the cycle came fromdebugging.- Keep the output.
- Record the test's identity, the identity of the evaluator, and the
expected observable as of this RED, under
.sdlc-skills/evidence/{{YYYY-MM-DD}}-{{topic}}/. If any of the three changes later, the cycle is invalid: restart and reach RED again. - Write only the code that makes this test pass.
- Run the new test, then the project's whole test command. Both must be green. Report every failing test by name, unrelated ones included; stop, and do not filter.
- Refactor under green. Rerun both. An intended behavior change is a new RED cycle under the approval that owns it.
Step 3: Preserved behavior, GREEN, then a deliberate RED, then GREEN
- Take the characterization check the task or plan accepted; for high-risk work, use the differential check from the assurance matrix. An inherited green suite counts only once it has been accepted as covering the preservation contract independently of the target. Strengthen smoke-only coverage before the first checkpoint.
- Run it on the current behavior. See it green. Keep the output.
- Introduce one controlled, representative divergence. Run the same check. Watch it go red the way you intended. Keep the output.
- Restore the exact state. Watch it go green again.
- Transform one slice, keeping that check green. Read
references/preservation-cycle.mdwhen you pick the oracle, when you meet the generator or config case, or when you decide which evidence to keep.
Step 4: Close the cycle
- If chronology is part of the claim, use an external observer or immutable checkpoints that the evaluator reruns. Logs written by the state under check are not evidence. Never write checkpoint history after the fact.
- Restore only the mutations this task made whose pre-state you recorded.
Leave anything else pending for
finishing-a-branch. Never delete inherited, shared, or user state to manufacture a cycle. - REQUIRED SUB-SKILL: invoke
verification-before-completionon the exact state you are about to call done. This cycle's check is one row of that skill's evidence record (the ledger: add to it, never rewrite it, and keep it outside the state under check), not the whole record. - Return to whatever invoked this skill: a plan task, a worktree checkpoint,
or a fix under
debugging. In that report, list each piece of work you deferred during the cycle with the condition that closes it. Run no commit, push, or PR here.
Gotchas
- A
debuggingdetour does not reset its attempt count. Handing the count back on every wrong-reason RED is what letsdebugging's circuit breaker trip at all.
Hard stops
- New behavior code created by the current work has no observed behavior RED.
- A new-behavior test passes first run, or fails only because the test cannot execute.
- A preservation oracle was never seen green, never made red by a deliberate divergence, or derives expected results from the target it judges.
- A preservation checkpoint contains no new oracle even though inherited tests were never accepted as covering the preservation contract.
- A behavioral generator or config change tests only text presence or generated file existence.
- A test or evaluator, expected observable, corpus, or oracle changed after its RED or falsification without invalidating and restarting that cycle.
- A command or divergence lacks authority for its environment, data, effects, or cleanup, or lacks verified restoration.
- Throwaway or out-of-cycle code is being copied into the product.
When you are tempted to skip
| The thought | The reality |
| "Too simple to test" | Simple behavior still breaks; use the smallest real check. |
| "I'll write the test after" | For new behavior, that records the implementation instead of leading it. |
| "The port already works, so I need a fake RED" | No: start green, falsify the independent oracle, restore, then preserve it. |
| "I tested it by hand" | An unrepeatable observation cannot guard the next change. |
| "I'd lose the code I wrote" | Revert only your out-of-cycle implementation; sunk cost is not evidence. |
| "The test is hard to write" | The interface or oracle is exposing a design problem; fix that seam. |
| "There's no test framework" | Use the smallest executable assertion that can fail. |
| "This layer has no test harness" | Move its rules into units and test-drive those. The wiring left without a RED stays pending under the hard stops: report it and how you checked it, then ask whether to add a harness (naming its dependencies and config cost) or to accept the wiring as an unverified exception, and end the turn. |
| "It's just generated/config code" | Test the behavioral source and regeneration contract, not text presence. |
Common mistakes
- Testing internals or mock calls instead of public behavior. Read
references/reference.mdandreferences/mocking.mdwhen a test reaches past the public interface.
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.

