universal-dev-standards 4.1.0 → 4.2.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 (46) hide show
  1. package/bin/uds.js +75 -0
  2. package/bundled/core/ai-friendly-architecture.md +542 -0
  3. package/bundled/locales/zh-CN/README.md +210 -509
  4. package/bundled/locales/zh-CN/core/ai-friendly-architecture.md +306 -0
  5. package/bundled/locales/zh-CN/docs/AI-AGENT-ROADMAP.md +82 -22
  6. package/bundled/locales/zh-CN/integrations/gemini-cli/GEMINI.md +35 -3
  7. package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +89 -3
  8. package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +8 -4
  9. package/bundled/locales/zh-TW/README.md +211 -490
  10. package/bundled/locales/zh-TW/core/ai-friendly-architecture.md +306 -0
  11. package/bundled/locales/zh-TW/docs/AI-AGENT-ROADMAP.md +82 -22
  12. package/bundled/locales/zh-TW/integrations/gemini-cli/GEMINI.md +35 -3
  13. package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +89 -3
  14. package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +8 -4
  15. package/bundled/skills/claude-code/README.md +8 -0
  16. package/bundled/skills/claude-code/agents/README.md +305 -0
  17. package/bundled/skills/claude-code/agents/code-architect.md +259 -0
  18. package/bundled/skills/claude-code/agents/doc-writer.md +406 -0
  19. package/bundled/skills/claude-code/agents/reviewer.md +353 -0
  20. package/bundled/skills/claude-code/agents/spec-analyst.md +374 -0
  21. package/bundled/skills/claude-code/agents/test-specialist.md +364 -0
  22. package/bundled/skills/claude-code/workflows/README.md +303 -0
  23. package/bundled/skills/claude-code/workflows/code-review.workflow.yaml +186 -0
  24. package/bundled/skills/claude-code/workflows/feature-dev.workflow.yaml +174 -0
  25. package/bundled/skills/claude-code/workflows/integrated-flow.workflow.yaml +238 -0
  26. package/bundled/skills/claude-code/workflows/large-codebase-analysis.workflow.yaml +226 -0
  27. package/package.json +11 -1
  28. package/src/commands/agent.js +417 -0
  29. package/src/commands/ai-context.js +552 -0
  30. package/src/commands/check.js +3 -3
  31. package/src/commands/init.js +6 -3
  32. package/src/commands/workflow.js +425 -0
  33. package/src/config/ai-agent-paths.js +217 -13
  34. package/src/core/constants.js +514 -0
  35. package/src/core/errors.js +398 -0
  36. package/src/core/manifest.js +473 -0
  37. package/src/core/paths.js +398 -0
  38. package/src/prompts/init.js +7 -5
  39. package/src/utils/agent-adapter.js +320 -0
  40. package/src/utils/agents-installer.js +393 -0
  41. package/src/utils/context-chunker.js +467 -0
  42. package/src/utils/copier.js +59 -99
  43. package/src/utils/hasher.js +2 -16
  44. package/src/utils/integration-generator.js +28 -52
  45. package/src/utils/workflows-installer.js +545 -0
  46. package/standards-registry.json +166 -20
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source: ../../../../integrations/github-copilot/COPILOT-CHAT-REFERENCE.md
3
- source_version: 1.0.0
4
- translation_version: 1.0.0
5
- last_synced: 2026-01-13
3
+ source_version: 1.1.0
4
+ translation_version: 1.1.0
5
+ last_synced: 2026-01-24
6
6
  status: current
7
7
  ---
8
8
 
@@ -204,6 +204,88 @@ INVEST 檢查清單:
204
204
 
205
205
  ---
206
206
 
207
+ ### 9. 重構指導
208
+
209
+ **Claude Code**:`/refactor`
210
+
211
+ **Copilot Chat 提示(決策樹)**:
212
+ ```
213
+ 幫我決定是否應該重構或重寫此程式碼。回答這些問題:
214
+
215
+ 1. 程式碼目前在生產環境運行?[Y/N]
216
+ → N:考慮重寫(風險較低)
217
+ 2. 我理解程式碼做什麼?[Y/N]
218
+ → N:先寫特徵測試
219
+ 3. 測試覆蓋率 > 60%?[Y/N]
220
+ → N:先加測試
221
+ 4. 核心架構可挽救?[Y/N]
222
+ → N:使用絞殺者無花果模式(漸進替換)
223
+ → Y:使用漸進式重構
224
+
225
+ 根據我的回答,推薦適當的策略。
226
+ ```
227
+
228
+ **Copilot Chat 提示(戰術重構)**:
229
+ ```
230
+ 為此程式碼建議戰術重構改進:
231
+
232
+ **童子軍法則**(小規模、機會性清理):
233
+ - 重新命名混淆的變數
234
+ - 提取方法
235
+ - 移除死碼
236
+ - 分鐘級,非小時級
237
+
238
+ **準備性重構**(新增功能前):
239
+ - 「先讓變更變容易,再做容易的變更」- Kent Beck
240
+ - 重組以適應新需求
241
+ - 與功能工作分開提交
242
+
243
+ 哪種方式適合我的情況?
244
+ ```
245
+
246
+ **Copilot Chat 提示(遺留程式碼安全)**:
247
+ ```
248
+ 幫我安全地重構此遺留程式碼:
249
+
250
+ 1. **特徵測試**(先做這個):
251
+ - 呼叫程式碼,寫預期失敗的斷言
252
+ - 更新斷言以符合實際行為
253
+ - 重複直到行為被捕捉
254
+
255
+ 2. **尋找接縫**:
256
+ - 物件接縫(多型)
257
+ - 連結接縫(依賴注入)
258
+
259
+ 3. **萌芽/包裝技術**:
260
+ - 萌芽方法:新邏輯在新的可測試方法中
261
+ - 包裝方法:在現有程式碼前/後加行為
262
+
263
+ 先幫我寫特徵測試。
264
+ ```
265
+
266
+ **Copilot Chat 提示(戰略重構)**:
267
+ ```
268
+ 我需要做大規模重構。幫我在以下之間選擇:
269
+
270
+ 1. **絞殺者無花果**:逐步替換遺留系統
271
+ - 使用時機:替換整個系統,需持續運作
272
+ - 方法:攔截 → 遷移 → 完成
273
+
274
+ 2. **防腐層 (ACL)**:在新舊之間轉譯
275
+ - 使用時機:必須與遺留系統共存
276
+ - 方法:建立 Facade + Adapter + Translator 層
277
+
278
+ 3. **分支抽象**:在主幹上重構共享程式碼
279
+ - 使用時機:長期重構,無功能分支
280
+ - 方法:引入抽象 → 加新實作 → 切換 → 移除舊的
281
+
282
+ 哪種模式適合我的情況?我的限制是:[描述情況]
283
+ ```
284
+
285
+ 參考:`core/refactoring-standards.md`
286
+
287
+ ---
288
+
207
289
  ## 快速參考卡
208
290
 
209
291
  | 任務 | Copilot Chat 提示開頭 |
@@ -216,6 +298,9 @@ INVEST 檢查清單:
216
298
  | 簽入前 | "在提交前驗證這些品質關卡..." |
217
299
  | 發布 | "依照語義化版本準備發布..." |
218
300
  | 文件 | "為此撰寫文件..." |
301
+ | 重構 | "幫我決定是否應該重構或重寫..." |
302
+ | 戰術 | "建議戰術重構改進..." |
303
+ | 遺留 | "幫我安全地重構此遺留程式碼..." |
219
304
 
220
305
  ---
221
306
 
@@ -260,6 +345,7 @@ INVEST 檢查清單:
260
345
 
261
346
  | 版本 | 日期 | 變更 |
262
347
  |------|------|------|
348
+ | 1.1.0 | 2026-01-21 | 新增重構指導提示(決策樹、戰術、遺留、戰略) |
263
349
  | 1.0.0 | 2026-01-13 | 初始發布 |
264
350
 
265
351
  ---
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source: ../../../../integrations/github-copilot/skills-mapping.md
3
- source_version: 1.0.0
4
- translation_version: 1.0.0
5
- last_synced: 2026-01-13
3
+ source_version: 1.1.0
4
+ translation_version: 1.1.0
5
+ last_synced: 2026-01-24
6
6
  status: current
7
7
  ---
8
8
 
@@ -36,7 +36,7 @@ Claude Code 提供 18 個 skills 和 16 個斜線命令。GitHub Copilot 不支
36
36
  | **git-workflow-guide** | 僅 Chat 提示 | ⚠️ 部分 |
37
37
  | **documentation-guide** | 僅 Chat 提示 | ⚠️ 部分 |
38
38
  | **methodology-system** | 不可用 | ❌ 無 |
39
- | **refactoring-assistant** | Chat 提示 | ⚠️ 部分 |
39
+ | **refactoring-assistant** | COPILOT-CHAT-REFERENCE.md §9 | 完整 |
40
40
  | **error-code-guide** | 僅 Chat 提示 | ⚠️ 部分 |
41
41
  | **project-structure-guide** | 僅 Chat 提示 | ⚠️ 部分 |
42
42
  | **logging-guide** | 僅 Chat 提示 | ⚠️ 部分 |
@@ -65,6 +65,9 @@ Claude Code 提供 18 個 skills 和 16 個斜線命令。GitHub Copilot 不支
65
65
  | `/changelog` | "以 Keep a Changelog 格式產生 CHANGELOG 條目" |
66
66
  | `/docs` | "為此函式/模組撰寫文件" |
67
67
  | `/spec` | "為此功能建立規格文件" |
68
+ | `/refactor` | "幫我決定是否應該重構或重寫..." |
69
+ | `/refactor tactical` | "建議戰術重構改進..." |
70
+ | `/refactor legacy` | "幫我安全地重構此遺留程式碼..." |
68
71
  | `/methodology` | ❌ 不可用 |
69
72
  | `/bdd` | "幫我用 Gherkin 格式撰寫 BDD 情境" |
70
73
  | `/config` | "為此類型應用程式建議專案結構" |
@@ -183,6 +186,7 @@ gh repo create my-project --template my-org/project-template
183
186
 
184
187
  | 版本 | 日期 | 變更 |
185
188
  |------|------|------|
189
+ | 1.1.0 | 2026-01-21 | 更新 refactoring-assistant 為完整狀態,新增 /refactor 命令對照 |
186
190
  | 1.0.0 | 2026-01-13 | 初始發布 |
187
191
 
188
192
  ---
@@ -81,6 +81,14 @@ These are **triggered by keywords** or specific tasks. Install as Skills:
81
81
 
82
82
  ## Slash Commands | 斜線命令
83
83
 
84
+ > **Claude Code v2.1.3+ Note**: Slash commands and skills are now merged. Both `.claude/commands/review.md` and `.claude/skills/review/SKILL.md` create `/review` and work identically. Your existing `.claude/commands/` files continue to work.
85
+ >
86
+ > **Claude Code v2.1.3+ 注意**:斜線命令與 Skills 已合併。`.claude/commands/review.md` 和 `.claude/skills/review/SKILL.md` 都會創建 `/review`,功能相同。現有的 `.claude/commands/` 檔案繼續運作。
87
+ >
88
+ > **For other AI tools**: OpenCode, Roo Code, Gemini CLI and others still use the traditional commands format.
89
+ >
90
+ > **其他 AI 工具**:OpenCode、Roo Code、Gemini CLI 等仍使用傳統的 commands 格式。
91
+
84
92
  In addition to automatic Skills, this plugin provides **manual slash commands** for explicit actions:
85
93
 
86
94
  除了自動觸發的 Skills,此插件還提供**手動斜線命令**用於明確的操作:
@@ -0,0 +1,305 @@
1
+ # UDS Agents
2
+
3
+ > **Language**: English | [繁體中文](../../../locales/zh-TW/skills/claude-code/agents/README.md)
4
+
5
+ **Version**: 1.1.0
6
+ **Last Updated**: 2026-01-21
7
+ **Status**: Stable
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ UDS Agents are specialized AI subagents that can be orchestrated to handle complex development workflows. Unlike Skills (which provide context/knowledge), Agents are autonomous entities that can execute multi-step tasks.
14
+
15
+ ## AGENT.md Format Specification
16
+
17
+ ### Frontmatter Schema
18
+
19
+ ```yaml
20
+ ---
21
+ # === REQUIRED FIELDS ===
22
+ name: agent-name # Unique identifier (kebab-case)
23
+ version: 1.0.0 # Semantic version
24
+ description: | # Multi-line description for AI matching
25
+ Brief description of the agent's purpose.
26
+ Keywords: keyword1, keyword2, keyword3.
27
+
28
+ # === ROLE CONFIGURATION ===
29
+ role: specialist # orchestrator | specialist | reviewer
30
+ expertise: # Domain expertise areas
31
+ - system-design
32
+ - api-design
33
+ - database-modeling
34
+
35
+ # === TOOL PERMISSIONS (Claude Code Task tool) ===
36
+ # Specify which tools this agent can use
37
+ allowed-tools:
38
+ - Read # File reading
39
+ - Glob # Pattern matching
40
+ - Grep # Content search
41
+ - Bash(git:*) # Git commands only
42
+ - WebFetch # Web fetching
43
+ - WebSearch # Web search
44
+ disallowed-tools: # Explicitly blocked tools
45
+ - Write # No file writing
46
+ - Edit # No file editing
47
+
48
+ # === SKILL DEPENDENCIES ===
49
+ # Skills that provide context/knowledge to this agent
50
+ skills:
51
+ - spec-driven-dev # Skill name reference
52
+ - testing-guide
53
+
54
+ # === MODEL PREFERENCES (Claude Code only) ===
55
+ model: claude-sonnet-4-20250514 # Preferred model
56
+ temperature: 0.3 # Response creativity (0.0-1.0)
57
+
58
+ # === CONTEXT STRATEGY (RLM-inspired) ===
59
+ # Configuration for handling large codebases and long contexts
60
+ context-strategy:
61
+ mode: adaptive # full | chunked | adaptive
62
+ max-chunk-size: 50000 # Maximum tokens per chunk
63
+ overlap: 500 # Token overlap between chunks
64
+ analysis-pattern: hierarchical # hierarchical | parallel | sequential
65
+
66
+ # === TRIGGER CONDITIONS ===
67
+ triggers:
68
+ keywords: # Auto-activate on these keywords
69
+ - architecture
70
+ - system design
71
+ - 架構設計
72
+ commands: # Slash commands that invoke this agent
73
+ - /architect
74
+ ---
75
+ ```
76
+
77
+ ### Role Types
78
+
79
+ | Role | Description | Use Case |
80
+ |------|-------------|----------|
81
+ | `orchestrator` | Coordinates multiple agents | Complex workflows, feature development |
82
+ | `specialist` | Deep expertise in specific domain | Architecture, testing, documentation |
83
+ | `reviewer` | Evaluates and provides feedback | Code review, spec review, PR review |
84
+
85
+ ### Tool Permission Patterns
86
+
87
+ ```yaml
88
+ # Full tool access (default if not specified)
89
+ allowed-tools: [*]
90
+
91
+ # Read-only agent
92
+ allowed-tools: [Read, Glob, Grep]
93
+ disallowed-tools: [Write, Edit, Bash]
94
+
95
+ # Git-only bash access
96
+ allowed-tools:
97
+ - Bash(git:*) # Only git commands
98
+ - Bash(npm:test) # Only npm test
99
+
100
+ # Specific file patterns
101
+ allowed-tools:
102
+ - Write(*.md) # Only markdown files
103
+ - Edit(src/**) # Only src directory
104
+ ```
105
+
106
+ ### Context Strategy Configuration (RLM-inspired)
107
+
108
+ The `context-strategy` section enables intelligent handling of large codebases and long contexts using RLM (Recursive Language Model) principles.
109
+
110
+ #### Mode Options
111
+
112
+ | Mode | Description | Use Case |
113
+ |------|-------------|----------|
114
+ | `full` | Load complete context at once | Small projects, documentation tasks |
115
+ | `chunked` | Divide context into fixed-size chunks | Sequential code review, large file analysis |
116
+ | `adaptive` | Dynamically adjust based on content structure | Complex analysis, architecture exploration |
117
+
118
+ #### Analysis Patterns
119
+
120
+ | Pattern | Description | Best For |
121
+ |---------|-------------|----------|
122
+ | `hierarchical` | Analyze high-level structure first, then drill down | Architecture analysis, system design |
123
+ | `parallel` | Process multiple sections simultaneously | Independent module analysis, spec review |
124
+ | `sequential` | Process sections in order, preserving context | Code review, step-by-step analysis |
125
+
126
+ #### Configuration Examples
127
+
128
+ ```yaml
129
+ # For architecture analysis (need overview first)
130
+ context-strategy:
131
+ mode: adaptive
132
+ max-chunk-size: 50000
133
+ overlap: 500
134
+ analysis-pattern: hierarchical
135
+
136
+ # For code review (sequential processing)
137
+ context-strategy:
138
+ mode: chunked
139
+ max-chunk-size: 30000
140
+ overlap: 200
141
+ analysis-pattern: sequential
142
+
143
+ # For documentation (need full context)
144
+ context-strategy:
145
+ mode: full
146
+ analysis-pattern: hierarchical
147
+ ```
148
+
149
+ ### Cross-Tool Execution Modes
150
+
151
+ | AI Tool | Execution Mode | How It Works |
152
+ |---------|---------------|--------------|
153
+ | Claude Code | `task` | Uses Task tool to spawn independent subagent |
154
+ | OpenCode | `task` | Similar Task tool support |
155
+ | Cursor / Windsurf | `inline` | Injects AGENT.md as context prefix |
156
+ | Copilot / Gemini | `inline` | Converts to prompt snippets |
157
+
158
+ ## Built-in Agents
159
+
160
+ | Agent | Role | Description |
161
+ |-------|------|-------------|
162
+ | [code-architect](./code-architect.md) | specialist | Software architecture and system design |
163
+ | [test-specialist](./test-specialist.md) | specialist | Testing strategy and test implementation |
164
+ | [reviewer](./reviewer.md) | reviewer | Code review and quality assessment |
165
+ | [doc-writer](./doc-writer.md) | specialist | Documentation and technical writing |
166
+ | [spec-analyst](./spec-analyst.md) | specialist | Specification analysis and requirement extraction |
167
+
168
+ ## Usage
169
+
170
+ ### CLI Installation
171
+
172
+ ```bash
173
+ # List available agents
174
+ uds agent list
175
+
176
+ # Install specific agent to project
177
+ uds agent install code-architect
178
+
179
+ # Install all agents
180
+ uds agent install --all
181
+
182
+ # Install to user directory (global)
183
+ uds agent install code-architect --global
184
+ ```
185
+
186
+ ### Direct Invocation in Claude Code
187
+
188
+ ```
189
+ /architect [task description]
190
+ ```
191
+
192
+ Or through natural language triggers:
193
+
194
+ ```
195
+ Please help me design the architecture for a new authentication system.
196
+ ```
197
+
198
+ ## Creating Custom Agents
199
+
200
+ ### 1. Create AGENT.md File
201
+
202
+ ```bash
203
+ # In your project
204
+ mkdir -p .claude/agents
205
+ touch .claude/agents/my-agent.md
206
+ ```
207
+
208
+ ### 2. Define Frontmatter
209
+
210
+ ```yaml
211
+ ---
212
+ name: my-custom-agent
213
+ version: 1.0.0
214
+ description: |
215
+ Custom agent for specific project needs.
216
+ Keywords: custom, specific, project.
217
+
218
+ role: specialist
219
+ expertise: [domain-specific]
220
+
221
+ allowed-tools: [Read, Glob, Grep, Edit]
222
+ skills: [relevant-skill]
223
+
224
+ triggers:
225
+ commands: [/myagent]
226
+ ---
227
+ ```
228
+
229
+ ### 3. Write Agent Instructions
230
+
231
+ ```markdown
232
+ # My Custom Agent
233
+
234
+ ## Purpose
235
+
236
+ Describe what this agent does.
237
+
238
+ ## Workflow
239
+
240
+ 1. Step one
241
+ 2. Step two
242
+ 3. Step three
243
+
244
+ ## Guidelines
245
+
246
+ - Guideline 1
247
+ - Guideline 2
248
+ ```
249
+
250
+ ## Agent vs Skill Comparison
251
+
252
+ | Aspect | Skill | Agent |
253
+ |--------|-------|-------|
254
+ | **Purpose** | Provide knowledge/context | Execute autonomous tasks |
255
+ | **Execution** | Loaded as context | Spawned as subagent (or inline) |
256
+ | **State** | Stateless | Can maintain task state |
257
+ | **Tool Access** | None (context only) | Configurable permissions |
258
+ | **Triggers** | Manual loading | Keywords, commands, workflows |
259
+ | **Composition** | Referenced by agents | Can use skills as context |
260
+
261
+ ## Integration with Workflows
262
+
263
+ Agents can be orchestrated through workflow definitions:
264
+
265
+ ```yaml
266
+ # workflows/feature-dev.workflow.yaml
267
+ name: feature-development
268
+ steps:
269
+ - agent: spec-analyst
270
+ task: Analyze requirements
271
+ - agent: code-architect
272
+ task: Design solution
273
+ - agent: test-specialist
274
+ task: Define test strategy
275
+ - manual: Implementation
276
+ - agent: reviewer
277
+ task: Code review
278
+ ```
279
+
280
+ See [workflows/README.md](../workflows/README.md) for workflow documentation.
281
+
282
+ ---
283
+
284
+ ## Related Resources
285
+
286
+ - [Skills Documentation](../README.md)
287
+ - [Workflows Documentation](../workflows/README.md)
288
+ - [AI Agent Paths Configuration](../../../cli/src/config/ai-agent-paths.js)
289
+
290
+ ---
291
+
292
+ ## Version History
293
+
294
+ | Version | Date | Changes |
295
+ |---------|------|---------|
296
+ | 1.1.0 | 2026-01-21 | Added RLM-inspired context-strategy configuration |
297
+ | 1.0.0 | 2026-01-20 | Initial release |
298
+
299
+ ---
300
+
301
+ ## License
302
+
303
+ This documentation is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
304
+
305
+ **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)