universal-dev-standards 5.15.1 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
- package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
- package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +1 -1
- package/bundled/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/core/forward-derivation-standards.md +19 -0
- package/bundled/core/knowledge-graph-memory.md +2 -2
- package/bundled/locales/zh-CN/CHANGELOG.md +13 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
- package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
- package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
- package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
- package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
- package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
- package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
- package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
- package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
- package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
- package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
- package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
- package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
- package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
- package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
- package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
- package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
- package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
- package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
- package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
- package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
- package/bundled/locales/zh-TW/CHANGELOG.md +13 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
- package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
- package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -2
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
- package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
- package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +5 -5
- package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
- package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +3 -2
- package/bundled/locales/zh-TW/skills/plan/SKILL.md +3 -2
- package/bundled/locales/zh-TW/skills/push/SKILL.md +3 -2
- package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
- package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
- package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
- package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
- package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
- package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
- package/bundled/skills/brainstorm-assistant/guide.md +256 -661
- package/bundled/skills/commands/brainstorm.md +51 -30
- package/bundled/skills/knowledge-graph/SKILL.md +5 -5
- package/bundled/skills/knowledge-graph/guide.md +4 -4
- package/package.json +2 -2
- package/src/commands/check.js +11 -2
- package/src/lint/i18n.js +109 -23
- package/standards-registry.json +4 -4
- package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../../skills/commands/brainstorm.md
|
|
3
|
-
source_version:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
source_version: 3.0.0
|
|
4
|
+
source_hash: 3212203924de
|
|
5
|
+
translation_version: 3.0.0
|
|
6
|
+
last_synced: 2026-06-01
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
---
|
|
9
10
|
name: brainstorm
|
|
10
|
-
description: "[UDS]
|
|
11
|
+
description: "[UDS] 在撰寫規格前進行結構化 AI 輔助腦力激盪"
|
|
11
12
|
argument-hint: "[problem or feature idea | 問題或功能構想]"
|
|
12
13
|
---
|
|
13
14
|
|
|
@@ -15,9 +16,7 @@ argument-hint: "[problem or feature idea | 問題或功能構想]"
|
|
|
15
16
|
|
|
16
17
|
> **Language**: [English](../../../../skills/commands/brainstorm.md) | 繁體中文
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
---
|
|
19
|
+
在撰寫規格前進行結構化發想。透過 persona 集成式腦力激盪,將模糊構想轉化為可執行的功能提案。
|
|
21
20
|
|
|
22
21
|
## 用法
|
|
23
22
|
|
|
@@ -28,33 +27,37 @@ argument-hint: "[problem or feature idea | 問題或功能構想]"
|
|
|
28
27
|
## 工作流程
|
|
29
28
|
|
|
30
29
|
```
|
|
31
|
-
FRAME ──► DIVERGE
|
|
32
|
-
定義問題
|
|
30
|
+
PRE-FLIGHT ──► FRAME ──► DIVERGE ──────────► CONVERGE ─────────► OUTPUT
|
|
31
|
+
防錨定 定義問題 persona 集成+透鏡 多評審面板+硬角色反駁 輸出提案
|
|
33
32
|
```
|
|
34
33
|
|
|
35
|
-
| 階段 | 目標 |
|
|
36
|
-
|
|
37
|
-
| **
|
|
38
|
-
| **
|
|
39
|
-
| **
|
|
40
|
-
| **
|
|
34
|
+
| 階段 | 目標 | 關鍵技法(v3) |
|
|
35
|
+
|------|------|---------------|
|
|
36
|
+
| **PRE-FLIGHT** | 防止 AI 錨定 | 使用者先寫 3 個想法;無類比種子 |
|
|
37
|
+
| **FRAME** | 清楚定義問題 | 5 Whys、HMW、Stakeholder Map |
|
|
38
|
+
| **DIVERGE** | 逼出視角多樣性 | persona 集成 + 多樣性透鏡 |
|
|
39
|
+
| **CONVERGE** | 降偏誤選擇 | 多評審面板 + Devil's Advocate/Steelman |
|
|
40
|
+
| **OUTPUT** | 可執行的報告 | Brainstorm Report 範本 |
|
|
41
41
|
|
|
42
42
|
## 技法
|
|
43
43
|
|
|
44
44
|
| 技法 | 適用場景 |
|
|
45
45
|
|------|----------|
|
|
46
|
-
| **
|
|
47
|
-
| **
|
|
48
|
-
| **
|
|
49
|
-
| **
|
|
50
|
-
| **
|
|
46
|
+
| **Persona ensemble** | 強制視角多樣性(v3 核心) |
|
|
47
|
+
| **Diversity lenses** | 突破顯而易見區(analogical / reversal / morphological) |
|
|
48
|
+
| **Multi-critic panel** | 降偏誤評分(v3 核心) |
|
|
49
|
+
| **Devil's Advocate + Steelman** | 硬角色反駁 |
|
|
50
|
+
| **5 Whys / HMW / SCAMPER / Six Hats** | 經典框定與發散 |
|
|
51
51
|
|
|
52
52
|
## 範例
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
/brainstorm
|
|
56
|
-
/brainstorm "user retention"
|
|
57
|
-
/brainstorm --
|
|
55
|
+
/brainstorm # 啟動互動式工作階段
|
|
56
|
+
/brainstorm "user retention" # 針對特定主題腦力激盪
|
|
57
|
+
/brainstorm --enhanced "user retention" # 平行 persona 集成(若宿主支援)
|
|
58
|
+
/brainstorm --personas "designer,economist,skeptic" # 自訂 persona
|
|
59
|
+
/brainstorm --lens analogical "onboarding" # 強制類比透鏡
|
|
60
|
+
/brainstorm --quick "reduce checkout friction" # 快速 3 想法模式
|
|
58
61
|
```
|
|
59
62
|
|
|
60
63
|
## 輸出格式
|
|
@@ -66,9 +69,10 @@ FRAME ──► DIVERGE ──► CONVERGE ──► OUTPUT
|
|
|
66
69
|
[Refined problem from FRAME phase]
|
|
67
70
|
|
|
68
71
|
## Top 3 Recommendations
|
|
69
|
-
1. **[Idea]** —
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
1. **[Idea]** — Agg. X.X ✓ Passed rebuttal — Persona: [..] — [Why recommended]
|
|
73
|
+
|
|
74
|
+
## Diversity Note
|
|
75
|
+
[How many distinct personas/lenses the surviving ideas span]
|
|
72
76
|
|
|
73
77
|
## Next Steps
|
|
74
78
|
- [ ] Proceed to `/requirement` with top idea
|
|
@@ -84,8 +88,69 @@ FRAME ──► DIVERGE ──► CONVERGE ──► OUTPUT
|
|
|
84
88
|
3. `/sdd` - 建立規格文件
|
|
85
89
|
4. `/derive-all` 或 `/tdd` - 以測試保護進行實作
|
|
86
90
|
|
|
91
|
+
## AI 代理行為
|
|
92
|
+
|
|
93
|
+
> 遵循 [AI Command Behavior Standards](../../core/ai-command-behavior.md)
|
|
94
|
+
|
|
95
|
+
### 進入路由
|
|
96
|
+
|
|
97
|
+
| 輸入 | AI 動作 |
|
|
98
|
+
|------|---------|
|
|
99
|
+
| `/brainstorm` | 啟動 PRE-FLIGHT,請使用者先寫 問題+3 想法+反向排除 |
|
|
100
|
+
| `/brainstorm "topic"` | 以指定主題啟動 PRE-FLIGHT,再進入 FRAME |
|
|
101
|
+
| `/brainstorm --personas "a,b,c"` | 以自訂 persona 組進入 DIVERGE |
|
|
102
|
+
| `/brainstorm --lens <name>` | 以指定多樣性透鏡為主進入 DIVERGE |
|
|
103
|
+
| `/brainstorm --enhanced` | 若宿主支援子代理則平行跑 persona/評審,否則靜默退回 baseline |
|
|
104
|
+
|
|
105
|
+
### 互動腳本
|
|
106
|
+
|
|
107
|
+
#### PRE-FLIGHT Phase
|
|
108
|
+
1. 請使用者先寫 問題(一句)+3 個初始想法+最不想要的解法類型
|
|
109
|
+
2. 拒絕「像 X 但給 Y」種子,改寫為底層問題
|
|
110
|
+
|
|
111
|
+
🛑 **STOP**: 收到三項輸入前不生成任何想法(`--skip-preflight` 例外,顯示錨定警告)
|
|
112
|
+
|
|
113
|
+
#### FRAME Phase
|
|
114
|
+
1. 釐清問題陳述(5 Whys 找根因)
|
|
115
|
+
2. 重構為 HMW 問題;識別利害關係人
|
|
116
|
+
|
|
117
|
+
🛑 **STOP**: 問題定義後等待使用者確認
|
|
118
|
+
|
|
119
|
+
#### DIVERGE Phase
|
|
120
|
+
1. 逐一以預設 persona(領域專家/懷疑者/跨域類比者/成本約束者/使用者代言)思維鏈生成想法
|
|
121
|
+
2. **分支隔離**:生成各 persona 時不互相預覽,全部產完才一起呈現
|
|
122
|
+
3. 至少套用一個多樣性透鏡(類比/假設反轉/形態矩陣)
|
|
123
|
+
4. 以多樣性(覆蓋的 persona/透鏡數)而非數量為繼續門檻
|
|
124
|
+
|
|
125
|
+
#### CONVERGE Phase
|
|
126
|
+
1. 以 3 個獨立評審(工程可行性/使用者影響/策略一致)各自評分後聚合
|
|
127
|
+
2. 對前 3 名跑硬角色 Devil's Advocate(論證會失敗)+ Steelman;使用者以 (a)修改/(b)反駁/(c)移除 回應
|
|
128
|
+
3. 排序並標記通過反駁的想法
|
|
129
|
+
|
|
130
|
+
🛑 **STOP**: 展示 Brainstorm Report 後等待使用者決定下一步
|
|
131
|
+
|
|
132
|
+
### 停止點
|
|
133
|
+
|
|
134
|
+
| 停止點 | 等待內容 |
|
|
135
|
+
|--------|---------|
|
|
136
|
+
| PRE-FLIGHT 提交前 | 收到使用者三項輸入 |
|
|
137
|
+
| 問題定義後 | 確認問題正確 |
|
|
138
|
+
| 反駁輪每個反對理由 | 使用者 (a)/(b)/(c) 回應 |
|
|
139
|
+
| 報告展示後 | 決定進入 `/requirement` 或 `/sdd` |
|
|
140
|
+
|
|
141
|
+
### 錯誤處理
|
|
142
|
+
|
|
143
|
+
| 錯誤情況 | AI 動作 |
|
|
144
|
+
|---------|---------|
|
|
145
|
+
| 主題太廣泛 | 引導縮小範圍 |
|
|
146
|
+
| 使用「像 X 但給 Y」種子 | 改寫為底層問題再繼續(反種子 guardrail) |
|
|
147
|
+
| 指定的 persona/透鏡不存在 | 列出可用選項供選擇 |
|
|
148
|
+
| `--enhanced` 但宿主不支援子代理 | 靜默退回 baseline,照常進行 |
|
|
149
|
+
| 前 3 名全來自同一 persona/透鏡 | 標示並在輸出前再跑一個透鏡 |
|
|
150
|
+
|
|
87
151
|
## 參考
|
|
88
152
|
|
|
89
153
|
* [Brainstorm Assistant Skill](../brainstorm-assistant/SKILL.md)
|
|
154
|
+
* [Brainstorm Assistant Guide](../brainstorm-assistant/guide.md)
|
|
90
155
|
* [Requirement Assistant](../requirement-assistant/SKILL.md)
|
|
91
156
|
* [Spec-Driven Development](../spec-driven-dev/SKILL.md)
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
name: commit-standards
|
|
3
3
|
source: ../../../../skills/commit-standards/SKILL.md
|
|
4
4
|
source_version: 1.0.0
|
|
5
|
+
source_hash: 8535f438ced8
|
|
5
6
|
translation_version: 1.0.0
|
|
6
|
-
last_synced: 2026-
|
|
7
|
+
last_synced: 2026-06-01
|
|
7
8
|
status: current
|
|
8
9
|
description: "[UDS] 根據 Conventional Commits 規範產生格式正確的 commit message"
|
|
9
10
|
---
|
|
@@ -16,31 +17,34 @@ description: "[UDS] 根據 Conventional Commits 規範產生格式正確的 comm
|
|
|
16
17
|
|
|
17
18
|
## 工作流程
|
|
18
19
|
|
|
20
|
+
0. **偵測語言** - 讀取 `.standards/manifest.json` → 檢查 `options.output_language`。若找不到,預設為 `english`。
|
|
19
21
|
1. **檢查狀態** - 執行 `git status` 和 `git diff --staged` 了解變更內容
|
|
20
22
|
2. **分析變更** - 判斷類型(feat、fix、refactor 等)和範圍
|
|
21
|
-
3. **產生訊息** -
|
|
23
|
+
3. **產生訊息** - 依偵測到的語言,按以下對應格式建立 commit message(見下方)
|
|
22
24
|
4. **確認並提交** - 在執行 `git commit` 前詢問使用者確認
|
|
23
25
|
|
|
24
26
|
### 訊息格式
|
|
25
27
|
|
|
26
28
|
```
|
|
27
29
|
<type>(<scope>): <subject>
|
|
30
|
+
|
|
28
31
|
<body>
|
|
32
|
+
|
|
29
33
|
<footer>
|
|
30
34
|
```
|
|
31
35
|
|
|
32
36
|
## 提交類型
|
|
33
37
|
|
|
34
|
-
| 類型 | 使用時機 |
|
|
35
|
-
|
|
36
|
-
| `feat` | 新功能 |
|
|
37
|
-
| `fix` | 修復錯誤 |
|
|
38
|
-
| `refactor` | 重構(無功能變更) |
|
|
39
|
-
| `docs` | 文件更新 |
|
|
40
|
-
| `style` | 格式調整(無邏輯變更) |
|
|
41
|
-
| `test` | 測試相關 |
|
|
42
|
-
| `perf` | 效能優化 |
|
|
43
|
-
| `chore` | 維護任務 |
|
|
38
|
+
| 類型 | 使用時機 |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| `feat` | 新功能 |
|
|
41
|
+
| `fix` | 修復錯誤 |
|
|
42
|
+
| `refactor` | 重構(無功能變更) |
|
|
43
|
+
| `docs` | 文件更新 |
|
|
44
|
+
| `style` | 格式調整(無邏輯變更) |
|
|
45
|
+
| `test` | 測試相關 |
|
|
46
|
+
| `perf` | 效能優化 |
|
|
47
|
+
| `chore` | 維護任務 |
|
|
44
48
|
|
|
45
49
|
## 規則
|
|
46
50
|
|
|
@@ -48,6 +52,60 @@ description: "[UDS] 根據 Conventional Commits 規範產生格式正確的 comm
|
|
|
48
52
|
- **Body**:說明**為什麼**進行變更,而非僅描述變更了什麼
|
|
49
53
|
- **Footer**:使用 `BREAKING CHANGE:` 標記破壞性變更,使用 `Fixes #123` 關聯 issue
|
|
50
54
|
|
|
55
|
+
## 雙語格式
|
|
56
|
+
|
|
57
|
+
當 `output_language` 為 `bilingual` 時,你必須使用以下格式:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
<type>(<scope>): <English subject>. <中文主旨>.
|
|
61
|
+
|
|
62
|
+
<English body — explain what and why in English>
|
|
63
|
+
|
|
64
|
+
<中文本文 — 用中文說明做了什麼及為什麼>
|
|
65
|
+
|
|
66
|
+
<footer>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 必須遵守的規則
|
|
70
|
+
|
|
71
|
+
1. 英文本文在前,中文本文在後
|
|
72
|
+
2. 英文本文與中文本文之間以空白行分隔
|
|
73
|
+
3. 嚴禁在同一段落內混用語言
|
|
74
|
+
4. 嚴禁省略中文本文——兩種語言皆為必填
|
|
75
|
+
5. Footer(BREAKING CHANGE、Fixes #、Co-authored-by)置於兩段本文之後的最末端
|
|
76
|
+
|
|
77
|
+
### 雙語範例
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援.
|
|
81
|
+
|
|
82
|
+
Implement Google OAuth2 authentication flow for user login.
|
|
83
|
+
|
|
84
|
+
- Add Google OAuth2 SDK integration
|
|
85
|
+
- Create callback endpoint for OAuth flow
|
|
86
|
+
- Store refresh tokens securely
|
|
87
|
+
|
|
88
|
+
實作 Google OAuth2 認證流程供使用者登入。
|
|
89
|
+
|
|
90
|
+
- 整合 Google OAuth2 SDK
|
|
91
|
+
- 建立 OAuth 流程回呼端點
|
|
92
|
+
- 安全儲存更新權杖
|
|
93
|
+
|
|
94
|
+
Closes #123
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 繁體中文格式
|
|
98
|
+
|
|
99
|
+
當 `output_language` 為 `traditional-chinese` 時,使用中文類型與本文:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
功能(認證): 新增 OAuth2 Google 登入支援
|
|
103
|
+
|
|
104
|
+
實作 Google OAuth2 認證流程供使用者登入。
|
|
105
|
+
|
|
106
|
+
關閉 #123
|
|
107
|
+
```
|
|
108
|
+
|
|
51
109
|
## 使用方式
|
|
52
110
|
|
|
53
111
|
- `/commit` - 自動分析 staged 的變更並建議 commit message
|
|
@@ -58,11 +116,15 @@ description: "[UDS] 根據 Conventional Commits 規範產生格式正確的 comm
|
|
|
58
116
|
`/commit` 完成後,AI 助手應建議:
|
|
59
117
|
|
|
60
118
|
> **提交完成。建議下一步:**
|
|
61
|
-
> - 執行 `git push` 推送到遠端
|
|
62
|
-
> - 準備發布時 → 執行 `/changelog` + `/release`
|
|
63
|
-
> - 發現重複模式或規範摩擦 → 執行 `/audit --report` 回報
|
|
119
|
+
> - 執行 `git push` 推送到遠端 ⭐ **推薦** — 推送到遠端
|
|
120
|
+
> - 準備發布時 → 執行 `/changelog` + `/release` — 準備發布時執行
|
|
121
|
+
> - 發現重複模式或規範摩擦 → 執行 `/audit --report` 回報 — 偵測到模式或摩擦時回報意見
|
|
64
122
|
|
|
65
123
|
## 參考
|
|
66
124
|
|
|
67
125
|
- 詳細指南:[guide.md](./guide.md)
|
|
68
126
|
- 核心規範:[commit-message-guide.md](../../../../core/commit-message-guide.md)
|
|
127
|
+
|
|
128
|
+
## AI 代理行為
|
|
129
|
+
|
|
130
|
+
> 完整的 AI 行為定義請參閱對應的命令文件:[`/commit`](../commands/commit.md#ai-agent-behavior--ai-代理行為)
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
name: contract-test-assistant
|
|
3
3
|
source: ../../../../skills/contract-test-assistant/SKILL.md
|
|
4
4
|
source_version: 1.0.0
|
|
5
|
+
source_hash: f67623eb913a
|
|
5
6
|
translation_version: 1.0.0
|
|
6
|
-
last_synced: 2026-
|
|
7
|
+
last_synced: 2026-06-01
|
|
7
8
|
status: current
|
|
8
9
|
description: "[UDS] 引導 API 和微服務的合約測試策略"
|
|
9
10
|
---
|
|
@@ -14,6 +15,42 @@ description: "[UDS] 引導 API 和微服務的合約測試策略"
|
|
|
14
15
|
|
|
15
16
|
引導 API 和微服務的合約測試策略選擇、設定和驗證。
|
|
16
17
|
|
|
18
|
+
## 什麼是合約測試?
|
|
19
|
+
|
|
20
|
+
合約測試透過測試消費者和提供者之間的協議(合約)來驗證服務間的通訊正確性,不需要所有服務同時運行。
|
|
21
|
+
|
|
22
|
+
## 策略選擇
|
|
23
|
+
|
|
24
|
+
| 策略 | 適用場景 | 工具 |
|
|
25
|
+
|------|---------|------|
|
|
26
|
+
| **消費者驅動(Consumer-Driven)** | 內部微服務,團隊同時擁有兩端 | Pact |
|
|
27
|
+
| **提供者驅動(Provider-Driven)** | 公開 API,OpenAPI 優先設計 | OpenAPI + Prism |
|
|
28
|
+
| **雙向(Bi-Directional)** | 混合所有權,漸進採用 | Pact + OpenAPI |
|
|
29
|
+
|
|
30
|
+
## 工作流程
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
ASSESS ──► CHOOSE ──► DEFINE ──► IMPLEMENT ──► VERIFY
|
|
34
|
+
評估架構 選擇策略 定義合約 實作測試 驗證合約
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 1. ASSESS — 評估架構
|
|
38
|
+
- 有多少服務互相通訊?
|
|
39
|
+
- 誰擁有消費者端、誰擁有提供者端?
|
|
40
|
+
|
|
41
|
+
### 2. CHOOSE — 選擇策略
|
|
42
|
+
- 消費者驅動(Pact)vs 提供者驅動(OpenAPI)
|
|
43
|
+
|
|
44
|
+
### 3. DEFINE — 定義合約
|
|
45
|
+
- 撰寫消費者期望或 OpenAPI 規格
|
|
46
|
+
|
|
47
|
+
### 4. IMPLEMENT — 實作測試
|
|
48
|
+
- 消費者測試產生合約
|
|
49
|
+
- 提供者測試驗證合約
|
|
50
|
+
|
|
51
|
+
### 5. VERIFY — 執行驗證
|
|
52
|
+
- CI 管線在每個 PR 上驗證合約
|
|
53
|
+
|
|
17
54
|
## 指令
|
|
18
55
|
|
|
19
56
|
| 指令 | 說明 |
|
|
@@ -23,31 +60,53 @@ description: "[UDS] 引導 API 和微服務的合約測試策略"
|
|
|
23
60
|
| `/contract-test provider` | 引導提供者測試設定 |
|
|
24
61
|
| `/contract-test verify` | 檢查合約覆蓋率 |
|
|
25
62
|
|
|
26
|
-
##
|
|
63
|
+
## 合約覆蓋率報告
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## 合約覆蓋率報告
|
|
67
|
+
|
|
68
|
+
| 消費者 | 提供者 | 端點 | 狀態 |
|
|
69
|
+
|--------|--------|------|------|
|
|
70
|
+
| web-app | user-api | GET /users/:id | ✅ 已驗證 |
|
|
71
|
+
| web-app | user-api | POST /users | ✅ 已驗證 |
|
|
72
|
+
| mobile-app | auth-api | POST /login | ⚠️ 僅消費者端 |
|
|
73
|
+
| admin-ui | report-api | GET /reports | ❌ 無合約 |
|
|
27
74
|
|
|
28
|
-
|
|
29
|
-
|
|
75
|
+
**覆蓋率**:50%(2/4 個端點兩端皆驗證)
|
|
76
|
+
```
|
|
30
77
|
|
|
78
|
+
## 與其他技能的整合
|
|
31
79
|
|
|
32
|
-
|
|
80
|
+
| 技能 | 整合方式 |
|
|
81
|
+
|------|---------|
|
|
82
|
+
| `/api-design` | 設計時定義 API 合約 |
|
|
83
|
+
| `/ci-cd` | 管線中加入合約驗證 |
|
|
84
|
+
| `/testing` | 合約測試作為測試策略一部分 |
|
|
85
|
+
| `/migrate` | API 遷移時捕獲 legacy response fixture,驗證新實作保持結構性等價 |
|
|
33
86
|
|
|
34
|
-
|
|
87
|
+
### 遷移合約測試(替換實作時)
|
|
88
|
+
|
|
89
|
+
當 API endpoint 從一個技術棧遷至另一個(PHP → .NET、Express → Spring 等),對 **legacy 參考 fixture** 的 contract test 可捕捉「缺漏欄位」「rename」「層級漂移」等新 DTO 單元測試無法覆蓋的缺陷。詳見 [migration-assistant § API Migration Contract Tests](../migration-assistant/SKILL.md#api-migration-contract-tests--api-遷移合約測試) 取得 fixture 捕獲協議與稽核檢查清單。
|
|
90
|
+
|
|
91
|
+
## 下一步引導
|
|
92
|
+
|
|
93
|
+
`/contract-test` 完成後:
|
|
35
94
|
|
|
36
95
|
> **合約測試引導完成。建議下一步:**
|
|
37
96
|
> - 執行 `/ci-cd` 將合約驗證加入 CI 管線
|
|
38
97
|
> - 執行 `/api-design` 完善 API 設計
|
|
39
98
|
> - 執行 `/testing` 整合到整體測試策略
|
|
40
99
|
|
|
41
|
-
##
|
|
100
|
+
## 參考
|
|
42
101
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
102
|
+
- 詳細指南:[contract-testing.md](../../options/testing/contract-testing.md)
|
|
103
|
+
- 相關:[api-design-assistant](../api-design-assistant/SKILL.md)
|
|
45
104
|
|
|
46
|
-
## AI
|
|
105
|
+
## AI 代理行為
|
|
47
106
|
|
|
48
|
-
|
|
49
|
-
1.
|
|
50
|
-
2.
|
|
51
|
-
3.
|
|
52
|
-
4.
|
|
53
|
-
5.
|
|
107
|
+
當 `/contract-test` 被呼叫時:
|
|
108
|
+
1. **評估(Assess)** — 詢問架構(單體、微服務、API 數量)
|
|
109
|
+
2. **推薦(Recommend)** — 依架構建議策略
|
|
110
|
+
3. **引導(Guide)** — 逐步引導所選策略的設定
|
|
111
|
+
4. **產生(Generate)** — 建立範例合約測試檔案
|
|
112
|
+
5. **驗證(Verify)** — 若為 `verify` 子指令,掃描合約並回報覆蓋率
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../../skills/dev-methodology/guide.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-02
|
|
6
|
+
source_hash: a17742b81576
|
|
7
|
+
status: current
|
|
8
|
+
scope: partial
|
|
9
|
+
description: |
|
|
10
|
+
管理並引導開發者完成當前的開發方法論(methodology)工作流程。
|
|
11
|
+
使用時機:需要 TDD、BDD、SDD、ATDD 或自訂方法論工作流程時。
|
|
12
|
+
關鍵字:methodology、workflow、TDD、BDD、SDD、ATDD、phase、checkpoint、開發流程。
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
> [!WARNING]
|
|
16
|
+
> **Experimental Feature / 實驗性功能**
|
|
17
|
+
>
|
|
18
|
+
> This feature is under active development and may change significantly in v4.0.
|
|
19
|
+
> 此功能正在積極開發中,可能在 v4.0 中有重大變更。
|
|
20
|
+
|
|
21
|
+
# Methodology System Skill
|
|
22
|
+
|
|
23
|
+
> **語言**:[English](../../../../skills/dev-methodology/guide.md) | 繁體中文
|
|
24
|
+
|
|
25
|
+
**版本**:2.0.0
|
|
26
|
+
**最後更新**:2026-01-25
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 概觀
|
|
31
|
+
|
|
32
|
+
Methodology System 為採用 Universal Development Standards 的專案提供一套統一的開發方法論管理框架。
|
|
33
|
+
|
|
34
|
+
### 兩套獨立系統
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
┌────────────────────────────────────────────────────────────────────────────┐
|
|
38
|
+
│ Two Independent Methodology Systems │
|
|
39
|
+
├────────────────────────────────────────────────────────────────────────────┤
|
|
40
|
+
│ │
|
|
41
|
+
│ System A: SDD (AI-Era Methodology) │
|
|
42
|
+
│ ───────────────────────────────────── │
|
|
43
|
+
│ /sdd → Review → /derive-all → Implementation → Verification │
|
|
44
|
+
│ Best for: New projects, AI-assisted development, greenfield features │
|
|
45
|
+
│ │
|
|
46
|
+
│ System B: Double-Loop TDD (Traditional) │
|
|
47
|
+
│ ───────────────────────────────────── │
|
|
48
|
+
│ /bdd (Outer Loop) → /tdd (Inner Loop) → Demo │
|
|
49
|
+
│ Best for: Legacy systems, manual development, established codebases │
|
|
50
|
+
│ │
|
|
51
|
+
│ Optional Input: ATDD Workshop │
|
|
52
|
+
│ ───────────────────────────────────── │
|
|
53
|
+
│ Stakeholder collaboration that feeds into EITHER system │
|
|
54
|
+
│ │
|
|
55
|
+
└────────────────────────────────────────────────────────────────────────────┘
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 支援的方法論
|
|
59
|
+
|
|
60
|
+
**System A:SDD(Spec-Driven Development)**
|
|
61
|
+
- Discuss → Proposal → Review → Forward Derivation → Implementation → Verification → Archive
|
|
62
|
+
- 以規格(spec)作為權威來源的 AI 原生工作流程
|
|
63
|
+
|
|
64
|
+
**System B:Double-Loop TDD**
|
|
65
|
+
- **BDD**(外迴圈 Outer Loop)- Discovery → Formulation → Automation
|
|
66
|
+
- **TDD**(內迴圈 Inner Loop)- Red → Green → Refactor
|
|
67
|
+
|
|
68
|
+
**選用輸入**
|
|
69
|
+
- **ATDD** - Acceptance Test-Driven Development 工作坊(可饋入任一系統)
|
|
70
|
+
|
|
71
|
+
**Custom** - 使用者自訂的方法論
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 功能
|
|
76
|
+
|
|
77
|
+
### 1. 階段感知引導(Phase-Aware Guidance)
|
|
78
|
+
|
|
79
|
+
AI 會自動追蹤當前階段,並提供符合情境的引導:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
┌─────────────────────────────────────────────┐
|
|
83
|
+
│ 📋 Current Methodology: TDD │
|
|
84
|
+
│ 📍 Current Phase: 🔴 RED (1-5 min) │
|
|
85
|
+
│ │
|
|
86
|
+
│ Checklist: │
|
|
87
|
+
│ ✅ Test describes behavior │
|
|
88
|
+
│ ✅ Test name is clear │
|
|
89
|
+
│ ⬜ Test follows AAA pattern │
|
|
90
|
+
│ ⬜ Test fails when run │
|
|
91
|
+
│ │
|
|
92
|
+
│ Next: Write the test following AAA pattern │
|
|
93
|
+
└─────────────────────────────────────────────┘
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2. 檢查點提醒(Checkpoint Reminders)
|
|
97
|
+
|
|
98
|
+
依據方法論觸發條件自動提醒:
|
|
99
|
+
|
|
100
|
+
- **Phase Transition(階段轉換)**:階段完成時建議提交(commit)
|
|
101
|
+
- **Accumulation Warning(累積警告)**:變更超過門檻時提出警告
|
|
102
|
+
- **Skip Warning(略過警告)**:連續略過 check-in 後提出警示
|
|
103
|
+
|
|
104
|
+
### 3. 方法論切換(Methodology Switching)
|
|
105
|
+
|
|
106
|
+
隨著專案需求變化,在不同方法論之間切換:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
/methodology switch bdd
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 4. 自訂方法論支援(Custom Methodology Support)
|
|
113
|
+
|
|
114
|
+
在 `.standards/methodologies/` 中定義團隊專屬的工作流程:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
id: my-team-workflow
|
|
118
|
+
name: My Team Workflow
|
|
119
|
+
phases:
|
|
120
|
+
- id: plan
|
|
121
|
+
name: Planning
|
|
122
|
+
checklist:
|
|
123
|
+
- id: requirements-clear
|
|
124
|
+
text: Requirements understood
|
|
125
|
+
required: true
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 指令
|
|
131
|
+
|
|
132
|
+
| 指令 | 說明 |
|
|
133
|
+
|---------|-------------|
|
|
134
|
+
| `/methodology` | 顯示當前方法論狀態 |
|
|
135
|
+
| `/methodology switch <id>` | 切換至不同的方法論 |
|
|
136
|
+
| `/methodology phase [phase]` | 顯示或變更當前階段 |
|
|
137
|
+
| `/methodology checklist` | 顯示當前階段的檢查清單 |
|
|
138
|
+
| `/methodology skip` | 略過當前階段(附帶警告) |
|
|
139
|
+
| `/methodology list` | 列出可用的方法論 |
|
|
140
|
+
| `/methodology create` | 建立自訂方法論 |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 設定
|
|
145
|
+
|
|
146
|
+
方法論設定儲存於 `.standards/manifest.json`:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"methodology": {
|
|
151
|
+
"active": "tdd",
|
|
152
|
+
"available": ["tdd", "bdd", "sdd", "atdd"],
|
|
153
|
+
"config": {
|
|
154
|
+
"tdd": {
|
|
155
|
+
"checkpointsEnabled": true,
|
|
156
|
+
"reminderIntensity": "suggest",
|
|
157
|
+
"skipLimit": 3
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 設定選項
|
|
165
|
+
|
|
166
|
+
| 選項 | 值 | 說明 |
|
|
167
|
+
|--------|--------|-------------|
|
|
168
|
+
| `active` | methodology id | 當前啟用的方法論 |
|
|
169
|
+
| `checkpointsEnabled` | `true`/`false` | 啟用檢查點提醒 |
|
|
170
|
+
| `reminderIntensity` | `suggest`/`warning`/`strict` | 強制執行檢查點的強度 |
|
|
171
|
+
| `skipLimit` | 數字 | 提出警告前可連續略過的次數 |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## AI 行為
|
|
176
|
+
|
|
177
|
+
### 偵測(Detection)
|
|
178
|
+
|
|
179
|
+
1. 檢查 `.standards/manifest.json` 中的 `methodology.active`
|
|
180
|
+
2. 從以下位置載入方法論定義:
|
|
181
|
+
- 內建:`methodologies/{id}.methodology.yaml`
|
|
182
|
+
- 自訂:`.standards/methodologies/{id}.methodology.yaml`
|
|
183
|
+
|
|
184
|
+
### 階段追蹤(Phase Tracking)
|
|
185
|
+
|
|
186
|
+
- 依據觸發條件追蹤當前階段
|
|
187
|
+
- 在符合退出條件時更新階段
|
|
188
|
+
- 提供階段專屬的引導與檢查清單
|
|
189
|
+
|
|
190
|
+
### 情境關鍵字(Context Keywords)
|
|
191
|
+
|
|
192
|
+
當偵測到下列關鍵字時,AI 會自動啟用對應的方法論情境:
|
|
193
|
+
|
|
194
|
+
| 系統 | 方法論 | 關鍵字 |
|
|
195
|
+
|--------|-------------|----------|
|
|
196
|
+
| A: SDD | SDD | specification, spec first, proposal, derive tests, forward derivation |
|
|
197
|
+
| B: Double-Loop | BDD(外迴圈) | given when then, gherkin, cucumber, scenario, discovery |
|
|
198
|
+
| B: Double-Loop | TDD(內迴圈) | test first, red green refactor, failing test |
|
|
199
|
+
| Input | ATDD | acceptance test, user story, product owner, workshop |
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 與其他標準的整合
|
|
204
|
+
|
|
205
|
+
### Check-in Standards
|
|
206
|
+
|
|
207
|
+
當某階段完成時,方法論系統會與 `checkin-standards.md` 整合:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Phase GREEN completed.
|
|
211
|
+
|
|
212
|
+
Changes:
|
|
213
|
+
- Files: 3
|
|
214
|
+
- Lines: +45 / -2
|
|
215
|
+
|
|
216
|
+
Suggested commit:
|
|
217
|
+
test(auth): add login validation test
|
|
218
|
+
feat(auth): implement login validation
|
|
219
|
+
|
|
220
|
+
[1] Commit now [2] Continue working [3] View changes
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Code Review
|
|
224
|
+
|
|
225
|
+
依據當前啟用的方法論,會加入額外的審查檢查項目:
|
|
226
|
+
|
|
227
|
+
- **TDD**:測試遵循命名慣例、每個測試只驗證單一行為
|
|
228
|
+
- **BDD**:宣告式風格、可重用的步驟
|
|
229
|
+
- **SDD**:變更符合規格、無範疇蔓延(scope creep)
|
|
230
|
+
- **ATDD**:所有驗收條件都有對應測試
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 相關技能
|
|
235
|
+
|
|
236
|
+
- [TDD Assistant](../tdd-assistant/SKILL.md) - 詳細的 TDD 引導
|
|
237
|
+
- [Spec-Driven Dev](../spec-driven-dev/SKILL.md) - SDD 工作流程
|
|
238
|
+
- [Code Review Assistant](../code-review-assistant/SKILL.md) - 審查整合
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 檔案
|
|
243
|
+
|
|
244
|
+
- [integrated-flow.md](./integrated-flow.md) - 兩套系統的完整工作流程指南
|
|
245
|
+
- [runtime.md](./runtime.md) - AI 行為與執行期(runtime)指南
|
|
246
|
+
- [create-methodology.md](./create-methodology.md) - 自訂方法論建立精靈
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 版本歷史
|
|
251
|
+
|
|
252
|
+
| 版本 | 日期 | 變更內容 |
|
|
253
|
+
|---------|------|---------|
|
|
254
|
+
| 2.0.0 | 2026-01-25 | 重構為兩套獨立系統的架構 |
|
|
255
|
+
| 1.0.0 | 2026-01-12 | 初版方法論系統 |
|