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
|
@@ -3,145 +3,216 @@ name: spec-driven-dev
|
|
|
3
3
|
source: ../../../../skills/spec-driven-dev/SKILL.md
|
|
4
4
|
source_version: 1.2.0
|
|
5
5
|
translation_version: 1.2.0
|
|
6
|
-
last_synced: 2026-
|
|
6
|
+
last_synced: 2026-06-02
|
|
7
|
+
source_hash: 195f50bcbfb7
|
|
7
8
|
status: current
|
|
8
9
|
description: "[UDS] 在撰寫程式碼前,建立、審查和管理規格文件"
|
|
9
10
|
---
|
|
11
|
+
<!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
|
|
12
|
+
SDD 生命週期編排(7 階段狀態機、階段轉換、閘門檢查)已遷移至
|
|
13
|
+
採用層(adoption layer,XSPEC-095,2026-04-28)。本 Skill 保留:規格格式定義、狀態
|
|
14
|
+
描述、delta 操作、決策樹。
|
|
15
|
+
若需強制執行的生命週期,請使用你的採用層工具鏈。
|
|
16
|
+
-->
|
|
10
17
|
|
|
11
|
-
# 規格驅動開發助手
|
|
18
|
+
# Spec-Driven Development Assistant | 規格驅動開發助手
|
|
19
|
+
|
|
20
|
+
在撰寫程式碼前,建立、審查和管理規格文件。
|
|
12
21
|
|
|
13
22
|
> **語言**: [English](../../../../skills/spec-driven-dev/SKILL.md) | 繁體中文
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
## When to Use `/sdd` vs `uds spec` | 何時使用
|
|
25
|
+
|
|
26
|
+
| 情境 | `/sdd` | `uds spec` |
|
|
27
|
+
|----------|--------|------------|
|
|
28
|
+
| 具審查循環的正式功能開發 | ✅ | ❌ |
|
|
29
|
+
| 完整規格生命週期(Draft → Archived) | ✅ | ❌ |
|
|
30
|
+
| 快速原型 / Vibe coding | ❌ | ✅ |
|
|
31
|
+
| 小型漸進式變更 | ❌ | ✅ |
|
|
32
|
+
| 需要利害關係人簽核 | ✅ | ❌ |
|
|
33
|
+
| 從自然語言意圖產生微規格(micro-spec) | ❌ | ✅ |
|
|
16
34
|
|
|
17
|
-
|
|
35
|
+
> **`/sdd`** = 正式開發的完整規格生命週期
|
|
36
|
+
> **`uds spec`** = 快速迭代的輕量微規格
|
|
37
|
+
|
|
38
|
+
## TL;DR Quick Checklist | 快速檢查清單
|
|
18
39
|
|
|
19
40
|
- 搜尋現有規格:查看 `specs/`、`docs/specs/` 或專案規格目錄
|
|
20
41
|
- 決定範圍:新功能 vs 修改現有功能
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
42
|
+
- 挑選唯一的規格 ID:`SPEC-NNN` 或 kebab-case 變更 ID
|
|
43
|
+
- 撰寫提案並附明確的 AC(Given/When/Then 格式)
|
|
44
|
+
- 在開始實作前取得核准
|
|
45
|
+
- 依序實作任務,並對照規格驗證
|
|
46
|
+
- 完成後將規格歸檔
|
|
26
47
|
|
|
27
|
-
## 決策樹
|
|
48
|
+
## Decision Tree | 決策樹
|
|
28
49
|
|
|
29
50
|
```
|
|
30
|
-
新需求?
|
|
31
|
-
├─
|
|
32
|
-
├─
|
|
33
|
-
├─
|
|
34
|
-
├─
|
|
35
|
-
├─
|
|
36
|
-
├─
|
|
37
|
-
|
|
51
|
+
New request? | 新需求?
|
|
52
|
+
├─ Bug fix restoring spec behavior? → Fix directly | 直接修復
|
|
53
|
+
├─ Typo/format/comment? → Fix directly | 直接修復
|
|
54
|
+
├─ Dependency update (non-breaking)? → Fix directly | 直接修復
|
|
55
|
+
├─ New feature/capability? → Create proposal | 建立提案
|
|
56
|
+
├─ Breaking change? → Create proposal | 建立提案
|
|
57
|
+
├─ Architecture change? → Create proposal | 建立提案
|
|
58
|
+
├─ Agent/role definition (spans multiple features)? → Use spec-type: agent | 使用 Agent SPEC template
|
|
59
|
+
└─ Unclear? → Create proposal (safer) | 建立提案(較安全)
|
|
38
60
|
```
|
|
39
61
|
|
|
40
|
-
## 工作流程
|
|
62
|
+
## Workflow | 工作流程
|
|
41
63
|
|
|
42
64
|
```
|
|
43
65
|
DISCUSS ──► CREATE ──► REVIEW ──► APPROVE ──► IMPLEMENT ──► VERIFY ──► ARCHIVE
|
|
44
66
|
```
|
|
45
67
|
|
|
46
|
-
### 0. Discuss - 釐清範圍
|
|
47
|
-
|
|
68
|
+
### 0. Discuss - Clarify Scope | 釐清範圍
|
|
69
|
+
在撰寫規格前,捕捉灰色地帶、建立治理原則、解決模糊之處。
|
|
48
70
|
|
|
49
|
-
### 1. Create - 撰寫規格
|
|
50
|
-
|
|
71
|
+
### 1. Create - Write Spec | 撰寫規格
|
|
72
|
+
定義需求、技術設計、驗收條件與測試計畫。
|
|
51
73
|
|
|
52
|
-
### 2. Review - 審查驗證
|
|
53
|
-
|
|
74
|
+
### 2. Review - Validate | 審查驗證
|
|
75
|
+
與利害關係人一同檢查完整性、一致性與可行性。
|
|
54
76
|
|
|
55
|
-
### 3. Approve - 核准
|
|
56
|
-
|
|
77
|
+
### 3. Approve - Sign Off | 核准
|
|
78
|
+
在開始實作前取得利害關係人簽核。
|
|
57
79
|
|
|
58
|
-
### 4. Implement - 實作
|
|
59
|
-
|
|
80
|
+
### 4. Implement - Code | 實作
|
|
81
|
+
依照核准的規格進行開發,參照需求與 AC。
|
|
60
82
|
|
|
61
|
-
### 5. Verify - 驗證
|
|
62
|
-
|
|
83
|
+
### 5. Verify - Confirm | 驗證
|
|
84
|
+
確保實作符合規格、所有測試通過、AC 已滿足。
|
|
63
85
|
|
|
64
|
-
### 6. Archive - 歸檔
|
|
65
|
-
|
|
86
|
+
### 6. Archive - Close | 歸檔
|
|
87
|
+
將完成的規格歸檔,並附上 commit/PR 連結。
|
|
66
88
|
|
|
67
|
-
## 規格狀態
|
|
89
|
+
## Spec States | 規格狀態
|
|
68
90
|
|
|
69
|
-
| 狀態 |
|
|
70
|
-
|
|
71
|
-
| **Draft** |
|
|
72
|
-
| **Review** |
|
|
73
|
-
| **Approved** |
|
|
74
|
-
| **Implemented** |
|
|
75
|
-
| **Archived** |
|
|
91
|
+
| 狀態 | 說明(英) | 說明 |
|
|
92
|
+
|-------|-------------|------|
|
|
93
|
+
| **Draft** | Work in progress | 草稿中 |
|
|
94
|
+
| **Review** | Under review | 審查中 |
|
|
95
|
+
| **Approved** | Ready for implementation | 已核准 |
|
|
96
|
+
| **Implemented** | Code complete | 已實作 |
|
|
97
|
+
| **Archived** | Completed or deprecated | 已歸檔 |
|
|
76
98
|
|
|
77
|
-
## 規格結構
|
|
99
|
+
## Spec Structure | 規格結構
|
|
78
100
|
|
|
79
101
|
```markdown
|
|
80
102
|
# [SPEC-ID] Feature: [Name]
|
|
81
103
|
|
|
82
104
|
## Overview
|
|
83
|
-
|
|
105
|
+
Brief description of the proposed change.
|
|
84
106
|
|
|
85
107
|
## Motivation
|
|
86
|
-
|
|
108
|
+
Why is this change needed? What problem does it solve?
|
|
87
109
|
|
|
88
110
|
## Requirements
|
|
89
111
|
### Requirement: [Name]
|
|
90
|
-
|
|
112
|
+
The system SHALL [behavior description].
|
|
91
113
|
|
|
92
|
-
#### Scenario: [
|
|
93
|
-
- **GIVEN** [
|
|
94
|
-
- **WHEN** [
|
|
95
|
-
- **THEN** [
|
|
114
|
+
#### Scenario: [Success case]
|
|
115
|
+
- **GIVEN** [initial context]
|
|
116
|
+
- **WHEN** [action performed]
|
|
117
|
+
- **THEN** [expected result]
|
|
96
118
|
|
|
97
119
|
## Acceptance Criteria
|
|
98
120
|
- AC-1: Given [context], when [action], then [result]
|
|
99
121
|
|
|
100
122
|
## Technical Design
|
|
101
|
-
[
|
|
123
|
+
[Architecture, API changes, database changes]
|
|
102
124
|
|
|
103
125
|
## Test Plan
|
|
104
|
-
- [ ] [
|
|
105
|
-
- [ ] [
|
|
126
|
+
- [ ] Unit tests for [component]
|
|
127
|
+
- [ ] Integration tests for [flow]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Agent SPEC Structure | Agent 規格結構(`spec-type: agent`)
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
# [SPEC-ID] Agent: [Role Name]
|
|
134
|
+
<!-- spec-type: agent -->
|
|
135
|
+
<!-- agent-id auto-referenced by feature SPECs -->
|
|
136
|
+
|
|
137
|
+
## Role Definition
|
|
138
|
+
- **Role**: [Agent Name]
|
|
139
|
+
- **Responsibility**: [One sentence]
|
|
140
|
+
- **Autonomy Level**: L[1-5] (per DEC-065)
|
|
141
|
+
|
|
142
|
+
## Capability Scope
|
|
143
|
+
**Owns:**
|
|
144
|
+
- [Capability 1]
|
|
145
|
+
- [Capability 2]
|
|
146
|
+
|
|
147
|
+
**Does NOT own:**
|
|
148
|
+
- [Explicit exclusion]
|
|
149
|
+
|
|
150
|
+
## Interface Contract
|
|
151
|
+
### Input
|
|
152
|
+
| Message Type | Required Fields | Optional Fields |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| [Type] | [fields] | [fields] |
|
|
155
|
+
|
|
156
|
+
### Output
|
|
157
|
+
| Artifact Type | Success Condition | Failure Condition |
|
|
158
|
+
|---|---|---|
|
|
159
|
+
| [Type] | [condition] | [condition] |
|
|
160
|
+
|
|
161
|
+
## Agent Interactions
|
|
162
|
+
- **Upstream**: [Who calls this agent]
|
|
163
|
+
- **Downstream**: [Who this agent calls]
|
|
164
|
+
- **Parallel**: [Agents working alongside]
|
|
165
|
+
|
|
166
|
+
## Related Feature SPECs
|
|
167
|
+
- [SPEC-NNN] — [This agent's role in that spec]
|
|
106
168
|
```
|
|
107
169
|
|
|
108
|
-
### 場景格式規則
|
|
170
|
+
### Scenario Formatting Rules | 場景格式規則
|
|
109
171
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
172
|
+
- 每個場景使用 `#### Scenario:`(h4 標題)
|
|
173
|
+
- 每個需求至少要有一個場景
|
|
112
174
|
- 使用 **GIVEN/WHEN/THEN** 格式描述結構化行為
|
|
113
|
-
-
|
|
175
|
+
- 規範性需求使用 **SHALL/MUST**,建議性內容使用 **SHOULD**
|
|
114
176
|
|
|
115
|
-
## 變更操作
|
|
177
|
+
## Delta Operations | 變更操作
|
|
116
178
|
|
|
117
179
|
修改現有規格時,使用 delta 區段:
|
|
118
180
|
|
|
119
|
-
| 操作 | 說明 |
|
|
120
|
-
|
|
121
|
-
| `## ADDED Requirements` | 新增功能 |
|
|
122
|
-
| `## MODIFIED Requirements` | 修改行為 |
|
|
123
|
-
| `## REMOVED Requirements` | 移除功能 |
|
|
124
|
-
| `## RENAMED Requirements` | 重新命名 |
|
|
181
|
+
| 操作 | 說明(英) | 說明 |
|
|
182
|
+
|-----------|-------------|------|
|
|
183
|
+
| `## ADDED Requirements` | New capabilities | 新增功能 |
|
|
184
|
+
| `## MODIFIED Requirements` | Changed behavior | 修改行為 |
|
|
185
|
+
| `## REMOVED Requirements` | Deprecated features | 移除功能 |
|
|
186
|
+
| `## RENAMED Requirements` | Name changes | 重新命名 |
|
|
125
187
|
|
|
126
|
-
## 使用方式
|
|
188
|
+
## Usage | 使用方式
|
|
127
189
|
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
|
|
190
|
+
```
|
|
191
|
+
/sdd - Interactive spec creation wizard | 互動式規格建立精靈
|
|
192
|
+
/sdd auth-flow - Create spec for specific feature | 為特定功能建立規格
|
|
193
|
+
/sdd review - Review existing specs | 審查現有規格
|
|
194
|
+
/sdd --sync-check - Check sync status | 檢查同步狀態
|
|
195
|
+
```
|
|
132
196
|
|
|
133
|
-
## 下一步引導
|
|
197
|
+
## Next Steps Guidance | 下一步引導
|
|
134
198
|
|
|
135
199
|
`/sdd` 完成後,AI 助手應建議:
|
|
136
200
|
|
|
137
|
-
>
|
|
138
|
-
> - 執行 `/derive` 從規格推導測試工件
|
|
139
|
-
> - 執行 `/derive bdd` 僅推導 BDD 場景
|
|
140
|
-
> - 執行 `/derive tdd` 僅推導 TDD 骨架
|
|
141
|
-
> - 審查 AC 完整性,確保所有驗收條件可測試
|
|
142
|
-
> - 檢查 UDS 規範覆蓋率 → 執行 `/audit --patterns`
|
|
201
|
+
> **規格文件已建立。建議下一步 / Specification document created. Suggested next steps:**
|
|
202
|
+
> - 執行 `/derive` 從規格推導測試工件 ⭐ **Recommended / 推薦** — Derive test artifacts from spec
|
|
203
|
+
> - 執行 `/derive bdd` 僅推導 BDD 場景 — Derive BDD scenarios only
|
|
204
|
+
> - 執行 `/derive tdd` 僅推導 TDD 骨架 — Derive TDD skeletons only
|
|
205
|
+
> - 審查 AC 完整性,確保所有驗收條件可測試 — Review AC completeness
|
|
206
|
+
> - 檢查 UDS 規範覆蓋率 → 執行 `/audit --patterns` — Check UDS standard coverage → Run `/audit --patterns`
|
|
143
207
|
|
|
144
|
-
## 參考
|
|
208
|
+
## Reference | 參考
|
|
145
209
|
|
|
146
210
|
- 詳細指南:[guide.md](./guide.md)
|
|
147
|
-
-
|
|
211
|
+
- 核心標準:[spec-driven-development.md](../../core/spec-driven-development.md)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## AI Agent Behavior | AI 代理行為
|
|
215
|
+
|
|
216
|
+
> 完整的 AI 行為定義請參閱對應的命令文件:[`/sdd`](../commands/sdd.md#ai-agent-behavior--ai-代理行為)
|
|
217
|
+
>
|
|
218
|
+
> For complete AI agent behavior definition, see the corresponding command file: [`/sdd`](../commands/sdd.md#ai-agent-behavior--ai-代理行為)
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sweep
|
|
3
|
+
source: ../../../../skills/sweep/SKILL.md
|
|
4
|
+
source_version: 1.0.0
|
|
5
|
+
translation_version: 1.0.0
|
|
6
|
+
last_synced: 2026-05-28
|
|
7
|
+
scope: universal
|
|
8
|
+
description: |
|
|
9
|
+
[UDS] 掃描程式庫的除錯殘留與程式碼品質問題;可自動修正安全模式。
|
|
10
|
+
Use when: before committing, during PR review, or periodic codebase cleanup.
|
|
11
|
+
Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 掃描, 清理.
|
|
12
|
+
allowed-tools: Read, Grep, Glob, Bash(find:*), Edit, Write
|
|
13
|
+
argument-hint: "[--fix] [--report] [--path <dir>] [--exclude <pattern>]"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# 掃碼助手
|
|
17
|
+
|
|
18
|
+
> **語言**: [English](../../../../skills/sweep/SKILL.md) | 繁體中文
|
|
19
|
+
|
|
20
|
+
掃描程式庫的除錯殘留、程式碼品質問題與技術債標記。
|
|
21
|
+
可選擇性自動修正安全模式(console.log、debugger 等語句)。
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 掃描模式
|
|
26
|
+
|
|
27
|
+
| Pattern ID | 名稱 | 可自動修正 | 說明 |
|
|
28
|
+
|------------|------|-----------|------|
|
|
29
|
+
| `console-log` | console.log / console.debug / console.trace | ✅ 是 | 留在正式環境的除錯輸出 |
|
|
30
|
+
| `debugger` | debugger 語句 | ✅ 是 | 留在程式碼中的中斷點 |
|
|
31
|
+
| `todo-fixme` | TODO / FIXME / HACK / XXX | ❌ 僅回報 | 技術債標記 |
|
|
32
|
+
| `ts-any` | TypeScript `any` 型別 | ❌ 僅回報 | 型別安全違規 |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 使用方式
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
/sweep # 掃描目前目錄,回報發現
|
|
40
|
+
/sweep --fix # 掃描並自動修正可修復項目
|
|
41
|
+
/sweep --report # 掃描並將報告寫入 .uds/sweep-report.json
|
|
42
|
+
/sweep --path src/ # 掃描指定目錄
|
|
43
|
+
/sweep --exclude "**/*.test.ts" # 排除模式(glob)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 執行工作流程
|
|
49
|
+
|
|
50
|
+
### Step 1:搜尋檔案
|
|
51
|
+
使用 Glob tool 找出目標路徑下所有原始碼檔案。
|
|
52
|
+
預設排除:`node_modules/`、`dist/`、`.git/`、`*.min.js`、`coverage/`。
|
|
53
|
+
|
|
54
|
+
### Step 2:逐 Pattern 掃描
|
|
55
|
+
對每個 pattern 使用 Grep 在所有檔案中尋找比對結果。
|
|
56
|
+
彙整發現:`{ file, line, column, pattern_id, label, fixable, content }`。
|
|
57
|
+
|
|
58
|
+
### Step 3:回報發現
|
|
59
|
+
輸出結構化摘要:
|
|
60
|
+
```
|
|
61
|
+
📊 掃描結果
|
|
62
|
+
─────────────────────────────────────
|
|
63
|
+
console-log: 12 筆 (可自動修正)
|
|
64
|
+
debugger: 2 筆 (可自動修正)
|
|
65
|
+
todo-fixme: 28 筆 (僅回報)
|
|
66
|
+
ts-any: 5 筆 (僅回報)
|
|
67
|
+
─────────────────────────────────────
|
|
68
|
+
合計:47 筆 | 可修正:14 筆
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Step 4:HITL 閘門(--fix 且發現數 > 20)
|
|
72
|
+
若設定 `--fix` **且**可修正發現總數超過 20:
|
|
73
|
+
**暫停並要求使用者明確確認**才套用修正。
|
|
74
|
+
顯示將被修改的檔案清單。
|
|
75
|
+
|
|
76
|
+
### Step 5:套用修正(確認 --fix 後)
|
|
77
|
+
對每筆可修正發現:
|
|
78
|
+
- `console-log`:若該行僅含 console 語句則刪除該行
|
|
79
|
+
- `debugger`:若該行僅含 debugger 語句則刪除該行
|
|
80
|
+
|
|
81
|
+
使用 Edit tool 逐檔套用變更。
|
|
82
|
+
回報:「已修正 N 筆,影響 M 個檔案。」
|
|
83
|
+
|
|
84
|
+
### Step 6:儲存報告(--report)
|
|
85
|
+
將發現寫入 `.uds/sweep-report.json`:
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"timestamp": "<ISO8601>",
|
|
89
|
+
"total_findings": 47,
|
|
90
|
+
"fixable": 14,
|
|
91
|
+
"fixed": 14,
|
|
92
|
+
"findings_by_pattern": { "console-log": 12, "debugger": 2, "todo-fixme": 28, "ts-any": 5 },
|
|
93
|
+
"files_modified": ["src/auth.ts", "src/utils.ts"]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 設定
|
|
100
|
+
|
|
101
|
+
透過 `uds.project.yaml` 設定:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
sweep:
|
|
105
|
+
default_path: "src/"
|
|
106
|
+
exclude_patterns:
|
|
107
|
+
- "**/*.test.ts"
|
|
108
|
+
- "**/*.spec.ts"
|
|
109
|
+
- "**/fixtures/**"
|
|
110
|
+
hitl_threshold: 20 # 可修正項目超過此值時需確認
|
|
111
|
+
patterns:
|
|
112
|
+
enabled:
|
|
113
|
+
- console-log
|
|
114
|
+
- debugger
|
|
115
|
+
- todo-fixme
|
|
116
|
+
- ts-any
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 下一步引導
|
|
122
|
+
|
|
123
|
+
`/sweep` 完成後建議:
|
|
124
|
+
|
|
125
|
+
> - 執行 `/checkin` 在提交前驗證整體程式碼品質
|
|
126
|
+
> - 執行 `/review` 審查清理後的變更
|
|
127
|
+
> - 執行 `/commit` 提交修正
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 相關標準
|
|
132
|
+
|
|
133
|
+
- [Checkin Standards](../../../../.standards/checkin-standards.ai.yaml) — Pre-commit 品質閘門
|
|
134
|
+
- [Code Review](../code-review-assistant/SKILL.md) — 程式碼審查助手
|
|
135
|
+
- [Testing Guide](../testing-guide/SKILL.md) — 測試標準
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 版本歷程
|
|
140
|
+
|
|
141
|
+
| 版本 | 日期 | 變更 |
|
|
142
|
+
|------|------|------|
|
|
143
|
+
| 1.0.0 | 2026-04-28 | 初始版本 — XSPEC-097 Phase 1(從上游遷移) |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 授權
|
|
148
|
+
|
|
149
|
+
本 Skill 採用 [MIT License](https://opensource.org/licenses/MIT) 與 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 雙重授權發布。
|