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
@@ -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、运维、incident、on-call、演练、SOP、运维手册、演练。
13
+ ---
14
+
15
+ # Runbook Assistant
16
+
17
+ > **语言**:English | [繁體中文](../../locales/zh-TW/skills/runbook-assistant/SKILL.md)
18
+
19
+ **版本**:1.0.0
20
+ **最后更新**:2026-04-01
21
+ **适用范围**:Claude Code Skills
22
+
23
+ ---
24
+
25
+ ## 目的
26
+
27
+ 本 skill 帮助团队编写、组织和验证用于运维流程和 incident 响应的 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
+ | Skill | 整合点 | 说明 |
155
+ |-------|-------------------|-------------|
156
+ | `/observability --alerting` | 告警与 Runbook 关联 | 每条告警规则都应包含 `runbook_url` 注解 |
157
+ | `/incident` | 事后检讨到 Runbook 流程 | 事后检讨后:更新现有 runbook 或为新的故障模式创建新 runbook |
158
+ | `/slo` | 燃尽率告警 | 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
+ - incident 揭露了 runbook 的缺漏 → 更新该 runbook
171
+ - incident 是全新的故障模式 → 创建新的 runbook
172
+ - 将事后检讨链接到 runbook 的变更日志
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) - incident 后审查
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
+ 本 skill 以 [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,149 @@
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-06-02
7
+ source_hash: 5d91e5974c44
8
+ status: current
9
+ scope: universal
10
+ description: |
11
+ [UDS] 识别重复流程并以正确的开发深度构建 Skill
12
+ allowed-tools: Read, Glob, Grep, Write, Edit, Bash
13
+ argument-hint: "[process description | 流程描述]"
14
+ ---
15
+
16
+ # 流程转 Skill 助手
17
+
18
+ > **Language**: English | [繁體中文](../../locales/zh-TW/skills/process-automation/SKILL.md)
19
+
20
+ 引导你从「我一直在手动做这件事」走到「拥有一个正确构建的 Skill」,并在这一过程中保持适量的流程治理。
21
+
22
+ ## 何时使用
23
+
24
+ - 你已经用同样的多步骤流程手动执行 ≥ 3 次
25
+ - 同事第 3 次问你「我们是怎么做 X 的?」
26
+ - 你临时建了一个 Skill,现在想把它正式化
27
+
28
+ ## 核心原则
29
+
30
+ > Skill 记录的是**流程知识**。Memory 记录的是历史事实。
31
+ > 当你注意到自己重复执行相同的步骤时,那就是一个 Skill 候选。
32
+
33
+ ## 决策树
34
+
35
+ ```
36
+ New Skill needed?
37
+ ├── Modifying existing Skill?
38
+ │ → Delta path: append ## MODIFIED / ## ADDED to existing SKILL.md
39
+ │ update version field → done
40
+
41
+ ├── Answer these 4 questions (any "yes" → Complex):
42
+ │ 1. More than 7 steps?
43
+ │ 2. Branching logic between steps (if/else)?
44
+ │ 3. Requires knowledge from 3+ separate standards/decisions?
45
+ │ 4. Output directly affects sub-project source code?
46
+
47
+ ├── All "no" → Simple path
48
+ │ → Fill Skill Brief (templates/SKILL-BRIEF-TEMPLATE.md)
49
+ │ → Create SKILL.md directly (no XSPEC needed)
50
+
51
+ └── Any "yes" → Complex path
52
+ → Create XSPEC first → run /sdd
53
+ → Return here after XSPEC Approved
54
+
55
+ Deprecating a Skill?
56
+ → Add to SKILL.md frontmatter:
57
+ status: deprecated
58
+ deprecated_at: YYYY-MM-DD
59
+ deprecated_reason: "..."
60
+ superseded_by: "/new-skill" (if applicable)
61
+ → Mark archived in SKILL-CANDIDATES.md
62
+ ```
63
+
64
+ ## 摆放位置决策
65
+
66
+ 在创建 SKILL.md 前,先决定它应该放在哪里:
67
+
68
+ | 条件 | 摆放位置 |
69
+ |-----------|-----------|
70
+ | 步骤引用项目特定路径(如 TECH-RADAR.md、DEC-*.md) | 项目:`{project}/.claude/skills/` |
71
+ | 步骤为通用流程(无项目特定路径) | UDS:`skills/{name}/` + zh-TW locale |
72
+
73
+ ## 工作流程
74
+
75
+ ### Step 1 — 描述流程
76
+
77
+ 捕捉重复的步骤序列:
78
+ - 哪些步骤?按什么顺序?
79
+ - 目前手动执行过几次?
80
+ - 触及哪些工具或文件?
81
+
82
+ ### Step 2 — 更新 SKILL-CANDIDATES.md
83
+
84
+ 打开你项目的 `SKILL-CANDIDATES.md`(首次请从 `templates/SKILL-CANDIDATES.md` 复制):
85
+ - 尚未记录 → 新增一行,填入当前次数
86
+ - 已记录 → 增加次数
87
+ - 次数达到 3 → 标记 trigger ✅,继续执行
88
+
89
+ ### Step 3 — 选择路径(Simple / Complex / Delta)
90
+
91
+ 回答这 4 个判断问题。确定:Simple、Complex 或 Delta。
92
+
93
+ ### Step 4a — Simple:填写 Skill Brief
94
+
95
+ 使用 `templates/SKILL-BRIEF-TEMPLATE.md`:
96
+ - 触发情境(何时会用到?)
97
+ - 核心步骤(3 ~ 7 个,有顺序)
98
+ - 验收条件(2 ~ 3 条)
99
+ - 范围外(明确边界)
100
+
101
+ ### Step 4b — Complex:创建 XSPEC
102
+
103
+ 执行 `/sdd` 创建 XSPEC。XSPEC Approved 之后回到 Step 5。
104
+
105
+ ### Step 4c — Delta:识别变更范围
106
+
107
+ 识别现有 SKILL.md 中哪些区段需要变更。
108
+ 在文件末尾加入 `## MODIFIED Requirements` 或 `## ADDED Requirements`。
109
+
110
+ ### Step 5 — 创建 / 更新 SKILL.md
111
+
112
+ 依据 Brief 或 XSPEC 生成 SKILL.md:
113
+ - 确认 frontmatter:`name`、`scope`、`description`、`allowed-tools`
114
+ - UDS 通用 Skill:同步创建 zh-TW locale 版本
115
+ - 项目 Skill:放在 `{project}/.claude/skills/{name}/SKILL.md`
116
+
117
+ ### Step 6 — 更新 SKILL-CANDIDATES.md
118
+
119
+ 将候选行标记为:trigger ✅、Skill 列填写完成。
120
+
121
+ ### Step 7 — Commit
122
+
123
+ ```
124
+ feat(skills): Add /{skill-name} skill. 新增 /{skill-name} Skill。
125
+
126
+ {English description, 1-2 lines}
127
+
128
+ {Chinese description, 1-2 lines}
129
+
130
+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
131
+ ```
132
+
133
+ ## 输出检查清单
134
+
135
+ 完成所有步骤后,请确认:
136
+
137
+ - [ ] `SKILL-CANDIDATES.md` 已更新(trigger ✅、Skill 名称已填)
138
+ - [ ] `SKILL.md` 已创建并具备完整 frontmatter(`name` / `scope` / `description` / `allowed-tools`)
139
+ - [ ] Simple 路径:Skill Brief 已引用或保留
140
+ - [ ] Complex 路径:XSPEC ID 已记录在 SKILL.md header comment 中
141
+ - [ ] UDS skill:已创建 zh-TW locale 文件
142
+ - [ ] 棄用(Deprecated):frontmatter 含 `status: deprecated`
143
+ - [ ] git commit 已完成
144
+
145
+ ## 参考
146
+
147
+ - Skill Brief 模板:[templates/SKILL-BRIEF-TEMPLATE.md](../../templates/SKILL-BRIEF-TEMPLATE.md)
148
+ - 候选追踪:[templates/SKILL-CANDIDATES.md](../../templates/SKILL-CANDIDATES.md)(请复制到你的项目)
149
+ - 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、可靠性、burn rate、服务水准、错误预算。
13
+ ---
14
+
15
+ # SLO Assistant
16
+
17
+ > **语言**:English | [繁體中文](../../locales/zh-TW/skills/slo-assistant/SKILL.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,86 @@
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-06-02
7
+ source_hash: ae80ca14f9b9
8
+ status: current
9
+ scope: partial
10
+ description: |
11
+ [UDS] 从规格衍生 BDD 场景、TDD 骨架或 ATDD 表格
12
+ allowed-tools: Read, Write, Grep, Glob
13
+ argument-hint: "[all|bdd|tdd|it|e2e|atdd] <spec-file>"
14
+ prerequisites: ["spec-approved"]
15
+ disable-model-invocation: true
16
+ ---
17
+
18
+ # 正向推演
19
+
20
+ > **语言**: [English](../../../../skills/spec-derivation/SKILL.md) | 简体中文
21
+
22
+ 从已批准的 SDD 规格生成衍生工件(BDD 场景、TDD 骨架、ATDD 表格)。
23
+
24
+ ## 子命令
25
+
26
+ | 子命令 | 说明 | 输出 |
27
+ |--------|------|------|
28
+ | `all` | 完整推演管线(BDD + TDD + IT + E2E + ATDD + Contracts) | `.feature` + `.test.*` + `.it.test.*` + `.e2e.test.*` + `.md` + `.json` |
29
+ | `bdd` | 仅生成 BDD 场景 | `.feature` |
30
+ | `tdd` | 仅生成 TDD 骨架 | `.test.*` |
31
+ | `it` | 生成集成测试骨架 | `.it.test.*` |
32
+ | `e2e` | 生成 E2E 测试骨架 | `.e2e.test.*` |
33
+ | `atdd` | 生成 ATDD 测试表格 | `.md`(Markdown 表格) |
34
+
35
+ ## 工作流程
36
+
37
+ 1. **读取 Spec** — 分析输入的 `SPEC-XXX.md` 文件
38
+ 2. **抽取 AC** — 解析所有验收条件
39
+ 3. **生成工件** — 创建 BDD / TDD / ATDD 输出
40
+ 4. **验证** — 确认 AC 与生成项目为一对一对应
41
+
42
+ ## 防幻觉规则
43
+
44
+ | 规则 | 说明 |
45
+ |------|------|
46
+ | **1:1 对应** | 每个 AC 对应一个测试 / 场景 |
47
+ | **可追溯性** | 所有工件都引用 Spec ID 与 AC ID |
48
+ | **不发明** | 不新增规格外的场景 |
49
+
50
+ ## 产生工件标签
51
+
52
+ | 标签 | 含义 |
53
+ |------|------|
54
+ | `[Source]` | 直接来自规格的内容 |
55
+ | `[Derived]` | 从来源转换而来 |
56
+ | `[Generated]` | AI 生成的结构 |
57
+ | `[TODO]` | 需人工实现 |
58
+
59
+ ## 使用方式
60
+
61
+ ```
62
+ /derive all specs/SPEC-001.md - 完整推演管线
63
+ /derive bdd specs/SPEC-001.md - 仅推演 BDD 场景
64
+ /derive tdd specs/SPEC-001.md - 仅推演 TDD 骨架
65
+ /derive it specs/SPEC-001.md - 推演集成测试骨架
66
+ /derive e2e specs/SPEC-001.md - 推演 E2E 测试骨架
67
+ /derive atdd specs/SPEC-001.md - 推演 ATDD 表格
68
+ ```
69
+
70
+ ## 下一步引导
71
+
72
+ `/derive` 完成后,AI 助手应建议:
73
+
74
+ > **测试工件已生成。建议下一步:**
75
+ > - 执行 `/tdd` 开始红绿重构循环 ⭐ **推荐**
76
+ > - 执行 `/bdd` 细化 Gherkin 场景
77
+ > - 检查生成的 `[TODO]` 标记并补齐实现
78
+
79
+ ## 参考
80
+
81
+ - 详细指南:[guide.md](./guide.md)
82
+ - 核心标准:[forward-derivation-standards.md](../../../../core/forward-derivation-standards.md)
83
+
84
+ ## AI 代理行为
85
+
86
+ > 完整的 AI 行为定义请参阅对应的命令文件:[`/derive`](../../../../skills/commands/derive.md#ai-agent-behavior--ai-代理行为)