universal-dev-standards 5.15.1 → 5.17.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 (84) 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/core/spec-driven-development.md +21 -3
  8. package/bundled/locales/zh-CN/CHANGELOG.md +23 -3
  9. package/bundled/locales/zh-CN/README.md +1 -1
  10. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
  11. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
  12. package/bundled/locales/zh-CN/core/spec-driven-development.md +16 -2
  13. package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
  14. package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
  15. package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
  16. package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
  17. package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
  18. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
  19. package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
  20. package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
  21. package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
  22. package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
  23. package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
  24. package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
  25. package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
  26. package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
  27. package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
  28. package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
  29. package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
  30. package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
  31. package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
  32. package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
  33. package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
  34. package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
  35. package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
  36. package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
  37. package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
  38. package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
  39. package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
  40. package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
  41. package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
  42. package/bundled/locales/zh-TW/CHANGELOG.md +23 -3
  43. package/bundled/locales/zh-TW/README.md +1 -1
  44. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
  45. package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
  46. package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
  47. package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
  48. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
  49. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -2
  50. package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
  51. package/bundled/locales/zh-TW/core/spec-driven-development.md +20 -2
  52. package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
  53. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
  54. package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
  55. package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
  56. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
  57. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
  58. package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
  59. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
  60. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +5 -5
  61. package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
  62. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
  63. package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
  64. package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +3 -2
  65. package/bundled/locales/zh-TW/skills/plan/SKILL.md +3 -2
  66. package/bundled/locales/zh-TW/skills/push/SKILL.md +3 -2
  67. package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
  68. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
  69. package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
  70. package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
  71. package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
  72. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
  73. package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
  74. package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
  75. package/bundled/skills/brainstorm-assistant/guide.md +256 -661
  76. package/bundled/skills/commands/brainstorm.md +51 -30
  77. package/bundled/skills/knowledge-graph/SKILL.md +5 -5
  78. package/bundled/skills/knowledge-graph/guide.md +4 -4
  79. package/bundled/skills/spec-driven-dev/SKILL.md +27 -0
  80. package/package.json +2 -2
  81. package/src/commands/check.js +11 -2
  82. package/src/lint/i18n.js +109 -23
  83. package/standards-registry.json +4 -4
  84. package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
@@ -0,0 +1,188 @@
1
+ ---
2
+ source: ../../../../skills/observability-assistant/guide.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-06-02
6
+ source_hash: 760e3ec43846
7
+ status: current
8
+ scope: universal
9
+ description: |
10
+ 引導跨三大支柱的 observability 實作:Logs、Metrics 與 Traces。
11
+ 使用時機:建立監控、選擇 metric 類型、實作 tracing、評估成熟度。
12
+ 關鍵字:observability, metrics, traces, logs, golden signals, OpenTelemetry, 可觀測性, 監控。
13
+ ---
14
+
15
+ # Observability Assistant
16
+
17
+ > **語言**:[English](../../../../skills/observability-assistant/guide.md) | 繁體中文
18
+
19
+ **版本**:1.0.0
20
+ **最後更新**:2026-04-01
21
+ **適用範圍**:Claude Code Skills
22
+
23
+ ---
24
+
25
+ ## 用途
26
+
27
+ 本 skill 透過提供三大支柱(Logs、Metrics、Traces)、metric 類型選擇、Golden Signals 監控與成熟度自我評估的指引,協助團隊建構可觀測的系統。
28
+
29
+ ---
30
+
31
+ ## 快速參考(YAML 壓縮版)
32
+
33
+ ```yaml
34
+ # === THREE PILLARS 三大支柱 ===
35
+ three_pillars:
36
+ logs:
37
+ captures: "Discrete events with context / 帶上下文的離散事件"
38
+ use_for: "Debugging, audit trails, error details"
39
+ granularity: "High (per-event)"
40
+ metrics:
41
+ captures: "Numerical measurements over time / 隨時間變化的數值量測"
42
+ use_for: "Dashboards, alerting, capacity planning"
43
+ granularity: "Low (aggregated)"
44
+ traces:
45
+ captures: "Request flow across services / 跨服務的請求流"
46
+ use_for: "Latency analysis, dependency mapping"
47
+ granularity: "Medium (per-request)"
48
+
49
+ correlation:
50
+ metric_to_trace: "Use Exemplars to link anomalous metric → specific trace"
51
+ trace_to_logs: "Use trace_id + span_id embedded in logs"
52
+ logs_to_metric: "Aggregate log patterns into metrics (e.g., error rate)"
53
+ key_fields: ["trace_id", "service.name"]
54
+
55
+ # === METRIC TYPES 指標類型 ===
56
+ metric_types:
57
+ counter:
58
+ behavior: "Monotonically increasing (resets on restart) / 只增不減"
59
+ examples: ["request count", "error count", "bytes sent"]
60
+ gauge:
61
+ behavior: "Point-in-time value, can go up or down / 當前值,可升可降"
62
+ examples: ["temperature", "queue depth", "active connections"]
63
+ histogram:
64
+ behavior: "Distribution across buckets / 跨桶分布"
65
+ examples: ["request duration", "response size"]
66
+ summary:
67
+ behavior: "Client-computed percentiles / 客戶端計算百分位"
68
+ examples: ["legacy systems needing client-side quantiles"]
69
+
70
+ metric_type_decision:
71
+ only_goes_up: "→ Counter"
72
+ need_distribution: "→ Histogram"
73
+ current_state_value: "→ Gauge"
74
+ legacy_client_percentiles: "→ Summary"
75
+
76
+ naming: "<domain>.<entity>.<action>.<unit>"
77
+ # e.g., http.server.request.duration.seconds
78
+
79
+ # === GOLDEN SIGNALS 黃金信號 ===
80
+ golden_signals:
81
+ latency:
82
+ what: "Request duration P50/P95/P99 / 請求延遲"
83
+ metric: "http.server.request.duration.seconds"
84
+ alert: "P99 > threshold sustained 5 min"
85
+ traffic:
86
+ what: "Requests per second (RPS) / 每秒請求數"
87
+ metric: "http.server.request.total (Counter, rate)"
88
+ alert: "Sudden drop >50% or spike >200%"
89
+ errors:
90
+ what: "Error rate = 5xx / total / 錯誤率"
91
+ metric: "http.server.request.total{status=~'5..'}"
92
+ alert: "Error rate > X% sustained 5 min"
93
+ saturation:
94
+ what: "Resource utilization / 資源飽和度"
95
+ metrics: ["system.cpu.utilization", "system.memory.utilization", "db.client.connection.pool.usage"]
96
+ alert: "Resource > 80% sustained 10 min"
97
+
98
+ # === MATURITY MODEL 成熟度模型 ===
99
+ maturity:
100
+ L0_no_observability:
101
+ characteristics: "No structured logs; debugging via SSH + tail -f / 無結構化日誌"
102
+ upgrade: "Implement structured logging; centralize collection"
103
+ L1_basic_logging:
104
+ characteristics: "Structured JSON logs; centralized; basic search / 結構化日誌+集中收集"
105
+ upgrade: "Add business metrics; create first dashboard"
106
+ L2_metrics_driven:
107
+ characteristics: "Logs + Metrics; dashboards; basic alerting / 日誌+指標+儀表板"
108
+ upgrade: "Enable distributed tracing; SLO-based alerting"
109
+ L3_full_observability:
110
+ characteristics: "All three pillars; correlation; SLO alerts; Golden Signals / 三支柱完整"
111
+ upgrade: "Add anomaly detection; auto-remediation"
112
+ L4_intelligent:
113
+ characteristics: "AIOps; predictive alerting; automatic remediation / 智慧化可觀測"
114
+ upgrade: "Maintain, optimize, share learnings"
115
+
116
+ self_assessment:
117
+ - "Can you find logs for a specific request across all services? (L1+)"
118
+ - "Can you view dashboards showing error rate and latency? (L2+)"
119
+ - "Can you trace a request from ingress to database and back? (L3+)"
120
+ - "Does your system auto-detect anomalies before users report? (L4)"
121
+
122
+ # === INSTRUMENTATION CHECKLIST 儀器化清單 ===
123
+ pre_production_checklist:
124
+ - "Structured logging enabled (JSON + trace_id)"
125
+ - "HTTP/gRPC entry metrics (count, duration histogram, error rate)"
126
+ - "Critical business operation custom metrics"
127
+ - "Distributed tracing enabled (sampling rate set, W3C headers)"
128
+ - "Health check endpoints (liveness + readiness)"
129
+ - "Dashboard covering Golden Signals"
130
+ - "Alert rules defined (SLO burn rate)"
131
+ - "Log retention configured"
132
+ - "Sensitive data excluded from logs/traces"
133
+ ```
134
+
135
+ ---
136
+
137
+ ## 與相關技能整合 / Integration with Related Skills
138
+
139
+ | Skill | 整合點 | 說明 |
140
+ |-------|-------------------|-------------|
141
+ | `/slo` | 以 SLO 為基礎的告警 | 以 metrics 作為 SLI 資料來源;burn rate 告警參照 Golden Signals |
142
+ | `/incident` | 事件診斷 | 三大支柱提供診斷資料;correlation 加速 MTTD/MTTR |
143
+ | `/observability --alerting` | 告警設計 | Golden Signals 引導告警規則建立 |
144
+
145
+ ---
146
+
147
+ ## 設定偵測
148
+
149
+ ### 偵測順序
150
+
151
+ 1. 檢查 `CONTRIBUTING.md` 是否有「Disabled Skills」段落
152
+ 2. 檢查 `CONTRIBUTING.md` 是否有「Observability Standards」段落
153
+ 3. 若未找到,**預設採用標準 observability 實務**
154
+
155
+ ---
156
+
157
+ ## 詳細指引
158
+
159
+ 完整標準請參閱:
160
+ - [Observability Standards](../../core/observability-standards.md)
161
+ - [Logging Standards](../../core/logging-standards.md)
162
+
163
+ ---
164
+
165
+ ## 相關標準
166
+
167
+ - [Observability Standards](../../core/observability-standards.md) - 核心標準
168
+ - [SLO Standards](../../core/slo-standards.md) - SLI/SLO/Error Budget
169
+ - [Alerting Standards](../../core/alerting-standards.md) - 告警設計
170
+ - [Performance Standards](../../core/performance-standards.md) - 效能目標
171
+ - [SLO Assistant](../slo-assistant/SKILL.md) - SLO 工作流程
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
+ 本 skill 以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 釋出。
187
+
188
+ **來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
@@ -2,8 +2,9 @@
2
2
  name: orchestrate
3
3
  source: ../../../../skills/orchestrate/SKILL.md
4
4
  source_version: 2.0.0
5
- translation_version: 1.0.0
6
- last_synced: 2026-05-28
5
+ translation_version: 2.0.0
6
+ last_synced: 2026-06-02
7
+ source_hash: 40e97479c7da
7
8
  scope: universal
8
9
  description: |
9
10
  [UDS] 以 Claude 原生 Agent tool 編排多任務執行計畫(DAG-based,無外部引擎)。
@@ -2,8 +2,9 @@
2
2
  name: plan
3
3
  source: ../../../../skills/plan/SKILL.md
4
4
  source_version: 2.0.0
5
- translation_version: 1.0.0
6
- last_synced: 2026-05-28
5
+ translation_version: 2.0.0
6
+ last_synced: 2026-06-02
7
+ source_hash: 6fbb1a1b8040
7
8
  scope: universal
8
9
  description: |
9
10
  [UDS] 從 Spec 文件、OpenSpec 變更或自由文字需求生成 plan.json。
@@ -2,8 +2,9 @@
2
2
  name: push
3
3
  source: ../../../../skills/push/SKILL.md
4
4
  source_version: 2.0.0
5
- translation_version: 1.0.0
6
- last_synced: 2026-05-28
5
+ translation_version: 2.0.0
6
+ last_synced: 2026-06-02
7
+ source_hash: b7812535483c
7
8
  scope: universal
8
9
  description: |
9
10
  [UDS] AI 輔助 git push 安全層:品質閘門 + 協作護欄。
@@ -2,17 +2,61 @@
2
2
  name: retrospective-assistant
3
3
  source: ../../../../skills/retrospective-assistant/SKILL.md
4
4
  source_version: 1.0.0
5
+ source_hash: 9c883f05ad7b
5
6
  translation_version: 1.0.0
6
- last_synced: 2026-03-26
7
+ last_synced: 2026-06-01
7
8
  status: current
8
- description: "[UDS] 引導結構化的團隊回顧,支援 Sprint Release 回顧"
9
+ description: "[UDS] 引導 Sprint Release 週期的結構化團隊回顧"
9
10
  ---
10
11
 
11
12
  # 回顧助手
12
13
 
13
14
  > **語言**: [English](../../../../skills/retrospective-assistant/SKILL.md) | 繁體中文
14
15
 
15
- 引導結構化的團隊回顧,識別改善機會並追蹤行動項目。
16
+ 引導結構化的團隊回顧,識別改善機會並追蹤行動項目。支援 Sprint 和 Release 回顧類型,提供多種引導技法。
17
+
18
+ ## 工作流程
19
+
20
+ ```
21
+ PREPARE ──► GATHER ──► ANALYZE ──► DECIDE ──► TRACK
22
+ 準備資料 蒐集意見 分析歸納 決定行動 追蹤落實
23
+ ```
24
+
25
+ ### 階段 1:PREPARE(準備)
26
+
27
+ 從 git log、指標和 issue tracker 蒐集數據作為討論基礎。
28
+
29
+ ### 階段 2:GATHER(蒐集)
30
+
31
+ 使用結構化技法蒐集團隊觀點。
32
+
33
+ ### 階段 3:ANALYZE(分析)
34
+
35
+ 分組歸納並識別模式。
36
+
37
+ ### 階段 4:DECIDE(決定)
38
+
39
+ 選出前 1-3 項改善作為行動項目。
40
+
41
+ ### 階段 5:TRACK(追蹤)
42
+
43
+ 檢視過去的行動項目並追蹤新項目。
44
+
45
+ ## 回顧類型
46
+
47
+ | 類型 | 時機 | 時長 | 焦點 |
48
+ |------|------|------|------|
49
+ | **Sprint** | 迭代結束 | 30-60 分鐘 | 流程、協作、工具 |
50
+ | **Release** | 發布之後 | 60-90 分鐘 | 品質、指標、跨團隊 |
51
+
52
+ ## 引導技法
53
+
54
+ | 技法 | 適用場景 | 結構 |
55
+ |------|---------|------|
56
+ | **Start-Stop-Continue** | 快速、預設 | 開始 / 停止 / 繼續 |
57
+ | **Starfish** | 細緻分析 | 更多 / 保持 / 減少 / 開始 / 停止 |
58
+ | **4Ls** | 團隊建立 | 喜歡 / 學到 / 缺少 / 渴望 |
59
+ | **Sailboat** | 視覺化、創意 | 風 / 錨 / 礁石 / 島嶼 |
16
60
 
17
61
  ## 指令
18
62
 
@@ -24,21 +68,43 @@ description: "[UDS] 引導結構化的團隊回顧,支援 Sprint 和 Release
24
68
  | `/retrospective actions` | 列出未完成行動項目 |
25
69
  | `/retrospective --technique starfish` | 使用指定技法 |
26
70
 
27
- ## 參考
71
+ ## 行動項目格式
28
72
 
29
- - 核心規範:[retrospective-standards.md](../../../../core/retrospective-standards.md)
30
- - 詳細指南:[guide.md](./guide.md)
73
+ | 欄位 | 說明 |
74
+ |------|------|
75
+ | **Action** | 具體描述 |
76
+ | **Owner** | 單一負責人 |
77
+ | **Due Date** | 預計完成日 |
78
+ | **Status** | Open → In Progress → Done |
31
79
 
80
+ ### 追蹤規則
32
81
 
33
- ## Next Steps Guidance | 下一步引導
82
+ 1. 每次回顧**開始**先檢視未完成項目
83
+ 2. 每次回顧最多 **3 項**行動項目
84
+ 3. 陳舊項目(超過 2 個循環未完成)須重新評估
85
+ 4. 每項須有**單一負責人**
34
86
 
35
- After `/retrospective` completes:
87
+ ## 存放
36
88
 
37
- > **Retrospective complete. Suggested next steps:**
38
- > - Commit the retrospective report: `/commit`
39
- > - Create ADRs for architectural decisions identified: `/adr`
40
- > - Track action items in your issue tracker
41
- > - Schedule next retrospective
89
+ ```
90
+ docs/retrospectives/
91
+ ├── RETRO-2026-03-15-sprint-12.md
92
+ ├── RETRO-2026-03-26-release-v5.1.0.md
93
+ └── README.md # 索引(選用)
94
+ ```
95
+
96
+ ## 與其他技能的整合
97
+
98
+ | 技能 | 整合方式 |
99
+ |------|---------|
100
+ | `/metrics` | 將指標數據引入 Release 回顧 |
101
+ | `/incident` | 事故後建議進行團隊回顧 |
102
+ | `/adr` | 識別架構問題時建議建立 ADR |
103
+ | `/commit` | 以 `docs(retro):` 提交回顧報告 |
104
+
105
+ ## 下一步引導
106
+
107
+ `/retrospective` 完成後:
42
108
 
43
109
  > **回顧完成。建議下一步:**
44
110
  > - 提交回顧報告:`/commit`
@@ -46,23 +112,23 @@ After `/retrospective` completes:
46
112
  > - 在 issue tracker 中追蹤行動項目
47
113
  > - 排定下次回顧
48
114
 
49
- ## AI Agent Behavior | AI 代理行為
115
+ ## AI 代理行為
50
116
 
51
- When `/retrospective` is invoked:
117
+ 當呼叫 `/retrospective` 時:
52
118
 
53
- 1. **Check type** — Sprint (default) or Release
54
- 2. **Gather data** Scan git log, check `docs/retrospectives/` for previous actions
55
- 3. **Guide technique** Use Start-Stop-Continue by default, or specified technique
56
- 4. **Generate report** Write to `docs/retrospectives/RETRO-YYYY-MM-DD-[type].md`
57
- 5. **Review past actions** Check previous retro for open action items
58
- 6. **Offer next steps** Show guidance above
119
+ 1. **確認類型** — Sprint(預設)或 Release
120
+ 2. **蒐集數據**掃描 git log,檢查 `docs/retrospectives/` 中過去的行動項目
121
+ 3. **引導技法**預設使用 Start-Stop-Continue,或使用指定技法
122
+ 4. **產生報告**寫入 `docs/retrospectives/RETRO-YYYY-MM-DD-[type].md`
123
+ 5. **檢視過去項目**檢查先前回顧中未完成的行動項目
124
+ 6. **提供下一步**顯示上方引導
59
125
 
60
- When `/retrospective actions` is invoked:
61
- 1. Scan `docs/retrospectives/` for all retro files
62
- 2. Parse action items from each
63
- 3. Display open/in-progress items as table
126
+ 當呼叫 `/retrospective actions` 時:
127
+ 1. 掃描 `docs/retrospectives/` 中所有回顧檔案
128
+ 2. 解析各檔案中的行動項目
129
+ 3. 以表格顯示未完成/進行中的項目
64
130
 
65
- ## Reference | 參考
131
+ ## 參考
66
132
 
67
- - Core Standard: [retrospective-standards.md](../../core/retrospective-standards.md)
68
- - Detailed Guide: [guide.md](./guide.md)
133
+ - 核心規範:[retrospective-standards.md](../../core/retrospective-standards.md)
134
+ - 詳細指南:[guide.md](./guide.md)
@@ -2,48 +2,94 @@
2
2
  name: reverse-engineer
3
3
  source: ../../../../skills/reverse-engineer/SKILL.md
4
4
  source_version: 1.2.0
5
+ source_hash: d543b24b2422
5
6
  translation_version: 1.2.0
6
- last_synced: 2026-02-10
7
+ last_synced: 2026-06-01
7
8
  status: current
8
- description: "[UDS] 將現有程式碼反向工程為規格文件、BDD 場景或 TDD 覆蓋率報告"
9
+ description: "[UDS] 系統考古——跨邏輯、資料、執行環境三維度反向工程程式碼"
9
10
  ---
10
11
 
11
12
  # 反向工程助手
12
13
 
13
14
  > **語言**: [English](../../../../skills/reverse-engineer/SKILL.md) | 繁體中文
14
15
 
15
- 將現有程式碼反向工程為規格文件、BDD 場景或 TDD 覆蓋率報告。
16
+ 系統考古框架:從三個維度反向工程既有系統——**邏輯**、**資料**、**執行環境**。
17
+
18
+ ## 三大維度
19
+
20
+ ```
21
+ ┌─────────────────────────────────────────────────────────┐
22
+ │ System Archeology Framework │
23
+ ├──────────┬──────────────┬────────────────────────────────┤
24
+ │ Logic │ Data │ Runtime │
25
+ │ (spec) │ (data) │ (runtime) │
26
+ ├──────────┼──────────────┼────────────────────────────────┤
27
+ │ APIs │ DB Schemas │ Logs & Error Patterns │
28
+ │ Modules │ ORMs/Models │ Config & Environment │
29
+ │ Flows │ Migrations │ Metrics & Performance │
30
+ │ Tests │ Seed Data │ Infra & Deployment │
31
+ └──────────┴──────────────┴────────────────────────────────┘
32
+ ```
16
33
 
17
34
  ## 子命令
18
35
 
19
- | 子命令 | 輸入 | 輸出 | 說明 |
20
- |--------|------|------|------|
21
- | `spec` | 程式碼檔案/目錄 | `SPEC-XXX.md` | 從程式碼提取規格 |
22
- | `bdd` | `SPEC-XXX.md` | `.feature` | 將 AC 轉為 Gherkin |
23
- | `tdd` | `.feature` | 覆蓋率報告 | 分析測試覆蓋率 |
36
+ | 子命令 | 維度 | 輸入 | 輸出 | 說明 |
37
+ |--------|------|------|------|------|
38
+ | *(無)* | 全部 | 專案根目錄 | 完整考古報告 | 三維度全面分析 |
39
+ | `spec` | 邏輯 | 程式碼檔案/目錄 | `SPEC-XXX.md` | 從程式碼提取規格 |
40
+ | `data` | 資料 | DB 結構、ORM、遷移檔 | 資料模型規格 | 分析資料模型與結構 |
41
+ | `runtime` | 執行環境 | 日誌、設定、指標 | 執行環境基準 | 分析執行環境基準 |
42
+ | `bdd` | — | `SPEC-XXX.md` | `.feature` | 將 AC 轉為 Gherkin |
43
+ | `tdd` | — | `.feature` | 覆蓋率報告 | 分析測試覆蓋率 |
44
+
45
+ ## 全面分析模式
46
+
47
+ 當 `/reverse` 在未帶子命令的情況下被呼叫時,依序執行全部三個維度:
48
+
49
+ 1. **資料(Data)** → 掃描結構、ORM、遷移檔
50
+ 2. **執行環境(Runtime)** → 分析日誌、設定、部署
51
+ 3. **邏輯(Logic / spec)** → 提取 API、流程、測試 → 產生 SPEC
52
+
53
+ 輸出:整合三個維度的 **系統考古報告(System Archeology Report)**。
24
54
 
25
- ## 工作流程
55
+ ## 維度詳情
26
56
 
27
- ### spec:程式碼轉規格
57
+ ### spec:邏輯維度(既有)
28
58
 
29
- 1. **掃描** - 讀取原始碼檔案,識別公開 API、資料流和業務邏輯
59
+ 1. **掃描** - 讀取原始碼檔案,識別公開 API、資料流與業務邏輯
30
60
  2. **分類** - 將每個發現標記為 `[Confirmed]`、`[Inferred]` 或 `[Unknown]`
31
61
  3. **結構化** - 整理為 SDD 規格格式,包含驗收條件
32
- 4. **引用來源** - 每個反向結果皆引用 `file:line` 來源參考
62
+ 4. **引用來源** - 每項反向結果皆以 `file:line` 引用來源
33
63
 
34
- ### bdd:規格轉 Gherkin
64
+ ### data:資料維度(新增)
35
65
 
36
- 1. **解析** - 讀取 SPEC-XXX.md 並提取驗收條件
37
- 2. **轉換** - 將每個 AC 對應為一個 Gherkin Scenario(1:1 對應)
38
- 3. **標記** - 加入 `@SPEC-XXX` `@AC-N` 標籤以確保可追溯性
39
- 4. **輸出** - 產生 `.feature` 檔案,包含 `# [Source: path:AC-N]` 註解
66
+ 1. **探索** - 找出資料庫結構、ORM 模型、遷移檔、種子資料
67
+ 2. **對應** - 從程式碼證據建立實體關聯模型
68
+ 3. **分類** - 將關聯標記為 `[Confirmed]`(FK 約束)或 `[Inferred]`(程式碼模式)
69
+ 4. **報告** - 輸出資料模型規格,包含:
70
+ - 含欄位與型別的實體清單
71
+ - 關聯對應(1:1、1:N、M:N)
72
+ - 索引與約束清單
73
+ - 遷移歷史摘要
74
+ - 資料流路徑(寫入 → 讀取)
40
75
 
41
- ### tdd:Feature 轉覆蓋率報告
76
+ **證據來源**:`schema.prisma`、`*.migration.*`、`models/`、`entities/`、`knexfile.*`、`sequelize`、`typeorm`、SQL 檔案、`docker-compose.yml`(DB 服務)
42
77
 
43
- 1. **解析** - 讀取 `.feature` 檔案中的場景
44
- 2. **搜尋** - 使用 Grep/Glob 尋找對應的測試檔案
45
- 3. **對應** - 將場景與現有單元測試進行配對
46
- 4. **報告** - 輸出覆蓋率矩陣(已覆蓋 / 缺失 / 部分覆蓋)
78
+ ### runtime:執行環境維度(新增)
79
+
80
+ 1. **掃描設定** - 環境變數、設定檔、功能旗標
81
+ 2. **分析日誌** - 日誌模式、錯誤頻率、日誌層級
82
+ 3. **檢查基礎設施** - Docker 設定、CI/CD 管線、部署清單
83
+ 4. **建立基準** - 輸出執行環境基準,包含:
84
+ - 環境變數清單(僅名稱,**絕不含值/密鑰**)
85
+ - 設定檔對應與階層
86
+ - 外部服務依賴(API、佇列、快取)
87
+ - 部署拓撲(容器、服務)
88
+ - 健康檢查與監控端點
89
+
90
+ **證據來源**:`.env.example`、`docker-compose.yml`、`Dockerfile`、`*.config.*`、CI/CD 檔案、`k8s/`、日誌檔案(僅模式)
91
+
92
+ **安全性**:絕不輸出實際密鑰值。僅列出變數名稱並描述其用途。
47
93
 
48
94
  ## 防幻覺規則
49
95
 
@@ -52,23 +98,33 @@ description: "[UDS] 將現有程式碼反向工程為規格文件、BDD 場景
52
98
  | **確定性標籤** | 所有發現須使用 `[Confirmed]`、`[Inferred]`、`[Unknown]` 標注 |
53
99
  | **來源引用** | 每項反向結果須引用 `file:line` 來源 |
54
100
  | **禁止捏造** | 不得捏造程式碼中不存在的 API 或行為 |
101
+ | **禁止密鑰** | 不得輸出設定檔或環境變數的密鑰值 |
55
102
 
56
103
  ## 使用方式
57
104
 
58
- - `/reverse spec src/auth/` - 從 auth 模組提取規格
59
- - `/reverse bdd specs/SPEC-AUTH.md` - 將規格 AC 轉為 Gherkin 場景
60
- - `/reverse tdd features/auth.feature` - 分析 feature 檔案的測試覆蓋率
105
+ ```
106
+ /reverse - 三維度全面分析
107
+ /reverse spec src/auth/ - 邏輯:提取規格
108
+ /reverse data - 資料:分析結構與模型
109
+ /reverse runtime - 執行環境:分析設定與基礎設施
110
+ /reverse bdd specs/SPEC-AUTH.md - 將規格 AC 轉為 Gherkin
111
+ /reverse tdd features/auth.feature - 分析測試覆蓋率
112
+ ```
61
113
 
62
114
  ## 下一步引導
63
115
 
64
116
  `/reverse`(完整或 `spec`)完成後,AI 助手應建議:
65
117
 
66
118
  > **系統考古完成。建議下一步:**
67
- > - 執行 `/sdd` 審查並核准此規格
68
- > - 執行 `/derive` 從規格推導測試
69
- > - 審查規格中的 `[Inferred]` 和 `[Unknown]` 標記
119
+ > - 執行 `/sdd` 審查並核准此規格 ⭐ **推薦** — 審查並核准產生的規格
120
+ > - 執行 `/derive` 從規格推導測試 — 從規格推導測試(須先核准)
121
+ > - 審查規格中的 `[Inferred]` 和 `[Unknown]` 標記 — 手動審查不確定性標籤
70
122
 
71
123
  ## 參考
72
124
 
73
125
  - 詳細指南:[guide.md](./guide.md)
74
126
  - 核心規範:[reverse-engineering-standards.md](../../../../core/reverse-engineering-standards.md)
127
+
128
+ ## AI 代理行為
129
+
130
+ > 完整的 AI 行為定義請參閱對應的命令文件:[`/reverse`](../commands/reverse.md#ai-agent-behavior--ai-代理行為)