Writing code with tests first: RED-GREEN-REFACTOR, reproduce bugs as failing tests before fixing, and avoid testing anti-patterns. Use when implementing behaviour, fixing a defect, or asked to add tests.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Test-driven development
Iron law: no production code without a failing test that demands it.
## The cycle
1. **RED**: write the smallest test for the next bit of behaviour. Run it. Read the failure and confirm it fails for the reason you intended (your assertion), not an import error, a typo, or a missing fixture. A test that fails for the wrong reason proves nothing.
2. **GREEN**: write the least production code that passes. Run the test again. Nothing more than the test asks for.
3. **REFACTOR**: improve names and structure while all tests stay green. Run them again.
Then the next slice. Cycles are minutes, not hours; commit-sized.
## Bugs: reproduce first
- Turn the bug into a failing test before touching the fix. Watch it fail, fix, watch it pass.
- If you cannot express the bug as a failing test, you do not understand it yet; switch to `skill://systematic-debugging`.
- Keep the repro test after the fix as the regression test. A bug fix without a test that dies when the bug returns is incomplete.
## Already wrote the code? Delete it
…
The line at the top of this page pins the label git:20261010.ee06e2b, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_gudvyedru4zo3pjc
GET https://markdownregistry.com/api/v1/resolve?ref=damianvtran/local-operator/test-driven-development
GET https://markdownregistry.com/api/v1/blob/516707d441ae66c3a49b2385dc1f47916593cf67a0a2f4a738807dde38ecd5a0
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
damianvtran/local-operator · local_operator/skills/builtin/browser-qa/SKILL.md · Testing web apps through a real browser: reconnaissance before acting, selector discovery, state capture, console…
damianvtran/local-operator · local_operator/skills/builtin/design-qa/SKILL.md · Deterministic design review for UI/UX on web and terminal screens: measure contrast, spacing, overlap, clipping and…
damianvtran/local-operator · local_operator/skills/builtin/financial-analysis/SKILL.md · Financial figures done carefully: periods and fiscal calendars, units and currencies, reconciliation, magnitude sanity…
damianvtran/local-operator · local_operator/skills/builtin/frontend-design/SKILL.md · Designing interfaces with a deliberate point of view: plan before pixels, avoid the generic-default look, typography…
damianvtran/local-operator · local_operator/skills/builtin/scheduling/SKILL.md · Scheduling across time zones: confirm times in the attendee's own zone, use IANA zone names, mind DST edges, buffers…
addyosmani/agent-skills · skills/test-driven-development/SKILL.md · Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or…
mvschwarz/openrig · skills/_canonical/process/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code
mvschwarz/openrig · packages/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code
cbrock84/headcount · plugins/technology/skills/test-driven-development/SKILL.md · Drives implementation by writing a failing test first, then the smallest code that passes it. Use this before writing…
a5c-ai/babysitter · library/methodologies/superpowers/skills/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle.
a5c-ai/babysitter · library/methodologies/rpikit/skills/test-driven-development/SKILL.md · Test-first development practice where test specifications are written before production code, integrated into plan…