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.
Files changed (80) hide show
  1. package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
  2. package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
  3. package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +1 -1
  4. package/bundled/core/acceptance-criteria-traceability.md +46 -0
  5. package/bundled/core/forward-derivation-standards.md +19 -0
  6. package/bundled/core/knowledge-graph-memory.md +2 -2
  7. package/bundled/locales/zh-CN/CHANGELOG.md +13 -3
  8. package/bundled/locales/zh-CN/README.md +1 -1
  9. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
  10. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
  11. package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
  12. package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
  13. package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
  14. package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
  15. package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
  16. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
  17. package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
  18. package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
  19. package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
  20. package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
  21. package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
  22. package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
  23. package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
  24. package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
  25. package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
  26. package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
  27. package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
  28. package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
  29. package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
  30. package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
  31. package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
  32. package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
  33. package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
  34. package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
  35. package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
  36. package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
  37. package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
  38. package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
  39. package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
  40. package/bundled/locales/zh-TW/CHANGELOG.md +13 -3
  41. package/bundled/locales/zh-TW/README.md +1 -1
  42. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
  43. package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
  44. package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
  45. package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
  46. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
  47. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -2
  48. package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
  49. package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
  50. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
  51. package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
  52. package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
  53. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
  54. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
  55. package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
  56. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
  57. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +5 -5
  58. package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
  59. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
  60. package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
  61. package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +3 -2
  62. package/bundled/locales/zh-TW/skills/plan/SKILL.md +3 -2
  63. package/bundled/locales/zh-TW/skills/push/SKILL.md +3 -2
  64. package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
  65. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
  66. package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
  67. package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
  68. package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
  69. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
  70. package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
  71. package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
  72. package/bundled/skills/brainstorm-assistant/guide.md +256 -661
  73. package/bundled/skills/commands/brainstorm.md +51 -30
  74. package/bundled/skills/knowledge-graph/SKILL.md +5 -5
  75. package/bundled/skills/knowledge-graph/guide.md +4 -4
  76. package/package.json +2 -2
  77. package/src/commands/check.js +11 -2
  78. package/src/lint/i18n.js +109 -23
  79. package/standards-registry.json +4 -4
  80. package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
@@ -3,145 +3,216 @@ name: spec-driven-dev
3
3
  source: ../../../../skills/spec-driven-dev/SKILL.md
4
4
  source_version: 1.2.0
5
5
  translation_version: 1.2.0
6
- last_synced: 2026-03-23
6
+ last_synced: 2026-06-02
7
+ source_hash: 195f50bcbfb7
7
8
  status: current
8
9
  description: "[UDS] 在撰寫程式碼前,建立、審查和管理規格文件"
9
10
  ---
11
+ <!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
12
+ SDD 生命週期編排(7 階段狀態機、階段轉換、閘門檢查)已遷移至
13
+ 採用層(adoption layer,XSPEC-095,2026-04-28)。本 Skill 保留:規格格式定義、狀態
14
+ 描述、delta 操作、決策樹。
15
+ 若需強制執行的生命週期,請使用你的採用層工具鏈。
16
+ -->
10
17
 
11
- # 規格驅動開發助手
18
+ # Spec-Driven Development Assistant | 規格驅動開發助手
19
+
20
+ 在撰寫程式碼前,建立、審查和管理規格文件。
12
21
 
13
22
  > **語言**: [English](../../../../skills/spec-driven-dev/SKILL.md) | 繁體中文
14
23
 
15
- 在撰寫程式碼前,建立、審查和管理規格文件。
24
+ ## When to Use `/sdd` vs `uds spec` | 何時使用
25
+
26
+ | 情境 | `/sdd` | `uds spec` |
27
+ |----------|--------|------------|
28
+ | 具審查循環的正式功能開發 | ✅ | ❌ |
29
+ | 完整規格生命週期(Draft → Archived) | ✅ | ❌ |
30
+ | 快速原型 / Vibe coding | ❌ | ✅ |
31
+ | 小型漸進式變更 | ❌ | ✅ |
32
+ | 需要利害關係人簽核 | ✅ | ❌ |
33
+ | 從自然語言意圖產生微規格(micro-spec) | ❌ | ✅ |
16
34
 
17
- ## 快速檢查清單
35
+ > **`/sdd`** = 正式開發的完整規格生命週期
36
+ > **`uds spec`** = 快速迭代的輕量微規格
37
+
38
+ ## TL;DR Quick Checklist | 快速檢查清單
18
39
 
19
40
  - 搜尋現有規格:查看 `specs/`、`docs/specs/` 或專案規格目錄
20
41
  - 決定範圍:新功能 vs 修改現有功能
21
- - 選擇唯一的規格 ID:`SPEC-NNN` 或 kebab-case 變更 ID
22
- - 撰寫包含明確 AC(Given/When/Then 格式)的提案
23
- - 實作前取得核准
24
- - 依序實作任務,對照規格驗證
25
- - 完成後歸檔規格
42
+ - 挑選唯一的規格 ID:`SPEC-NNN` 或 kebab-case 變更 ID
43
+ - 撰寫提案並附明確的 AC(Given/When/Then 格式)
44
+ - 在開始實作前取得核准
45
+ - 依序實作任務,並對照規格驗證
46
+ - 完成後將規格歸檔
26
47
 
27
- ## 決策樹
48
+ ## Decision Tree | 決策樹
28
49
 
29
50
  ```
30
- 新需求?
31
- ├─ 修復符合規格行為的 Bug → 直接修復
32
- ├─ 錯字/格式/註解? → 直接修復
33
- ├─ 相依套件更新(不破壞相容性)? → 直接修復
34
- ├─ 新功能/能力? → 建立提案
35
- ├─ 破壞性變更? → 建立提案
36
- ├─ 架構變更? → 建立提案
37
- └─ 不確定?建立提案(較安全)
51
+ New request? | 新需求?
52
+ ├─ Bug fix restoring spec behavior? Fix directly | 直接修復
53
+ ├─ Typo/format/comment?Fix directly | 直接修復
54
+ ├─ Dependency update (non-breaking)? Fix directly | 直接修復
55
+ ├─ New feature/capability? Create proposal | 建立提案
56
+ ├─ Breaking change? Create proposal | 建立提案
57
+ ├─ Architecture change? Create proposal | 建立提案
58
+ ├─ Agent/role definition (spans multiple features)? Use spec-type: agent | 使用 Agent SPEC template
59
+ └─ Unclear? → Create proposal (safer) | 建立提案(較安全)
38
60
  ```
39
61
 
40
- ## 工作流程
62
+ ## Workflow | 工作流程
41
63
 
42
64
  ```
43
65
  DISCUSS ──► CREATE ──► REVIEW ──► APPROVE ──► IMPLEMENT ──► VERIFY ──► ARCHIVE
44
66
  ```
45
67
 
46
- ### 0. Discuss - 釐清範圍
47
- 在撰寫規格前,捕捉模糊地帶、建立治理原則、解決歧義。
68
+ ### 0. Discuss - Clarify Scope | 釐清範圍
69
+ 在撰寫規格前,捕捉灰色地帶、建立治理原則、解決模糊之處。
48
70
 
49
- ### 1. Create - 撰寫規格
50
- 定義需求、技術設計、驗收條件和測試計畫。
71
+ ### 1. Create - Write Spec | 撰寫規格
72
+ 定義需求、技術設計、驗收條件與測試計畫。
51
73
 
52
- ### 2. Review - 審查驗證
53
- 與利害關係人檢查完整性、一致性和可行性。
74
+ ### 2. Review - Validate | 審查驗證
75
+ 與利害關係人一同檢查完整性、一致性與可行性。
54
76
 
55
- ### 3. Approve - 核准
56
- 在實作開始前取得利害關係人簽核。
77
+ ### 3. Approve - Sign Off | 核准
78
+ 在開始實作前取得利害關係人簽核。
57
79
 
58
- ### 4. Implement - 實作
59
- 依據已核准的規格進行開發,參照需求和驗收條件。
80
+ ### 4. Implement - Code | 實作
81
+ 依照核准的規格進行開發,參照需求與 AC。
60
82
 
61
- ### 5. Verify - 驗證
62
- 確保實作符合規格,所有測試通過,驗收條件已滿足。
83
+ ### 5. Verify - Confirm | 驗證
84
+ 確保實作符合規格、所有測試通過、AC 已滿足。
63
85
 
64
- ### 6. Archive - 歸檔
65
- 歸檔已完成的規格,連結至 commits/PRs。
86
+ ### 6. Archive - Close | 歸檔
87
+ 將完成的規格歸檔,並附上 commit/PR 連結。
66
88
 
67
- ## 規格狀態
89
+ ## Spec States | 規格狀態
68
90
 
69
- | 狀態 | 說明 | State | Description |
70
- |------|------|-------|-------------|
71
- | **Draft** | 草稿中 | Draft | Work in progress |
72
- | **Review** | 審查中 | Review | Under review |
73
- | **Approved** | 已核准 | Approved | Ready for implementation |
74
- | **Implemented** | 已實作 | Implemented | Code complete |
75
- | **Archived** | 已歸檔 | Archived | Completed or deprecated |
91
+ | 狀態 | 說明(英) | 說明 |
92
+ |-------|-------------|------|
93
+ | **Draft** | Work in progress | 草稿中 |
94
+ | **Review** | Under review | 審查中 |
95
+ | **Approved** | Ready for implementation | 已核准 |
96
+ | **Implemented** | Code complete | 已實作 |
97
+ | **Archived** | Completed or deprecated | 已歸檔 |
76
98
 
77
- ## 規格結構
99
+ ## Spec Structure | 規格結構
78
100
 
79
101
  ```markdown
80
102
  # [SPEC-ID] Feature: [Name]
81
103
 
82
104
  ## Overview
83
- 簡短描述提案變更。
105
+ Brief description of the proposed change.
84
106
 
85
107
  ## Motivation
86
- 為什麼需要這個變更?解決什麼問題?
108
+ Why is this change needed? What problem does it solve?
87
109
 
88
110
  ## Requirements
89
111
  ### Requirement: [Name]
90
- 系統 SHALL [行為描述]
112
+ The system SHALL [behavior description].
91
113
 
92
- #### Scenario: [成功案例]
93
- - **GIVEN** [初始情境]
94
- - **WHEN** [執行動作]
95
- - **THEN** [預期結果]
114
+ #### Scenario: [Success case]
115
+ - **GIVEN** [initial context]
116
+ - **WHEN** [action performed]
117
+ - **THEN** [expected result]
96
118
 
97
119
  ## Acceptance Criteria
98
120
  - AC-1: Given [context], when [action], then [result]
99
121
 
100
122
  ## Technical Design
101
- [架構、API 變更、資料庫變更]
123
+ [Architecture, API changes, database changes]
102
124
 
103
125
  ## Test Plan
104
- - [ ] [元件] 的單元測試
105
- - [ ] [流程] 的整合測試
126
+ - [ ] Unit tests for [component]
127
+ - [ ] Integration tests for [flow]
128
+ ```
129
+
130
+ ### Agent SPEC Structure | Agent 規格結構(`spec-type: agent`)
131
+
132
+ ```markdown
133
+ # [SPEC-ID] Agent: [Role Name]
134
+ <!-- spec-type: agent -->
135
+ <!-- agent-id auto-referenced by feature SPECs -->
136
+
137
+ ## Role Definition
138
+ - **Role**: [Agent Name]
139
+ - **Responsibility**: [One sentence]
140
+ - **Autonomy Level**: L[1-5] (per DEC-065)
141
+
142
+ ## Capability Scope
143
+ **Owns:**
144
+ - [Capability 1]
145
+ - [Capability 2]
146
+
147
+ **Does NOT own:**
148
+ - [Explicit exclusion]
149
+
150
+ ## Interface Contract
151
+ ### Input
152
+ | Message Type | Required Fields | Optional Fields |
153
+ |---|---|---|
154
+ | [Type] | [fields] | [fields] |
155
+
156
+ ### Output
157
+ | Artifact Type | Success Condition | Failure Condition |
158
+ |---|---|---|
159
+ | [Type] | [condition] | [condition] |
160
+
161
+ ## Agent Interactions
162
+ - **Upstream**: [Who calls this agent]
163
+ - **Downstream**: [Who this agent calls]
164
+ - **Parallel**: [Agents working alongside]
165
+
166
+ ## Related Feature SPECs
167
+ - [SPEC-NNN] — [This agent's role in that spec]
106
168
  ```
107
169
 
108
- ### 場景格式規則
170
+ ### Scenario Formatting Rules | 場景格式規則
109
171
 
110
- - 使用 `#### Scenario:` (h4 標題) 撰寫每個場景
111
- - 每個需求必須至少有一個場景
172
+ - 每個場景使用 `#### Scenario:`(h4 標題)
173
+ - 每個需求至少要有一個場景
112
174
  - 使用 **GIVEN/WHEN/THEN** 格式描述結構化行為
113
- - 使用 **SHALL/MUST** 表達強制需求,**SHOULD** 表達建議
175
+ - 規範性需求使用 **SHALL/MUST**,建議性內容使用 **SHOULD**
114
176
 
115
- ## 變更操作
177
+ ## Delta Operations | 變更操作
116
178
 
117
179
  修改現有規格時,使用 delta 區段:
118
180
 
119
- | 操作 | 說明 |
120
- |------|------|
121
- | `## ADDED Requirements` | 新增功能 |
122
- | `## MODIFIED Requirements` | 修改行為 |
123
- | `## REMOVED Requirements` | 移除功能 |
124
- | `## RENAMED Requirements` | 重新命名 |
181
+ | 操作 | 說明(英) | 說明 |
182
+ |-----------|-------------|------|
183
+ | `## ADDED Requirements` | New capabilities | 新增功能 |
184
+ | `## MODIFIED Requirements` | Changed behavior | 修改行為 |
185
+ | `## REMOVED Requirements` | Deprecated features | 移除功能 |
186
+ | `## RENAMED Requirements` | Name changes | 重新命名 |
125
187
 
126
- ## 使用方式
188
+ ## Usage | 使用方式
127
189
 
128
- - `/sdd` - 互動式規格建立精靈
129
- - `/sdd auth-flow` - 為特定功能建立規格
130
- - `/sdd review` - 審查現有規格
131
- - `/sdd --sync-check` - 檢查同步狀態
190
+ ```
191
+ /sdd - Interactive spec creation wizard | 互動式規格建立精靈
192
+ /sdd auth-flow - Create spec for specific feature | 為特定功能建立規格
193
+ /sdd review - Review existing specs | 審查現有規格
194
+ /sdd --sync-check - Check sync status | 檢查同步狀態
195
+ ```
132
196
 
133
- ## 下一步引導
197
+ ## Next Steps Guidance | 下一步引導
134
198
 
135
199
  `/sdd` 完成後,AI 助手應建議:
136
200
 
137
- > **規格文件已建立。建議下一步:**
138
- > - 執行 `/derive` 從規格推導測試工件
139
- > - 執行 `/derive bdd` 僅推導 BDD 場景
140
- > - 執行 `/derive tdd` 僅推導 TDD 骨架
141
- > - 審查 AC 完整性,確保所有驗收條件可測試
142
- > - 檢查 UDS 規範覆蓋率 → 執行 `/audit --patterns`
201
+ > **規格文件已建立。建議下一步 / Specification document created. Suggested next steps:**
202
+ > - 執行 `/derive` 從規格推導測試工件 ⭐ **Recommended / 推薦** — Derive test artifacts from spec
203
+ > - 執行 `/derive bdd` 僅推導 BDD 場景 — Derive BDD scenarios only
204
+ > - 執行 `/derive tdd` 僅推導 TDD 骨架 — Derive TDD skeletons only
205
+ > - 審查 AC 完整性,確保所有驗收條件可測試 — Review AC completeness
206
+ > - 檢查 UDS 規範覆蓋率 → 執行 `/audit --patterns` — Check UDS standard coverage → Run `/audit --patterns`
143
207
 
144
- ## 參考
208
+ ## Reference | 參考
145
209
 
146
210
  - 詳細指南:[guide.md](./guide.md)
147
- - 核心規範:[spec-driven-development.md](../../../../core/spec-driven-development.md)
211
+ - 核心標準:[spec-driven-development.md](../../core/spec-driven-development.md)
212
+
213
+
214
+ ## AI Agent Behavior | AI 代理行為
215
+
216
+ > 完整的 AI 行為定義請參閱對應的命令文件:[`/sdd`](../commands/sdd.md#ai-agent-behavior--ai-代理行為)
217
+ >
218
+ > For complete AI agent behavior definition, see the corresponding command file: [`/sdd`](../commands/sdd.md#ai-agent-behavior--ai-代理行為)
@@ -2,7 +2,8 @@
2
2
  source: ../../../../skills/testing-guide/SKILL.md
3
3
  source_version: 1.2.0
4
4
  translation_version: 1.2.0
5
- last_synced: 2026-02-10
5
+ last_synced: 2026-06-02
6
+ source_hash: 49b6f9e0c6a4
6
7
  status: current
7
8
  name: testing
8
9
  description: "[UDS] 測試金字塔與 UT/IT/ST/E2E 測試撰寫標準"
@@ -12,15 +13,38 @@ description: "[UDS] 測試金字塔與 UT/IT/ST/E2E 測試撰寫標準"
12
13
 
13
14
  > **語言**: [English](../../../../skills/testing-guide/SKILL.md) | 繁體中文
14
15
 
15
- **版本**: 1.1.0
16
- **最後更新**: 2025-12-29
16
+ **版本**: 1.2.0
17
+ **最後更新**: 2026-01-29
17
18
  **適用範圍**: Claude Code Skills
18
19
 
19
20
  ---
20
21
 
21
22
  ## 目的
22
23
 
23
- 本 Skill 提供測試金字塔標準和系統化測試的最佳實踐,支援 ISTQB 和業界通行金字塔框架。
24
+ 本 Skill 提供測試金字塔標準和系統化測試的最佳實踐,同時支援 ISTQB 和業界通行金字塔框架。
25
+
26
+ ## 測試技能導航 | Testing Skills Navigator
27
+
28
+ UDS 提供 6 個與測試相關的 Skill。請使用以下決策樹找到合適的工具:
29
+
30
+ ```
31
+ 你想做什麼? | What do you want to do?
32
+ ├── 測量程式碼覆蓋率(行/分支/函式) → /coverage
33
+ ├── 追蹤哪些需求有測試(AC 可追蹤性) → /ac-coverage
34
+ ├── 以測試驅動開發進行開發(紅-綠-重構) → /tdd
35
+ ├── 撰寫 BDD 場景(Given-When-Then) → /bdd
36
+ ├── 與利害關係人定義驗收測試 → /atdd
37
+ └── 學習測試標準與最佳實踐 → /testing(本 Skill)
38
+ ```
39
+
40
+ | Skill | 焦點 | Focus |
41
+ |-------|------|-------|
42
+ | `/testing` | 測試標準與最佳實踐參考 | Standards and best practices reference |
43
+ | `/coverage` | 程式碼層級覆蓋率分析 | Code-level coverage analysis |
44
+ | `/ac-coverage` | 需求層級 AC 可追蹤性 | Requirement-level AC traceability |
45
+ | `/tdd` | 紅-綠-重構開發循環 | Red-Green-Refactor development cycle |
46
+ | `/bdd` | Given-When-Then 行為場景 | Behavior scenarios with Given-When-Then |
47
+ | `/atdd` | 與利害關係人定義驗收條件 | Acceptance criteria with stakeholders |
24
48
 
25
49
  ## 框架選擇
26
50
 
@@ -71,7 +95,10 @@ description: "[UDS] 測試金字塔與 UT/IT/ST/E2E 測試撰寫標準"
71
95
  ## 詳細指南
72
96
 
73
97
  完整標準請參考:
74
- - [測試金字塔](./testing-pyramid.md)
98
+ - [測試標準](../../core/testing-standards.md) - 可執行的規則
99
+ - [測試理論](./testing-theory.md) - 教學知識庫
100
+ - [測試金字塔](./testing-pyramid.md) - 詳細的金字塔比例
101
+ - [測試骨架範本](./test-skeleton-templates.md) - UT/IT/ST/Perf/Contract 的多語言骨架
75
102
 
76
103
  ### AI 優化格式(Token 高效)
77
104
 
@@ -85,6 +112,10 @@ description: "[UDS] 測試金字塔與 UT/IT/ST/E2E 測試撰寫標準"
85
112
  - 整合測試:`ai/options/testing/integration-testing.ai.yaml`
86
113
  - 系統測試:`ai/options/testing/system-testing.ai.yaml`
87
114
  - E2E 測試:`ai/options/testing/e2e-testing.ai.yaml`
115
+ - 安全測試:`ai/options/testing/security-testing.ai.yaml`
116
+ - 效能測試:`ai/options/testing/performance-testing.ai.yaml`
117
+ - 合約測試:`ai/options/testing/contract-testing.ai.yaml`
118
+ - 骨架範本(所有層級、多語言):[test-skeleton-templates.md](./test-skeleton-templates.md)
88
119
 
89
120
  ## 命名慣例
90
121
 
@@ -156,15 +187,104 @@ test('method_scenario_expected', () => {
156
187
 
157
188
  ---
158
189
 
190
+ ## 測試理論精要(YAML 壓縮)
191
+
192
+ ```yaml
193
+ # === ISTQB FUNDAMENTALS ===
194
+ terminology:
195
+ error: "Human mistake in thinking"
196
+ defect: "Bug in code (caused by error)"
197
+ failure: "System behaves incorrectly (caused by defect)"
198
+ chain: "Error → Defect → Failure"
199
+
200
+ oracle_problem:
201
+ definition: "How do we know the expected result is correct?"
202
+ approaches:
203
+ - specification_oracle: "Compare against spec"
204
+ - reference_oracle: "Compare against reference impl"
205
+ - consistency_oracle: "Same input → same output"
206
+ - heuristic_oracle: "Reasonable approximation"
207
+
208
+ # === STATIC vs DYNAMIC ===
209
+ static_testing:
210
+ definition: "Examine without executing"
211
+ techniques: [reviews, walkthroughs, inspections, static_analysis]
212
+ finds: "Defects before runtime"
213
+ examples: [ESLint, SonarQube, code_review]
214
+
215
+ dynamic_testing:
216
+ definition: "Execute and observe behavior"
217
+ techniques: [unit, integration, system, acceptance]
218
+ finds: "Failures during execution"
219
+
220
+ # === TEST DESIGN TECHNIQUES ===
221
+ black_box:
222
+ equivalence_partitioning:
223
+ principle: "Divide inputs into equivalent classes"
224
+ example: "Age: [<0 invalid], [0-17 minor], [18-64 adult], [65+ senior]"
225
+ boundary_value:
226
+ principle: "Test at boundaries of partitions"
227
+ example: "Age: test -1, 0, 17, 18, 64, 65"
228
+ decision_table:
229
+ principle: "Combinations of conditions → actions"
230
+ use: "Complex business rules"
231
+ state_transition:
232
+ principle: "Valid sequences of states"
233
+ use: "Workflow, state machines"
234
+
235
+ white_box:
236
+ statement_coverage: "Every statement executed once"
237
+ branch_coverage: "Every decision branch taken"
238
+ condition_coverage: "Every condition T/F"
239
+ path_coverage: "Every possible path (often impractical)"
240
+
241
+ # === RISK-BASED TESTING ===
242
+ risk_assessment:
243
+ likelihood: "How likely to fail?"
244
+ impact: "How bad if fails?"
245
+ priority: "likelihood × impact"
246
+
247
+ risk_matrix:
248
+ high_high: "Test extensively, first priority"
249
+ high_low: "Good coverage"
250
+ low_high: "Good coverage"
251
+ low_low: "Basic coverage"
252
+
253
+ # === DEFECT MANAGEMENT ===
254
+ defect_lifecycle:
255
+ states: [new, assigned, in_progress, fixed, verified, closed]
256
+ reopen_trigger: "Verification fails"
257
+
258
+ severity_vs_priority:
259
+ severity: "Technical impact (critical/major/minor/trivial)"
260
+ priority: "Business urgency (high/medium/low)"
261
+ example: "Typo on login page: low severity, high priority (brand)"
262
+
263
+ # === TEST ENVIRONMENT ===
264
+ isolation_levels:
265
+ unit: "In-memory, mocked deps"
266
+ integration: "Containerized DB (Docker)"
267
+ staging: "Production-like, isolated"
268
+ production: "Real, feature flags for testing"
269
+
270
+ test_data_strategies:
271
+ fixtures: "Static predefined data"
272
+ factories: "Dynamic generation (faker)"
273
+ snapshots: "Sanitized production copy"
274
+ synthetic: "Algorithm-generated edge cases"
275
+ ```
276
+
277
+ ---
278
+
159
279
  ## 設定偵測
160
280
 
161
281
  本 Skill 支援專案特定設定。
162
282
 
163
283
  ### 偵測順序
164
284
 
165
- 1. 檢查 `CONTRIBUTING.md` 的「停用 Skills」區段
285
+ 1. 檢查 `CONTRIBUTING.md` 的「Disabled Skills」(停用 Skills)區段
166
286
  - 如果列出此 Skill,則為該專案停用
167
- 2. 檢查 `CONTRIBUTING.md` 的「測試標準」區段
287
+ 2. 檢查 `CONTRIBUTING.md` 的「Testing Standards」(測試標準)區段
168
288
  3. 若未找到,**預設使用標準覆蓋率目標**
169
289
 
170
290
  ### 首次設定
@@ -207,32 +327,9 @@ test('method_scenario_expected', () => {
207
327
 
208
328
  ---
209
329
 
210
- ## 相關標準
211
-
212
- - [測試標準](../../core/testing-standards.md)
213
- - [程式碼審查檢查清單](../../core/code-review-checklist.md)
214
-
215
- ---
330
+ ## 下一步引導 | Next Steps Guidance
216
331
 
217
- ## 版本歷史
218
-
219
- | 版本 | 日期 | 變更內容 |
220
- |---------|------|---------|
221
- | 1.1.0 | 2025-12-29 | 新增:框架選擇(ISTQB/業界通行金字塔)、IT/SIT 縮寫說明 |
222
- | 1.0.0 | 2025-12-24 | 新增:標準區段(目的、相關標準、版本歷史、授權) |
223
-
224
- ---
225
-
226
- ## 授權
227
-
228
- 本 Skill 以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
229
-
230
- **來源**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
231
-
232
-
233
- ## Next Steps Guidance | 下一步引導
234
-
235
- After `/testing` completes, the AI assistant should suggest:
332
+ `/testing` 完成後,AI 助理應建議:
236
333
 
237
334
  > **測試標準與最佳實踐已掌握。建議下一步 / Testing standards and best practices understood. Suggested next steps:**
238
335
  > - 執行 `/tdd` 開始測試驅動開發(紅-綠-重構循環) ⭐ **Recommended / 推薦** — 將測試知識立即轉化為實踐 / Turn testing knowledge into practice immediately
@@ -241,26 +338,26 @@ After `/testing` completes, the AI assistant should suggest:
241
338
 
242
339
  ---
243
340
 
244
- ## Related Standards
341
+ ## 相關標準
245
342
 
246
- - [Testing Standards](../../core/testing-standards.md) - Actionable rules
247
- - [Testing Theory](./testing-theory.md) - Educational knowledge base
248
- - [Code Review Checklist](../../core/code-review-checklist.md)
343
+ - [測試標準](../../core/testing-standards.md) - 可執行的規則
344
+ - [測試理論](./testing-theory.md) - 教學知識庫
345
+ - [程式碼審查檢查清單](../../core/code-review-checklist.md)
249
346
 
250
347
  ---
251
348
 
252
- ## Version History
349
+ ## 版本歷史
253
350
 
254
- | Version | Date | Changes |
351
+ | 版本 | 日期 | 變更內容 |
255
352
  |---------|------|---------|
256
- | 1.2.0 | 2026-01-29 | Added links to new testing-theory.md knowledge base |
257
- | 1.1.0 | 2025-12-29 | Added Testing Theory Essentials YAML section |
258
- | 1.0.0 | 2025-12-24 | Initial: Standard sections (Purpose, Related Standards, Version History, License) |
353
+ | 1.2.0 | 2026-01-29 | 新增連結至新的 testing-theory.md 知識庫 |
354
+ | 1.1.0 | 2025-12-29 | 新增測試理論精要 YAML 區段 |
355
+ | 1.0.0 | 2025-12-24 | 初版:標準區段(目的、相關標準、版本歷史、授權) |
259
356
 
260
357
  ---
261
358
 
262
- ## License
359
+ ## 授權
263
360
 
264
- This skill is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
361
+ Skill [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
265
362
 
266
- **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
363
+ **來源**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)