universal-dev-standards 5.15.1 → 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.
Files changed (80) hide show
  1. package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
  2. package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
  3. package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +1 -1
  4. package/bundled/core/acceptance-criteria-traceability.md +46 -0
  5. package/bundled/core/forward-derivation-standards.md +19 -0
  6. package/bundled/core/knowledge-graph-memory.md +2 -2
  7. package/bundled/locales/zh-CN/CHANGELOG.md +13 -3
  8. package/bundled/locales/zh-CN/README.md +1 -1
  9. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
  10. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
  11. package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
  12. package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
  13. package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
  14. package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
  15. package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
  16. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
  17. package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
  18. package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
  19. package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
  20. package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
  21. package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
  22. package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
  23. package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
  24. package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
  25. package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
  26. package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
  27. package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
  28. package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
  29. package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
  30. package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
  31. package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
  32. package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
  33. package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
  34. package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
  35. package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
  36. package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
  37. package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
  38. package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
  39. package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
  40. package/bundled/locales/zh-TW/CHANGELOG.md +13 -3
  41. package/bundled/locales/zh-TW/README.md +1 -1
  42. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
  43. package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
  44. package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
  45. package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
  46. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
  47. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -2
  48. package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
  49. package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
  50. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
  51. package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
  52. package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
  53. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
  54. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
  55. package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
  56. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
  57. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +5 -5
  58. package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
  59. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
  60. package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
  61. package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +3 -2
  62. package/bundled/locales/zh-TW/skills/plan/SKILL.md +3 -2
  63. package/bundled/locales/zh-TW/skills/push/SKILL.md +3 -2
  64. package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
  65. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
  66. package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
  67. package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
  68. package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
  69. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
  70. package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
  71. package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
  72. package/bundled/skills/brainstorm-assistant/guide.md +256 -661
  73. package/bundled/skills/commands/brainstorm.md +51 -30
  74. package/bundled/skills/knowledge-graph/SKILL.md +5 -5
  75. package/bundled/skills/knowledge-graph/guide.md +4 -4
  76. package/package.json +2 -2
  77. package/src/commands/check.js +11 -2
  78. package/src/lint/i18n.js +109 -23
  79. package/standards-registry.json +4 -4
  80. package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
@@ -2,148 +2,222 @@
2
2
  source: ../../../../skills/spec-driven-dev/SKILL.md
3
3
  source_version: 1.2.0
4
4
  translation_version: 1.2.0
5
- last_synced: 2026-03-23
5
+ last_synced: 2026-06-02
6
+ source_hash: 195f50bcbfb7
6
7
  status: current
7
8
  description: |
8
9
  在编写代码前,建立、审查和管理规格文件。
9
10
  使用时机:建立规格、审查设计、规格驱动开发流程。
10
11
  关键字:spec, specification, SDD, design, review, 规格, 设计, 审查, 验证。
11
12
  ---
13
+ <!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
14
+ SDD 生命周期编排(7 阶段状态机、阶段转换、闸门检查)已迁移至
15
+ 采用层(XSPEC-095, 2026-04-28)。本 Skill 保留:spec 格式定义、状态
16
+ 描述、delta 操作、决策树。
17
+ 如需强制执行的生命周期,请使用你采用层的工具链。
18
+ -->
12
19
 
13
- # 规格驱动开发助手
20
+ # Spec-Driven Development Assistant | 规格驱动开发助手
14
21
 
15
- > **语言**: [English](../../../../skills/spec-driven-dev/SKILL.md) | 简体中文
22
+ 在编写代码前,建立、审查和管理规格文件。
16
23
 
17
24
  在编写代码前,建立、审查和管理规格文件。
18
25
 
19
- ## 快速检查清单
26
+ ## When to Use `/sdd` vs `uds spec` | 何时使用
27
+
28
+ | 场景 | `/sdd` | `uds spec` |
29
+ |----------|--------|------------|
30
+ | 带审查周期的正式功能开发 | ✅ | ❌ |
31
+ | 完整 spec 生命周期(Draft → Archived) | ✅ | ❌ |
32
+ | 快速原型 / Vibe coding | ❌ | ✅ |
33
+ | 小幅增量改动 | ❌ | ✅ |
34
+ | 需要利益相关方签核 | ✅ | ❌ |
35
+ | 从自然语言意图生成 micro-spec | ❌ | ✅ |
36
+
37
+ > **`/sdd`** = 用于正式开发的完整 spec 生命周期
38
+ > **`uds spec`** = 用于快速迭代的轻量 micro-spec
39
+ >
40
+ > **`/sdd`** = 正式开发的完整规格生命周期
41
+ > **`uds spec`** = 快速迭代的轻量微规格
42
+
43
+ ## TL;DR Quick Checklist | 快速检查清单
20
44
 
21
- - 搜索现有规格:查看 `specs/`、`docs/specs/` 或项目规格目录
22
- - 决定范围:新功能 vs 修改现有功能
23
- - 选择唯一的规格 ID:`SPEC-NNN` 或 kebab-case 变更 ID
24
- - 撰写包含明确 AC(Given/When/Then 格式)的提案
25
- - 实现前取得核准
26
- - 依序实现任务,对照规格验证
27
- - 完成后归档规格
45
+ - 搜索已有 spec:查看 `specs/`、`docs/specs/` 或项目的 spec 目录
46
+ - 确定范围:新增功能 vs 修改既有能力
47
+ - 选取唯一的 spec ID:`SPEC-NNN` 或 kebab-case 变更 ID
48
+ - 撰写提案,包含清晰的 AC(Given/When/Then 格式)
49
+ - 在实作开始前取得批准
50
+ - 按顺序实作各任务,对照 spec 进行验证
51
+ - 完成后归档 spec
28
52
 
29
- ## 决策树
53
+ ## Decision Tree | 决策树
30
54
 
31
55
  ```
32
- 新需求?
33
- ├─ 修复符合规格行为的 Bug → 直接修复
34
- ├─ 错字/格式/注释? → 直接修复
35
- ├─ 依赖套件更新(不破坏兼容性)? → 直接修复
36
- ├─ 新功能/能力? → 建立提案
37
- ├─ 破坏性变更? → 建立提案
38
- ├─ 架构变更? → 建立提案
39
- └─ 不确定?建立提案(较安全)
56
+ New request? | 新需求?
57
+ ├─ Bug fix restoring spec behavior? Fix directly | 直接修复
58
+ ├─ Typo/format/comment?Fix directly | 直接修复
59
+ ├─ Dependency update (non-breaking)? Fix directly | 直接修复
60
+ ├─ New feature/capability? Create proposal | 建立提案
61
+ ├─ Breaking change? Create proposal | 建立提案
62
+ ├─ Architecture change? Create proposal | 建立提案
63
+ ├─ Agent/role definition (spans multiple features)? Use spec-type: agent | 使用 Agent SPEC template
64
+ └─ Unclear? → Create proposal (safer) | 建立提案(较安全)
40
65
  ```
41
66
 
42
- ## 工作流程
67
+ ## Workflow | 工作流程
43
68
 
44
69
  ```
45
70
  DISCUSS ──► CREATE ──► REVIEW ──► APPROVE ──► IMPLEMENT ──► VERIFY ──► ARCHIVE
46
71
  ```
47
72
 
48
- ### 0. Discuss - 厘清范围
49
- 在编写规格前,捕捉模糊地带、建立治理原则、解决歧义。
73
+ ### 0. Discuss - Clarify Scope | 厘清范围
74
+ 捕捉灰色地带、建立指导原则,并在撰写 spec 前消解歧义。
50
75
 
51
- ### 1. Create - 编写规格
52
- 定义需求、技术设计、验收条件和测试计划。
76
+ ### 1. Create - Write Spec | 撰写规格
77
+ 定义需求、技术设计、验收条件与测试计划。
53
78
 
54
- ### 2. Review - 审查验证
55
- 与利害关系人检查完整性、一致性和可行性。
79
+ ### 2. Review - Validate | 审查验证
80
+ 与利益相关方一起检查完整性、一致性与可行性。
56
81
 
57
- ### 3. Approve - 核准
58
- 在实现开始前取得利害关系人签核。
82
+ ### 3. Approve - Sign Off | 核准
83
+ 在实作开始前取得利益相关方签核。
59
84
 
60
- ### 4. Implement - 实现
61
- 依据已核准的规格进行开发,参照需求和验收条件。
85
+ ### 4. Implement - Code | 实作
86
+ 依据已核准的 spec 进行开发,参照需求与 AC。
62
87
 
63
- ### 5. Verify - 验证
64
- 确保实现符合规格,所有测试通过,验收条件已满足。
88
+ ### 5. Verify - Confirm | 验证
89
+ 确保实作与 spec 相符、所有测试通过、AC 满足。
65
90
 
66
- ### 6. Archive - 归档
67
- 归档已完成的规格,链接至 commits/PRs。
91
+ ### 6. Archive - Close | 归档
92
+ 将完成的 spec 归档,并附上指向 commit/PR 的链接。
68
93
 
69
- ## 规格状态
94
+ ## Spec States | 规格状态
70
95
 
71
- | 状态 | 说明 | State | Description |
72
- |------|------|-------|-------------|
73
- | **Draft** | 草稿中 | Draft | Work in progress |
74
- | **Review** | 审查中 | Review | Under review |
75
- | **Approved** | 已核准 | Approved | Ready for implementation |
76
- | **Implemented** | 已实现 | Implemented | Code complete |
77
- | **Archived** | 已归档 | Archived | Completed or deprecated |
96
+ | 状态 | Description | 说明 |
97
+ |-------|-------------|------|
98
+ | **Draft** | Work in progress | 草稿中 |
99
+ | **Review** | Under review | 审查中 |
100
+ | **Approved** | Ready for implementation | 已核准 |
101
+ | **Implemented** | Code complete | 已实作 |
102
+ | **Archived** | Completed or deprecated | 已归档 |
78
103
 
79
- ## 规格结构
104
+ ## Spec Structure | 规格结构
80
105
 
81
106
  ```markdown
82
107
  # [SPEC-ID] Feature: [Name]
83
108
 
84
109
  ## Overview
85
- 简短描述提案变更。
110
+ Brief description of the proposed change.
86
111
 
87
112
  ## Motivation
88
- 为什么需要这个变更?解决什么问题?
113
+ Why is this change needed? What problem does it solve?
89
114
 
90
115
  ## Requirements
91
116
  ### Requirement: [Name]
92
- 系统 SHALL [行为描述]
117
+ The system SHALL [behavior description].
93
118
 
94
- #### Scenario: [成功案例]
95
- - **GIVEN** [初始情境]
96
- - **WHEN** [执行动作]
97
- - **THEN** [预期结果]
119
+ #### Scenario: [Success case]
120
+ - **GIVEN** [initial context]
121
+ - **WHEN** [action performed]
122
+ - **THEN** [expected result]
98
123
 
99
124
  ## Acceptance Criteria
100
125
  - AC-1: Given [context], when [action], then [result]
101
126
 
102
127
  ## Technical Design
103
- [架构、API 变更、数据库变更]
128
+ [Architecture, API changes, database changes]
104
129
 
105
130
  ## Test Plan
106
- - [ ] [组件] 的单元测试
107
- - [ ] [流程] 的集成测试
131
+ - [ ] Unit tests for [component]
132
+ - [ ] Integration tests for [flow]
108
133
  ```
109
134
 
110
- ### 场景格式规则
135
+ ### Agent SPEC Structure | Agent 规格结构(`spec-type: agent`)
136
+
137
+ ```markdown
138
+ # [SPEC-ID] Agent: [Role Name]
139
+ <!-- spec-type: agent -->
140
+ <!-- agent-id auto-referenced by feature SPECs -->
141
+
142
+ ## Role Definition
143
+ - **Role**: [Agent Name]
144
+ - **Responsibility**: [One sentence]
145
+ - **Autonomy Level**: L[1-5] (per DEC-065)
146
+
147
+ ## Capability Scope
148
+ **Owns:**
149
+ - [Capability 1]
150
+ - [Capability 2]
151
+
152
+ **Does NOT own:**
153
+ - [Explicit exclusion]
154
+
155
+ ## Interface Contract
156
+ ### Input
157
+ | Message Type | Required Fields | Optional Fields |
158
+ |---|---|---|
159
+ | [Type] | [fields] | [fields] |
160
+
161
+ ### Output
162
+ | Artifact Type | Success Condition | Failure Condition |
163
+ |---|---|---|
164
+ | [Type] | [condition] | [condition] |
165
+
166
+ ## Agent Interactions
167
+ - **Upstream**: [Who calls this agent]
168
+ - **Downstream**: [Who this agent calls]
169
+ - **Parallel**: [Agents working alongside]
170
+
171
+ ## Related Feature SPECs
172
+ - [SPEC-NNN] — [This agent's role in that spec]
173
+ ```
111
174
 
112
- - 使用 `#### Scenario:` (h4 标题) 撰写每个场景
113
- - 每个需求必须至少有一个场景
175
+ ### Scenario Formatting Rules | 场景格式规则
176
+
177
+ - 每个场景使用 `#### Scenario:`(h4 标题)
178
+ - 每条 requirement 必须至少有一个场景
114
179
  - 使用 **GIVEN/WHEN/THEN** 格式描述结构化行为
115
- - 使用 **SHALL/MUST** 表达强制需求,**SHOULD** 表达建议
180
+ - 规范性需求使用 **SHALL/MUST**,建议性使用 **SHOULD**
116
181
 
117
- ## 变更操作
182
+ ## Delta Operations | 变更操作
118
183
 
119
- 修改现有规格时,使用 delta 区段:
184
+ 修改既有 spec 时,使用 delta 区段:
120
185
 
121
- | 操作 | 说明 |
122
- |------|------|
123
- | `## ADDED Requirements` | 新增功能 |
124
- | `## MODIFIED Requirements` | 修改行为 |
125
- | `## REMOVED Requirements` | 移除功能 |
126
- | `## RENAMED Requirements` | 重新命名 |
186
+ | Operation | Description | 说明 |
187
+ |-----------|-------------|------|
188
+ | `## ADDED Requirements` | New capabilities | 新增功能 |
189
+ | `## MODIFIED Requirements` | Changed behavior | 修改行为 |
190
+ | `## REMOVED Requirements` | Deprecated features | 移除功能 |
191
+ | `## RENAMED Requirements` | Name changes | 重新命名 |
127
192
 
128
- ## 使用方式
193
+ ## Usage | 使用方式
129
194
 
130
- - `/sdd` - 交互式规格建立向导
131
- - `/sdd auth-flow` - 为特定功能建立规格
132
- - `/sdd review` - 审查现有规格
133
- - `/sdd --sync-check` - 检查同步状态
195
+ ```
196
+ /sdd - Interactive spec creation wizard | 互动式规格建立向导
197
+ /sdd auth-flow - Create spec for specific feature | 为特定功能建立规格
198
+ /sdd review - Review existing specs | 审查现有规格
199
+ /sdd --sync-check - Check sync status | 检查同步状态
200
+ ```
134
201
 
135
- ## 下一步引导
202
+ ## Next Steps Guidance | 下一步引导
136
203
 
137
204
  `/sdd` 完成后,AI 助手应建议:
138
205
 
139
- > **规格文档已建立。建议下一步:**
140
- > - 执行 `/derive` 从规格推导测试工件
141
- > - 执行 `/derive bdd` 仅推导 BDD 场景
142
- > - 执行 `/derive tdd` 仅推导 TDD 骨架
143
- > - 审查 AC 完整性,确保所有验收条件可测试
144
- > - 检查 UDS 规范覆盖率 → 执行 `/audit --patterns`
206
+ > **规格文件已建立。建议下一步 / Specification document created. Suggested next steps:**
207
+ > - 执行 `/derive` 从规格推导测试工件 ⭐ **Recommended / 推荐** — Derive test artifacts from spec
208
+ > - 执行 `/derive bdd` 仅推导 BDD 场景 — Derive BDD scenarios only
209
+ > - 执行 `/derive tdd` 仅推导 TDD 骨架 — Derive TDD skeletons only
210
+ > - 审查 AC 完整性,确保所有验收条件可测试 — Review AC completeness
211
+ > - 检查 UDS 规范覆盖率 → 执行 `/audit --patterns` — Check UDS standard coverage → Run `/audit --patterns`
212
+
213
+ ## Reference | 参考
214
+
215
+ - Detailed guide: [guide.md](./guide.md)
216
+ - Core standard: [spec-driven-development.md](../../core/spec-driven-development.md)
217
+
145
218
 
146
- ## 参考
219
+ ## AI Agent Behavior | AI 代理行为
147
220
 
148
- - 详细指南:[guide.md](./guide.md)
149
- - 核心规范:[spec-driven-development.md](../../../../core/spec-driven-development.md)
221
+ > 完整的 AI 行为定义请参阅对应的命令文件:[`/sdd`](../commands/sdd.md#ai-agent-behavior--ai-代理行为)
222
+ >
223
+ > For complete AI agent behavior definition, see the corresponding command file: [`/sdd`](../commands/sdd.md#ai-agent-behavior--ai-代理行为)
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: sweep
3
+ source: ../../../../skills/sweep/SKILL.md
4
+ source_version: 1.0.0
5
+ translation_version: 1.0.0
6
+ last_synced: 2026-06-02
7
+ source_hash: 712e596d091a
8
+ status: current
9
+ scope: universal
10
+ description: |
11
+ [UDS] 扫描代码库的调试残留与代码质量问题;可自动修正安全模式。
12
+ Use when: before committing, during PR review, or periodic codebase cleanup.
13
+ Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 扫描, 清理.
14
+ allowed-tools: Read, Grep, Glob, Bash(find:*), Edit, Write
15
+ argument-hint: "[--fix] [--report] [--path <dir>] [--exclude <pattern>]"
16
+ ---
17
+
18
+ # 扫码助手
19
+
20
+ > **语言**: [English](../../../../skills/sweep/SKILL.md) | 简体中文
21
+
22
+ 扫描代码库的调试残留、代码质量问题与技术债标记。
23
+ 可选择性自动修正安全模式(console.log、debugger 等语句)。
24
+
25
+ ---
26
+
27
+ ## 扫描模式
28
+
29
+ | Pattern ID | 名称 | 可自动修正 | 说明 |
30
+ |------------|------|-----------|------|
31
+ | `console-log` | console.log / console.debug / console.trace | ✅ 是 | 留在生产环境的调试输出 |
32
+ | `debugger` | debugger 语句 | ✅ 是 | 留在代码中的断点 |
33
+ | `todo-fixme` | TODO / FIXME / HACK / XXX | ❌ 仅报告 | 技术债标记 |
34
+ | `ts-any` | TypeScript `any` 类型 | ❌ 仅报告 | 类型安全违规 |
35
+
36
+ ---
37
+
38
+ ## 使用方式
39
+
40
+ ```bash
41
+ /sweep # 扫描当前目录,报告发现
42
+ /sweep --fix # 扫描并自动修正可修复项
43
+ /sweep --report # 扫描并将报告写入 .uds/sweep-report.json
44
+ /sweep --path src/ # 扫描指定目录
45
+ /sweep --exclude "**/*.test.ts" # 排除模式(glob)
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 执行工作流程
51
+
52
+ ### Step 1:搜索文件
53
+ 使用 Glob tool 找出目标路径下所有源代码文件。
54
+ 默认排除:`node_modules/`、`dist/`、`.git/`、`*.min.js`、`coverage/`。
55
+
56
+ ### Step 2:逐 Pattern 扫描
57
+ 对每个 pattern 使用 Grep 在所有文件中查找匹配结果。
58
+ 汇总发现:`{ file, line, column, pattern_id, label, fixable, content }`。
59
+
60
+ ### Step 3:报告发现
61
+ 输出结构化摘要:
62
+ ```
63
+ 📊 扫描结果
64
+ ─────────────────────────────────────
65
+ console-log: 12 条 (可自动修正)
66
+ debugger: 2 条 (可自动修正)
67
+ todo-fixme: 28 条 (仅报告)
68
+ ts-any: 5 条 (仅报告)
69
+ ─────────────────────────────────────
70
+ 合计:47 条 | 可修正:14 条
71
+ ```
72
+
73
+ ### Step 4:HITL 闸门(--fix 且发现数 > 20)
74
+ 若设置 `--fix` **且**可修正发现总数超过 20:
75
+ **暂停并要求用户明确确认**后才应用修正。
76
+ 显示将被修改的文件清单。
77
+
78
+ ### Step 5:应用修正(确认 --fix 后)
79
+ 对每条可修正发现:
80
+ - `console-log`:若该行仅含 console 语句则删除该行
81
+ - `debugger`:若该行仅含 debugger 语句则删除该行
82
+
83
+ 使用 Edit tool 逐文件应用变更。
84
+ 报告:「已修正 N 条,影响 M 个文件。」
85
+
86
+ ### Step 6:保存报告(--report)
87
+ 将发现写入 `.uds/sweep-report.json`:
88
+ ```json
89
+ {
90
+ "timestamp": "<ISO8601>",
91
+ "total_findings": 47,
92
+ "fixable": 14,
93
+ "fixed": 14,
94
+ "findings_by_pattern": { "console-log": 12, "debugger": 2, "todo-fixme": 28, "ts-any": 5 },
95
+ "files_modified": ["src/auth.ts", "src/utils.ts"]
96
+ }
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 设置
102
+
103
+ 通过 `uds.project.yaml` 设置:
104
+
105
+ ```yaml
106
+ sweep:
107
+ default_path: "src/"
108
+ exclude_patterns:
109
+ - "**/*.test.ts"
110
+ - "**/*.spec.ts"
111
+ - "**/fixtures/**"
112
+ hitl_threshold: 20 # 可修正项超过此值时需确认
113
+ patterns:
114
+ enabled:
115
+ - console-log
116
+ - debugger
117
+ - todo-fixme
118
+ - ts-any
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 下一步引导
124
+
125
+ `/sweep` 完成后建议:
126
+
127
+ > - 执行 `/checkin` 在提交前验证整体代码质量
128
+ > - 执行 `/review` 审查清理后的变更
129
+ > - 执行 `/commit` 提交修正
130
+
131
+ ---
132
+
133
+ ## 相关标准
134
+
135
+ - [Checkin Standards](../../../../.standards/checkin-standards.ai.yaml) — Pre-commit 质量闸门
136
+ - [Code Review](../code-review-assistant/SKILL.md) — 代码审查助手
137
+ - [Testing Guide](../testing-guide/SKILL.md) — 测试标准
138
+
139
+ ---
140
+
141
+ ## 版本历程
142
+
143
+ | 版本 | 日期 | 变更 |
144
+ |------|------|------|
145
+ | 1.0.0 | 2026-04-28 | 初始版本 — XSPEC-097 Phase 1(从上游迁移) |
146
+
147
+ ---
148
+
149
+ ## 授权
150
+
151
+ 本 Skill 采用 [MIT License](https://opensource.org/licenses/MIT) 与 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 双重授权发布。