locales/zh-TW/skills/tdd-assistant/SKILL.md
[UDS] 引導測試驅動開發(TDD)流程:紅-綠-重構
npx skillsauth add asiaostrich/universal-dev-standards tdd-assistantInstall 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.
語言: English | 繁體中文
⚠️ 狀態:參考用(非可執行流程) — TDD 流程協調(RED→GREEN→REFACTOR 循環、測試執行 gates)已於 2026-04-28 移至 adoption layer(XSPEC-095)。此處保留 TDD 原則、FIRST 規則、AAA 格式、語言範例、流程指南供參考;需要強制執行的流程請改用你的 adoption layer 工具鏈。
引導測試驅動開發(TDD)流程:紅-綠-重構。
┌─────┐ ┌───────┐ ┌──────────┐
│ RED │ ────► │ GREEN │ ────► │ REFACTOR │
└─────┘ └───────┘ └──────────┘
▲ │
└────────────────────────────────┘
| 原則 | 說明 | Description | |------|------|-------------| | Fast | 測試快速執行(< 100ms/單元) | Tests run quickly | | Independent | 測試間無共享狀態 | No shared state between tests | | Repeatable | 每次結果相同 | Same result every time | | Self-validating | 明確的通過/失敗結果 | Clear pass/fail result | | Timely | 在產品程式碼之前撰寫 | Written before production code |
/tdd - 開始互動式 TDD 工作階段/tdd calculateTotal - 對特定函式進行 TDD/tdd "user can login" - 對使用者故事進行 TDD/tdd 完成後,AI 助手應建議:
TDD 循環完成。建議下一步:
- 執行
/checkin通過品質關卡- 執行
/coverage確認測試覆蓋率- 執行
/code-review自我審查程式碼
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