Drive a change through a red-green-refactor loop - failing test first, minimal code to pass, then clean up. Use when implementing a feature or fixing a bug where correctness matters and a test can pin the behavior. Says "TDD", "test first", "red green refactor", "write the test first".
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
# tdd
The agent codes better with a tight feedback loop than with a long
specification. A failing test is the tightest loop there is: it states the
target, and the target either goes green or it does not.
## The loop
1. **Red.** Write one failing test that states the next slice of behavior.
Run it. Confirm it fails for the right reason - a test that passes before
you write the code is testing nothing. If it errors instead of failing on
the assertion, fix the test setup first.
2. **Green.** Write the least code that makes the test pass. Not the general
solution, not the abstraction - the minimal move. Run the test. Green.
3. **Refactor.** Now clean up with the test as a net: remove duplication,
name things, simplify. Re-run after every edit. Behavior is frozen; only
the shape changes.
4. Repeat for the next slice. Small slices. The rate of feedback is the
speed limit - never take on a step too big to hold a single test.
## What makes a test worth writing
- **Tests behavior, not implementation.** Assert on the observable result,
not on which private method got called. A test that breaks on every
refactor is a liability.
…
The line at the top of this page pins the label git:20260718.7f7209d, 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_6yqcoo66trx7yxpg
GET https://markdownregistry.com/api/v1/resolve?ref=rohitg00/pro-workflow/tdd
GET https://markdownregistry.com/api/v1/blob/6f872ab005db3e9d8b655f0416b092fbfb94563f719639ca9e5fc8402e3750ef
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.
rohitg00/pro-workflow · skills/agent-teams/SKILL.md · Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and…
rohitg00/pro-workflow · skills/auto-setup/SKILL.md · Auto-configure quality gates, hooks, and settings for a new project. Detects project type and sets up appropriate…
rohitg00/pro-workflow · skills/batch-orchestration/SKILL.md · Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for…
rohitg00/pro-workflow · skills/bug-capture/SKILL.md · Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the…
rohitg00/pro-workflow · skills/compact-guard/SKILL.md · Smart context compaction with state preservation. Saves critical files, task progress, and working state before…
rohitg00/pro-workflow · skills/context-optimizer/SKILL.md · Optimize token usage and context management. Use when sessions feel slow, context is degraded, or you're running out of…
rohitg00/pro-workflow · skills/cost-tracker/SKILL.md · Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
rohitg00/pro-workflow · skills/design-engineering/SKILL.md · Apply interface craft when building or reviewing UI - motion, easing, timing, springs, component feel, and visual…
rohitg00/pro-workflow · skills/deslop/SKILL.md · Remove AI-generated code slop, unnecessary comments, and over-engineering from the current branch diff. Cleans up…
rohitg00/pro-workflow · skills/domain-modeling/SKILL.md · Build the project's shared language and bounded contexts before writing code, so names stay consistent and the agent…
cursor/plugins · harness/pstack/claude-code/skills/tdd/SKILL.md · Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious…
cursor/plugins · pstack/skills/tdd/SKILL.md · Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious…
michael-denyer/pstack-claude · plugins/pstack/skills/tdd/SKILL.md · Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious…
backnotprop/pstack · skills/tdd/SKILL.md · Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious…