skills/tdd-assistant/SKILL.md
[UDS] Guide through Test-Driven Development workflow
npx skillsauth add asiaostrich/universal-dev-standards tddInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
⚠️ 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)流程:紅-綠-重構。
┌─────┐ ┌───────┐ ┌──────────┐
│ RED │ ────► │ GREEN │ ────► │ REFACTOR │
└─────┘ └───────┘ └──────────┘
▲ │
└────────────────────────────────┘
📖 以下為流程的參考結構,非可執行步驟;自動化/強制執行請用 adoption layer 工具鏈(XSPEC-095)。 The steps below are a reference structure, not an executable workflow.
| 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 | 在產品程式碼之前撰寫 |
/tdd - Start interactive TDD session/tdd calculateTotal - TDD for specific function/tdd "user can login" - TDD for user storyAfter /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
完整的 AI 行為定義請參閱對應的命令文件:
/tddFor complete AI agent behavior definition, see the corresponding command file:
/tdd
tools
[UDS] 從規格衍生 BDD 場景、TDD 骨架或 ATDD 表格
development
[UDS] /methodology: 選擇並追蹤開發方法論(SDD/BDD/TDD)。 Use when: 選擇方法論、切換開發模式、查詢當前方法論狀態。 若要查詢各階段對應指令請用 /dev-workflow。
testing
[UDS] Derive BDD scenarios, TDD skeletons, or ATDD tables from specifications
development
[UDS] Create or review specification documents for Spec-Driven Development