Derives TDD test skeletons from approved SDD specs by parsing acceptance criteria into framework-detected describe/it blocks with AAA [TODO] markers.
npx claudepluginhub asiaostrich/universal-dev-standards --plugin universal-dev-standards# /derive-tdd — Derive TDD Skeletons | 推演 TDD 測試骨架 Derive test skeleton files from an approved SDD specification document. 從已核准的 SDD 規格文件推演測試骨架檔案。 ## Workflow | 工作流程 1. **Read** the SDD spec and extract acceptance criteria 2. **Map** each AC to a `describe`/`it` block with AAA pattern 3. **Generate** test file with `[TODO]` markers for implementation 4. **Output** derivation summary ## Output Format | 輸出格式 ## Usage | 使用方式 | Command | Purpose | 用途 | |---------|---------|------| | `/derive-tdd specs/SPEC-001.md` | Derive TDD from specific spec | 從特定規格推演 TDD | | `/derive-tdd` | Inte...
/atddStarts ATDD workflow for a new feature: understands requirements from argument or user input, writes Given/When/Then specs in specs/, generates test pipeline, runs tests expecting failure, implements with TDD until passing, reviews specs.
/COMMANDGuides through TDD workflow for functions/modules/features: understand requirements, write failing tests (RED), implement minimally (GREEN), refactor, repeat.
Share bugs, ideas, or general feedback.
Derive test skeleton files from an approved SDD specification document.
從已核准的 SDD 規格文件推演測試骨架檔案。
SPEC-XXX.md ──► Parse AC ──► Generate .test.ts ──► Review
describe/it block with AAA pattern[TODO] markers for implementationdescribe('SPEC-001: [Feature Name]', () => {
describe('AC-1: [AC description]', () => {
it('should [expected behavior]', () => {
// Arrange — [TODO]
// Act — [TODO]
// Assert — [TODO]
});
});
});
| Command | Purpose | 用途 |
|---|---|---|
/derive-tdd specs/SPEC-001.md | Derive TDD from specific spec | 從特定規格推演 TDD |
/derive-tdd | Interactive — ask for spec file | 互動式 — 詢問規格檔案 |
Follows AI Command Behavior Standards
| Input | AI Action |
|---|---|
/derive-tdd | 列出 status=Approved 的 spec 供選擇 |
/derive-tdd <spec-file> | 直接從指定 spec 推演 TDD 骨架 |
Decision: 語言/框架偵測
vitest.config / jest.config → 使用對應框架pytest.ini / pyproject.toml → 使用 pytestdescribe/it block(含 AAA 註解和 [TODO] 標記)🛑 STOP: 展示測試骨架後等待使用者確認寫入
| Stop Point | 等待內容 |
|---|---|
| 測試骨架生成後 | 確認內容正確並寫入 |
| Error Condition | AI Action |
|---|---|
| AC 過於抽象無法轉為測試 | 標記 [TODO: AC needs refinement],繼續其餘 AC |
| 無法偵測語言/框架 | 詢問使用者指定 |
| Spec 無 AC | 告知並引導修改 spec |