tdd-workflow
Skill130 starsChanged 10 months agoMITView on GitHub
Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle.
We split this skill into the rules it gives an agent
9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 109 edited versions we read keep these.
9
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 29
Write production code only to make a failing test pass
- Distinctive: line 30
Write only enough test to demonstrate failure
- Distinctive: line 31
Write only enough code to make the test pass
- Distinctive: line 47
Test must fail first
- Distinctive: line 48
Test name describes expected behavior
- Distinctive: line 65
Don't write unneeded code
- Distinctive: line 66
Don't optimize yet
- Distinctive: line 84
All tests must stay green
- Distinctive: line 86
Commit after each refactor
“Common” is measured: kept by at least 6 in 10 of the 109 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
TDD Workflow
Write tests first, code second.
1. The TDD Cycle
🔴 RED → Write failing test
↓
🟢 GREEN → Write minimal code to pass
↓
🔵 REFACTOR → Improve code quality
↓
Repeat...2. The Three Laws of TDD
- Write production code only to make a failing test pass
- Write only enough test to demonstrate failure
- Write only enough code to make the test pass
3. RED Phase Principles
What to Write
| Focus | Example |
| Behavior | "should add two numbers" |
| Edge cases | "should handle empty input" |
| Error states | "should throw for invalid data" |
RED Phase Rules
- Test must fail first
- Test name describes expected behavior
- One assertion per test (ideally)
4. GREEN Phase Principles
Minimum Code
| Principle | Meaning |
| YAGNI | You Aren't Gonna Need It |
| Simplest thing | Write the minimum to pass |
| No optimization | Just make it work |
GREEN Phase Rules
- Don't write unneeded code
- Don't optimize yet
- Pass the test, nothing more
5. REFACTOR Phase Principles
What to Improve
| Area | Action |
| Duplication | Extract common code |
| Naming | Make intent clear |
| Structure | Improve organization |
| Complexity | Simplify logic |
REFACTOR Rules
- All tests must stay green
- Small incremental changes
- Commit after each refactor
6. AAA Pattern
Every test follows:
| Step | Purpose |
| Arrange | Set up test data |
| Act | Execute code under test |
| Assert | Verify expected outcome |
7. When to Use TDD
| Scenario | TDD Value |
| New feature | High |
| Bug fix | High (write test first) |
| Complex logic | High |
| Exploratory | Low (spike, then TDD) |
| UI layout | Low |
8. Test Prioritization
| Priority | Test Type |
| 1 | Happy path |
| 2 | Error cases |
| 3 | Edge cases |
| 4 | Performance |
9. Anti-Patterns
| ❌ Don't | ✅ Do |
| Skip the RED phase | Watch test fail first |
| Write tests after | Write tests before |
| Over-engineer initial | Keep it simple |
| Multiple asserts | One behavior per test |
| Test implementation | Test behavior |
10. AI-Augmented TDD
Multi-Agent Pattern
| Agent | Role |
| Agent A | Write failing tests (RED) |
| Agent B | Implement to pass (GREEN) |
| Agent C | Optimize (REFACTOR) |
Remember: The test is the specification. If you can't write a test, you don't understand the requirement.
Other versions123 projects use a version of this.
Word for word · 5
- VoDaiLocz/kilo-kit-mcp★ 26100% same
- xfstudio/skills★ 9100% same
- SKB3002/agenthub★ 4100% same
- ai4brands-design/claude-skills★ 2100% same
- sid-lakhani/agents-config★ 2100% same
Edited · 4
- vudovn/ag-kit★ 8.2k92% same
- vudovn/antigravity-kit★ 8.2k92% same
- jornalistainclusivo/jinc-skills★ 1100% same
- lschGSL/claude_code_template★ 192% same
Wrote their own version · 114
- affaan-m/ECC★ 246ksame 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
- cohen-liel/hivemind★ 108same name
- travisjneuman/.claude★ 106same name
- tpavanipradeep/everything-claude-code★ 104same name
- MRCalderon3D/everything-game-dev-code★ 91same name
- mturac/everything-openai-codex★ 89same name
104 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.
Used alongsideProjects with it also use brand-discovery, ralphinho-rfc-pipeline 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
junimnjwSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 11 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 10 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 9 projects that use this
InfopibeSkillinvestor-materials
Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.
Also in 35 projects that use this
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 12 projects that use this
In this repository45 other files it gives its agents.
- api-patternsSkill
- app-builderSkill
- templatesSkill
- architectureSkill
- bash-linuxSkill
- behavioral-modesSkill
- brainstormingSkill
- clean-codeSkill
- code-review-checklistSkill
- database-designSkill
- deployment-proceduresSkill
- documentation-templatesSkill
- frontend-designSkill
- 2d-gamesSkill
- 3d-gamesSkill
- game-artSkill
- game-audioSkill
- game-designSkill
- mobile-gamesSkill
- multiplayerSkill
- pc-gamesSkill
- game-developmentSkill
- vr-arSkill
- web-gamesSkill
- geo-fundamentalsSkill
- i18n-localizationSkill
- lint-and-validateSkill
- mcp-builderSkill
- mobile-designSkill
- nextjs-best-practicesSkill
- nodejs-best-practicesSkill
- parallel-agentsSkill
- performance-profilingSkill
- plan-writingSkill
- powershell-windowsSkill
- python-patternsSkill
- react-patternsSkill
- red-team-tacticsSkill
- seo-fundamentalsSkill
- server-managementSkill
- systematic-debuggingSkill
- tailwind-patternsSkill
- testing-patternsSkill
- vulnerability-scannerSkill
- webapp-testingSkill
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.

