test-driven-development
Skill1 starsChanged 11 days agoMITView on GitHub
Write tests first with RED-GREEN-REFACTOR cycle. Use when implementing logic, fixing bugs, or proving code works. Do NOT use for exploratory prototyping.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 179 edited versions we read keep these.
2
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 16
Write a failing test before writing the code that makes it pass.
- Distinctive: line 140
After completing any implementation:
“Common” is measured: kept by at least 6 in 10 of the 179 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
Write a failing test before writing the code that makes it pass. For bug fixes, reproduce the bug with a test before attempting a fix. Tests are proof — "seems right" is not done.
When to Activate
- Implementing any new logic or behavior
- Fixing any bug (the Prove-It Pattern)
- Modifying existing functionality
- Adding edge case handling
- User says "add tests" or "make sure it works"
When NOT to Use
- Pure configuration changes, documentation updates, or static content changes
Output Contract
| Artifact | Format | Location | Quality Criteria |
| Test files + tested source code | Test files (framework-agnostic) + modified source code | tests/ or alongside source (any project structure) | Test-first (RED→GREEN→REFACTOR) for every behavior change, bug fixes include reproduction test before fix, all tests passing, test names describe behavior (not implementation), no skipped/disabled tests, no empty tests (assert on behavior, not just "no error") |
Decision Tree: What Kind of Test?
What are you testing?
├── Single function, pure logic → Unit test
│ ├── Input/output, no side effects
│ ├── Fast, isolated, many cases
│ └── ~80% of your test suite
│
├── Multiple units working together → Integration test
│ ├── API endpoint + database
│ ├── Component + service layer
│ ├── ~15% of your test suite
│ └── Test real interactions, not mocks
│
├── User flow through the app → E2E test
│ ├── Click through a complete workflow
│ ├── Login → create item → see it in list
│ ├── ~5% of your test suite
│ └── Use sparingly — slow, brittle
│
└── Bug fix → Prove-It Pattern
├── Write test that reproduces the bug
├── Test fails (proves the bug exists)
├── Fix the bug
├── Test passes (proves the fix works)
└── Add to regression suiteCore Workflows
TDD Cycle
→ See guides/TDD-CYCLE.md
RED (write failing test) → GREEN (minimal code to pass) → REFACTOR (clean up)
Prove-It Pattern
→ See guides/PROVE-IT.md
For bug fixes: write test that reproduces the bug, then fix.
Test Pyramid
→ See guides/TEST-PYRAMID.md
Unit tests (~80%) → Integration (~15%) → E2E (~5%)
Writing Good Tests
→ See guides/WRITING-TESTS.md
State vs interactions, DAMP, AAA pattern, test naming.
Anti-Patterns
→ See guides/ANTI-PATTERNS.md
Empty tests, testing implementation, over-mocking, test interdependence.
Browser Testing
→ See guides/BROWSER-TESTING.md
DevTools workflow, security boundaries, when to use E2E vs integration.
Quick Reference
TDD Cycle:
RED: Write test that fails
GREEN: Minimal code to pass
REFACTOR: Clean up, tests still passProve-It Pattern:
Bug → Write failing test → Fix → Test passes → Full suiteEmpty Test Detection (from METR study):
Test passes but doesn't prove anything?
├── Does it assert on behavior (not implementation)? → Good
├── Does it test the actual output? → Good
├── Does it only call the function and check "no error"? → EMPTY TEST — rewrite
└── Does it use mocks for everything? → Likely testing mocks, not codeFramework Quick Start
| Framework | Run tests | Watch mode | Coverage |
| Jest/Vitest | npm test | npm test -- --watch | npm test -- --coverage |
| pytest | pytest | pytest --looponfail | pytest --cov |
| cargo test | cargo test | cargo watch -x test | cargo tarpaulin |
| Go | go test ./... | go test -count=1 ./... | go test -cover |
Integration
| Skill | When to use with TDD |
debugging-and-error-recovery | Write failing test to reproduce bug, then debug |
code-review-and-quality | Review test quality alongside code quality |
incremental-implementation | Each increment = one RED→GREEN→REFACTOR cycle |
doubt-driven-development | Challenge test assumptions before writing |
Verification
After completing any implementation:
- Every new behavior has a corresponding test
- All tests pass
- Bug fixes include a reproduction test
- Test names describe the behavior being verified
- No tests were skipped or disabled
- No empty tests (tests that pass without asserting anything real)
Other versions190 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 190
- obra/superpowers★ 305ksame name
- NousResearch/hermes-agent★ 259ksame name
- addyosmani/agent-skills★ 112ksame name
- cloudflare/computer★ 9.8ksame name
- jnMetaCode/superpowers-zh★ 8.4ksame name
- openai/plugins★ 7.4ksame name
- farm-fe/farm★ 5.6ksame name
- microsoft/FluidFramework★ 5ksame name
- mikeyobrien/ralph-orchestrator★ 3.2ksame name
- crbnos/carbon★ 2.8ksame name
180 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 chinese-code-review, chinese-commit-conventions and 6 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.
GEd520Skillchinese-code-review
中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
Also in 7 projects that use this
GEd520Skillchinese-commit-conventions
中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。
Also in 7 projects that use this
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 12 projects that use this
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 36 projects that use this
10CGSkillworkflow-runner
十步循环轻量编排器,协调 Phase Skills 执行,支持灵活组合。
Also in 8 projects that use this
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 12 projects that use this
- +2 more from GEd520
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- adapt-skillSkill
- api-and-interface-designSkill
- architecture-analysisSkill
- audit-skillSkill
- backend-api-masterySkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- clarify-skillSkill
- cli-toolsSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- critique-skillSkill
- customize-opencodeSkill
- debugging-and-error-recoverySkill
- debugging-three-strikesSkill
- delight-skillSkill
- deprecation-and-migrationSkill
- dev-environment-auditSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- engineering-fundamentalsSkill
- frontend-desktopSkill
- frontend-mobileSkill
- frontend-pwaSkill
- frontend-ui-engineeringSkill
- frontend-webSkill
- fullstack-shippingSkill
- gateSkill
- git-init-and-versioningSkill
- git-workflow-and-versioningSkill
- hard-skillSkill
- idea-refineSkill
- incremental-implementationSkill
- industrial-brutalist-uiSkill
- interview-meSkill
- minimalist-uiSkill
- multi-agent-orchestrationSkill
- observability-and-instrumentationSkill
- optimize-skillSkill
- output-skillSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- polish-skillSkill
- project-health-checkSkill
- project-metricsSkill
- redesign-skillSkill
- security-and-hardeningSkill
- self-improvementSkill
- shipping-and-launchSkill
- skill-creatorSkill
- skill-improverSkill
- soft-premium-uiSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- typeset-skillSkill
- user-onboardingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

