universal-dev-standards 5.14.0 → 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/bin/uds.js +2 -0
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
- package/bundled/ai/standards/ai-instruction-standards.ai.yaml +190 -3
- package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
- package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +83 -0
- package/bundled/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/core/ai-instruction-standards.md +136 -11
- package/bundled/core/forward-derivation-standards.md +19 -0
- package/bundled/core/knowledge-graph-memory.md +119 -0
- package/bundled/locales/COVERAGE.md +226 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +42 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-CN/core/ai-instruction-standards.md +111 -5
- 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 +46 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-TW/core/ai-instruction-standards.md +130 -5
- 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 +127 -0
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
- package/bundled/locales/zh-TW/core/self-review-protocol.md +9 -1
- package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +192 -0
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +5 -1
- 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/deploy-assistant/SKILL.md +187 -0
- package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +108 -0
- 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/journey-test-assistant/SKILL.md +222 -0
- package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +56 -0
- 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 +173 -0
- package/bundled/locales/zh-TW/skills/plan/SKILL.md +240 -0
- package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +5 -1
- package/bundled/locales/zh-TW/skills/push/SKILL.md +242 -0
- 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/skill-builder/SKILL.md +165 -0
- package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +83 -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/sweep/SKILL.md +149 -0
- package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
- package/bundled/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/skills/ai-collaboration-standards/SKILL.md +1 -1
- package/bundled/skills/ai-friendly-architecture/SKILL.md +1 -1
- package/bundled/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/skills/api-design-assistant/SKILL.md +1 -1
- package/bundled/skills/audit-assistant/SKILL.md +1 -1
- package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
- package/bundled/skills/brainstorm-assistant/guide.md +256 -661
- package/bundled/skills/ci-cd-assistant/SKILL.md +1 -1
- package/bundled/skills/commands/brainstorm.md +51 -30
- package/bundled/skills/contract-test-assistant/SKILL.md +1 -1
- package/bundled/skills/database-assistant/SKILL.md +1 -1
- package/bundled/skills/deploy-assistant/SKILL.md +1 -1
- package/bundled/skills/documentation-guide/SKILL.md +1 -1
- package/bundled/skills/error-code-guide/SKILL.md +1 -1
- package/bundled/skills/git-workflow-guide/SKILL.md +1 -1
- package/bundled/skills/incident-response-assistant/SKILL.md +1 -1
- package/bundled/skills/journey-test-assistant/SKILL.md +1 -1
- package/bundled/skills/knowledge-graph/SKILL.md +58 -0
- package/bundled/skills/knowledge-graph/guide.md +69 -0
- package/bundled/skills/logging-guide/SKILL.md +1 -1
- package/bundled/skills/observability-assistant/SKILL.md +1 -1
- package/bundled/skills/orchestrate/SKILL.md +1 -1
- package/bundled/skills/plan/SKILL.md +1 -1
- package/bundled/skills/pr-automation-assistant/SKILL.md +1 -1
- package/bundled/skills/project-structure-guide/SKILL.md +1 -1
- package/bundled/skills/push/SKILL.md +1 -1
- package/bundled/skills/retrospective-assistant/SKILL.md +1 -1
- package/bundled/skills/reverse-engineer/SKILL.md +1 -1
- package/bundled/skills/runbook-assistant/SKILL.md +1 -1
- package/bundled/skills/security-assistant/SKILL.md +1 -1
- package/bundled/skills/security-scan-assistant/SKILL.md +1 -1
- package/bundled/skills/slo-assistant/SKILL.md +1 -1
- package/bundled/skills/sweep/SKILL.md +1 -1
- package/bundled/skills/testing-guide/SKILL.md +1 -1
- package/package.json +2 -2
- package/src/commands/check.js +80 -0
- package/src/commands/init.js +8 -1
- package/src/commands/update.js +49 -14
- package/src/i18n/messages.js +32 -5
- package/src/installers/skills-installer.js +49 -0
- package/src/lint/i18n.js +424 -0
- package/src/utils/config-manager.js +39 -0
- package/src/utils/skills-installer.js +39 -7
- package/standards-registry.json +16 -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,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deploy
|
|
3
|
+
source: ../../../../skills/deploy-assistant/SKILL.md
|
|
4
|
+
source_version: 1.0.0
|
|
5
|
+
translation_version: 1.0.0
|
|
6
|
+
last_synced: 2026-05-28
|
|
7
|
+
scope: universal
|
|
8
|
+
description: |
|
|
9
|
+
[UDS] 無 CI/CD 平台環境下的可靠部署指引(不依賴 GitHub Actions / GitLab CI)。
|
|
10
|
+
Use when: deploying to VPS, air-gapped servers, or environments without CI/CD infrastructure.
|
|
11
|
+
Keywords: deployment, no-cicd, shell script, blue-green, smoke test, rollback, 無CI/CD, 部署.
|
|
12
|
+
allowed-tools: Read, Bash(cat VERSION:*), Bash(git describe:*), Bash(which nginx:*), Bash(which rsync:*)
|
|
13
|
+
argument-hint: "[專案類型: node/python/docker/go]"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# 無 CI/CD 部署助手
|
|
17
|
+
|
|
18
|
+
> **語言**: [English](../../../../skills/deploy-assistant/SKILL.md) | 繁體中文
|
|
19
|
+
|
|
20
|
+
引導無 CI/CD 平台環境下的可靠部署,採用三層架構:防錯、驗證、快速回復。
|
|
21
|
+
|
|
22
|
+
## 三層部署架構
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Layer 1:防止錯誤部署 Layer 2:驗證正確性 Layer 3:快速回復
|
|
26
|
+
set -euo pipefail Smoke Test + /health Blue-Green 切換
|
|
27
|
+
版本 tag 強制 版本號比對 rollback.sh < 30s
|
|
28
|
+
deploy.lock 並發守衛 驗證失敗自動回滾
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 引導式問答
|
|
32
|
+
|
|
33
|
+
| 問題 | 選項 | 影響 |
|
|
34
|
+
|------|------|------|
|
|
35
|
+
| 專案類型 | node / python / go / docker | 建置指令 |
|
|
36
|
+
| 部署目標 | SSH+rsync / Docker Compose | 傳輸方式 |
|
|
37
|
+
| Blue-Green 支援 | yes / no | rollback.sh 是否生成 |
|
|
38
|
+
| 健康檢查 URL | URL 輸入 | verify.sh 目標 |
|
|
39
|
+
| 版本來源 | VERSION 檔 / package.json / git tag | 版本比對邏輯 |
|
|
40
|
+
|
|
41
|
+
## 生成的腳本組
|
|
42
|
+
|
|
43
|
+
### deploy.sh — 主要部署腳本
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
#!/usr/bin/env bash
|
|
47
|
+
set -euo pipefail
|
|
48
|
+
|
|
49
|
+
LOCK_FILE="/tmp/deploy.lock"
|
|
50
|
+
trap "rm -f $LOCK_FILE" EXIT
|
|
51
|
+
|
|
52
|
+
# 防並發守衛
|
|
53
|
+
if [ -f "$LOCK_FILE" ]; then
|
|
54
|
+
echo "❌ 已有部署進行中(PID: $(cat $LOCK_FILE))"
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
echo $$ > "$LOCK_FILE"
|
|
58
|
+
|
|
59
|
+
# 版本 tag 強制
|
|
60
|
+
CURRENT_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
|
|
61
|
+
if [ -z "$CURRENT_TAG" ]; then
|
|
62
|
+
echo "❌ HEAD 沒有版本 tag。請執行:git tag vX.Y.Z && git push --tags"
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
echo "[1/4] 執行測試..."
|
|
67
|
+
# {TEST_COMMAND}
|
|
68
|
+
|
|
69
|
+
echo "[2/4] 建置產物..."
|
|
70
|
+
# {BUILD_COMMAND}
|
|
71
|
+
|
|
72
|
+
echo "[3/4] 同步至伺服器..."
|
|
73
|
+
rsync -avz --delete ./dist/ {USER}@{SERVER}:/app/
|
|
74
|
+
|
|
75
|
+
echo "[4/4] 驗證部署..."
|
|
76
|
+
./verify.sh || { echo "驗證失敗,啟動回滾..."; ./rollback.sh; exit 1; }
|
|
77
|
+
|
|
78
|
+
echo "{\"timestamp\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"version\":\"$CURRENT_TAG\",\"operator\":\"$(whoami)\",\"result\":\"success\"}" >> /var/log/deployments.jsonl
|
|
79
|
+
echo "✅ 部署成功:$CURRENT_TAG"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### verify.sh — Smoke Test
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
#!/usr/bin/env bash
|
|
86
|
+
set -euo pipefail
|
|
87
|
+
|
|
88
|
+
HEALTH_URL="${HEALTH_URL:-{HEALTH_URL}}"
|
|
89
|
+
EXPECTED_VERSION=$(cat VERSION)
|
|
90
|
+
|
|
91
|
+
for i in $(seq 1 3); do
|
|
92
|
+
RESPONSE=$(curl -sf --max-time 10 "$HEALTH_URL" 2>/dev/null) && break
|
|
93
|
+
echo "健康檢查第 $i/3 次失敗,5 秒後重試..."
|
|
94
|
+
sleep 5
|
|
95
|
+
done
|
|
96
|
+
|
|
97
|
+
ACTUAL_VERSION=$(echo "$RESPONSE" | python3 -c "import json,sys; print(json.load(sys.stdin)['version'])")
|
|
98
|
+
|
|
99
|
+
if [ "$ACTUAL_VERSION" != "$EXPECTED_VERSION" ]; then
|
|
100
|
+
echo "❌ 版本不符!預期 $EXPECTED_VERSION,實際 $ACTUAL_VERSION"
|
|
101
|
+
exit 1
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
echo "✅ 版本驗證通過:$ACTUAL_VERSION"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### rollback.sh — Blue-Green 回滾
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
#!/usr/bin/env bash
|
|
111
|
+
set -euo pipefail
|
|
112
|
+
|
|
113
|
+
CURRENT=$(readlink /app/current 2>/dev/null || echo "/app/blue")
|
|
114
|
+
TARGET=$([[ "$CURRENT" == *"green"* ]] && echo "/app/blue" || echo "/app/green")
|
|
115
|
+
|
|
116
|
+
ln -sfn "$TARGET" /app/current
|
|
117
|
+
nginx -s reload
|
|
118
|
+
|
|
119
|
+
echo "✅ 已回滾至 $TARGET ($(date -u +%Y-%m-%dT%H:%M:%SZ))"
|
|
120
|
+
echo "{\"timestamp\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"event\":\"rollback\",\"from\":\"$CURRENT\",\"to\":\"$TARGET\",\"operator\":\"$(whoami)\"}" >> /var/log/deployments.jsonl
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Makefile
|
|
124
|
+
|
|
125
|
+
```makefile
|
|
126
|
+
.PHONY: deploy rollback verify status
|
|
127
|
+
|
|
128
|
+
deploy:
|
|
129
|
+
@./deploy.sh
|
|
130
|
+
|
|
131
|
+
rollback:
|
|
132
|
+
@./rollback.sh
|
|
133
|
+
|
|
134
|
+
verify:
|
|
135
|
+
@./verify.sh
|
|
136
|
+
|
|
137
|
+
status:
|
|
138
|
+
@echo "目前 slot:$$(readlink /app/current 2>/dev/null || echo 'N/A')"
|
|
139
|
+
@curl -s $${HEALTH_URL:-http://localhost/health} | python3 -m json.tool 2>/dev/null || echo "健康檢查失敗"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 輸出確認清單
|
|
143
|
+
|
|
144
|
+
腳本生成後,AI 助手必須確認:
|
|
145
|
+
|
|
146
|
+
- [ ] `deploy.sh` 含 `set -euo pipefail`
|
|
147
|
+
- [ ] `deploy.sh` 含 deploy.lock 並發守衛
|
|
148
|
+
- [ ] `verify.sh` 比對版本號(不只是 HTTP 200)
|
|
149
|
+
- [ ] `rollback.sh` 在 verify 失敗時自動觸發
|
|
150
|
+
- [ ] `Makefile` 提供 `make deploy / make rollback / make status`
|
|
151
|
+
|
|
152
|
+
## 使用方式
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
/deploy # 互動模式 — 自動偵測專案類型
|
|
156
|
+
/deploy node # Node.js 專案,直接生成
|
|
157
|
+
/deploy docker # Docker Compose 部署模式
|
|
158
|
+
/deploy --verify-only # 僅生成 verify.sh
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 下一步引導
|
|
162
|
+
|
|
163
|
+
`/deploy` 完成後,AI 助手應建議:
|
|
164
|
+
|
|
165
|
+
> **部署腳本已生成,建議下一步:**
|
|
166
|
+
> - `chmod +x deploy.sh verify.sh rollback.sh` — 設定執行權限
|
|
167
|
+
> - `make verify` — 測試健康檢查設定
|
|
168
|
+
> - `git tag v1.0.0 && git push --tags` — 建立版本 tag
|
|
169
|
+
> - `make deploy` — 執行第一次部署
|
|
170
|
+
|
|
171
|
+
## 參考
|
|
172
|
+
|
|
173
|
+
- 核心標準:[no-cicd-deployment.md](../../../../core/no-cicd-deployment.md)
|
|
174
|
+
- 核心標準:[deployment-standards.md](../../../../core/deployment-standards.md)
|
|
175
|
+
- 核心標準:[deployment-standards.md § Defensive Deployment Ordering](../../../../core/deployment-standards.md#defensive-deployment-ordering) — **強制**遵循 extract-verify-then-delete 順序
|
|
176
|
+
- 核心標準:[packaging-standards.md § Archive Format Integrity](../../../../core/packaging-standards.md#archive-format-integrity) — 消費 archive 前先驗證格式
|
|
177
|
+
- 相關:[ci-cd-assistant](../ci-cd-assistant/SKILL.md) — 適用於有 CI/CD 的環境
|
|
178
|
+
|
|
179
|
+
## 版本歷史
|
|
180
|
+
|
|
181
|
+
| 版本 | 日期 | 變更說明 |
|
|
182
|
+
|------|------|----------|
|
|
183
|
+
| 1.0.0 | 2026-04-26 | 初始版本 — XSPEC-085 Phase 1b |
|
|
184
|
+
|
|
185
|
+
## 授權
|
|
186
|
+
|
|
187
|
+
CC BY 4.0 — 文件內容
|