tdd
Skill4 starsChanged 29 days agoMITView on GitHub
[UDS] Reference for Test-Driven Development: the Red-Green-Refactor cycle, FIRST principles, and Arrange-Act-Assert structure. Use when: writing a failing test before implementation, structuring a test with Arrange-Act-Assert, checking tests against FIRST. Not for: driving the RED/GREEN cycle interactively — that moved to the adoption layer (XSPEC-095); measuring how much code the tests cover — use /coverage. Keywords: TDD, test first, Red Green Refactor, FIRST, Arrange Act Assert, unit test, 測試驅動開發, 紅綠重構, 單元測試.
194 other projects use a version of this.
Adopted by
Most recently taken up by
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- trpc/trpctheir own version, first seen Nov 8, 2026
- wowyuarm/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Contexera/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Dimon94/dveritytheir own version, first seen Nov 8, 2026
- Dimon94/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use capture-learning-tools, design-frontend-dev 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.
The-Vibe-CompanySkillcapture-learning-tools
Turn technical conversations, bugs, CI failures, review comments,
Also in 5 projects that use this
The-Vibe-CompanySkilldesign-frontend-dev
Clean Impeccable frontend design skill. Use when the user wants to
Also in 5 projects that use this
tristanphvnSkillketchup-video
Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.
Also in 14 projects that use this
jaydubya818Skillfigure-it-out
Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.
Also in 54 projects that use this
jaydubya818Skillprinciple-laziness-protocol
Apply when a refactor is adding wrappers or abstractions instead of simplifying.
Also in 45 projects that use this
- +2 more from The-Vibe-Company
- +5 more from jaydubya818
Other versions194 projects use a version of this.
Word for word · 1
- AsiaOstrich/universal-dev-standards★ 84100% same
Edited · 0
None found.
Wrote their own version · 193
- mattpocock/skills★ 309ksame name
- trpc/trpc★ 41ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
183 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 repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ac-coverageSkill
- adrSkill
- ai-collaboration-standardsSkill
- ai-friendly-architectureSkill
- ai-instruction-standardsSkill
- api-designSkill
- atddSkill
- auditSkill
- bddSkill
- brainstormSkill
- changelogSkill
- checkinSkill
- ci-cdSkill
- code-reviewSkill
- commitSkill
- contract-testSkill
- databaseSkill
- deploySkill
- methodologySkill
- dev-workflowSkill
- docgenSkill
- documentation-guideSkill
- durableSkill
- e2eSkill
- error-code-guideSkill
- git-workflow-guideSkill
- incidentSkill
- journey-test-assistantSkill
- knowledge-graphSkill
- logging-guideSkill
- metricsSkill
- migrateSkill
- observabilitySkill
- orchestrateSkill
- planSkill
- prSkill
- discoverSkill
- project-structure-guideSkill
- pushSkill
- refactorSkill
- releaseSkill
- requirementSkill
- retrospectiveSkill
- reverseSkill
- runbookSkill
- securitySkill
- scanSkill
- skill-builderSkill
- sloSkill
- spec-deriveSkill
- sddSkill
- sweepSkill
- coverageSkill
- testing-guideSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Write a test that describes the desired behavior | 撰寫描述預期行為的測試
- Distinctive: line 47
Run tests - confirm it fails for the right reason | 執行測試 - 確認正確地失敗
- Distinctive: line 48
Use AAA pattern (Arrange-Act-Assert) | 使用 AAA 模式
- Distinctive: line 52
Write minimum code to pass the test | 撰寫最少的程式碼讓測試通過
- Distinctive: line 54
Run tests - confirm it passes | 執行測試 - 確認通過
- Distinctive: line 60
Run tests after every change | 每次變更後執行測試
- Distinctive: line 61
No new functionality added | 不新增功能
- Very specific: line 81
After /tdd completes, the AI assistant should suggest:
“Common” is measured: kept by at least 6 in 10 of the 186 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
<!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
TDD flow orchestration (RED→GREEN→REFACTOR cycle, test execution gates) relocated to adoption
layer (XSPEC-095, 2026-04-28). This Skill retains: TDD principles, FIRST rules, AAA format,
language examples, workflow guide.
For enforced interactive cycle, use your adoption layer's toolchain.
-->TDD Assistant | TDD 助手
⚠️ Status: Reference(參考用,非可執行流程) — TDD 流程協調(RED→GREEN→REFACTOR 循環、測試執行 gates)已於 2026-04-28 移至 adoption layer(XSPEC-095)。此處保留 TDD 原則、FIRST 規則、AAA 格式、語言範例、流程指南供參考。 Lifecycle orchestration has moved to the adoption layer (XSPEC-095); this document is reference-only. For enforced execution, use your adoption layer's toolchain.
Guide through the Test-Driven Development workflow: Red-Green-Refactor.
引導測試驅動開發(TDD)流程:紅-綠-重構。
TDD Cycle | TDD 循環
┌─────┐ ┌───────┐ ┌──────────┐
│ RED │ ────► │ GREEN │ ────► │ REFACTOR │
└─────┘ └───────┘ └──────────┘
▲ │
└────────────────────────────────┘Workflow | 工作流程
📖 以下為流程的參考結構,非可執行步驟;自動化/強制執行請用 adoption layer 工具鏈(XSPEC-095)。 The steps below are a reference structure, not an executable workflow.
Phase 1: RED - Write Failing Test | 紅燈 - 撰寫失敗測試
- Write a test that describes the desired behavior | 撰寫描述預期行為的測試
- Run tests - confirm it fails for the right reason | 執行測試 - 確認正確地失敗
- Use AAA pattern (Arrange-Act-Assert) | 使用 AAA 模式
Phase 2: GREEN - Make Test Pass | 綠燈 - 讓測試通過
- Write minimum code to pass the test | 撰寫最少的程式碼讓測試通過
- Hardcoding is acceptable at this stage | 此階段可以硬編碼
- Run tests - confirm it passes | 執行測試 - 確認通過
Phase 3: REFACTOR - Improve Code | 重構 - 改善程式碼
- Remove duplication (DRY) | 移除重複
- Improve naming and structure | 改善命名與結構
- Run tests after every change | 每次變更後執行測試
- No new functionality added | 不新增功能
FIRST Principles | FIRST 原則
| Principle | Description | 說明 |
| Fast | Tests run quickly (< 100ms/unit) | 快速執行 |
| Independent | No shared state between tests | 測試間無共享狀態 |
| Repeatable | Same result every time | 每次結果相同 |
| Self-validating | Clear pass/fail result | 明確的通過/失敗 |
| Timely | Written before production code | 在產品程式碼之前撰寫 |
Usage | 使用方式
/tdd- Start interactive TDD session/tdd calculateTotal- TDD for specific function/tdd "user can login"- TDD for user story
Next Steps Guidance | 下一步引導
After /tdd completes, the AI assistant should suggest:
TDD 循環完成。建議下一步 / TDD cycle complete. Suggested next steps:
- 執行
/checkin通過品質關卡 ⭐ Recommended / 推薦 — Pass quality gates- 執行
/coverage確認測試覆蓋率 — Check test coverage- 執行
/code-review自我審查程式碼 — Self-review code quality
Reference | 參考
- TDD Language Examples — Read it when you need a concrete example in a specific language.
- TDD Workflow Guide — Read it when running the red-green-refactor cycle end to end.
- Detailed guide: guide.md
- Core standard: test-driven-development.md
AI Agent Behavior | AI 代理行為
完整的 AI 行為定義請參閱對應的命令文件:
/tddFor complete AI agent behavior definition, see the corresponding command file:
/tdd
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.

