tdd-workflow
Skill9 starsChanged 6 months agoMITView on GitHub
NOT A SINGLE LINE OF PRODUCTION CODE WITHOUT A FAILING TEST. Order is always: RED → GREEN → REFACTOR. No exceptions. Critical: if tests pass before writing code — they are useless. That means: they test the wrong thing, or they test already existing behavior. If a test passed → delete it and write a correct test that checks NEW behavior. A separate commit creates clean history: contract (tests) first, then implementation. If something broke — fix the implementation, NOT…
128 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- mahsumaktas/agent-evolution-kittheir own version, first seen Nov 8, 2026
- ControllableModel/SWE-Skills-Benchtheir own version, first seen Nov 8, 2026
- LuisSambrano/antigravity-configtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use brand-discovery, configure-ecc 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.
ysyecustSkillbrand-discovery
Use when a brand needs to discover or articulate its identity through structured multi-session interviews. Covers purpose, positioning, audience, personality, voice, narrative, and founder-brand tension across 8 modules using laddering, 5 Whys, and projective techniques. Produces a resumable session with disk-persisted state and a master brandbook (90_SYNTHESIS.md).
Also in 6 projects that use this
royaluniondesign-sysSkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 12 projects that use this
junimnjwSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 12 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 10 projects that use this
royaluniondesign-sysSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 16 projects that use this
RojiosSkilldart-flutter-patterns
Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.
Also in 7 projects that use this
Other versions128 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 128
- affaan-m/ECC★ 246ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- loulanyue/awesome-claude-notes★ 272same name
- ab604/claude-code-r-skills★ 202same name
- cloudnative-co/claude-code-starter-kit★ 153same name
- xenitV1/Antigravity-Workflows★ 130same name
- cohen-liel/hivemind★ 108same name
- travisjneuman/.claude★ 106same name
118 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 repository164 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- agents/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- claude-md/CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- insight-architectSkill
- agent-teamsSkill
- brainstormingSkill
- claim-decomposerSkill
- context-engineeringSkill
- dispatcherSkill
- git-worktreesSkill
- hd-mavp-routerSkill
- mentor-modeSkill
- reference-registrySkill
- routing-policySkill
- skill-self-updateSkill
- ab-testSkill
- academic-researchSkill
- advanced-methodology-extensionsSkill
- agent-governanceSkill
- ai-hyp-gateSkill
- algorithm-designSkill
- analystSkill
- archcode-genomicsSkill
- arm-cortex-microcontrollersSkill
- atomizeSkill
- backward-traceabilitySkill
- boyko-constraint-engineSkill
- boyko-epistemic-auditSkill
- boyko-goal-expansion-100Skill
- boyko-knowledge-architectureSkill
- boyko-leverage-mapSkill
- boyko-methodSkill
- boyko-preflightSkill
- boyko-project-radarSkill
- boyko-rippleSkill
- boyko-scientific-consortiumSkill
- boyko-specialistSkill
- boyko-toolcheckSkill
- boyko-triangle-auditSkill
- boyko-why-ladderSkill
- browser-actSkill
- build-autoSkill
- c4-architectureSkill
- career-prepSkill
- changelog-genSkill
- citation-managementSkill
- code-debuggingSkill
- code-materialitySkill
- codex-skepticSkill
- codex-solverSkill
- codex-tracySkill
- combinatorial-creativitySkill
- common-groundSkill
- conductorSkill
- consilienceSkill
- construct-measurement-gateSkill
- convertSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 18 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 117 edited versions we read keep these.
18
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
ALWAYS USE when writing new features, fixing bugs, or adding functionality.
- Distinctive: line 13
MUST USE when user mentions: tests, test, TDD, coverage, red-green, write tests, cover with tests, add with tests, fix with tests.
- Distinctive: line 16
Do NOT use for throwaway prototypes, generated code (migrations, protobuf stubs), or config files — tests are not needed there.
- Distinctive: line 36
Write tests based on requirements, NOT on implementation.
- Distinctive: line 40
Do not write implementation.
- Distinctive: line 43
Run the tests. Confirm that EVERY new test FAILS.
- Distinctive: line 48
Critical: if tests pass before writing code — they are useless.
- Distinctive: line 51
If a test passed → delete it and write a correct test that checks NEW behavior.
- Distinctive: line 62
Write MINIMAL code to make all tests green.
- Distinctive: line 63
Do not add functionality beyond what the tests require
- Distinctive: line 65
If a test seems wrong — stop, discuss with user
- Distinctive: line 68
Run all tests (not just the new ones):
- Distinctive: line 73
If something broke — fix the implementation, NOT the tests.
- Distinctive: line 78
No workarounds instead of a real solution?
- Distinctive: line 85
Run tests after EVERY change
- Distinctive: line 117
Test passes BEFORE writing code → Test is useless.
- Distinctive: line 128
Write tests BEFORE implementation — tests after code test implementation, not requirements
- Distinctive: line 129
Never weaken a test to make it pass — fix the code, not the test
“Common” is measured: kept by at least 6 in 10 of the 117 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
<!-- BSV — Brief Skill View | поиск: BSV
Скил : tdd-workflow
TL;DR : TDD цикл RED→GREEN→REFACTOR, тест до кода
Вызов : `test:`, `TDD:`, 'напиши тесты'
НЕ для : Написание кода без тестов
-->name: tdd-workflow description: > [STATUS: review] [CONFIDENCE: high] [REVIEWED: 2026-03-13] ALWAYS USE when writing new features, fixing bugs, or adding functionality. MUST USE when user mentions: tests, test, TDD, coverage, red-green, write tests, cover with tests, add with tests, fix with tests. ESPECIALLY when tempted to write code before tests. Do NOT use for throwaway prototypes, generated code (migrations, protobuf stubs), or config files — tests are not needed there.
TDD Workflow — Test-Driven Development
Existing Tests (auto-injected)
!`pytest --co -q 2>/dev/null | head -20`Iron Law
NOT A SINGLE LINE OF PRODUCTION CODE WITHOUT A FAILING TEST.
Order is always: RED → GREEN → REFACTOR. No exceptions.
6-Step Process
Step 1: RED — Write Tests
Write tests based on requirements, NOT on implementation.
- One test = one behavior
- Clear names:
test_user_login_returns_token_on_valid_credentials - Real data, mock only when unavoidable (DB, external API)
- Do not write implementation. Tests only.
Step 2: RED — Confirm Tests Fail
Run the tests. Confirm that EVERY new test FAILS.
pytest tests/unit/module_name/ -x -q --tb=shortCritical: if tests pass before writing code — they are useless. That means: they test the wrong thing, or they test already existing behavior.
If a test passed → delete it and write a correct test that checks NEW behavior.
Step 3: RED — Commit Tests Separately
git add tests/...
git commit -m "test: add failing tests for <feature>"A separate commit creates clean history: contract (tests) first, then implementation.
Step 4: GREEN — Write Minimal Implementation
Write MINIMAL code to make all tests green.
- Do not add functionality beyond what the tests require
- FORBIDDEN to modify tests in this step
- If a test seems wrong — stop, discuss with user
Step 5: GREEN — Verification
Run all tests (not just the new ones):
pytest tests/ -x -q --tb=shortIf something broke — fix the implementation, NOT the tests.
Dispatch reviewer subagent to check:
- Implementation is not hardcoded to specific test values?
- Edge cases covered?
- No workarounds instead of a real solution?
Step 6: REFACTOR — Improve While Staying Green
Refactor ONLY with green tests:
- Remove duplication
- Improve naming
- Simplify logic
- Run tests after EVERY change
Commit:
git add src/... tests/...
git commit -m "feat: implement <feature>"Rationalization Prevention
| Excuse | Reality |
| "Tests are too simple for this function" | Write at least happy path + one edge case. Simple tests catch simple bugs. 30 seconds of work. |
| "I already know the implementation, let's do code first" | No. RED → GREEN → REFACTOR. Tests first, always. Knowing the implementation does not cancel the process. |
| "This module is hard to test" | Hard to test = signal of poor design. Refactor the module, then test. |
| "Just this once without tests, I'll add them later" | "Later" never comes. Tests written after code are fitted to implementation, not requirements. |
| "This is just config/utility, no tests needed" | Config breaks production more often than business logic. One validation test = insurance. |
| "Tests slow down development" | Tests slow down CODE WRITING by 20%. Debugging without tests — by 300%. |
| "I'll write integration tests later" | Unit tests and integration tests are different things. Unit now, integration later. |
Exceptions (require explicit user confirmation)
- Throwaway prototype (user explicitly said "no tests, prototype")
- Generated code (migrations, protobuf, OpenAPI stubs)
- Configuration files (CI/CD, Docker, package.json)
- Documentation
Red Flags — STOP if noticed
- "I'll skip TDD just this once" → No. Follow the process.
- "I'll write tests after" → No. RED first.
- "Tests after code give the same result" → No. Tests after code test implementation, not requirements.
- Test passes BEFORE writing code → Test is useless. Rewrite it.
- Modifying test to make it pass → FORBIDDEN. Fix code, not tests.
Relationship with rules/testing.md
This skill extends the base rules from @~/.claude/rules/testing.md:
- testing.md sets CONSTRAINTS (do not delete tests, coverage 80%+)
- tdd-workflow sets PROCESS (RED → GREEN → REFACTOR)
- They complement each other, not conflict
Gotchas
- Write tests BEFORE implementation — tests after code test implementation, not requirements
- Never weaken a test to make it pass — fix the code, not the test
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.

