Tdd assistant

From AsiaOstrich/universal-dev-standards · View interactive version

Tdd assistant is an AI agent skill from the GitHub repository AsiaOstrich/universal-dev-standards. [UDS] 引導測試驅動開發(TDD)流程:紅-綠-重構

How to use this skill

Skill file

TDD 助手

語言: English | 繁體中文

引導測試驅動開發(TDD)流程:紅-綠-重構。

TDD 循環

    ┌─────┐       ┌───────┐       ┌──────────┐
    │ RED │ ────► │ GREEN │ ────► │ REFACTOR │
    └─────┘       └───────┘       └──────────┘
       ▲                                │
       └────────────────────────────────┘

工作流程

階段 1:RED - 撰寫失敗測試

階段 2:GREEN - 讓測試通過

階段 3:REFACTOR - 改善程式碼

FIRST 原則

| 原則 | 說明 | 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 完成後,AI 助手應建議:

TDD 循環完成。建議下一步:

- 執行 /checkin 通過品質關卡

- 執行 /coverage 確認測試覆蓋率

- 執行 /code-review 自我審查程式碼

參考

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.