test-driven-development
Skill1 starsChanged 3 months agoMITView on GitHub
Write the failing test before the code that passes it — one behaviour per test, named for the scenario id it realizes, red, then green, then refactored. Reach for it inside a slice's build and ahead of every bug fix. Not increment sequencing (`incremental-implementation`) or grading a built slice (`quality-verification`).
191 other projects use a version of this.
Adopted by
Most recently taken up by
- NousResearch/hermes-agenttheir own version, first seen Nov 13, 2026
- andreymudri/fleetmatestheir own version, first seen Oct 5, 2026
- Jacobinwwey/notemdprotheir own version, first seen Oct 5, 2026
- crbnos/carbontheir own version, first seen Oct 4, 2026
- L-X-T/ng-agentic-skillstheir own version, first seen Oct 4, 2026
- GuillemRoca/agent-skills-androidtheir own version, first seen Oct 3, 2026
Used with
Projects with it also use diagnosing-superpowers, api-and-interface-design and 5 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.
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 6 projects that use this
LLl0k0laDSkillapi-and-interface-design
Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
Also in 32 projects that use this
MorningStar0709Skillworkflow-runner
Run an agency-orchestrator style YAML workflow inside the current Trae conversation by simulating or coordinating multiple roles. Use when the user provides a `.yaml` or `.yml` workflow, asks for multi-role collaboration, says things like “用多个角色一起评审这个 PRD”“多角色协作”“先生成工作流再执行”“让产品经理、架构师、QA 一起看一下”, or wants roles such as product manager, architect, reviewer, or QA to work together. Supports layered execution, role prompting, variable interpolation, document-backed inputs, and parallel steps only when the current environment has a clear subagent mapping. Do not use for ordinary implementation plans, simple code changes, or tasks already covered by `writing-plans`, `executing-plans`, `subagent-driven-development`, or single-purpose review/debug skills.
Also in 5 projects that use this
MorningStar0709Skillchinese-git-workflow
Configure Git for domestic platforms and manage branching strategies suitable for Chinese teams. Use when the user asks to configure remotes, set up SSH, or manage Git workflows for Gitee, Coding, Jihu GitLab, or CNB, including requests like "配置国内 Git", "设置 Gitee 远程仓库", "推荐适合小团队的 Git 流程".
Also in 4 projects that use this
vinvcnSkillconstraint-driven-development
把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。
Also in 4 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 26 projects that use this
- +1 more from LLl0k0laD
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- obra/superpowers★ 314ksame name
- NousResearch/hermes-agent★ 267ksame name
- addyosmani/agent-skills★ 101ksame name
- cloudflare/computer★ 9.5ksame name
- jnMetaCode/superpowers-zh★ 8.3ksame name
- openai/plugins★ 7.3ksame name
- microsoft/FluidFramework★ 4.9ksame name
- mikeyobrien/ralph-orchestrator★ 3.2ksame name
- crbnos/carbon★ 2.7ksame name
- NeoLabHQ/context-engineering-kit★ 1.7ksame name
181 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 repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- acceptance-criteriaSkill
- api-designSkill
- architecture-designSkill
- browser-testing-with-devtoolsSkill
- ci-cdSkill
- codebase-designSkill
- codebase-researchSkill
- code-reviewSkill
- code-simplificationSkill
- comprehension-quizSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- environment-manifestSkill
- gauntlet-loopSkill
- git-workflowSkill
- handoffSkill
- idea-refineSkill
- incremental-implementationSkill
- interview-meSkill
- literate-explainerSkill
- observability-and-instrumentationSkill
- orchestratorSkill
- performance-optimizationSkill
- plan-breakdownSkill
- preflight-readinessSkill
- project-setupSkill
- pull-requestSkill
- quality-verificationSkill
- security-and-hardeningSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-grillingSkill
- spec-reviewSkill
- to-prdSkill
- using-agent-skillsSkill
- worktreeSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
0
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 25
Not sequencing the increments (incremental-implementation owns the loop this drives one turn of), nor re-cutting slices (plan-breakdown), …
“Common” is measured: kept by at least 6 in 10 of the 177 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 (TDD)
Purpose
Stage: Implement. Principles 1, 6, 7.
The test-first loop, one behaviour at a time inside a slice's build: red, green, refactor. It emits
tests and the minimal code passing them into the caller's checkout — the loop
incremental-implementation turns once per behaviour a slice owes.
When to use / when to skip
- A slice's next behaviour, inside
incremental-implementation's increment loop. - A bug fix — the reproducer first, so something proves the fix and catches its return
(
debugging-and-error-recoveryroot-causes; this writes the guard). - A behaviour change, a refactor of code with tests to hold it still, or a hand call — a scenario, a ticket, "make it do X" in a repository with no scaffolding.
- Skip a throwaway prototype, generated code and configuration — none has behaviour to pin. "Too simple to test" is not on that list.
- Not sequencing the increments (
incremental-implementationowns the loop this drives one turn of), nor re-cutting slices (plan-breakdown), nor grading what was built —quality-verificationexercises the scenarios cold against the running app.
Inputs
docs/features/<slug>/acceptance.md— helps: the Given/When/Then scenarios and the feature-namespaced ids your test names carry · without it: take the behaviours fromprd.md, the prompt and the code, give each a local id,deriveddocs/features/<slug>/plan/<slice-id>.md— helps: the behaviours this slice owes and the files holding them · without it: the slice row inplan.md, or infer it from the files the work reaches,derived- the test framework and runner command — helps: red and green are real runs · without it: read
package.json, the tests already there or the CI config, and name the command you chose,derived - the caller's checkout or worktree — helps: tests and code land where the slice's commits are · without it: work in the repository and touch no board row
With a person present, ask at most three questions, and only where the gap changes which behaviours get tested rather than how one is worded.
Process
- One behaviour, one test, named for the scenario id it realizes —
PWR-A3: retries a failed save three times. Realize the Given/When/Then by judgment in the project's own framework; there is no step-definition engine here. A name carrying "and" is two tests. The id is what letsquality-verificationkey its ledger by behaviour. - Write it before the code it judges, and delete the production code you wrote for this behaviour ahead of its own test — code kept as reference, or adapted while the test is written, shapes that test around its own blind spots. Explore freely, then throw the exploration away and start from the test.
- Run it and watch it fail for the reason you predicted. A test that errors is broken rather than red: re-run until the failure message is the missing behaviour itself. One passing first time is describing something that already worked.
- Write the simplest code that turns it green — no options, no configuration, no second caller's
needs. Assert on what the code does, never on what a mock was called with; a test needing everything
mocked says the interface is too coupled, so inject the dependency or move the seam. Load
references/testing-anti-patterns.mdwhen adding a mock, a fixture or a test utility. - Run it again and read the whole output — this test green, every other still green, no warnings, no stray errors. Fix the code rather than the test: a relaxed assertion buys one green run and spends the only evidence downstream has.
- Refactor under green — duplication out, names better, helpers extracted, no behaviour added; re-run before moving on.
- Repeat until the slice's list is spent, covering error and edge paths as well as the happy one and
giving every new function or method a test. Record a scenario whose Given this slice cannot construct
as
not-reachablewith its reason and carry past it — nothing stopped being checked, so it ends no slice. - Change a test the plan moved past rather than test a stale thing — nothing here is frozen. Its
before, its after and the reason go to the pull request and one
docs/session-log.mdentry, where the code-cold review meets the change inside the diff (pull-requestshapes it). Only the stop list (safety-rails.md) ends a slice; the rest is a default with a reason, a log line and a Decided-for-you row.
Rationalizations
| Rationalization | Reality |
| "I'll write the tests straight after" | A test written after its code passes first run, having shown nothing about what it catches. |
| "It's already written — keep it as reference" | A test shaped around existing code inherits that code's blind spots. Adapting is testing after, renamed. |
| "The feature works, the assertion is a bit off" | Then the code is wrong — or the plan moved and the test is stale, which travels in the PR body, not into the assertion. |
| "Mocking everything keeps it fast and isolated" | A test asserting on mock calls stays green when the product breaks and red on a correct refactor. |
| "This scenario can't be built yet, so drop it" | not-reachable by id leaves it in the contract, unproven and visible; removing it stops something being checked. |
Red flags
- Production code in the diff that no test was ever red against.
- A new test that passed on its first run.
- An assertion counting mock calls where the returned value or stored row was there to assert on.
- A test loosened, skipped or deleted to reach green, with nothing in the PR body saying so.
- A test name carrying "and", or naming no scenario id where a contract supplies them.
- Green reported with no runner output behind it.
Verification
- Every behaviour this slice owes has a test that failed first for the reason predicted, passes now, and carries its scenario id.
- Every new function or method has a test; error and edge paths are covered too.
- The suite is green and the output pristine — no warnings, no stray errors, nothing quietly skipped.
- Scenarios this slice could not construct are handed back
not-reachableby id, with their reasons. - Any changed test is handed back with its before, its after and why the plan moved.
- Every derived input is marked
derivedwhere written or handed back.
Outputs & handoff
- Tests and the code passing them, in the caller's checkout — each named for its scenario id, each watched red before its production code existed, scoped to the files the caller named. Both ride the caller's commits; this pass opens no artifact of its own.
docs/session-log.md— one appended entry, cap 60 words, where this pass changed a test or settled something itself; shape instate-schema.md. Where no such file exists, hand the entry back rather than create one —project-setupowns that.- No
STATE.mdrow and no gate flip — the caller owns the slice's transition (state-schema.md). - Returned in conversation — the red and green commands with their real output, the scenario ids
proved, the
not-reachableids with reasons, the before/after of any changed test, and the log entry's measured size against its cap — an over-cap entry reported at that size, never handed on as if it fit.
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.

