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
|
@@ -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
|
---
|
|
@@ -6,9 +6,9 @@ argument-hint: "[problem or feature idea | 問題或功能構想]"
|
|
|
6
6
|
|
|
7
7
|
# Brainstorm Assistant | 腦力激盪助手
|
|
8
8
|
|
|
9
|
-
Structured ideation before specification writing. Transform vague ideas into actionable feature proposals through
|
|
9
|
+
Structured ideation before specification writing. Transform vague ideas into actionable feature proposals through a persona-ensemble brainstorm.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
在撰寫規格前進行結構化發想。透過 persona 集成式腦力激盪,將模糊構想轉化為可執行的功能提案。
|
|
12
12
|
|
|
13
13
|
## Usage | 用法
|
|
14
14
|
|
|
@@ -19,33 +19,37 @@ Structured ideation before specification writing. Transform vague ideas into act
|
|
|
19
19
|
## Workflow | 工作流程
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
FRAME ──► DIVERGE
|
|
23
|
-
定義問題
|
|
22
|
+
PRE-FLIGHT ──► FRAME ──► DIVERGE ──────────► CONVERGE ─────────► OUTPUT
|
|
23
|
+
防錨定 定義問題 persona 集成+透鏡 多評審面板+硬角色反駁 輸出提案
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
| Phase | Goal | Key Techniques | 目標 |
|
|
27
|
-
|
|
26
|
+
| Phase | Goal | Key Techniques (v3) | 目標 |
|
|
27
|
+
|-------|------|---------------------|------|
|
|
28
|
+
| **PRE-FLIGHT** | Prevent AI anchoring | User writes 3 ideas first; no analogy seed | 防止錨定 |
|
|
28
29
|
| **FRAME** | Define problem clearly | 5 Whys, HMW, Stakeholder Map | 清楚定義問題 |
|
|
29
|
-
| **DIVERGE** |
|
|
30
|
-
| **CONVERGE** |
|
|
30
|
+
| **DIVERGE** | Force viewpoint diversity | Persona ensemble + diversity lenses | 逼出視角多樣性 |
|
|
31
|
+
| **CONVERGE** | Bias-checked selection | Multi-critic panel + Devil's Advocate/Steelman | 降偏誤選擇 |
|
|
31
32
|
| **OUTPUT** | Actionable report | Brainstorm Report template | 可執行的報告 |
|
|
32
33
|
|
|
33
34
|
## Techniques | 技法
|
|
34
35
|
|
|
35
36
|
| Technique | Best For | 適用場景 |
|
|
36
37
|
|-----------|----------|----------|
|
|
37
|
-
| **
|
|
38
|
-
| **
|
|
39
|
-
| **
|
|
40
|
-
| **
|
|
41
|
-
| **
|
|
38
|
+
| **Persona ensemble** | Forced viewpoint diversity (v3 core) | 強制視角多樣性(v3 核心) |
|
|
39
|
+
| **Diversity lenses** | Analogical / reversal / morphological | 突破顯而易見區 |
|
|
40
|
+
| **Multi-critic panel** | Bias-reduced scoring (v3 core) | 降偏誤評分(v3 核心) |
|
|
41
|
+
| **Devil's Advocate + Steelman** | Hard-role rebuttal | 硬角色反駁 |
|
|
42
|
+
| **5 Whys / HMW / SCAMPER / Six Hats** | Classic framing & divergence | 經典框定與發散 |
|
|
42
43
|
|
|
43
44
|
## Examples | 範例
|
|
44
45
|
|
|
45
46
|
```bash
|
|
46
|
-
/brainstorm
|
|
47
|
-
/brainstorm "user retention"
|
|
48
|
-
/brainstorm --
|
|
47
|
+
/brainstorm # Start interactive session
|
|
48
|
+
/brainstorm "user retention" # Brainstorm around a topic
|
|
49
|
+
/brainstorm --enhanced "user retention" # Parallel persona ensemble (if host supports it)
|
|
50
|
+
/brainstorm --personas "designer,economist,skeptic" # Custom personas
|
|
51
|
+
/brainstorm --lens analogical "onboarding" # Force the analogical lens
|
|
52
|
+
/brainstorm --quick "reduce checkout friction" # Fast 3-idea mode
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
## Output Format | 輸出格式
|
|
@@ -57,9 +61,10 @@ FRAME ──► DIVERGE ──► CONVERGE ──► OUTPUT
|
|
|
57
61
|
[Refined problem from FRAME phase]
|
|
58
62
|
|
|
59
63
|
## Top 3 Recommendations
|
|
60
|
-
1. **[Idea]** —
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
1. **[Idea]** — Agg. X.X ✓ Passed rebuttal — Persona: [..] — [Why recommended]
|
|
65
|
+
|
|
66
|
+
## Diversity Note
|
|
67
|
+
[How many distinct personas/lenses the surviving ideas span]
|
|
63
68
|
|
|
64
69
|
## Next Steps
|
|
65
70
|
- [ ] Proceed to `/requirement` with top idea
|
|
@@ -83,26 +88,36 @@ After brainstorming, the typical workflow is:
|
|
|
83
88
|
|
|
84
89
|
| Input | AI Action |
|
|
85
90
|
|-------|-----------|
|
|
86
|
-
| `/brainstorm` |
|
|
87
|
-
| `/brainstorm "topic"` |
|
|
88
|
-
| `/brainstorm --
|
|
91
|
+
| `/brainstorm` | 啟動 PRE-FLIGHT,請使用者先寫 問題+3 想法+反向排除 |
|
|
92
|
+
| `/brainstorm "topic"` | 以指定主題啟動 PRE-FLIGHT,再進入 FRAME |
|
|
93
|
+
| `/brainstorm --personas "a,b,c"` | 以自訂 persona 組進入 DIVERGE |
|
|
94
|
+
| `/brainstorm --lens <name>` | 以指定多樣性透鏡為主進入 DIVERGE |
|
|
95
|
+
| `/brainstorm --enhanced` | 若宿主支援子代理則平行跑 persona/評審,否則靜默退回 baseline |
|
|
89
96
|
|
|
90
97
|
### Interaction Script | 互動腳本
|
|
91
98
|
|
|
99
|
+
#### PRE-FLIGHT Phase
|
|
100
|
+
1. 請使用者先寫 問題(一句)+3 個初始想法+最不想要的解法類型
|
|
101
|
+
2. 拒絕「像 X 但給 Y」種子,改寫為底層問題
|
|
102
|
+
|
|
103
|
+
🛑 **STOP**: 收到三項輸入前不生成任何想法(`--skip-preflight` 例外,顯示錨定警告)
|
|
104
|
+
|
|
92
105
|
#### FRAME Phase
|
|
93
|
-
1.
|
|
94
|
-
2.
|
|
106
|
+
1. 釐清問題陳述(5 Whys 找根因)
|
|
107
|
+
2. 重構為 HMW 問題;識別利害關係人
|
|
95
108
|
|
|
96
109
|
🛑 **STOP**: 問題定義後等待使用者確認
|
|
97
110
|
|
|
98
111
|
#### DIVERGE Phase
|
|
99
|
-
1.
|
|
100
|
-
2.
|
|
101
|
-
3.
|
|
112
|
+
1. 逐一以預設 persona(領域專家/懷疑者/跨域類比者/成本約束者/使用者代言)思維鏈生成想法
|
|
113
|
+
2. **分支隔離**:生成各 persona 時不互相預覽,全部產完才一起呈現
|
|
114
|
+
3. 至少套用一個多樣性透鏡(類比/假設反轉/形態矩陣)
|
|
115
|
+
4. 以多樣性(覆蓋的 persona/透鏡數)而非數量為繼續門檻
|
|
102
116
|
|
|
103
117
|
#### CONVERGE Phase
|
|
104
|
-
1.
|
|
105
|
-
2.
|
|
118
|
+
1. 以 3 個獨立評審(工程可行性/使用者影響/策略一致)各自評分後聚合
|
|
119
|
+
2. 對前 3 名跑硬角色 Devil's Advocate(論證會失敗)+ Steelman;使用者以 (a)修改/(b)反駁/(c)移除 回應
|
|
120
|
+
3. 排序並標記通過反駁的想法
|
|
106
121
|
|
|
107
122
|
🛑 **STOP**: 展示 Brainstorm Report 後等待使用者決定下一步
|
|
108
123
|
|
|
@@ -110,7 +125,9 @@ After brainstorming, the typical workflow is:
|
|
|
110
125
|
|
|
111
126
|
| Stop Point | 等待內容 |
|
|
112
127
|
|-----------|---------|
|
|
128
|
+
| PRE-FLIGHT 提交前 | 收到使用者三項輸入 |
|
|
113
129
|
| 問題定義後 | 確認問題正確 |
|
|
130
|
+
| 反駁輪每個反對理由 | 使用者 (a)/(b)/(c) 回應 |
|
|
114
131
|
| 報告展示後 | 決定進入 `/requirement` 或 `/sdd` |
|
|
115
132
|
|
|
116
133
|
### Error Handling | 錯誤處理
|
|
@@ -118,10 +135,14 @@ After brainstorming, the typical workflow is:
|
|
|
118
135
|
| Error Condition | AI Action |
|
|
119
136
|
|-----------------|-----------|
|
|
120
137
|
| 主題太廣泛 | 引導縮小範圍 |
|
|
121
|
-
|
|
|
138
|
+
| 使用「像 X 但給 Y」種子 | 改寫為底層問題再繼續(反種子 guardrail) |
|
|
139
|
+
| 指定的 persona/透鏡不存在 | 列出可用選項供選擇 |
|
|
140
|
+
| `--enhanced` 但宿主不支援子代理 | 靜默退回 baseline,照常進行 |
|
|
141
|
+
| 前 3 名全來自同一 persona/透鏡 | 標示並在輸出前再跑一個透鏡 |
|
|
122
142
|
|
|
123
143
|
## References | 參考
|
|
124
144
|
|
|
125
145
|
* [Brainstorm Assistant Skill](../brainstorm-assistant/SKILL.md)
|
|
146
|
+
* [Brainstorm Assistant Guide](../brainstorm-assistant/guide.md)
|
|
126
147
|
* [Requirement Assistant](../requirement-assistant/SKILL.md)
|
|
127
148
|
* [Spec-Driven Development](../spec-driven-dev/SKILL.md)
|
|
@@ -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
|
|
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
|
|
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]
|
|
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 (EngramGraph opt-in)
|
|
18
|
+
|
|
19
|
+
## Mode Selection | 模式選擇
|
|
20
|
+
|
|
21
|
+
Detect which mode to use **before** answering:
|
|
22
|
+
|
|
23
|
+
| Condition | Mode |
|
|
24
|
+
|-----------|------|
|
|
25
|
+
| `ENGRAM_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 "$ENGRAM_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. EngramGraph) would give a complete chain, and how to set `ENGRAM_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): [EngramGraph](https://github.com/AsiaOstrich/EngramGraph) — `engramgraph`
|
|
58
|
+
- Detailed guide: [guide.md](guide.md)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Knowledge Graph — Detailed Guide | 詳細指南
|
|
2
|
+
|
|
3
|
+
Companion to [SKILL.md](SKILL.md). Worked examples of both operating modes and the engine API.
|
|
4
|
+
|
|
5
|
+
[SKILL.md](SKILL.md) 的配套說明。兩種運作模式的範例與引擎 API。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Service Mode (graph engine) | 服務模式
|
|
10
|
+
|
|
11
|
+
When an EngramGraph-compatible engine is reachable, a single query returns the full chain.
|
|
12
|
+
|
|
13
|
+
### Impact analysis | 影響分析
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -s -X POST "$ENGRAM_URL/graph/impact-analysis" \
|
|
17
|
+
-H 'content-type: application/json' \
|
|
18
|
+
-d '{"nodeId":"XSPEC-205","maxHops":3}'
|
|
19
|
+
# => { "nodeId": "XSPEC-205",
|
|
20
|
+
# "decisions": [ {"id":"DEC-062","title":"...","via":"direct"},
|
|
21
|
+
# {"id":"DEC-069","title":"...","via":"supersedes"} ] }
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`via: "direct"` means the decision IMPACTS the spec directly; `via: "supersedes"` means it reaches the spec through a SUPERSEDES chain (≤ `maxHops`).
|
|
25
|
+
|
|
26
|
+
### Confidence feedback (SAGE) | 信心回饋
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
curl -s -X POST "$ENGRAM_URL/graph/ingest" \
|
|
30
|
+
-H 'content-type: application/json' \
|
|
31
|
+
-d '{"type":"test_fail","functionId":"src/a.ts#execute"}'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Lowers the node's confidence; reads then surface higher-confidence nodes first.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. Degraded Mode (Markdown only) | 降級模式
|
|
39
|
+
|
|
40
|
+
No engine required. Reconstruct the chain by reading files:
|
|
41
|
+
|
|
42
|
+
1. Read the target document (e.g. `XSPEC-205`).
|
|
43
|
+
2. Collect ids from its front-matter (`impacts`, `impacted_by`, `supersedes`, `related`) and inline `[[ref]]` links.
|
|
44
|
+
3. For each id, read that document and repeat up to the desired hop depth.
|
|
45
|
+
4. Classify each id by prefix (`XSPEC-*`/`SPEC-*` → Spec; `DEC-*`/`ADR-*` → Decision) and report the edges.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# find the documents
|
|
49
|
+
grep -rl "id: XSPEC-205" --include='*.md' .
|
|
50
|
+
# discover outbound references
|
|
51
|
+
grep -nE "(impacts|impacted_by|supersedes|related):|\[\[(XSPEC|DEC|ADR)-" path/to/XSPEC-205.md
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Degraded mode is always correct but bounded by how many files you read; cross-domain code links (function → spec) are usually only available in service mode.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 3. Equivalence | 等價性
|
|
59
|
+
|
|
60
|
+
Both modes produce the **same answer shape** (a list of connected Specs/Decisions with edge types). Service mode is faster and more complete (it can include code→spec→decision hops); degraded mode is the universal fallback. Always tell the user which mode produced the answer.
|
|
61
|
+
|
|
62
|
+
兩種模式產生**相同形狀的答案**。服務模式更快更完整;降級模式為通用後備。務必告知使用者答案來自哪種模式。
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Reference | 參考
|
|
67
|
+
|
|
68
|
+
- [core/knowledge-graph-memory.md](../../core/knowledge-graph-memory.md)
|
|
69
|
+
- [EngramGraph](https://github.com/AsiaOstrich/EngramGraph)
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Implement structured logging with proper log levels and sensitive data handling.
|
|
6
6
|
Use when: adding logging, debugging, setting up observability.
|
|
7
|
-
Keywords: logging, log level, structured logging, observability
|
|
7
|
+
Keywords: logging, log level, structured logging, observability.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Logging Guide
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide observability setup, metrics design, and alerting configuration.
|
|
6
6
|
Use when: new service instrumentation, SLO definition, alert design, maturity assessment.
|
|
7
|
-
Keywords: observability, metrics, traces, golden signals, alerting, SLO
|
|
7
|
+
Keywords: observability, metrics, traces, golden signals, alerting, SLO.
|
|
8
8
|
allowed-tools: Read, Write, Grep, Glob
|
|
9
9
|
argument-hint: "[service name or observability topic | 服務名稱或可觀測性主題]"
|
|
10
10
|
---
|
|
@@ -5,7 +5,7 @@ scope: universal
|
|
|
5
5
|
description: |
|
|
6
6
|
Orchestrate multi-task execution plans using Claude's native Agent tool (DAG-based, no external engine).
|
|
7
7
|
Use when: executing a plan.json file with parallel/sequential task dependencies.
|
|
8
|
-
Keywords: orchestrate, plan, execute, DAG, task plan
|
|
8
|
+
Keywords: orchestrate, plan, execute, DAG, task plan.
|
|
9
9
|
argument-hint: "<plan.json> [--dry-run]"
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ scope: universal
|
|
|
5
5
|
description: |
|
|
6
6
|
Generate plan.json from Spec documents, OpenSpec changes, or free-text requirements.
|
|
7
7
|
Use when: converting specifications into executable task plans for /orchestrate.
|
|
8
|
-
Keywords: plan, spec, task plan,
|
|
8
|
+
Keywords: plan, spec, task plan, plan.json, DAG.
|
|
9
9
|
argument-hint: "[spec-file.md | openspec-dir/ | \"requirement text\" | (interactive)]"
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide pull request creation, review automation, and merge strategies.
|
|
6
6
|
Use when: creating PRs, automating reviews, configuring merge policies.
|
|
7
|
-
Keywords: pull request, PR, merge, review, GitHub, GitLab
|
|
7
|
+
Keywords: pull request, PR, merge, review, GitHub, GitLab.
|
|
8
8
|
allowed-tools: Read, Grep, Glob, Bash(git:*, gh:*)
|
|
9
9
|
argument-hint: "[branch name or PR number | 分支名稱或 PR 編號]"
|
|
10
10
|
---
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide for organizing project directories following language-specific best practices.
|
|
6
6
|
Use when: creating projects, reorganizing structure, adding modules, setting up builds, deciding file placement.
|
|
7
|
-
Keywords: project, structure, directory, layout, gitignore, scaffold,
|
|
7
|
+
Keywords: project, structure, directory, layout, gitignore, scaffold, file placement, utils, helpers, shared, where to put.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Project Structure Guide
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
AI-assisted safety layer for git push operations with quality gates and collaboration guardrails.
|
|
6
6
|
Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches.
|
|
7
|
-
Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation
|
|
7
|
+
Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation.
|
|
8
8
|
allowed-tools: Read, Bash(git:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(bun:*)
|
|
9
9
|
argument-hint: "[--force] [--target <branch>] [--skip-gates] [--no-pr]"
|
|
10
10
|
---
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
[UDS] Guide structured team retrospectives for Sprint and Release cycles.
|
|
6
6
|
Use when: sprint end, release post-mortem, iteration review, process improvement.
|
|
7
|
-
Keywords: retrospective, retro, sprint review, lessons learned, action items
|
|
7
|
+
Keywords: retrospective, retro, sprint review, lessons learned, action items.
|
|
8
8
|
allowed-tools: Read, Write, Glob, Grep
|
|
9
9
|
argument-hint: "[sprint | release | actions | --technique starfish]"
|
|
10
10
|
---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reverse
|
|
3
3
|
scope: partial
|
|
4
|
-
description: "[UDS] System archeology
|
|
4
|
+
description: "[UDS] System archeology - reverse engineer code across Logic, Data, and Runtime dimensions"
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Bash(pg_dump:*), Bash(mysql:*), Bash(sqlite3:*), Bash(npm run:*), Bash(cat:*), Bash(docker:*)
|
|
6
6
|
argument-hint: "[spec|data|runtime|bdd|tdd] <input>"
|
|
7
7
|
disable-model-invocation: true
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide runbook creation, maintenance, and drill exercises.
|
|
6
6
|
Use when: writing runbooks, planning drills, auditing runbook coverage, post-incident runbook updates.
|
|
7
|
-
Keywords: runbook, operations, drill, on-call, procedure
|
|
7
|
+
Keywords: runbook, operations, drill, on-call, procedure.
|
|
8
8
|
allowed-tools: Read, Write, Grep, Glob
|
|
9
9
|
argument-hint: "[create|drill|coverage] [alert name or type | 告警名稱或類型]"
|
|
10
10
|
---
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide security review and vulnerability assessment following OWASP standards.
|
|
6
6
|
Use when: security audit, vulnerability check, secure coding review, threat modeling.
|
|
7
|
-
Keywords: security, OWASP, vulnerability, authentication, authorization
|
|
7
|
+
Keywords: security, OWASP, vulnerability, authentication, authorization.
|
|
8
8
|
allowed-tools: Read, Grep, Glob
|
|
9
9
|
argument-hint: "[module or file to audit | 要審計的模組或檔案]"
|
|
10
10
|
---
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide automated security scanning, dependency auditing, and secret detection.
|
|
6
6
|
Use when: dependency audit, CVE scanning, secret detection, license compliance.
|
|
7
|
-
Keywords: scan, audit, CVE, dependency, secret, SBOM, vulnerability
|
|
7
|
+
Keywords: scan, audit, CVE, dependency, secret, SBOM, vulnerability.
|
|
8
8
|
allowed-tools: Read, Grep, Glob, Bash(npm:audit, npx:*)
|
|
9
9
|
argument-hint: "[scan type or target | 掃描類型或目標]"
|
|
10
10
|
---
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Guide SLI selection, SLO setting, and Error Budget management.
|
|
6
6
|
Use when: defining service quality targets, setting up SLO-based alerting, Error Budget policy.
|
|
7
|
-
Keywords: SLI, SLO, SLA, Error Budget, burn rate, service level
|
|
7
|
+
Keywords: SLI, SLO, SLA, Error Budget, burn rate, service level.
|
|
8
8
|
allowed-tools: Read, Write, Grep, Glob
|
|
9
9
|
argument-hint: "[create|review|budget] [service name | 服務名稱]"
|
|
10
10
|
---
|
|
@@ -4,7 +4,7 @@ scope: universal
|
|
|
4
4
|
description: |
|
|
5
5
|
Scan codebase for debug artifacts and code quality issues; optionally auto-fix safe patterns.
|
|
6
6
|
Use when: before committing, during PR review, or periodic codebase cleanup.
|
|
7
|
-
Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality
|
|
7
|
+
Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality.
|
|
8
8
|
allowed-tools: Read, Grep, Glob, Bash(find:*), Edit, Write
|
|
9
9
|
argument-hint: "[--fix] [--report] [--path <dir>] [--exclude <pattern>]"
|
|
10
10
|
---
|
|
@@ -5,7 +5,7 @@ description: |
|
|
|
5
5
|
Testing pyramid and test writing standards for UT/IT/ST/E2E.
|
|
6
6
|
Supports ISTQB and Industry Pyramid frameworks.
|
|
7
7
|
Use when: writing tests, discussing test coverage, test strategy, or test naming.
|
|
8
|
-
Keywords: test, unit, integration, e2e, coverage, mock, ISTQB, SIT
|
|
8
|
+
Keywords: test, unit, integration, e2e, coverage, mock, ISTQB, SIT.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Testing Guide
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-dev-standards",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.16.0",
|
|
4
4
|
"description": "CLI tool for adopting Universal Development Standards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@vitest/coverage-v8": "^4.1.5",
|
|
71
71
|
"ajv": "^8.20.0",
|
|
72
72
|
"ajv-formats": "^3.0.1",
|
|
73
|
-
"eslint": "10.4.
|
|
73
|
+
"eslint": "10.4.1",
|
|
74
74
|
"glob": "^13.0.1",
|
|
75
75
|
"globals": "17.6.0",
|
|
76
76
|
"husky": "^9.1.7",
|
package/src/commands/check.js
CHANGED
|
@@ -38,6 +38,7 @@ import { StandardValidator } from '../utils/standard-validator.js';
|
|
|
38
38
|
import { WorkflowGate } from '../utils/workflow-gate.js';
|
|
39
39
|
import { t, setLanguage, isLanguageExplicitlySet } from '../i18n/messages.js';
|
|
40
40
|
import { guardAgainstSelfAdoption } from '../utils/detect-self-adoption.js';
|
|
41
|
+
import { lintAll as lintI18nAll, partitionFindings as partitionI18nFindings } from '../lint/i18n.js';
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Display the summary of file integrity status
|
|
@@ -243,6 +244,15 @@ function displayAdoptionStatus(manifest, msg, common, repoInfo) {
|
|
|
243
244
|
export async function checkCommand(options = {}) {
|
|
244
245
|
const projectPath = process.cwd();
|
|
245
246
|
|
|
247
|
+
// Handle --i18n option early — i18n lint is meant to be runnable both
|
|
248
|
+
// inside UDS source (lint canonical + locale variants) and inside
|
|
249
|
+
// adopter projects (lint installed locale variants). It does not require
|
|
250
|
+
// adoption-drift checks, so we short-circuit before guardAgainstSelfAdoption.
|
|
251
|
+
if (options.i18n) {
|
|
252
|
+
await runI18nLint(projectPath, options);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
|
|
246
256
|
// Refuse to run inside the UDS source repo itself.
|
|
247
257
|
// See DEC-044 / XSPEC-071 — adoption-drift check makes no sense for the
|
|
248
258
|
// source repo. `--force` bypasses (e.g. private forks of UDS).
|
|
@@ -1837,3 +1847,73 @@ function displayWorkflowStatus(projectPath) {
|
|
|
1837
1847
|
// Silently skip if workflow gate not available
|
|
1838
1848
|
}
|
|
1839
1849
|
}
|
|
1850
|
+
|
|
1851
|
+
// ============================================================
|
|
1852
|
+
// i18n Lint (XSPEC-239 — P1-CLI-5)
|
|
1853
|
+
// ============================================================
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* Run i18n lint across canonical + locale variants and print findings.
|
|
1857
|
+
* Exits 1 if any error-level findings are detected.
|
|
1858
|
+
*
|
|
1859
|
+
* @param {string} projectPath
|
|
1860
|
+
* @param {object} options - CLI options (currently honors options.json)
|
|
1861
|
+
*/
|
|
1862
|
+
async function runI18nLint(projectPath, options = {}) {
|
|
1863
|
+
const findings = lintI18nAll({ projectPath });
|
|
1864
|
+
const { errors, warnings, infos } = partitionI18nFindings(findings);
|
|
1865
|
+
|
|
1866
|
+
if (options.json) {
|
|
1867
|
+
console.log(JSON.stringify({
|
|
1868
|
+
summary: {
|
|
1869
|
+
errors: errors.length,
|
|
1870
|
+
warnings: warnings.length,
|
|
1871
|
+
infos: infos.length,
|
|
1872
|
+
},
|
|
1873
|
+
findings,
|
|
1874
|
+
}, null, 2));
|
|
1875
|
+
if (errors.length > 0) process.exitCode = 1;
|
|
1876
|
+
return;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
console.log();
|
|
1880
|
+
console.log(chalk.bold('UDS i18n Lint (XSPEC-239)'));
|
|
1881
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
1882
|
+
console.log();
|
|
1883
|
+
|
|
1884
|
+
if (findings.length === 0) {
|
|
1885
|
+
console.log(chalk.green(' ✓ No i18n violations found.'));
|
|
1886
|
+
console.log();
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
// Display errors first
|
|
1891
|
+
for (const f of errors) {
|
|
1892
|
+
console.log(chalk.red(` ✗ [${f.rule}]`));
|
|
1893
|
+
console.log(chalk.red(` ${f.file}:${f.line}`));
|
|
1894
|
+
console.log(chalk.gray(` ${f.message}`));
|
|
1895
|
+
console.log();
|
|
1896
|
+
}
|
|
1897
|
+
for (const f of warnings) {
|
|
1898
|
+
console.log(chalk.yellow(` ⚠ [${f.rule}]`));
|
|
1899
|
+
console.log(chalk.yellow(` ${f.file}:${f.line}`));
|
|
1900
|
+
console.log(chalk.gray(` ${f.message}`));
|
|
1901
|
+
console.log();
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
// Info findings are collapsed to a summary line to avoid flooding output
|
|
1905
|
+
// (e.g. many locale files still lack source_hash). They never fail the gate.
|
|
1906
|
+
if (infos.length > 0) {
|
|
1907
|
+
console.log(chalk.cyan(` ℹ ${infos.length} locale file(s) lack source_hash — silent content drift cannot be detected for them.`));
|
|
1908
|
+
console.log(chalk.gray(' Stamp source_hash (sha256[:12] of canonical) when a locale is verified in sync to enable detection.'));
|
|
1909
|
+
console.log();
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
1913
|
+
console.log(` ${chalk.red('Errors:')} ${errors.length} ${chalk.yellow('Warnings:')} ${warnings.length} ${chalk.cyan('Info:')} ${infos.length}`);
|
|
1914
|
+
console.log();
|
|
1915
|
+
|
|
1916
|
+
if (errors.length > 0) {
|
|
1917
|
+
process.exitCode = 1;
|
|
1918
|
+
}
|
|
1919
|
+
}
|