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
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../../skills/runbook-assistant/guide.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-02
|
|
6
|
+
source_hash: 79012dab91fb
|
|
7
|
+
status: current
|
|
8
|
+
scope: universal
|
|
9
|
+
description: |
|
|
10
|
+
引導 runbook 的建立、組織與驗證。
|
|
11
|
+
使用時機:撰寫 runbook、審查維運程序、規劃演練、評估覆蓋率。
|
|
12
|
+
關鍵字:runbook, operations, incident, on-call, drill, SOP, 運維手冊, 演練。
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Runbook 助手
|
|
16
|
+
|
|
17
|
+
> **語言**:[English](../../../../skills/runbook-assistant/guide.md) | 繁體中文
|
|
18
|
+
|
|
19
|
+
**版本**:1.0.0
|
|
20
|
+
**最後更新**:2026-04-01
|
|
21
|
+
**適用範圍**:Claude Code Skills
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 目的
|
|
26
|
+
|
|
27
|
+
此技能協助團隊撰寫、組織與驗證維運程序及 incident response 的 runbook。內容涵蓋 5 種 runbook 類型、標準 7 段式範本、撰寫品質原則、演練流程與覆蓋率報告。
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 快速參考(YAML 壓縮版)
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
# === 5 RUNBOOK TYPES 五種類型 ===
|
|
35
|
+
types:
|
|
36
|
+
alert_response:
|
|
37
|
+
purpose: "Diagnose and fix a specific alert / 診斷並修復特定告警"
|
|
38
|
+
example: "api-latency-high.md"
|
|
39
|
+
trigger: "Alert fires"
|
|
40
|
+
standard_operation:
|
|
41
|
+
purpose: "Routine operational procedures / 例行維運程序"
|
|
42
|
+
example: "database-backup-restore.md"
|
|
43
|
+
trigger: "Scheduled or on-demand"
|
|
44
|
+
emergency_procedure:
|
|
45
|
+
purpose: "Major incident rapid response / 重大事件快速回應"
|
|
46
|
+
example: "full-service-outage.md"
|
|
47
|
+
trigger: "SEV-1 incident"
|
|
48
|
+
change_procedure:
|
|
49
|
+
purpose: "Planned change execution steps / 計畫變更執行步驟"
|
|
50
|
+
example: "database-migration.md"
|
|
51
|
+
trigger: "Change window"
|
|
52
|
+
troubleshooting_guide:
|
|
53
|
+
purpose: "General problem investigation / 一般問題調查"
|
|
54
|
+
example: "memory-leak.md"
|
|
55
|
+
trigger: "Ad-hoc investigation"
|
|
56
|
+
|
|
57
|
+
# === STANDARD TEMPLATE 標準範本 (7 Sections) ===
|
|
58
|
+
template_sections:
|
|
59
|
+
1_overview:
|
|
60
|
+
fields: ["Alert Name", "Severity (P1-P4)", "Related Services", "Last Updated", "Owner", "Last Drilled"]
|
|
61
|
+
2_symptoms:
|
|
62
|
+
content: "Observable behaviors — what users see, how system behaves / 可觀察的異常行為"
|
|
63
|
+
3_impact_assessment:
|
|
64
|
+
fields: ["Affected users scope", "Business impact (revenue, reputation)", "Upstream/downstream cascading"]
|
|
65
|
+
4_diagnostic_steps:
|
|
66
|
+
format: "Numbered steps with copy-paste commands and expected output / 編號步驟+可複製指令+預期輸出"
|
|
67
|
+
branching: "If [condition A] → Scenario A; If [condition B] → Scenario B"
|
|
68
|
+
5_fix_steps:
|
|
69
|
+
format: "Per-scenario fix with verification command after each step / 每場景修復+每步驟驗證"
|
|
70
|
+
include: ["Specific commands", "Verification check", "Estimated time"]
|
|
71
|
+
6_escalation:
|
|
72
|
+
fields: ["Contact person/team", "Channel (Slack/phone)", "Backup contact", "Time threshold"]
|
|
73
|
+
7_post_actions:
|
|
74
|
+
checklist: ["Update runbook", "Create postmortem if P1/P2", "Notify stakeholders", "Record MTTD/MTTR"]
|
|
75
|
+
|
|
76
|
+
optional_sections: ["Prerequisites", "Rollback Steps", "Related Runbooks", "Changelog"]
|
|
77
|
+
|
|
78
|
+
# === WRITING QUALITY 撰寫品質 (6 Principles) ===
|
|
79
|
+
six_principles:
|
|
80
|
+
reproducible:
|
|
81
|
+
rule: "Steps specific enough to copy-paste and execute / 步驟具體到可直接複製執行"
|
|
82
|
+
good: "kubectl rollout restart deployment/payment-service -n production"
|
|
83
|
+
bad: "Restart the payment service"
|
|
84
|
+
unambiguous:
|
|
85
|
+
rule: "Each step has exactly one interpretation / 每個步驟只有一種解讀"
|
|
86
|
+
good: "Restart the payment-service Pod in the production namespace"
|
|
87
|
+
bad: "Restart the service"
|
|
88
|
+
decision_points:
|
|
89
|
+
rule: "Branch conditions are explicit with clear criteria / 分支條件明確有具體判斷標準"
|
|
90
|
+
good: "If CPU > 90%, execute Plan A; otherwise Plan B"
|
|
91
|
+
bad: "If the server seems overloaded..."
|
|
92
|
+
rollback:
|
|
93
|
+
rule: "Failed fix steps have a fallback plan / 失敗的修復步驟有回退方案"
|
|
94
|
+
verification:
|
|
95
|
+
rule: "Each fix step has success confirmation / 每個修復步驟有成功驗證"
|
|
96
|
+
good: "Run curl health-check and verify HTTP 200"
|
|
97
|
+
bad: "Check that it's working"
|
|
98
|
+
time_bounded:
|
|
99
|
+
rule: "Expected completion time is stated / 標明預期完成時間"
|
|
100
|
+
good: "This step typically takes 2-5 minutes"
|
|
101
|
+
|
|
102
|
+
anti_patterns:
|
|
103
|
+
- {bad: "Contact the team", fix: "Name specific people and channels / 指名具體人員和頻道"}
|
|
104
|
+
- {bad: "Check the logs", fix: "Provide exact log query / 提供精確的日誌查詢"}
|
|
105
|
+
- {bad: "If needed, scale up", fix: "Define threshold and target / 定義閾值和目標"}
|
|
106
|
+
- {bad: "Outdated commands", fix: "Regular review cycle / 定期審查週期"}
|
|
107
|
+
|
|
108
|
+
# === DRILL PROCESS 演練機制 ===
|
|
109
|
+
drill:
|
|
110
|
+
schedule:
|
|
111
|
+
highest: {condition: "P1 alert runbooks", frequency: "Monthly / 每月"}
|
|
112
|
+
high: {condition: "P2 alert runbooks", frequency: "Quarterly / 每季"}
|
|
113
|
+
medium: {condition: "Emergency procedures", frequency: "Quarterly / 每季"}
|
|
114
|
+
low: {condition: "Other runbooks", frequency: "Bi-annually / 每半年"}
|
|
115
|
+
recording:
|
|
116
|
+
fields: ["Date", "Participants", "Result (Pass/Partial/Fail)", "Estimated vs Actual time", "Issues found", "Updates required"]
|
|
117
|
+
failure_handling:
|
|
118
|
+
1: "Immediately flag runbook as needing update / 立即標記需更新"
|
|
119
|
+
2: "Create action item with owner and deadline / 建立待辦事項"
|
|
120
|
+
3: "Re-drill after update / 更新後重新演練"
|
|
121
|
+
4: "Not valid until re-drill passes / 重新演練通過前視為無效"
|
|
122
|
+
|
|
123
|
+
# === REVIEW CYCLES 審查週期 ===
|
|
124
|
+
review_cycles:
|
|
125
|
+
alert_response: "Quarterly (3 months) / 每季"
|
|
126
|
+
emergency_procedure: "Monthly / 每月"
|
|
127
|
+
standard_operation: "Bi-annually (6 months) / 每半年"
|
|
128
|
+
change_procedure: "After each use / 每次使用後"
|
|
129
|
+
troubleshooting_guide: "Bi-annually (6 months) / 每半年"
|
|
130
|
+
|
|
131
|
+
staleness: "Runbook is stale when Last Updated exceeds review cycle or not drilled within drill cycle / 超過審查週期或演練週期即為過時"
|
|
132
|
+
|
|
133
|
+
# === COVERAGE REPORT 覆蓋率報告 ===
|
|
134
|
+
coverage:
|
|
135
|
+
target:
|
|
136
|
+
P1_P2: "100% alerts must have runbooks / P1/P2 告警必須 100% 有手冊"
|
|
137
|
+
P3_P4: "> 80% alerts should have runbooks / P3/P4 告警應 > 80% 有手冊"
|
|
138
|
+
report_format:
|
|
139
|
+
columns: ["Alert Level", "Total Alerts", "With Runbook", "Coverage", "Target"]
|
|
140
|
+
action: "List alerts without runbooks for creation / 列出無手冊的告警待建立"
|
|
141
|
+
|
|
142
|
+
# === DIRECTORY STRUCTURE 目錄結構 ===
|
|
143
|
+
organization:
|
|
144
|
+
root: "docs/runbooks/"
|
|
145
|
+
subdirs: ["alerts/", "operations/", "emergency/", "changes/", "troubleshooting/"]
|
|
146
|
+
naming: "kebab-case, describe the PROBLEM not the solution / 描述問題而非解法"
|
|
147
|
+
index: "README.md with runbook table (name, severity, services, date)"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 與相關技能整合 / Integration with Related Skills
|
|
153
|
+
|
|
154
|
+
| 技能 | 整合點 | 說明 |
|
|
155
|
+
|-------|-------------------|-------------|
|
|
156
|
+
| `/observability --alerting` | 告警對應 runbook 連結 | 每條告警規則都應包含 `runbook_url` 標註 |
|
|
157
|
+
| `/incident` | 事後檢討(postmortem)對應 runbook 流程 | postmortem 之後:更新既有或為新的失效模式建立新 runbook |
|
|
158
|
+
| `/slo` | 燃燒率(burn rate)告警 | SLO 燃燒率告警應連結到對應的 runbook |
|
|
159
|
+
|
|
160
|
+
### 告警連結手冊 / Alert-to-Runbook Linking
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
# In alert rule definition
|
|
164
|
+
annotations:
|
|
165
|
+
runbook_url: "https://wiki.example.com/runbooks/alerts/api-latency-high"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 事後檢討到手冊流程 / Postmortem-to-Runbook Flow
|
|
169
|
+
|
|
170
|
+
- 事件揭露了 runbook 的缺口 → 更新該 runbook
|
|
171
|
+
- 事件是全新的失效模式 → 建立新的 runbook
|
|
172
|
+
- 將 postmortem 連結到 runbook 的 changelog
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 設定偵測
|
|
177
|
+
|
|
178
|
+
### 偵測順序
|
|
179
|
+
|
|
180
|
+
1. 檢查 `CONTRIBUTING.md` 是否有「Disabled Skills」段落
|
|
181
|
+
2. 檢查 `CONTRIBUTING.md` 是否有「Runbook Standards」段落
|
|
182
|
+
3. 若未找到,**預設採用標準 runbook 實務**
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 詳細準則
|
|
187
|
+
|
|
188
|
+
完整標準請參閱:
|
|
189
|
+
- [Runbook Standards](../../core/runbook-standards.md)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 相關標準
|
|
194
|
+
|
|
195
|
+
- [Runbook Standards](../../core/runbook-standards.md) - 核心標準
|
|
196
|
+
- [Alerting Standards](../../core/alerting-standards.md) - 告警設計與 runbook 連結
|
|
197
|
+
- [Postmortem Standards](../../core/postmortem-standards.md) - 事後檢討
|
|
198
|
+
- [Observability Standards](../../core/observability-standards.md) - 監控與儀表板
|
|
199
|
+
- [Observability Assistant](../observability-assistant/SKILL.md) - 監控設定
|
|
200
|
+
- [SLO Assistant](../slo-assistant/SKILL.md) - 基於 SLO 的告警
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 版本歷史
|
|
205
|
+
|
|
206
|
+
| 版本 | 日期 | 變更 |
|
|
207
|
+
|---------|------|---------|
|
|
208
|
+
| 1.0.0 | 2026-04-01 | 首次發布 |
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 授權
|
|
213
|
+
|
|
214
|
+
本技能以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
|
|
215
|
+
|
|
216
|
+
**來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-builder
|
|
3
|
+
source: ../../../../skills/skill-builder/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: "[UDS] 識別重複流程並以正確開發深度建立 Skill"
|
|
9
|
+
allowed-tools: Read, Glob, Grep, Write, Edit, Bash
|
|
10
|
+
argument-hint: "[流程描述]"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# 流程轉 Skill 助手
|
|
14
|
+
|
|
15
|
+
> **語言**: [English](../../../../skills/skill-builder/SKILL.md) | 繁體中文
|
|
16
|
+
|
|
17
|
+
引導你從「我一直手動做這件事」走到「擁有一個正確建立的 Skill」,並在過程中保持適量的流程治理。
|
|
18
|
+
|
|
19
|
+
## 何時使用
|
|
20
|
+
|
|
21
|
+
- 你已經用同樣的多步驟流程手動執行 ≥ 3 次
|
|
22
|
+
- 同事第 3 次問你「我們是怎麼做 X 的?」
|
|
23
|
+
- 你臨時建了一個 Skill,現在想將其正式化
|
|
24
|
+
|
|
25
|
+
> **備註**:`/process-to-skill` 是本 Skill 的繁體中文翻譯版,功能完全相同。
|
|
26
|
+
|
|
27
|
+
## 核心原則
|
|
28
|
+
|
|
29
|
+
> Skill 紀錄的是**流程知識**。Memory 紀錄的是歷史事實。
|
|
30
|
+
> 當你注意到自己重複執行相同的步驟,那就是 Skill 候選。
|
|
31
|
+
|
|
32
|
+
## 決策樹
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
需要新建 Skill?
|
|
36
|
+
├── 修改現有 Skill?
|
|
37
|
+
│ → Delta 路徑:在現有 SKILL.md 後附加 ## MODIFIED / ## ADDED
|
|
38
|
+
│ 更新 version 欄位 → 完成
|
|
39
|
+
│
|
|
40
|
+
├── 回答這 4 個問題(任一「是」→ Complex):
|
|
41
|
+
│ 1. 超過 7 個步驟?
|
|
42
|
+
│ 2. 步驟之間有分支邏輯(if / else)?
|
|
43
|
+
│ 3. 需要 3+ 不同標準/決策的知識?
|
|
44
|
+
│ 4. 輸出會直接影響子專案原始碼?
|
|
45
|
+
│
|
|
46
|
+
├── 全部「否」→ Simple 路徑
|
|
47
|
+
│ → 填寫 Skill Brief(templates/SKILL-BRIEF-TEMPLATE.md)
|
|
48
|
+
│ → 直接建立 SKILL.md(無需 XSPEC)
|
|
49
|
+
│
|
|
50
|
+
└── 任一「是」→ Complex 路徑
|
|
51
|
+
→ 先建立 XSPEC → 執行 /sdd
|
|
52
|
+
→ XSPEC Approved 後回到此處
|
|
53
|
+
|
|
54
|
+
棄用 Skill?
|
|
55
|
+
→ 在 SKILL.md frontmatter 加入:
|
|
56
|
+
status: deprecated
|
|
57
|
+
deprecated_at: YYYY-MM-DD
|
|
58
|
+
deprecated_reason: "..."
|
|
59
|
+
superseded_by: "/new-skill" (若適用)
|
|
60
|
+
→ 在 SKILL-CANDIDATES.md 標記為已封存
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 擺放位置決策
|
|
64
|
+
|
|
65
|
+
建立 SKILL.md 前,先決定它該放在哪裡:
|
|
66
|
+
|
|
67
|
+
| 條件 | 擺放位置 |
|
|
68
|
+
|------|----------|
|
|
69
|
+
| 步驟引用專案特定路徑(如 TECH-RADAR.md、DEC-*.md) | 專案:`{project}/.claude/skills/` |
|
|
70
|
+
| 步驟為通用流程(無專案特定路徑) | UDS:`skills/{name}/` + zh-TW locale |
|
|
71
|
+
|
|
72
|
+
## 工作流程
|
|
73
|
+
|
|
74
|
+
### Step 1 — 描述流程
|
|
75
|
+
|
|
76
|
+
捕捉重複的步驟序列:
|
|
77
|
+
- 哪些步驟?依什麼順序?
|
|
78
|
+
- 目前手動執行過幾次?
|
|
79
|
+
- 觸及哪些工具或檔案?
|
|
80
|
+
|
|
81
|
+
### Step 2 — 更新 SKILL-CANDIDATES.md
|
|
82
|
+
|
|
83
|
+
打開專案的 `SKILL-CANDIDATES.md`(首次請從 `templates/SKILL-CANDIDATES.md` 複製):
|
|
84
|
+
- 尚未記錄 → 新增一列,填入當前次數
|
|
85
|
+
- 已記錄 → 增加次數
|
|
86
|
+
- 次數達 3 → 標記 trigger ✅,繼續執行
|
|
87
|
+
|
|
88
|
+
### Step 3 — 選擇路徑(Simple / Complex / Delta)
|
|
89
|
+
|
|
90
|
+
回答 4 個判斷問題,決定:Simple、Complex 或 Delta。
|
|
91
|
+
|
|
92
|
+
### Step 4a — Simple:填寫 Skill Brief
|
|
93
|
+
|
|
94
|
+
使用 `templates/SKILL-BRIEF-TEMPLATE.md`:
|
|
95
|
+
- 觸發情境(何時會用到?)
|
|
96
|
+
- 核心步驟(3 ~ 7 個,有順序)
|
|
97
|
+
- 驗收條件(2 ~ 3 條)
|
|
98
|
+
- 範圍外(明確邊界)
|
|
99
|
+
|
|
100
|
+
### Step 4b — Complex:建立 XSPEC
|
|
101
|
+
|
|
102
|
+
執行 `/sdd` 建立 XSPEC。XSPEC Approved 後回到 Step 5。
|
|
103
|
+
|
|
104
|
+
### Step 4c — Delta:識別變更範圍
|
|
105
|
+
|
|
106
|
+
識別現有 SKILL.md 中哪些區段需要變更。
|
|
107
|
+
在檔尾加入 `## MODIFIED Requirements` 或 `## ADDED Requirements`。
|
|
108
|
+
|
|
109
|
+
### Step 5 — 建立 / 更新 SKILL.md
|
|
110
|
+
|
|
111
|
+
依 Brief 或 XSPEC 生成 SKILL.md:
|
|
112
|
+
- 確認 frontmatter:`name`、`scope`、`description`、`allowed-tools`
|
|
113
|
+
- **description 格式規則**(`scope: universal` 或 `uds-specific` 時強制):
|
|
114
|
+
- 必須以 `[UDS]` 開頭
|
|
115
|
+
- 第一行使用**繁體中文**描述用途
|
|
116
|
+
- 單行寫法:`description: "[UDS] 繁體中文說明"`
|
|
117
|
+
- 多行寫法(含 Use when / Keywords):`description: |\n [UDS] 繁體中文說明\n Use when: ...`
|
|
118
|
+
- **禁止**:`description: "\"[UDS] ..."`(多餘引號會讓 description 顯示空白)
|
|
119
|
+
- UDS 通用 Skill:同步建立 zh-TW locale 版本
|
|
120
|
+
- 專案 Skill:放在 `{project}/.claude/skills/{name}/SKILL.md`
|
|
121
|
+
|
|
122
|
+
**description 快速驗證(寫完即執行)**:
|
|
123
|
+
```bash
|
|
124
|
+
bash cross-project/validate-skills.sh
|
|
125
|
+
# → 0 ❌ 錯誤才能繼續
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Step 6 — 更新 SKILL-CANDIDATES.md
|
|
129
|
+
|
|
130
|
+
將候選列標記為:trigger ✅、Skill 欄位填寫完成。
|
|
131
|
+
|
|
132
|
+
### Step 7 — Commit
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
feat(skills): Add /{skill-name} skill. 新增 /{skill-name} Skill。
|
|
136
|
+
|
|
137
|
+
{English description, 1-2 lines}
|
|
138
|
+
|
|
139
|
+
{中文描述,1-2 行}
|
|
140
|
+
|
|
141
|
+
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 輸出檢查清單
|
|
145
|
+
|
|
146
|
+
完成所有步驟後,請確認:
|
|
147
|
+
|
|
148
|
+
- [ ] `SKILL-CANDIDATES.md` 已更新(trigger ✅、Skill 名稱已填)
|
|
149
|
+
- [ ] `SKILL.md` 已建立並有完整 frontmatter(`name` / `scope` / `description` / `allowed-tools`)
|
|
150
|
+
- [ ] **description 格式**(`universal` / `uds-specific` scope 必填):
|
|
151
|
+
- [ ] 第一行以 `[UDS]` 開頭(`"[UDS] 繁體中文..."` 格式)
|
|
152
|
+
- [ ] 使用繁體中文,非純英文
|
|
153
|
+
- [ ] 無多餘外層引號(避免 `"\"[UDS]..."` 格式)
|
|
154
|
+
- [ ] `bash cross-project/validate-skills.sh` → **0 ❌ 錯誤**
|
|
155
|
+
- [ ] Simple 路徑:Skill Brief 已引用或保留
|
|
156
|
+
- [ ] Complex 路徑:XSPEC ID 已記錄在 SKILL.md header comment
|
|
157
|
+
- [ ] UDS skill:已建立 zh-TW locale 檔案
|
|
158
|
+
- [ ] 棄用:frontmatter 含 `status: deprecated`
|
|
159
|
+
- [ ] git commit 已完成
|
|
160
|
+
|
|
161
|
+
## 參考
|
|
162
|
+
|
|
163
|
+
- Skill Brief 模板:[templates/SKILL-BRIEF-TEMPLATE.md](../../../../templates/SKILL-BRIEF-TEMPLATE.md)
|
|
164
|
+
- 候選追蹤:[templates/SKILL-CANDIDATES.md](../../../../templates/SKILL-CANDIDATES.md)(請複製到專案)
|
|
165
|
+
- ADR 標準:[core/adr-standards.md](../../../../core/adr-standards.md)
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../../skills/slo-assistant/guide.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-02
|
|
6
|
+
source_hash: 3c3397aec3fe
|
|
7
|
+
status: current
|
|
8
|
+
scope: universal
|
|
9
|
+
description: |
|
|
10
|
+
引導 SLI/SLO/Error Budget 的定義與管理。
|
|
11
|
+
使用時機:定義 SLO、選取 SLI、計算 error budget、設定可靠性目標時。
|
|
12
|
+
關鍵字:SLI、SLO、SLA、error budget、reliability、burn rate、服務水準、錯誤預算。
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# SLO Assistant
|
|
16
|
+
|
|
17
|
+
> **語言**:[English](../../../../skills/slo-assistant/guide.md) | 繁體中文
|
|
18
|
+
|
|
19
|
+
**版本**:1.0.0
|
|
20
|
+
**最後更新**:2026-04-01
|
|
21
|
+
**適用範圍**:Claude Code Skills
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 目的
|
|
26
|
+
|
|
27
|
+
本技能協助團隊定義、實作與管理 Service Level Objectives(服務水準目標)。內容涵蓋不同服務類型的 SLI 選取、五步驟 SLO 設定法、Error Budget 計算與政策,以及可立即套用的範本。
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 快速參考(YAML 壓縮格式)
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
# === KEY CONCEPTS 核心概念 ===
|
|
35
|
+
definitions:
|
|
36
|
+
SLI: "Service Level Indicator — quantitative measurement of service behavior / 服務品質的量化量測"
|
|
37
|
+
SLO: "Service Level Objective — internal target for SLI over a window / SLI 的內部目標值"
|
|
38
|
+
SLA: "Service Level Agreement — external contract with penalties / 外部合約,違反有罰則"
|
|
39
|
+
error_budget: "Allowed unreliability = 1 - SLO target / 允許的不可靠度"
|
|
40
|
+
|
|
41
|
+
relationship: "SLI ── measures ──► SLO ── stricter than ──► SLA"
|
|
42
|
+
rule: "SLO should be stricter than SLA to provide buffer / SLO 應比 SLA 嚴格以提供緩衝"
|
|
43
|
+
|
|
44
|
+
# === SLI SELECTION GUIDE SLI 選取指南 ===
|
|
45
|
+
sli_by_service_type:
|
|
46
|
+
api_services:
|
|
47
|
+
availability: "Non-5xx / Total requests"
|
|
48
|
+
latency: "Requests below duration threshold / Total"
|
|
49
|
+
quality: "Non-degraded responses / Total"
|
|
50
|
+
batch_jobs:
|
|
51
|
+
freshness: "Time since last success within threshold"
|
|
52
|
+
correctness: "Correctly processed / Total records"
|
|
53
|
+
coverage: "Completed batches / Scheduled batches"
|
|
54
|
+
frontend:
|
|
55
|
+
load_performance: "LCP<2.5s, FID<100ms, CLS<0.1 / Total pages"
|
|
56
|
+
availability: "Successful loads / Total loads"
|
|
57
|
+
interaction_delay: "Actions with response < threshold / Total"
|
|
58
|
+
|
|
59
|
+
sli_quick_select:
|
|
60
|
+
api: "→ Availability + Latency + Quality"
|
|
61
|
+
batch: "→ Freshness + Correctness + Coverage"
|
|
62
|
+
frontend: "→ LCP/FID/CLS + Availability"
|
|
63
|
+
|
|
64
|
+
# === 5-STEP SLO METHODOLOGY 五步驟設定法 ===
|
|
65
|
+
slo_methodology:
|
|
66
|
+
step_1_select_sli: "Choose 1-3 most meaningful SLIs per service / 每個服務選 1-3 個最有意義的 SLI"
|
|
67
|
+
step_2_measurement_window:
|
|
68
|
+
rolling_28d: "Recommended; smooths weekly patterns / 推薦,平滑週間波動"
|
|
69
|
+
calendar_month: "Aligns with business reporting / 對齊業務報告週期"
|
|
70
|
+
step_3_set_target:
|
|
71
|
+
"99%": "7.3h downtime/month — internal tools / 內部工具"
|
|
72
|
+
"99.5%": "3.65h — general B2B / 一般 B2B"
|
|
73
|
+
"99.9%": "43.8min — consumer-facing / 面向消費者"
|
|
74
|
+
"99.95%": "21.9min — financial, healthcare / 金融、醫療"
|
|
75
|
+
"99.99%": "4.38min — infrastructure, payments / 基礎設施"
|
|
76
|
+
tip: "Don't set higher than you can sustain / 別設得比你能維持的更高"
|
|
77
|
+
step_4_compliance_formula: |
|
|
78
|
+
SLO Compliance = (Good Events / Total Events) x 100%
|
|
79
|
+
Define: Good Events, Total Events, Window, Target
|
|
80
|
+
step_5_document: "Record using SLO Document Template / 使用 SLO 文件範本記錄"
|
|
81
|
+
|
|
82
|
+
iterative_adjustment:
|
|
83
|
+
budget_underused: "Consider tightening SLO / 考慮收緊 SLO"
|
|
84
|
+
budget_exhausted_often: "Loosen SLO or invest in reliability / 放寬或投資可靠性"
|
|
85
|
+
users_unhappy_despite_meeting: "Revisit SLI selection / 重新檢視 SLI 選取"
|
|
86
|
+
team_burnout: "SLO may be too aggressive / SLO 可能過於激進"
|
|
87
|
+
|
|
88
|
+
# === ERROR BUDGET 錯誤預算 ===
|
|
89
|
+
error_budget:
|
|
90
|
+
formula: "Budget = 1 - SLO Target"
|
|
91
|
+
example: "99.9% over 28d → 0.1% → 40.32 min allowed downtime"
|
|
92
|
+
quick_calc: "Budget = (1 - target) x window_minutes"
|
|
93
|
+
|
|
94
|
+
burn_rate_alerting:
|
|
95
|
+
fast_burn: {threshold: "2% in 1h", action: "Page (P1)", meaning: "Budget gone in ~2 days"}
|
|
96
|
+
medium_burn: {threshold: "5% in 6h", action: "Alert (P2)", meaning: "Budget gone in ~5 days"}
|
|
97
|
+
slow_burn: {threshold: "10% in 3d", action: "Ticket (P3)", meaning: "May exhaust before month end"}
|
|
98
|
+
|
|
99
|
+
budget_exhaustion_policies:
|
|
100
|
+
freeze_releases: "Halt non-reliability features until recovery / 凍結非可靠性功能發布"
|
|
101
|
+
reliability_sprint: "Dedicate sprint to reliability / 專注衝刺可靠性改善"
|
|
102
|
+
enhanced_review: "Additional production-readiness review / 加強生產就緒審查"
|
|
103
|
+
lower_slo: "Reduce target after stakeholder agreement / 經利害關係人同意後降低目標"
|
|
104
|
+
rule: "Agree on policy BEFORE budget exhaustion / 在預算耗盡前就達成政策共識"
|
|
105
|
+
|
|
106
|
+
# === SLO TEMPLATES 範本庫 ===
|
|
107
|
+
templates:
|
|
108
|
+
api_service:
|
|
109
|
+
availability: {sli: "Non-5xx / Total", default_slo: "99.9%"}
|
|
110
|
+
latency: {sli: "P99 < threshold / Total", default_slo: "99%"}
|
|
111
|
+
error_rate: {sli: "Non-5xx+timeout / Total", default_slo: "99.9%"}
|
|
112
|
+
batch_job:
|
|
113
|
+
freshness: {sli: "Max delay < threshold", default_slo: "99.5%"}
|
|
114
|
+
correctness: {sli: "Correct / Total", default_slo: "99.99%"}
|
|
115
|
+
completion: {sli: "Completed / Scheduled", default_slo: "99.9%"}
|
|
116
|
+
frontend:
|
|
117
|
+
load_perf: {sli: "LCP<2.5s proportion", default_slo: "90%"}
|
|
118
|
+
interaction: {sli: "FID<100ms proportion", default_slo: "95%"}
|
|
119
|
+
visual: {sli: "CLS<0.1 proportion", default_slo: "95%"}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 與相關技能整合 / Integration with Related Skills
|
|
125
|
+
|
|
126
|
+
| 技能 | 整合點 | 說明 |
|
|
127
|
+
|-------|-------------------|-------------|
|
|
128
|
+
| `/observability` | SLI 資料來源 | 三大支柱的指標餵入 SLI 計算 |
|
|
129
|
+
| `/incident` | SLO 影響評估 | 在事件報告中納入已消耗與剩餘的 Error Budget |
|
|
130
|
+
| `/sdd` | 規格中的 SLO | 新服務規格「應」包含 SLO 目標章節 |
|
|
131
|
+
|
|
132
|
+
### 事件回應中的 SLO / SLO in Incident Response
|
|
133
|
+
|
|
134
|
+
回報事件時,應包含:
|
|
135
|
+
- **受影響的 SLI**:哪個指標受到衝擊
|
|
136
|
+
- **已消耗的 Error Budget**:分鐘數或百分比
|
|
137
|
+
- **剩餘預算**:該量測視窗內還剩多少
|
|
138
|
+
|
|
139
|
+
### 規格驅動開發中的 SLO / SLO in Spec-Driven Development
|
|
140
|
+
|
|
141
|
+
使用 `/sdd` 定義新服務時,新增一個 SLO 章節:
|
|
142
|
+
- 附帶理由的 SLI 選取
|
|
143
|
+
- 附帶論證的目標值
|
|
144
|
+
- Error Budget 政策的選擇
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 設定偵測
|
|
149
|
+
|
|
150
|
+
### 偵測順序
|
|
151
|
+
|
|
152
|
+
1. 檢查 `CONTRIBUTING.md` 是否有「Disabled Skills」章節
|
|
153
|
+
2. 檢查 `CONTRIBUTING.md` 是否有「SLO Standards」章節
|
|
154
|
+
3. 若皆未找到,**預設採用標準 SLO 實務做法**
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 詳細準則
|
|
159
|
+
|
|
160
|
+
完整標準請參閱:
|
|
161
|
+
- [SLO Standards](../../core/slo-standards.md)
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 相關標準
|
|
166
|
+
|
|
167
|
+
- [SLO Standards](../../core/slo-standards.md) - 核心標準
|
|
168
|
+
- [Observability Standards](../../core/observability-standards.md) - 三大支柱框架
|
|
169
|
+
- [Alerting Standards](../../core/alerting-standards.md) - 以 SLO 為基礎的告警
|
|
170
|
+
- [Performance Standards](../../core/performance-standards.md) - 效能目標
|
|
171
|
+
- [Observability Assistant](../observability-assistant/SKILL.md) - 監控設定
|
|
172
|
+
- [Runbook Assistant](../runbook-assistant/SKILL.md) - 告警回應程序
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 版本歷史
|
|
177
|
+
|
|
178
|
+
| 版本 | 日期 | 變更內容 |
|
|
179
|
+
|---------|------|---------|
|
|
180
|
+
| 1.0.0 | 2026-04-01 | 初始發布 |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 授權
|
|
185
|
+
|
|
186
|
+
本技能以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
|
|
187
|
+
|
|
188
|
+
**來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-derive
|
|
3
|
+
source: ../../../../skills/spec-derivation/SKILL.md
|
|
4
|
+
source_version: 1.0.0
|
|
5
|
+
translation_version: 1.0.0
|
|
6
|
+
last_synced: 2026-05-28
|
|
7
|
+
scope: partial
|
|
8
|
+
description: "[UDS] 從規格衍生 BDD 場景、TDD 骨架或 ATDD 表格"
|
|
9
|
+
allowed-tools: Read, Write, Grep, Glob
|
|
10
|
+
argument-hint: "[all|bdd|tdd|it|e2e|atdd] <spec-file>"
|
|
11
|
+
prerequisites: ["spec-approved"]
|
|
12
|
+
disable-model-invocation: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# 正向推演
|
|
16
|
+
|
|
17
|
+
> **語言**: [English](../../../../skills/spec-derivation/SKILL.md) | 繁體中文
|
|
18
|
+
|
|
19
|
+
從已批准的 SDD 規格生成衍生工件(BDD 場景、TDD 骨架、ATDD 表格)。
|
|
20
|
+
|
|
21
|
+
## 子命令
|
|
22
|
+
|
|
23
|
+
| 子命令 | 說明 | 輸出 |
|
|
24
|
+
|--------|------|------|
|
|
25
|
+
| `all` | 完整推演管線(BDD + TDD + IT + E2E + ATDD + Contracts) | `.feature` + `.test.*` + `.it.test.*` + `.e2e.test.*` + `.md` + `.json` |
|
|
26
|
+
| `bdd` | 僅生成 BDD 場景 | `.feature` |
|
|
27
|
+
| `tdd` | 僅生成 TDD 骨架 | `.test.*` |
|
|
28
|
+
| `it` | 生成整合測試骨架 | `.it.test.*` |
|
|
29
|
+
| `e2e` | 生成 E2E 測試骨架 | `.e2e.test.*` |
|
|
30
|
+
| `atdd` | 生成 ATDD 測試表格 | `.md`(Markdown 表格) |
|
|
31
|
+
|
|
32
|
+
## 工作流程
|
|
33
|
+
|
|
34
|
+
1. **讀取 Spec** — 分析輸入的 `SPEC-XXX.md` 檔案
|
|
35
|
+
2. **抽取 AC** — 解析所有驗收條件
|
|
36
|
+
3. **生成工件** — 建立 BDD / TDD / ATDD 輸出
|
|
37
|
+
4. **驗證** — 確認 AC 與生成項目為一對一對應
|
|
38
|
+
|
|
39
|
+
## 防幻覺規則
|
|
40
|
+
|
|
41
|
+
| 規則 | 說明 |
|
|
42
|
+
|------|------|
|
|
43
|
+
| **1:1 對應** | 每個 AC 對應一個測試 / 場景 |
|
|
44
|
+
| **追溯性** | 所有工件都引用 Spec ID 與 AC ID |
|
|
45
|
+
| **不發明** | 不新增規格外的場景 |
|
|
46
|
+
|
|
47
|
+
## 產生工件標籤
|
|
48
|
+
|
|
49
|
+
| 標籤 | 含義 |
|
|
50
|
+
|------|------|
|
|
51
|
+
| `[Source]` | 直接來自規格的內容 |
|
|
52
|
+
| `[Derived]` | 從來源轉換而來 |
|
|
53
|
+
| `[Generated]` | AI 生成的結構 |
|
|
54
|
+
| `[TODO]` | 需人工實作 |
|
|
55
|
+
|
|
56
|
+
## 使用方式
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
/derive all specs/SPEC-001.md - 完整推演管線
|
|
60
|
+
/derive bdd specs/SPEC-001.md - 僅推演 BDD 場景
|
|
61
|
+
/derive tdd specs/SPEC-001.md - 僅推演 TDD 骨架
|
|
62
|
+
/derive it specs/SPEC-001.md - 推演整合測試骨架
|
|
63
|
+
/derive e2e specs/SPEC-001.md - 推演 E2E 測試骨架
|
|
64
|
+
/derive atdd specs/SPEC-001.md - 推演 ATDD 表格
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 下一步引導
|
|
68
|
+
|
|
69
|
+
`/derive` 完成後,AI 助手應建議:
|
|
70
|
+
|
|
71
|
+
> **測試工件已產生。建議下一步:**
|
|
72
|
+
> - 執行 `/tdd` 開始紅綠重構循環 ⭐ **推薦**
|
|
73
|
+
> - 執行 `/bdd` 細化 Gherkin 場景
|
|
74
|
+
> - 檢查產生的 `[TODO]` 標記並補齊實作
|
|
75
|
+
|
|
76
|
+
## 參考
|
|
77
|
+
|
|
78
|
+
- 詳細指南:[guide.md](./guide.md)
|
|
79
|
+
- 核心標準:[forward-derivation-standards.md](../../../../core/forward-derivation-standards.md)
|
|
80
|
+
|
|
81
|
+
## AI 代理行為
|
|
82
|
+
|
|
83
|
+
> 完整的 AI 行為定義請參閱對應的命令文件:[`/derive`](../../../../skills/commands/derive.md#ai-agent-behavior--ai-代理行為)
|