universal-dev-standards 5.13.3 → 5.15.1

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 (71) hide show
  1. package/bin/uds.js +2 -0
  2. package/bundled/ai/standards/ai-instruction-standards.ai.yaml +190 -3
  3. package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +83 -0
  4. package/bundled/core/ai-instruction-standards.md +136 -11
  5. package/bundled/core/knowledge-graph-memory.md +119 -0
  6. package/bundled/locales/COVERAGE.md +226 -0
  7. package/bundled/locales/zh-CN/CHANGELOG.md +43 -3
  8. package/bundled/locales/zh-CN/README.md +1 -1
  9. package/bundled/locales/zh-CN/SECURITY.md +1 -1
  10. package/bundled/locales/zh-CN/core/ai-instruction-standards.md +111 -5
  11. package/bundled/locales/zh-TW/CHANGELOG.md +47 -3
  12. package/bundled/locales/zh-TW/README.md +1 -1
  13. package/bundled/locales/zh-TW/SECURITY.md +1 -1
  14. package/bundled/locales/zh-TW/core/ai-instruction-standards.md +130 -5
  15. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +127 -0
  16. package/bundled/locales/zh-TW/core/self-review-protocol.md +9 -1
  17. package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +192 -0
  18. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +5 -1
  19. package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +187 -0
  20. package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +108 -0
  21. package/bundled/locales/zh-TW/skills/journey-test-assistant/SKILL.md +222 -0
  22. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +56 -0
  23. package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +172 -0
  24. package/bundled/locales/zh-TW/skills/plan/SKILL.md +239 -0
  25. package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +5 -1
  26. package/bundled/locales/zh-TW/skills/push/SKILL.md +241 -0
  27. package/bundled/locales/zh-TW/skills/skill-builder/SKILL.md +165 -0
  28. package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +83 -0
  29. package/bundled/locales/zh-TW/skills/sweep/SKILL.md +149 -0
  30. package/bundled/skills/adr-assistant/SKILL.md +1 -1
  31. package/bundled/skills/ai-collaboration-standards/SKILL.md +1 -1
  32. package/bundled/skills/ai-friendly-architecture/SKILL.md +1 -1
  33. package/bundled/skills/ai-instruction-standards/SKILL.md +1 -1
  34. package/bundled/skills/api-design-assistant/SKILL.md +1 -1
  35. package/bundled/skills/audit-assistant/SKILL.md +1 -1
  36. package/bundled/skills/ci-cd-assistant/SKILL.md +1 -1
  37. package/bundled/skills/contract-test-assistant/SKILL.md +1 -1
  38. package/bundled/skills/database-assistant/SKILL.md +1 -1
  39. package/bundled/skills/deploy-assistant/SKILL.md +1 -1
  40. package/bundled/skills/documentation-guide/SKILL.md +1 -1
  41. package/bundled/skills/error-code-guide/SKILL.md +1 -1
  42. package/bundled/skills/git-workflow-guide/SKILL.md +1 -1
  43. package/bundled/skills/incident-response-assistant/SKILL.md +1 -1
  44. package/bundled/skills/journey-test-assistant/SKILL.md +1 -1
  45. package/bundled/skills/knowledge-graph/SKILL.md +58 -0
  46. package/bundled/skills/knowledge-graph/guide.md +69 -0
  47. package/bundled/skills/logging-guide/SKILL.md +1 -1
  48. package/bundled/skills/observability-assistant/SKILL.md +1 -1
  49. package/bundled/skills/orchestrate/SKILL.md +1 -1
  50. package/bundled/skills/plan/SKILL.md +1 -1
  51. package/bundled/skills/pr-automation-assistant/SKILL.md +1 -1
  52. package/bundled/skills/project-structure-guide/SKILL.md +1 -1
  53. package/bundled/skills/push/SKILL.md +1 -1
  54. package/bundled/skills/retrospective-assistant/SKILL.md +1 -1
  55. package/bundled/skills/reverse-engineer/SKILL.md +1 -1
  56. package/bundled/skills/runbook-assistant/SKILL.md +1 -1
  57. package/bundled/skills/security-assistant/SKILL.md +1 -1
  58. package/bundled/skills/security-scan-assistant/SKILL.md +1 -1
  59. package/bundled/skills/slo-assistant/SKILL.md +1 -1
  60. package/bundled/skills/sweep/SKILL.md +1 -1
  61. package/bundled/skills/testing-guide/SKILL.md +1 -1
  62. package/package.json +1 -1
  63. package/src/commands/check.js +91 -1
  64. package/src/commands/init.js +8 -1
  65. package/src/commands/update.js +49 -14
  66. package/src/i18n/messages.js +32 -5
  67. package/src/installers/skills-installer.js +49 -0
  68. package/src/lint/i18n.js +338 -0
  69. package/src/utils/config-manager.js +39 -0
  70. package/src/utils/skills-installer.js +39 -7
  71. package/standards-registry.json +16 -4
@@ -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,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-代理行為)
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: sweep
3
+ source: ../../../../skills/sweep/SKILL.md
4
+ source_version: 1.0.0
5
+ translation_version: 1.0.0
6
+ last_synced: 2026-05-28
7
+ scope: universal
8
+ description: |
9
+ [UDS] 掃描程式庫的除錯殘留與程式碼品質問題;可自動修正安全模式。
10
+ Use when: before committing, during PR review, or periodic codebase cleanup.
11
+ Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 掃描, 清理.
12
+ allowed-tools: Read, Grep, Glob, Bash(find:*), Edit, Write
13
+ argument-hint: "[--fix] [--report] [--path <dir>] [--exclude <pattern>]"
14
+ ---
15
+
16
+ # 掃碼助手
17
+
18
+ > **語言**: [English](../../../../skills/sweep/SKILL.md) | 繁體中文
19
+
20
+ 掃描程式庫的除錯殘留、程式碼品質問題與技術債標記。
21
+ 可選擇性自動修正安全模式(console.log、debugger 等語句)。
22
+
23
+ ---
24
+
25
+ ## 掃描模式
26
+
27
+ | Pattern ID | 名稱 | 可自動修正 | 說明 |
28
+ |------------|------|-----------|------|
29
+ | `console-log` | console.log / console.debug / console.trace | ✅ 是 | 留在正式環境的除錯輸出 |
30
+ | `debugger` | debugger 語句 | ✅ 是 | 留在程式碼中的中斷點 |
31
+ | `todo-fixme` | TODO / FIXME / HACK / XXX | ❌ 僅回報 | 技術債標記 |
32
+ | `ts-any` | TypeScript `any` 型別 | ❌ 僅回報 | 型別安全違規 |
33
+
34
+ ---
35
+
36
+ ## 使用方式
37
+
38
+ ```bash
39
+ /sweep # 掃描目前目錄,回報發現
40
+ /sweep --fix # 掃描並自動修正可修復項目
41
+ /sweep --report # 掃描並將報告寫入 .uds/sweep-report.json
42
+ /sweep --path src/ # 掃描指定目錄
43
+ /sweep --exclude "**/*.test.ts" # 排除模式(glob)
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 執行工作流程
49
+
50
+ ### Step 1:搜尋檔案
51
+ 使用 Glob tool 找出目標路徑下所有原始碼檔案。
52
+ 預設排除:`node_modules/`、`dist/`、`.git/`、`*.min.js`、`coverage/`。
53
+
54
+ ### Step 2:逐 Pattern 掃描
55
+ 對每個 pattern 使用 Grep 在所有檔案中尋找比對結果。
56
+ 彙整發現:`{ file, line, column, pattern_id, label, fixable, content }`。
57
+
58
+ ### Step 3:回報發現
59
+ 輸出結構化摘要:
60
+ ```
61
+ 📊 掃描結果
62
+ ─────────────────────────────────────
63
+ console-log: 12 筆 (可自動修正)
64
+ debugger: 2 筆 (可自動修正)
65
+ todo-fixme: 28 筆 (僅回報)
66
+ ts-any: 5 筆 (僅回報)
67
+ ─────────────────────────────────────
68
+ 合計:47 筆 | 可修正:14 筆
69
+ ```
70
+
71
+ ### Step 4:HITL 閘門(--fix 且發現數 > 20)
72
+ 若設定 `--fix` **且**可修正發現總數超過 20:
73
+ **暫停並要求使用者明確確認**才套用修正。
74
+ 顯示將被修改的檔案清單。
75
+
76
+ ### Step 5:套用修正(確認 --fix 後)
77
+ 對每筆可修正發現:
78
+ - `console-log`:若該行僅含 console 語句則刪除該行
79
+ - `debugger`:若該行僅含 debugger 語句則刪除該行
80
+
81
+ 使用 Edit tool 逐檔套用變更。
82
+ 回報:「已修正 N 筆,影響 M 個檔案。」
83
+
84
+ ### Step 6:儲存報告(--report)
85
+ 將發現寫入 `.uds/sweep-report.json`:
86
+ ```json
87
+ {
88
+ "timestamp": "<ISO8601>",
89
+ "total_findings": 47,
90
+ "fixable": 14,
91
+ "fixed": 14,
92
+ "findings_by_pattern": { "console-log": 12, "debugger": 2, "todo-fixme": 28, "ts-any": 5 },
93
+ "files_modified": ["src/auth.ts", "src/utils.ts"]
94
+ }
95
+ ```
96
+
97
+ ---
98
+
99
+ ## 設定
100
+
101
+ 透過 `uds.project.yaml` 設定:
102
+
103
+ ```yaml
104
+ sweep:
105
+ default_path: "src/"
106
+ exclude_patterns:
107
+ - "**/*.test.ts"
108
+ - "**/*.spec.ts"
109
+ - "**/fixtures/**"
110
+ hitl_threshold: 20 # 可修正項目超過此值時需確認
111
+ patterns:
112
+ enabled:
113
+ - console-log
114
+ - debugger
115
+ - todo-fixme
116
+ - ts-any
117
+ ```
118
+
119
+ ---
120
+
121
+ ## 下一步引導
122
+
123
+ `/sweep` 完成後建議:
124
+
125
+ > - 執行 `/checkin` 在提交前驗證整體程式碼品質
126
+ > - 執行 `/review` 審查清理後的變更
127
+ > - 執行 `/commit` 提交修正
128
+
129
+ ---
130
+
131
+ ## 相關標準
132
+
133
+ - [Checkin Standards](../../../../.standards/checkin-standards.ai.yaml) — Pre-commit 品質閘門
134
+ - [Code Review](../code-review-assistant/SKILL.md) — 程式碼審查助手
135
+ - [Testing Guide](../testing-guide/SKILL.md) — 測試標準
136
+
137
+ ---
138
+
139
+ ## 版本歷程
140
+
141
+ | 版本 | 日期 | 變更 |
142
+ |------|------|------|
143
+ | 1.0.0 | 2026-04-28 | 初始版本 — XSPEC-097 Phase 1(從上游遷移) |
144
+
145
+ ---
146
+
147
+ ## 授權
148
+
149
+ 本 Skill 採用 [MIT License](https://opensource.org/licenses/MIT) 與 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 雙重授權發布。
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  [UDS] Create, manage, and track Architecture Decision Records (ADR).
6
6
  Use when: architecture decisions, technology choices, design trade-offs, pattern selection.
7
- Keywords: ADR, architecture decision, decision record, trade-off, 架構決策, 決策記錄.
7
+ Keywords: ADR, architecture decision, decision record, trade-off.
8
8
  allowed-tools: Read, Write, Glob, Grep
9
9
  argument-hint: "[create | list | supersede ADR-NNN | 決策主題]"
10
10
  ---
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Prevent AI hallucination and ensure evidence-based responses when analyzing code or making suggestions.
6
6
  Use when: analyzing code, making recommendations, providing options, or when user asks about confidence/certainty.
7
- Keywords: certainty, assumption, inference, evidence, source, 確定性, 推測, 假設, 來源, 證據.
7
+ Keywords: certainty, assumption, inference, evidence, source.
8
8
  ---
9
9
 
10
10
  # AI Collaboration Standards
@@ -4,7 +4,7 @@ scope: uds-specific
4
4
  description: |
5
5
  Design AI-friendly architecture with explicit patterns, layered documentation, and semantic boundaries.
6
6
  Use when: structuring projects for AI collaboration, optimizing codebase for AI analysis, setting up AI context.
7
- Keywords: architecture, AI-friendly, context, modules, documentation layers, .ai-context.yaml, 架構, AI 友善, 上下文.
7
+ Keywords: architecture, AI-friendly, context, modules, documentation layers, .ai-context.yaml.
8
8
  ---
9
9
 
10
10
  # AI-Friendly Architecture Guide
@@ -4,7 +4,7 @@ scope: partial
4
4
  description: |
5
5
  Create and maintain AI instruction files (CLAUDE.md, AGENTS.md, .cursor/rules/, etc.) with proper structure.
6
6
  Use when: creating AI instruction files, separating universal vs project-specific rules, configuring AI tools.
7
- Keywords: CLAUDE.md, AGENTS.md, cursorrules, windsurfrules, clinerules, AI instructions, system prompt, 指令檔案, AI 設定.
7
+ Keywords: CLAUDE.md, AGENTS.md, cursorrules, windsurfrules, clinerules, AI instructions, system prompt.
8
8
  ---
9
9
 
10
10
  # AI Instruction File Standards Guide
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide API design following REST, GraphQL, and gRPC best practices.
6
6
  Use when: designing APIs, reviewing endpoints, API versioning decisions.
7
- Keywords: API, REST, GraphQL, gRPC, endpoint, versioning, 介面設計.
7
+ Keywords: API, REST, GraphQL, gRPC, endpoint, versioning.
8
8
  allowed-tools: Read, Grep, Glob
9
9
  argument-hint: "[API endpoint or module | API 端點或模組]"
10
10
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: audit
3
3
  scope: universal
4
- description: "[UDS] UDS Health & Feedback System | UDS 健康檢查與回饋系統"
4
+ description: "[UDS] UDS Health & Feedback System"
5
5
  allowed-tools: Read, Grep, Glob, Bash(git log, uds audit)
6
6
  argument-hint: "[--health | --patterns | --friction | --report]"
7
7
  disable-model-invocation: true
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide CI/CD pipeline design, configuration, and optimization.
6
6
  Use when: setting up pipelines, optimizing build times, configuring deployment stages.
7
- Keywords: CI/CD, pipeline, GitHub Actions, deployment, build, 持續整合, 持續部署.
7
+ Keywords: CI/CD, pipeline, GitHub Actions, deployment, build.
8
8
  allowed-tools: Read, Grep, Glob
9
9
  argument-hint: "[pipeline config or stage | Pipeline 配置或階段]"
10
10
  ---
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  [UDS] Guide contract testing strategy for APIs and microservices.
6
6
  Use when: API contracts, microservices, consumer-driven testing, provider verification.
7
- Keywords: contract test, Pact, OpenAPI, consumer-driven, provider, 合約測試, API 合約.
7
+ Keywords: contract test, Pact, OpenAPI, consumer-driven, provider.
8
8
  allowed-tools: Read, Write, Glob, Grep
9
9
  argument-hint: "[verify | consumer | provider | 策略選擇]"
10
10
  ---
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide database design, migration, and query optimization.
6
6
  Use when: schema design, migration planning, query optimization, index strategy.
7
- Keywords: database, schema, migration, SQL, index, query, 資料庫, 遷移, 查詢.
7
+ Keywords: database, schema, migration, SQL, index, query.
8
8
  allowed-tools: Read, Grep, Glob
9
9
  argument-hint: "[schema or migration to review | 要審查的 schema 或遷移]"
10
10
  ---
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide reliable deployments without CI/CD platforms (GitHub Actions / GitLab CI).
6
6
  Use when: deploying to VPS, air-gapped servers, or environments without CI/CD infrastructure.
7
- Keywords: deployment, no-cicd, shell script, blue-green, smoke test, rollback, 無CI/CD, 部署.
7
+ Keywords: deployment, no-cicd, shell script, blue-green, smoke test, rollback.
8
8
  allowed-tools: Read, Bash(cat VERSION:*), Bash(git describe:*), Bash(which nginx:*), Bash(which rsync:*)
9
9
  argument-hint: "[project type | 專案類型: node/python/docker/go]"
10
10
  ---
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide documentation structure, content requirements, and project documentation best practices.
6
6
  Use when: creating README, documentation, docs folder, project setup, technical docs.
7
- Keywords: README, docs, documentation, CONTRIBUTING, CHANGELOG, ARCHITECTURE, API docs, 文件, 說明文件, 技術文件.
7
+ Keywords: README, docs, documentation, CONTRIBUTING, CHANGELOG, ARCHITECTURE, API docs.
8
8
  ---
9
9
 
10
10
  # Documentation Guide
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Design consistent error codes following the PREFIX_CATEGORY_NUMBER format.
6
6
  Use when: defining error codes, creating error handling, designing APIs.
7
- Keywords: error code, error handling, error format, API errors, 錯誤碼, 錯誤處理.
7
+ Keywords: error code, error handling, error format, API errors.
8
8
  ---
9
9
 
10
10
  # Error Code Guide
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide Git branching strategies, branch naming, and merge operations.
6
6
  Use when: creating branches, merging, pull requests, Git workflow questions.
7
- Keywords: branch, merge, PR, pull request, GitFlow, GitHub Flow, 分支, 合併, 工作流程.
7
+ Keywords: branch, merge, PR, pull request, GitFlow, GitHub Flow.
8
8
  ---
9
9
 
10
10
  # Git Workflow Guide
@@ -4,7 +4,7 @@ scope: universal
4
4
  description: |
5
5
  Guide incident response, root cause analysis, and post-mortem documentation.
6
6
  Use when: production incident, outage response, post-mortem writing, RCA.
7
- Keywords: incident, outage, post-mortem, RCA, root cause, 事故, 故障, 根因分析.
7
+ Keywords: incident, outage, post-mortem, RCA, root cause.
8
8
  allowed-tools: Read, Write, Grep, Glob
9
9
  argument-hint: "[incident description or severity | 事故描述或嚴重程度]"
10
10
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: journey-test-assistant
3
3
  scope: partial
4
- description: "[UDS] 從專案描述生成連貫使用者旅程測試計畫(TESTPLAN)與 E2E 骨架"
4
+ description: "[UDS] Generate coherent user journey test plans (TESTPLAN) and E2E skeletons from project description."
5
5
  allowed-tools: Read, Write, Grep, Glob
6
6
  argument-hint: "[project description | --analyze | --archetype A1|A2|A3]"
7
7
  status: stable
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: knowledge-graph
3
+ scope: partial
4
+ description: "[UDS] Trace spec/decision/code impact chains via a knowledge graph (engine or Markdown fallback)"
5
+ allowed-tools: Read, Glob, Grep, Bash(curl:*)
6
+ argument-hint: "[artifact id, e.g. XSPEC-205 | 產物 id]"
7
+ ---
8
+
9
+ # Knowledge Graph | 知識圖
10
+
11
+ > **Language**: English | [繁體中文](../../locales/zh-TW/skills/knowledge-graph/SKILL.md)
12
+
13
+ Answer structural questions across specs, decisions, and code — *"what is the full impact chain of XSPEC-205?"* — using the [Knowledge Graph Memory](../../core/knowledge-graph-memory.md) relationship schema. Works with or without a graph engine.
14
+
15
+ 回答橫跨規格、決策與程式碼的結構性問題——*「XSPEC-205 的完整影響鏈是什麼?」*——依據[知識圖記憶標準](../../core/knowledge-graph-memory.md)的關係 schema。有無圖引擎皆可運作。
16
+
17
+ > **Implements**: XSPEC-237 Phase 5 — knowledge-graph skill (CodeSage opt-in)
18
+
19
+ ## Mode Selection | 模式選擇
20
+
21
+ Detect which mode to use **before** answering:
22
+
23
+ | Condition | Mode |
24
+ |-----------|------|
25
+ | `CODESAGE_URL` set, or a local graph engine responds on `/health` | Service mode (engine) |
26
+ | Otherwise | Degraded mode (Markdown) |
27
+
28
+ ## Workflow | 工作流程
29
+
30
+ 1. **Resolve the target** — normalise the argument to a canonical id (`XSPEC-205`, `DEC-062`, a function name).
31
+ 2. **Choose mode** — probe for a graph engine (service) else fall back (degraded).
32
+ 3. **Service mode (AC-5b)** — issue a single multi-hop query and present the returned chain, including cross-domain links (code → spec → decision):
33
+ ```bash
34
+ curl -s -X POST "$CODESAGE_URL/graph/impact-analysis" \
35
+ -H 'content-type: application/json' \
36
+ -d '{"nodeId":"XSPEC-205","maxHops":3}'
37
+ ```
38
+ 4. **Degraded mode (AC-5a)** — with no engine, read the target document, follow its `impacts`/`impacted_by`/`supersedes`/`related` front-matter and inline `[[ref]]` links by reading the linked files, and assemble the chain manually (bounded by reading depth).
39
+ 5. **Present the chain** — list the connected Specs and Decisions, the edge type for each hop, and (if present) each node's `confidence`, highest first.
40
+ 6. **State the mode used** — always say whether the answer came from the engine or Markdown fallback, so completeness is clear.
41
+
42
+ ## Relationship Schema | 關係 schema
43
+
44
+ See [knowledge-graph-memory](../../core/knowledge-graph-memory.md). Front-matter fields: `related`, `impacts`, `impacted_by`, `supersedes`, `implements`. Edge derivation: Decision `impacts` Spec → IMPACTS; Decision `supersedes` Decision → SUPERSEDES.
45
+
46
+ 關係欄位與邊推導見[知識圖記憶標準](../../core/knowledge-graph-memory.md)。
47
+
48
+ ## Next Steps Guidance | 下一步引導
49
+
50
+ - If degraded mode hit a reading-depth limit, tell the user a graph engine (e.g. CodeSage) would give a complete chain, and how to set `CODESAGE_URL`.
51
+ - If a referenced id was not found, surface it as a dangling reference to fix.
52
+ - Offer to add missing `impacts`/`impacted_by` front-matter to the documents you traversed.
53
+
54
+ ## Reference | 參考
55
+
56
+ - Standard: [core/knowledge-graph-memory.md](../../core/knowledge-graph-memory.md)
57
+ - Engine (opt-in): [CodeSage](https://github.com/AsiaOstrich/CodeSage) — `@asiaostrich/codesage`
58
+ - Detailed guide: [guide.md](guide.md)