universal-dev-standards 5.1.0 → 5.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 (119) hide show
  1. package/bundled/ai/options/push/single-owner-mode.ai.yaml +60 -0
  2. package/bundled/ai/options/push/team-mode.ai.yaml +64 -0
  3. package/bundled/ai/standards/agent-behavior-discipline.ai.yaml +142 -0
  4. package/bundled/ai/standards/checkin-standards.ai.yaml +18 -0
  5. package/bundled/ai/standards/test-governance.ai.yaml +12 -0
  6. package/bundled/ai/standards/testing.ai.yaml +14 -0
  7. package/bundled/core/agent-behavior-discipline.md +178 -0
  8. package/bundled/core/checkin-standards.md +21 -2
  9. package/bundled/core/test-governance.md +3 -0
  10. package/bundled/core/testing-standards.md +25 -2
  11. package/bundled/core/versioning.md +1 -1
  12. package/bundled/locales/zh-CN/CHANGELOG.md +41 -3
  13. package/bundled/locales/zh-CN/README.md +9 -1
  14. package/bundled/locales/zh-CN/SECURITY.md +8 -0
  15. package/bundled/locales/zh-CN/core/ai-friendly-architecture.md +8 -0
  16. package/bundled/locales/zh-CN/core/checkin-standards.md +22 -3
  17. package/bundled/locales/zh-CN/core/test-governance.md +14 -3
  18. package/bundled/locales/zh-CN/core/testing-standards.md +26 -3
  19. package/bundled/locales/zh-CN/core/workflow-enforcement.md +8 -0
  20. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +8 -0
  21. package/bundled/locales/zh-CN/docs/CLI-FLOW.md +8 -0
  22. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +8 -0
  23. package/bundled/locales/zh-CN/docs/STANDARDS-REFERENCE.md +8 -0
  24. package/bundled/locales/zh-CN/skills/commands/requirement.md +8 -0
  25. package/bundled/locales/zh-CN/skills/commands/reverse-bdd.md +8 -0
  26. package/bundled/locales/zh-CN/skills/commands/reverse-sdd.md +8 -0
  27. package/bundled/locales/zh-CN/skills/commands/reverse-tdd.md +8 -0
  28. package/bundled/locales/zh-CN/skills/commands/reverse.md +8 -0
  29. package/bundled/locales/zh-CN/skills/commands/review.md +8 -0
  30. package/bundled/locales/zh-CN/skills/commands/sdd-retro.md +8 -0
  31. package/bundled/locales/zh-CN/skills/commands/sdd.md +8 -0
  32. package/bundled/locales/zh-CN/skills/commands/tdd.md +8 -0
  33. package/bundled/locales/zh-CN/skills/commands/update.md +8 -0
  34. package/bundled/locales/zh-TW/CHANGELOG.md +41 -3
  35. package/bundled/locales/zh-TW/MAINTENANCE.md +17 -6
  36. package/bundled/locales/zh-TW/README.md +9 -1
  37. package/bundled/locales/zh-TW/SECURITY.md +8 -0
  38. package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +1 -1
  39. package/bundled/locales/zh-TW/core/ai-friendly-architecture.md +8 -0
  40. package/bundled/locales/zh-TW/core/anti-hallucination.md +8 -0
  41. package/bundled/locales/zh-TW/core/checkin-standards.md +24 -3
  42. package/bundled/locales/zh-TW/core/git-workflow.md +8 -0
  43. package/bundled/locales/zh-TW/core/refactoring-standards.md +8 -0
  44. package/bundled/locales/zh-TW/core/spec-driven-development.md +8 -0
  45. package/bundled/locales/zh-TW/core/structured-task-definition.md +8 -0
  46. package/bundled/locales/zh-TW/core/test-driven-development.md +8 -0
  47. package/bundled/locales/zh-TW/core/test-governance.md +14 -3
  48. package/bundled/locales/zh-TW/core/testing-standards.md +31 -0
  49. package/bundled/locales/zh-TW/core/versioning.md +1 -1
  50. package/bundled/locales/zh-TW/core/workflow-enforcement.md +8 -0
  51. package/bundled/locales/zh-TW/core/workflow-state-protocol.md +8 -0
  52. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +8 -0
  53. package/bundled/locales/zh-TW/docs/CLI-FLOW.md +8 -0
  54. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +8 -0
  55. package/bundled/locales/zh-TW/docs/MIGRATION-V5.md +8 -0
  56. package/bundled/locales/zh-TW/docs/STANDARDS-REFERENCE.md +8 -0
  57. package/bundled/locales/zh-TW/integrations/claude-code/README.md +8 -0
  58. package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +1 -0
  59. package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +1 -0
  60. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +1 -0
  61. package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +1 -0
  62. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +1 -0
  63. package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +1 -0
  64. package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +1 -0
  65. package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +1 -0
  66. package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +1 -0
  67. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +1 -0
  68. package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +1 -0
  69. package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +1 -0
  70. package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +1 -0
  71. package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +1 -0
  72. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +1 -0
  73. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +1 -0
  74. package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +1 -0
  75. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +1 -0
  76. package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +1 -0
  77. package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +1 -0
  78. package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +1 -0
  79. package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +1 -0
  80. package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +1 -0
  81. package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +1 -0
  82. package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +1 -0
  83. package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +1 -0
  84. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +1 -0
  85. package/bundled/locales/zh-TW/skills/observability-assistant/SKILL.md +1 -0
  86. package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +1 -0
  87. package/bundled/locales/zh-TW/skills/process-automation/SKILL.md +1 -0
  88. package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +1 -0
  89. package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +1 -0
  90. package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +1 -0
  91. package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +1 -0
  92. package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +1 -0
  93. package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +1 -0
  94. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +1 -0
  95. package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +1 -0
  96. package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +1 -0
  97. package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +1 -0
  98. package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +1 -0
  99. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +1 -0
  100. package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +1 -0
  101. package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +1 -0
  102. package/bundled/skills/ai-collaboration-standards/SKILL.md +1 -0
  103. package/bundled/skills/ai-friendly-architecture/SKILL.md +1 -0
  104. package/bundled/skills/ai-instruction-standards/SKILL.md +1 -0
  105. package/bundled/skills/documentation-guide/SKILL.md +1 -0
  106. package/bundled/skills/error-code-guide/SKILL.md +1 -0
  107. package/bundled/skills/git-workflow-guide/SKILL.md +1 -0
  108. package/bundled/skills/logging-guide/SKILL.md +1 -0
  109. package/bundled/skills/project-structure-guide/SKILL.md +1 -0
  110. package/bundled/skills/push/SKILL.md +203 -0
  111. package/bundled/skills/testing-guide/SKILL.md +1 -0
  112. package/package.json +4 -4
  113. package/src/config/ai-agent-paths.js +0 -1
  114. package/src/utils/directory-mapper.js +2 -2
  115. package/standards-registry.json +15 -4
  116. package/bundled/locales/zh-CN/docs/AI-AGENT-ROADMAP.md +0 -410
  117. package/bundled/locales/zh-CN/docs/OPERATION-WORKFLOW.md +0 -1074
  118. package/bundled/locales/zh-TW/docs/AI-AGENT-ROADMAP.md +0 -410
  119. package/bundled/locales/zh-TW/docs/OPERATION-WORKFLOW.md +0 -1074
@@ -1,1074 +0,0 @@
1
- ---
2
- source: ../../../docs/OPERATION-WORKFLOW.md
3
- source_version: 2.0.0
4
- translation_version: 2.0.0
5
- status: current
6
- last_updated: 2026-03-17
7
- translator: Claude
8
- ---
9
-
10
- # UDS 作业流程
11
-
12
- > **Language**: [English](../../../docs/OPERATION-WORKFLOW.md) | [繁體中文](../../zh-TW/docs/OPERATION-WORKFLOW.md) | 简体中文
13
-
14
- **版本**: 2.0.0
15
- **最后更新**: 2026-03-17
16
-
17
- 本文档提供 Universal Development Standards (UDS) 项目的完整作业流程,涵盖从核心规范到文件生成的所有流程。
18
-
19
- ---
20
-
21
- ## 目录
22
-
23
- 1. [概览](#1-概览)
24
- 2. [核心规范层](#2-核心规范层)
25
- 3. [衍生格式生成](#3-衍生格式生成)
26
- 4. [Claude Code Skills](#4-claude-code-skills)
27
- 5. [AI 工具集成](#5-ai-工具集成)
28
- 6. [CLI 执行流程](#6-cli-执行流程)
29
- 7. [维护流程](#7-维护流程)
30
- 8. [开发指南](#8-开发指南)
31
- 9. [发布流程](#9-发布流程)
32
- 10. [文件路径参考](#10-文件路径参考)
33
-
34
- ---
35
-
36
- ## 1. 概览
37
-
38
- ### 1.1 项目架构
39
-
40
- ```
41
- ┌─────────────────────────────────────────────────────────────────┐
42
- │ 核心规范层 (core/) │
43
- │ 16 个标准:Essential(6) + Recommended(6) + Enterprise(4) │
44
- └──────────────────────────┬──────────────────────────────────────┘
45
-
46
- ┌──────────────────┼──────────────────┐
47
- ↓ ↓ ↓
48
- ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
49
- │ AI 格式 │ │ 选项文件 │ │ 本地化 │
50
- │ ai/standards/│ │ options/ │ │ locales/ │
51
- │ 16 个 YAML │ │ 7 类 36 个 │ │ zh-TW/zh-CN │
52
- └───────┬───────┘ └───────┬───────┘ └───────────────┘
53
- │ │
54
- └────────┬─────────┘
55
-
56
- ┌─────────────────────────────────────────────────────────────────┐
57
- │ Claude Code Skills │
58
- │ skills/ - 15 个 Skills │
59
- │ 每个 Skill 对应 1+ 个核心规范 │
60
- └──────────────────────────┬──────────────────────────────────────┘
61
-
62
-
63
- ┌─────────────────────────────────────────────────────────────────┐
64
- │ AI 工具集成 │
65
- │ integrations/ - 10 种工具模板 │
66
- │ CLI 动态生成:CLAUDE.md, .cursorrules, .windsurfrules 等 │
67
- └─────────────────────────────────────────────────────────────────┘
68
- ```
69
-
70
- ### 1.2 文件关系摘要
71
-
72
- | 来源 | 衍生格式 | 数量 |
73
- |------|----------|------|
74
- | `core/*.md` | 人类可读规范 | 16 |
75
- | `ai/standards/*.ai.yaml` | AI 优化规范 | 16 |
76
- | `options/*/*.md` | 实践选项 | 36 |
77
- | `ai/options/*/*.ai.yaml` | AI 优化选项 | 36 |
78
- | `skills/*/` | Claude Code 技能 | 15 |
79
- | `integrations/*/` | AI 工具模板 | 10 |
80
- | `locales/zh-TW/` | 繁体中文 | ~129 |
81
- | `locales/zh-CN/` | 简体中文 | 部分 |
82
-
83
- ---
84
-
85
- ## 2. 核心规范层
86
-
87
- ### 2.1 按采用层级分类
88
-
89
- #### 层级 1:Essential(6 个规范)
90
-
91
- | ID | 文件 | 说明 |
92
- |----|------|------|
93
- | anti-hallucination | `core/anti-hallucination.md` | AI 协作防幻觉指南 |
94
- | commit-message | `core/commit-message-guide.md` | Conventional Commits 规范 |
95
- | checkin-standards | `core/checkin-standards.md` | 代码签入标准 |
96
- | git-workflow | `core/git-workflow.md` | Git 工作流程标准 |
97
- | changelog | `core/changelog-standards.md` | CHANGELOG 格式规范 |
98
- | versioning | `core/versioning.md` | 语义化版本规范 |
99
-
100
- #### 层级 2:Recommended(6 个规范)
101
-
102
- | ID | 文件 | 说明 |
103
- |----|------|------|
104
- | code-review | `core/code-review-checklist.md` | 代码审查清单 |
105
- | documentation-structure | `core/documentation-structure.md` | 文档组织结构 |
106
- | documentation-writing | `core/documentation-writing-standards.md` | 文档撰写标准 |
107
- | project-structure | `core/project-structure.md` | 项目目录结构 |
108
- | testing | `core/testing-standards.md` | 测试标准 |
109
- | logging | `core/logging-standards.md` | 日志记录标准 |
110
-
111
- #### 层级 3:Enterprise(4 个规范)
112
-
113
- | ID | 文件 | 说明 |
114
- |----|------|------|
115
- | tdd | `core/test-driven-development.md` | 测试驱动开发 |
116
- | test-completeness | `core/test-completeness-dimensions.md` | 测试完整性维度 |
117
- | spec-driven | `core/spec-driven-development.md` | 规格驱动开发 |
118
- | error-codes | `core/error-code-standards.md` | 错误码标准 |
119
-
120
- ### 2.2 规范文档模板
121
-
122
- ```markdown
123
- # [规范名称]
124
-
125
- > **Language**: English | [简体中文](../locales/zh-TW/core/[file].md)
126
-
127
- **版本**: X.Y.Z
128
- **最后更新**: YYYY-MM-DD
129
-
130
- ---
131
-
132
- ## 目的
133
-
134
- [规范目的说明]
135
-
136
- ## 主要指南
137
-
138
- [详细指南]
139
-
140
- ## 相关规范
141
-
142
- - [相关规范链接]
143
-
144
- ## 版本历史
145
-
146
- | 版本 | 日期 | 变更 |
147
- |------|------|------|
148
- | X.Y.Z | YYYY-MM-DD | 说明 |
149
-
150
- ## 许可
151
-
152
- 本规范采用 [CC BY 4.0](...)
153
- ```
154
-
155
- ---
156
-
157
- ## 3. 衍生格式生成
158
-
159
- ### 3.1 AI 优化格式(`ai/`)
160
-
161
- **转换规则:**
162
- ```
163
- core/commit-message-guide.md(人类可读)
164
- ↓ 转换
165
- ai/standards/commit-message.ai.yaml(AI 优化)
166
- ```
167
-
168
- **名称映射:**
169
- | 核心文件 | AI 文件 |
170
- |----------|---------|
171
- | `changelog-standards` | `changelog` |
172
- | `code-review-checklist` | `code-review` |
173
- | `commit-message-guide` | `commit-message` |
174
- | `error-code-standards` | `error-codes` |
175
- | `logging-standards` | `logging` |
176
- | `testing-standards` | `testing` |
177
- | 其他 | 相同名称 |
178
-
179
- **AI YAML 结构:**
180
- ```yaml
181
- ---
182
- name: commit-message
183
- description: AI 助手的简要说明
184
- keywords: [commit, conventional, message, 提交, 消息]
185
- ---
186
-
187
- # Commit Message Standards
188
-
189
- ## Quick Reference
190
- [简洁内容]
191
-
192
- ## Configuration Detection
193
- [项目配置检测逻辑]
194
-
195
- ## Related Standards
196
- - [核心规范链接]
197
-
198
- ## Version History
199
- [表格]
200
-
201
- ## License
202
- CC BY 4.0
203
- ```
204
-
205
- ### 3.2 选项文件(`options/`)
206
-
207
- | 类别 | 选项 | 路径 |
208
- |------|------|------|
209
- | Git 工作流 | github-flow, gitflow, trunk-based | `options/git-workflow/` |
210
- | 合并策略 | squash, merge-commit, rebase-ff | `options/git-workflow/` |
211
- | 产出语言 | english, traditional-chinese, bilingual | `options/commit-message/` |
212
- | 测试类型 | unit, integration, e2e, system 等 | `options/testing/` |
213
- | 代码审查 | pr-review, pair-programming, automated | `options/code-review/` |
214
- | 文档类型 | markdown, api-docs, wiki-style | `options/documentation/` |
215
- | 项目结构 | nodejs, python, java, go 等 | `options/project-structure/` |
216
-
217
- ### 3.3 本地化(`locales/`)
218
-
219
- **同步层级:**
220
- ```
221
- core/*.md(主要来源)
222
-
223
- locales/zh-TW/core/*.md(繁体中文)
224
-
225
- locales/zh-CN/core/*.md(简体中文)
226
- ```
227
-
228
- **YAML Front Matter 模板:**
229
- ```yaml
230
- ---
231
- source: ../../../docs/OPERATION-WORKFLOW.md
232
- source_version: 1.2.0
233
- translation_version: 1.2.0
234
- status: current
235
- last_updated: 2026-01-10
236
- translator: [名称]
237
- ---
238
- ```
239
-
240
- **状态值:**
241
- - `current` - 翻译已同步
242
- - `outdated` - 来源已更新
243
- - `needs_review` - 需要审查
244
-
245
- ---
246
-
247
- ## 4. Claude Code Skills
248
-
249
- ### 4.1 Skills 清单(15 个 Skills)
250
-
251
- | Skill 名称 | 对应核心规范 | 路径 |
252
- |------------|--------------|------|
253
- | ai-collaboration-standards | anti-hallucination | `skills/ai-collaboration-standards/` |
254
- | changelog-guide | changelog | `skills/changelog-guide/` |
255
- | code-review-assistant | code-review, checkin | `skills/code-review-assistant/` |
256
- | commit-standards | commit-message | `skills/commit-standards/` |
257
- | documentation-guide | documentation-* | `skills/documentation-guide/` |
258
- | error-code-guide | error-codes | `skills/error-code-guide/` |
259
- | git-workflow-guide | git-workflow | `skills/git-workflow-guide/` |
260
- | logging-guide | logging | `skills/logging-guide/` |
261
- | project-structure-guide | project-structure | `skills/project-structure-guide/` |
262
- | release-standards | versioning | `skills/release-standards/` |
263
- | requirement-assistant | (需求文档) | `skills/requirement-assistant/` |
264
- | spec-driven-dev | spec-driven | `skills/spec-driven-dev/` |
265
- | tdd-assistant | tdd | `skills/tdd-assistant/` |
266
- | test-coverage-assistant | test-completeness | `skills/test-coverage-assistant/` |
267
- | testing-guide | testing | `skills/testing-guide/` |
268
-
269
- ### 4.2 Skill 目录结构
270
-
271
- ```
272
- skills/[skill-name]/
273
- ├── SKILL.md # 主要技能文档(YAML 前置 + 内容)
274
- ├── [guide1].md # 详细指南
275
- ├── [guide2].md # 详细指南
276
- └── commands/ # 可选:命令文件
277
- └── [command].md
278
- ```
279
-
280
- ### 4.3 SKILL.md 模板
281
-
282
- ```markdown
283
- ---
284
- name: skill-name
285
- description: |
286
- 简要说明。
287
- 使用时机:触发此技能的时机。
288
- 关键字:[keyword1, keyword2]
289
- ---
290
-
291
- # 技能标题
292
-
293
- > **Language**: English | [简体中文](翻译路径)
294
-
295
- **版本**: 1.0.0
296
- **最后更新**: YYYY-MM-DD
297
- **适用范围**: Claude Code Skills
298
-
299
- ---
300
-
301
- ## 目的
302
- [清楚说明]
303
-
304
- ## 快速参考
305
- [快速参考指南]
306
-
307
- ## 详细指南
308
- 完整信息请参阅:
309
- - [guide1.md](./guide1.md)
310
-
311
- ## 配置检测
312
- [项目配置检测]
313
-
314
- ## 相关规范
315
- - [core/related-standard.md](路径)
316
-
317
- ## 版本历史
318
- | 版本 | 日期 | 变更 |
319
- |------|------|------|
320
-
321
- ## 许可
322
- CC BY 4.0
323
- ```
324
-
325
- ---
326
-
327
- ## 5. AI 工具集成
328
-
329
- ### 5.1 支持工具(10 种工具)
330
-
331
- | 工具 | 集成文件 | 格式 |
332
- |------|----------|------|
333
- | Claude Code | `CLAUDE.md` | Markdown |
334
- | Cursor | `.cursorrules` | 纯文本 |
335
- | Windsurf | `.windsurfrules` | 纯文本 |
336
- | Cline | `.clinerules` | 纯文本 |
337
- | GitHub Copilot | `.github/copilot-instructions.md` | Markdown |
338
- | Google Antigravity | `INSTRUCTIONS.md` | Markdown |
339
- | OpenAI Codex | `AGENTS.md` | Markdown |
340
- | OpenCode | `AGENTS.md`(共用) | Markdown |
341
- | Gemini CLI | `GEMINI.md` | Markdown |
342
- | OpenSpec | `AGENTS.md` | Markdown |
343
-
344
- > **相关文档**:完整的 AI Agent 支持状态、Skills 兼容性矩阵及未来规划,请参阅 [AI-AGENT-ROADMAP.md](./AI-AGENT-ROADMAP.md)。
345
-
346
- ### 5.2 集成目录结构
347
-
348
- ```
349
- integrations/[tool-name]/
350
- ├── README.md # 安装和使用指南
351
- ├── [config-file] # 工具特定配置
352
- └── examples/ # 可选:示例配置
353
- ```
354
-
355
- ---
356
-
357
- ## 6. CLI 执行流程
358
-
359
- ### 6.1 完整流程图(`uds init`)
360
-
361
- ```
362
- ┌─────────────────────────────────────────────────────────────────┐
363
- │ 阶段 1:初始化检查 │
364
- │ - 检查 .standards/manifest.json 是否存在 │
365
- │ - 如已初始化,提示使用 uds update │
366
- └─────────────────────────────┬───────────────────────────────────┘
367
-
368
- ┌─────────────────────────────────────────────────────────────────┐
369
- │ 阶段 2:项目检测(detector.js) │
370
- │ - detectLanguage(): C#, PHP, TypeScript, JavaScript, Python │
371
- │ - detectFramework(): Fat-Free, React, Vue, Angular, .NET │
372
- │ - detectAITools(): 9 种 AI 工具检测 │
373
- └─────────────────────────────┬───────────────────────────────────┘
374
-
375
- ┌─────────────────────────────────────────────────────────────────┐
376
- │ 阶段 3:交互配置(prompts/init.js) │
377
- │ - AI 工具选择(1-9 种) │
378
- │ - Skills 安装位置(marketplace/user/project/none) │
379
- │ - 采用层级(Essential/Recommended/Enterprise) │
380
- │ - 格式选择(ai/human/both) │
381
- │ - 标准选项(workflow, output_language, test_levels) │
382
- │ - 内容模式(minimal/index/full) │
383
- └─────────────────────────────┬───────────────────────────────────┘
384
-
385
- ┌─────────────────────────────────────────────────────────────────┐
386
- │ 阶段 4:标准查询(registry.js) │
387
- │ - 加载 cli/standards-registry.json │
388
- │ - getStandardsByLevel() 筛选标准 │
389
- │ - getStandardSource() 获取来源路径 │
390
- └─────────────────────────────┬───────────────────────────────────┘
391
-
392
- ┌─────────────────────────────────────────────────────────────────┐
393
- │ 阶段 5:文件复制(copier.js) │
394
- │ - 核心规范 → .standards/*.md │
395
- │ - AI 格式 → .standards/*.ai.yaml │
396
- │ - 选项文件 → .standards/options/ │
397
- │ - 扩展文件 → .standards/(语言/框架/本地化) │
398
- └─────────────────────────────┬───────────────────────────────────┘
399
-
400
- ┌─────────────────────────────────────────────────────────────────┐
401
- │ 阶段 6:集成文件生成(integration-generator.js) │
402
- │ - 根据选择的 AI 工具动态生成 │
403
- │ - 依据 contentMode 调整内容量 │
404
- │ - 支持多语言(en/zh-cn) │
405
- │ 生成文件: │
406
- │ - CLAUDE.md(Claude Code) │
407
- │ - .cursorrules(Cursor) │
408
- │ - .windsurfrules(Windsurf) │
409
- │ - .clinerules(Cline) │
410
- │ - .github/copilot-instructions.md(Copilot) │
411
- │ - AGENTS.md(Codex/OpenCode) │
412
- │ - GEMINI.md(Gemini CLI) │
413
- │ - INSTRUCTIONS.md(Antigravity) │
414
- └─────────────────────────────┬───────────────────────────────────┘
415
-
416
- ┌─────────────────────────────────────────────────────────────────┐
417
- │ 阶段 7:Skills 安装(github.js) │
418
- │ - 用户级:~/.claude/skills/ │
419
- │ - 项目级:.claude/skills/ │
420
- │ - 下载全部 15 个 Skills 文件 │
421
- │ - 写入 skills-manifest.json │
422
- └─────────────────────────────┬───────────────────────────────────┘
423
-
424
- ┌─────────────────────────────────────────────────────────────────┐
425
- │ 阶段 8:哈希计算(hasher.js) │
426
- │ - 计算所有复制文件的 SHA-256 哈希 │
427
- │ - 用于 uds check 完整性验证 │
428
- └─────────────────────────────┬───────────────────────────────────┘
429
-
430
- ┌─────────────────────────────────────────────────────────────────┐
431
- │ 阶段 9:Manifest 生成 │
432
- │ - 写入 .standards/manifest.json │
433
- │ - 记录:版本、配置、文件路径、哈希、时间戳 │
434
- └─────────────────────────────────────────────────────────────────┘
435
- ```
436
-
437
- ### 6.2 生成文件结构
438
-
439
- ```
440
- project-root/
441
- ├── .standards/ # 标准目录
442
- │ ├── manifest.json # 跟踪清单
443
- │ ├── anti-hallucination.md # 核心规范(Markdown)
444
- │ ├── anti-hallucination.ai.yaml # 核心规范(AI YAML)
445
- │ ├── commit-message.md
446
- │ ├── commit-message.ai.yaml
447
- │ ├── ...(其他规范)
448
- │ └── options/ # 选项文件
449
- │ ├── github-flow.md
450
- │ ├── english.md
451
- │ └── unit-testing.md
452
-
453
- ├── CLAUDE.md # Claude Code 集成
454
- ├── .cursorrules # Cursor 集成
455
- ├── .windsurfrules # Windsurf 集成
456
- ├── .clinerules # Cline 集成
457
- ├── AGENTS.md # Codex/OpenCode 集成
458
- ├── .github/
459
- │ └── copilot-instructions.md # Copilot 集成
460
-
461
- └── .claude/ # Claude Code Skills
462
- └── skills/
463
- ├── commit-standards/
464
- ├── code-review-assistant/
465
- └── ...(其他 skills)
466
- ```
467
-
468
- ### 6.3 CLI 源码结构
469
-
470
- ```
471
- cli/
472
- ├── bin/
473
- │ └── uds.js # 入口点
474
- ├── src/
475
- │ ├── index.js # 主要导出
476
- │ ├── commands/ # 命令实现
477
- │ │ ├── init.js # init 命令(约 920 行)
478
- │ │ ├── list.js # list 命令
479
- │ │ ├── check.js # check 命令
480
- │ │ ├── update.js # update 命令
481
- │ │ ├── configure.js # configure 命令
482
- │ │ └── skills.js # skills 命令
483
- │ ├── prompts/ # 交互提示
484
- │ │ ├── init.js # init 提示(约 1007 行)
485
- │ │ └── integrations.js # 集成提示
486
- │ └── utils/ # 工具模块
487
- │ ├── registry.js # 标准注册表(207 行)
488
- │ ├── copier.js # 文件复制(143 行)
489
- │ ├── github.js # GitHub 下载(508 行)
490
- │ ├── detector.js # 项目检测(159 行)
491
- │ ├── hasher.js # 哈希计算(219 行)
492
- │ ├── integration-generator.js # 集成生成(2310 行)
493
- │ └── reference-sync.js # 引用同步(189 行)
494
- ├── standards-registry.json # 标准注册表(约 1000 行)
495
- └── package.json # 依赖包
496
- ```
497
-
498
- ---
499
-
500
- ## 7. 维护流程
501
-
502
- ### 7.1 同步检查脚本
503
-
504
- | 脚本 | 用途 | 命令 |
505
- |------|------|------|
506
- | `check-translation-sync.sh` | 检查翻译同步 | `./scripts/check-translation-sync.sh [locale]` |
507
- | `check-standards-sync.sh` | 检查 MD ↔ AI YAML 同步 | `./scripts/check-standards-sync.sh` |
508
- | `check-version-sync.sh` | 检查版本一致性 | `./scripts/check-version-sync.sh` |
509
- | `check-install-scripts-sync.sh` | 检查安装脚本同步 | `./scripts/check-install-scripts-sync.sh` |
510
- | `pre-release.sh` | 预发布自动化 | `./scripts/pre-release.sh --version X.Y.Z` |
511
-
512
- ### 7.2 翻译同步机制
513
-
514
- **检查流程:**
515
- ```bash
516
- # 检查 zh-TW 翻译
517
- ./scripts/check-translation-sync.sh
518
-
519
- # 检查 zh-CN 翻译
520
- ./scripts/check-translation-sync.sh zh-CN
521
- ```
522
-
523
- **输出状态:**
524
- - `[CURRENT]`(绿色)- 翻译已同步
525
- - `[OUTDATED]`(红色)- 翻译版本过旧
526
- - `[NO META]`(黄色)- 缺少 YAML Front Matter
527
- - `[MISSING]`(红色)- 来源文件不存在
528
-
529
- **更新流程:**
530
- 1. 执行同步检查
531
- 2. 打开过时的翻译文件
532
- 3. 更新内容
533
- 4. 更新 YAML Front Matter 中的 `source_version` 和 `translation_version`
534
- 5. 再次执行同步检查验证
535
-
536
- ### 7.3 标准同步机制
537
-
538
- **检查流程:**
539
- ```bash
540
- ./scripts/check-standards-sync.sh
541
- ```
542
-
543
- **第一阶段:core/ ↔ ai/standards/**
544
- ```
545
- core/changelog-standards.md ↔ ai/standards/changelog.ai.yaml
546
- core/commit-message-guide.md ↔ ai/standards/commit-message.ai.yaml
547
- ...
548
- ```
549
-
550
- **第二阶段:options/ ↔ ai/options/**
551
- ```
552
- options/git-workflow/github-flow.md ↔ ai/options/git-workflow/github-flow.ai.yaml
553
- options/commit-message/english.md ↔ ai/options/commit-message/english.ai.yaml
554
- ...
555
- ```
556
-
557
- ### 7.4 版本同步机制
558
-
559
- **版本文件位置(6 处):**
560
-
561
- | 文件 | 字段 | 更新频率 |
562
- |------|------|----------|
563
- | `cli/package.json` | `"version"` | 每次发布 |
564
- | `.claude-plugin/plugin.json` | `"version"` | 每次发布 |
565
- | `.claude-plugin/marketplace.json` | `"version"` | 每次发布 |
566
- | `cli/standards-registry.json` | 根 `"version"` | 每次发布 |
567
- | `cli/standards-registry.json` | `repositories.standards.version` | 每次发布 |
568
- | `cli/standards-registry.json` | `repositories.skills.version` | 每次发布 |
569
- | `README.md` | `**Version**:` | 仅稳定版本 |
570
-
571
- **检查流程:**
572
- ```bash
573
- ./scripts/check-version-sync.sh
574
- ```
575
-
576
- ### 7.5 CLI 与斜线命令同步
577
-
578
- #### 关系概述
579
-
580
- UDS 有两个相关但独立的组件:
581
-
582
- | 组件 | 类型 | 位置 | 用途 |
583
- |------|------|------|------|
584
- | UDS CLI | Node.js 程序 | `cli/src/` | 执行实际操作(`uds init`、`uds check` 等)|
585
- | 斜线命令 | Markdown 文档 | `skills/commands/` | 指导 AI 如何使用 CLI |
586
-
587
- **执行流程:**
588
- ```
589
- 用户在 Claude Code 输入 /update
590
-
591
- AI 读取 skills/commands/update.md
592
-
593
- AI 执行 CLI 命令(uds check、uds update)
594
-
595
- AI 根据 CLI 输出向用户报告结果
596
- ```
597
-
598
- #### 同步要求
599
-
600
- 修改 CLI 功能时,对应的斜线命令文档**必须**同步更新:
601
-
602
- | CLI 文件 | 斜线命令 |
603
- |----------|----------|
604
- | `cli/src/commands/init.js` | `skills/commands/init.md` |
605
- | `cli/src/commands/check.js` | `skills/commands/check.md` |
606
- | `cli/src/commands/update.js` | `skills/commands/update.md` |
607
- | `cli/src/commands/configure.js` | `skills/commands/configure.md` |
608
- | `cli/src/commands/list.js` | `skills/commands/list.md` |
609
- | `cli/src/commands/skills.js` | `skills/commands/skills.md` |
610
-
611
- #### 同步检查清单
612
-
613
- 添加 CLI 功能时:
614
-
615
- 1. [ ] 在 CLI 实现功能(`cli/src/commands/*.js` 或 `cli/src/utils/*.js`)
616
- 2. [ ] 添加单元测试(`cli/tests/`)
617
- 3. [ ] 更新斜线命令文档(`skills/commands/*.md`)
618
- 4. [ ] 如需要,更新翻译(`locales/zh-TW/skills/`、`locales/zh-CN/skills/`)
619
- 5. [ ] 运行验证:`cd cli && npm test && npm run lint`
620
-
621
- #### 示例:添加 Marketplace Skills 版本检测
622
-
623
- 当 CLI `check.js` 更新以检测 Plugin Marketplace Skills 版本时:
624
-
625
- ```
626
- 步骤 1:在 cli/src/utils/github.js 添加 getMarketplaceSkillsInfo()
627
- - 读取 ~/.claude/plugins/installed_plugins.json
628
- - 返回 universal-dev-standards plugin 的版本信息
629
-
630
- 步骤 2:更新 cli/src/commands/check.js 的 displaySkillsStatus()
631
- - 对 Marketplace 安装调用 getMarketplaceSkillsInfo()
632
- - 显示版本和最后更新日期
633
-
634
- 步骤 3:在 cli/tests/utils/github.test.js 添加单元测试
635
- - 测试各种场景(文件存在、找不到、解析错误)
636
-
637
- 步骤 4:更新 skills/commands/check.md
638
- - 在 Skills Status 区段记录新的版本输出
639
-
640
- 步骤 5:更新 skills/commands/update.md
641
- - 添加说明如何检查 Skills 版本的章节
642
- ```
643
-
644
- **关键洞察**:如果不更新斜线命令文档,AI 将不知道新的 CLI 功能,可能向用户提供不准确的信息。
645
-
646
- ---
647
-
648
- ## 8. 开发指南
649
-
650
- ### 8.1 新增核心规范
651
-
652
- **完整流程(10 步骤):**
653
-
654
- ```
655
- 步骤 1:创建 core/new-standard.md
656
-
657
- 步骤 2:创建 ai/standards/new-standard.ai.yaml
658
-
659
- 步骤 3:创建 options/new-standard/*.md(如适用)
660
-
661
- 步骤 4:创建 ai/options/new-standard/*.ai.yaml(如适用)
662
-
663
- 步骤 5:创建 skills/new-skill/(如适用)
664
-
665
- 步骤 6:创建 locales/zh-TW/core/new-standard.md
666
-
667
- 步骤 7:创建 locales/zh-CN/core/new-standard.md
668
-
669
- 步骤 8:更新 cli/standards-registry.json
670
-
671
- 步骤 9:更新 CHANGELOG.md
672
-
673
- 步骤 10:执行所有同步检查脚本
674
- ```
675
-
676
- **详细步骤:**
677
-
678
- 1. **创建核心规范**
679
- ```bash
680
- # 创建 markdown 文件
681
- touch core/new-standard.md
682
- # 遵循标准模板结构
683
- ```
684
-
685
- 2. **创建 AI 优化版本**
686
- ```bash
687
- touch ai/standards/new-standard.ai.yaml
688
- # 使用简洁的 YAML 格式
689
- ```
690
-
691
- 3. **创建选项(如适用)**
692
- ```bash
693
- mkdir -p options/new-standard
694
- touch options/new-standard/option-1.md
695
- touch options/new-standard/option-2.md
696
-
697
- mkdir -p ai/options/new-standard
698
- touch ai/options/new-standard/option-1.ai.yaml
699
- touch ai/options/new-standard/option-2.ai.yaml
700
- ```
701
-
702
- 4. **创建 Skill(如适用)**
703
- ```bash
704
- mkdir -p skills/new-standard-skill
705
- touch skills/new-standard-skill/SKILL.md
706
- touch skills/new-standard-skill/guide.md
707
- ```
708
-
709
- 5. **创建翻译**
710
- ```bash
711
- touch locales/zh-TW/core/new-standard.md
712
- touch locales/zh-CN/core/new-standard.md
713
- # 添加含来源跟踪的 YAML Front Matter
714
- ```
715
-
716
- 6. **更新注册表**
717
- ```json
718
- // 在 cli/standards-registry.json 中
719
- {
720
- "standards": [
721
- {
722
- "id": "new-standard",
723
- "name": "New Standard Name",
724
- "level": 2,
725
- "category": "reference",
726
- "source": {
727
- "ai": "ai/standards/new-standard.ai.yaml",
728
- "human": "core/new-standard.md"
729
- }
730
- }
731
- ]
732
- }
733
- ```
734
-
735
- 7. **验证**
736
- ```bash
737
- ./scripts/check-standards-sync.sh
738
- ./scripts/check-translation-sync.sh
739
- ./scripts/check-translation-sync.sh zh-CN
740
- cd cli && npm test
741
- ```
742
-
743
- ### 8.2 新增 Skill
744
-
745
- **完整流程(6 步骤):**
746
-
747
- ```
748
- 步骤 1:创建 skills/new-skill/ 目录
749
-
750
- 步骤 2:创建含 YAML 前置的 SKILL.md
751
-
752
- 步骤 3:创建辅助指南文件
753
-
754
- 步骤 4:在 locales/ 中创建翻译
755
-
756
- 步骤 5:更新文档(README.md 等)
757
-
758
- 步骤 6:执行验证脚本
759
- ```
760
-
761
- ### 8.3 新增 AI 工具集成
762
-
763
- **完整流程(14 步骤):**
764
-
765
- ```
766
- 阶段 1:研究与规划(3 步骤)
767
- 步骤 1:研究目标工具的指令格式与功能
768
- 步骤 2:识别相较于 Claude Code 的限制
769
- 步骤 3:创建 Skills 对照计划(哪些 Claude Code 功能要迁移)
770
-
771
- 阶段 2:核心文件 - 4 文件模式(4 步骤)
772
- 步骤 4:创建 integrations/[tool-name]/ 目录
773
- 步骤 5:创建 README.md(安装指南、限制说明、功能比较)
774
- 步骤 6:创建 [tool]-instructions.md(主要 AI 指令)
775
- 步骤 7:创建 CHAT-REFERENCE.md(适用于无斜线命令的工具)
776
- 步骤 8:创建 skills-mapping.md(Claude Code → 工具功能对照)
777
-
778
- 阶段 3:翻译(2 步骤)
779
- 步骤 9:创建 locales/zh-TW/integrations/[tool-name]/(4 个文件)
780
- 步骤 10:创建 locales/zh-CN/integrations/[tool-name]/(4 个文件)
781
-
782
- 阶段 4:集成更新(3 步骤)
783
- 步骤 11:更新 integration-generator.js(如需 CLI 动态生成)
784
- 步骤 12:更新 skills/[tool]/ 精简版(如存在)
785
- 步骤 13:更新相关文档(README.md 等)
786
-
787
- 阶段 5:验证(1 步骤)
788
- 步骤 14:执行所有验证脚本
789
- ```
790
-
791
- #### 4 文件模式(必要结构)
792
-
793
- 完整的 AI 工具集成需创建这 4 个文件:
794
-
795
- | 文件 | 用途 | 必要 |
796
- |------|------|------|
797
- | `README.md` | 安装指南、快速开始、限制说明、功能比较 | ✅ 必要 |
798
- | `[tool]-instructions.md` | 工具的主要 AI 指令 | ✅ 必要 |
799
- | `CHAT-REFERENCE.md` | Chat 提示模板(适用于无斜线命令的工具) | ⚠️ 视情况 |
800
- | `skills-mapping.md` | Claude Code → 工具功能对照 | ✅ 必要 |
801
-
802
- **示例:**
803
- ```
804
- integrations/github-copilot/
805
- ├── README.md # 集成概述
806
- ├── copilot-instructions.md # 主要指令
807
- ├── COPILOT-CHAT-REFERENCE.md # Chat 提示模板
808
- └── skills-mapping.md # Skills 迁移指南
809
- ```
810
-
811
- #### README.md 模板
812
-
813
- ```markdown
814
- # [工具名称] 集成
815
-
816
- ## 概述
817
- [简要说明]
818
-
819
- ## 快速开始
820
-
821
- ### 方式 1:从仓库复制
822
- ### 方式 2:使用 curl 下载
823
- ### 方式 3:使用 UDS CLI
824
-
825
- ## 配置方式
826
- [IDE 特定设置:VS Code、JetBrains 等]
827
-
828
- ## 限制说明
829
- [与 Claude Code 和其他工具的功能比较表]
830
-
831
- ## 包含的规范
832
- [集成中包含的规范表格]
833
-
834
- ## 验证集成
835
- [如何验证集成是否正常工作]
836
-
837
- ## 相关规范
838
- ## 版本历史
839
- ## 许可
840
- ```
841
-
842
- #### Skills 对照方法论
843
-
844
- 将 Claude Code 功能迁移到其他工具时:
845
-
846
- | Claude Code 功能 | 迁移策略 |
847
- |------------------|----------|
848
- | Skills(18 个) | → 指令文件中的专用章节 |
849
- | 斜线命令(16 个) | → CHAT-REFERENCE.md 中的 Chat 提示模板 |
850
- | MCP 支持 | → 记录为限制,建议替代方案 |
851
- | 全局配置 | → 记录为限制 |
852
- | 自动触发关键字 | → 建议使用 IDE 代码片段/快捷键作为替代 |
853
- | 方法论跟踪 | → 记录为限制,建议手动跟踪 |
854
-
855
- #### 翻译要求
856
-
857
- 每个集成需要 8 个翻译文件(每种语言 4 个):
858
-
859
- **目录:**
860
- - `locales/zh-TW/integrations/[tool-name]/`(繁体中文)
861
- - `locales/zh-CN/integrations/[tool-name]/`(简体中文)
862
-
863
- **YAML 前置模板:**
864
- ```yaml
865
- ---
866
- source: ../../../docs/OPERATION-WORKFLOW.md
867
- source_version: X.Y.Z
868
- translation_version: X.Y.Z
869
- last_synced: YYYY-MM-DD
870
- status: current
871
- ---
872
- ```
873
-
874
- #### 验证检查清单
875
-
876
- 完成集成后,验证:
877
-
878
- ```bash
879
- # 翻译同步检查
880
- ./scripts/check-translation-sync.sh
881
- ./scripts/check-translation-sync.sh zh-CN
882
-
883
- # 标准一致性检查
884
- ./scripts/check-standards-sync.sh
885
-
886
- # CLI 测试(如修改了 integration-generator.js)
887
- cd cli && npm test && npm run lint
888
-
889
- # 完整预发布检查
890
- ./scripts/pre-release-check.sh
891
- ```
892
-
893
- #### 功能比较表模板
894
-
895
- 在 README.md 中包含此表格:
896
-
897
- | 功能 | [新工具] | Claude Code | 其他工具 |
898
- |------|----------|-------------|----------|
899
- | 项目指令 | ✅/❌ | ✅ | ... |
900
- | 全局配置 | ✅/❌ | ✅ | ... |
901
- | 斜线命令 | ✅/❌ | ✅(18 个 skills) | ... |
902
- | MCP 支持 | ✅/❌ | ✅ | ... |
903
- | 自定义 skills | ✅/❌ | ✅ | ... |
904
- | 多文件上下文 | ✅/❌ | ✅ | ... |
905
-
906
- ---
907
-
908
- ## 9. 发布流程
909
-
910
- ### 9.1 预发布检查清单
911
-
912
- **任何发布前:**
913
- - [ ] 所有测试通过(`npm test`)
914
- - [ ] Linting 通过(`npm run lint`)
915
- - [ ] 版本同步检查通过(`./scripts/check-version-sync.sh`)
916
- - [ ] CHANGELOG.md 已更新
917
- - [ ] Git 工作目录干净
918
- - [ ] 文档同步检查通过(`./scripts/check-usage-docs-sync.sh`)
919
- - [ ] 文档完整性检查通过(`./scripts/check-docs-integrity.sh`)
920
-
921
- **文档同步检查清单:**
922
- - [ ] 生成的文档与源文件一致
923
- - [ ] 文档链接有效
924
- - [ ] 功能数量与实际数量相符
925
- - [ ] 跨语言表格的行数一致
926
-
927
- > **注意**:以上所有文档检查均已包含在 `./scripts/pre-release-check.sh` 中。
928
-
929
- **版本文件检查清单(6 个文件):**
930
- - [ ] `cli/package.json` - `"version": "X.Y.Z"`
931
- - [ ] `.claude-plugin/plugin.json` - `"version": "X.Y.Z"`
932
- - [ ] `.claude-plugin/marketplace.json` - `"version": "X.Y.Z"`
933
- - [ ] `cli/standards-registry.json` - 3 处位置
934
- - [ ] `README.md` - `**Version**:`(仅稳定版本)
935
-
936
- ### 9.2 版本类型与 npm Tags
937
-
938
- | 类型 | 版本格式 | npm Tag | 用途 |
939
- |------|----------|---------|------|
940
- | 稳定版 | `3.3.0` | `@latest` | 正式发布 |
941
- | Beta | `3.3.0-beta.1` | `@beta` | 测试新功能 |
942
- | Alpha | `3.3.0-alpha.1` | `@alpha` | 早期内部测试 |
943
- | RC | `3.3.0-rc.1` | `@rc` | 最终预发布测试 |
944
-
945
- ### 9.3 完整发布工作流
946
-
947
- ```
948
- 步骤 1:预发布准备
949
- ./scripts/pre-release.sh --version X.Y.Z
950
-
951
- 步骤 2:更新 CHANGELOG.md
952
- (遵循 Keep a Changelog 格式)
953
-
954
- 步骤 3:提交变更
955
- git add -A
956
- git commit -m "chore(release): prepare vX.Y.Z"
957
-
958
- 步骤 4:创建 Git 标签
959
- git tag vX.Y.Z
960
- git push origin main --tags
961
-
962
- 步骤 5:创建 GitHub Release
963
- (在 GitHub UI 中手动操作)
964
-
965
- 步骤 6:GitHub Actions 自动发布
966
- - 检测版本类型(stable/beta/alpha/rc)
967
- - npm publish --tag [latest/beta/alpha/rc]
968
-
969
- 步骤 7:验证发布
970
- npm view universal-dev-standards dist-tags
971
- ```
972
-
973
- ### 9.4 GitHub Actions 工作流
974
-
975
- **CI 工作流(`.github/workflows/ci.yml`):**
976
- - 触发条件:Push 到 main、PR 到 main
977
- - 工作:Linting、测试(多矩阵)、翻译同步检查
978
-
979
- **发布工作流(`.github/workflows/publish.yml`):**
980
- - 触发条件:GitHub Release 发布
981
- - 自动从 package.json 检测版本类型
982
- - 使用适当的 tag 发布到 npm
983
-
984
- ---
985
-
986
- ## 10. 文件路径参考
987
-
988
- ### 10.1 核心目录
989
-
990
- | 目录 | 说明 | 数量 |
991
- |------|------|------|
992
- | `core/` | 人类可读核心规范 | 16 文件 |
993
- | `ai/standards/` | AI 优化规范 | 16 文件 |
994
- | `ai/options/` | AI 优化选项 | 36 文件 |
995
- | `options/` | 人类可读选项 | 36 文件 |
996
- | `skills/` | Claude Code skills | 15 目录 |
997
- | `integrations/` | AI 工具集成模板 | 10 目录 |
998
- | `locales/zh-TW/` | 繁体中文翻译 | ~129 文件 |
999
- | `locales/zh-CN/` | 简体中文翻译 | 部分 |
1000
-
1001
- ### 10.2 维护脚本
1002
-
1003
- | 脚本 | 路径 | 用途 |
1004
- |------|------|------|
1005
- | 翻译同步 | `scripts/check-translation-sync.sh` | 检查翻译同步 |
1006
- | 标准同步 | `scripts/check-standards-sync.sh` | 检查 MD ↔ YAML 同步 |
1007
- | 版本同步 | `scripts/check-version-sync.sh` | 检查版本一致性 |
1008
- | 安装脚本同步 | `scripts/check-install-scripts-sync.sh` | 检查安装脚本 |
1009
- | 预发布 | `scripts/pre-release.sh` | 预发布自动化 |
1010
-
1011
- ### 10.3 配置文件
1012
-
1013
- | 文件 | 用途 |
1014
- |------|------|
1015
- | `cli/package.json` | 主版本来源、依赖包 |
1016
- | `cli/standards-registry.json` | 标准注册表、版本信息 |
1017
- | `.claude-plugin/plugin.json` | Plugin 配置 |
1018
- | `.claude-plugin/marketplace.json` | Marketplace 配置 |
1019
- | `cli/.eslintrc.json` | ESLint 配置 |
1020
- | `cli/vitest.config.js` | 测试配置 |
1021
-
1022
- ### 10.4 GitHub Actions
1023
-
1024
- | 文件 | 用途 |
1025
- |------|------|
1026
- | `.github/workflows/ci.yml` | CI 工作流(测试、linting) |
1027
- | `.github/workflows/publish.yml` | npm 发布工作流 |
1028
-
1029
- ---
1030
-
1031
- ## 附录:快速参考命令
1032
-
1033
- ### 日常维护
1034
-
1035
- ```bash
1036
- # 执行所有同步检查
1037
- ./scripts/check-standards-sync.sh
1038
- ./scripts/check-translation-sync.sh
1039
- ./scripts/check-version-sync.sh
1040
-
1041
- # 执行测试和 linting
1042
- cd cli && npm test && npm run lint
1043
- ```
1044
-
1045
- ### 预发布
1046
-
1047
- ```bash
1048
- # 自动化预发布准备
1049
- ./scripts/pre-release.sh --version 3.4.0
1050
-
1051
- # 或使用选项
1052
- ./scripts/pre-release.sh --version 3.4.0-beta.1 --skip-translations
1053
- ```
1054
-
1055
- ### 发布
1056
-
1057
- ```bash
1058
- # 提交并标记
1059
- git add -A
1060
- git commit -m "chore(release): prepare v3.4.0"
1061
- git tag v3.4.0
1062
- git push origin main --tags
1063
-
1064
- # 在 GitHub Release 后验证
1065
- npm view universal-dev-standards dist-tags
1066
- ```
1067
-
1068
- ---
1069
-
1070
- ## 许可
1071
-
1072
- 本文档采用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)。
1073
-
1074
- **来源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)