universal-dev-standards 5.4.0 → 5.6.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/bundled/ai/options/testing/integration-testing.ai.yaml +2 -2
- package/bundled/ai/options/testing/unit-testing.ai.yaml +2 -2
- package/bundled/ai/standards/adversarial-test.ai.yaml +277 -0
- package/bundled/ai/standards/audit-trail.ai.yaml +113 -0
- package/bundled/ai/standards/browser-compatibility-standards.ai.yaml +63 -0
- package/bundled/ai/standards/chaos-injection-tests.ai.yaml +91 -0
- package/bundled/ai/standards/container-image-standards.ai.yaml +88 -0
- package/bundled/ai/standards/container-security.ai.yaml +331 -0
- package/bundled/ai/standards/contract-testing-standards.ai.yaml +62 -0
- package/bundled/ai/standards/cost-budget-test.ai.yaml +96 -0
- package/bundled/ai/standards/cross-flow-regression.ai.yaml +61 -0
- package/bundled/ai/standards/data-contract.ai.yaml +110 -0
- package/bundled/ai/standards/data-migration-testing.ai.yaml +96 -0
- package/bundled/ai/standards/data-pipeline.ai.yaml +113 -0
- package/bundled/ai/standards/disaster-recovery-drill.ai.yaml +89 -0
- package/bundled/ai/standards/flaky-test-management.ai.yaml +89 -0
- package/bundled/ai/standards/flow-based-testing.ai.yaml +240 -0
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +192 -0
- package/bundled/ai/standards/iac-design-principles.ai.yaml +83 -0
- package/bundled/ai/standards/incident-response.ai.yaml +107 -0
- package/bundled/ai/standards/license-compliance.ai.yaml +106 -0
- package/bundled/ai/standards/llm-output-validation.ai.yaml +269 -0
- package/bundled/ai/standards/mock-boundary.ai.yaml +250 -0
- package/bundled/ai/standards/mutation-testing.ai.yaml +192 -0
- package/bundled/ai/standards/pii-classification.ai.yaml +109 -0
- package/bundled/ai/standards/policy-as-code-testing.ai.yaml +227 -0
- package/bundled/ai/standards/prd-standards.ai.yaml +88 -0
- package/bundled/ai/standards/product-metrics-standards.ai.yaml +111 -0
- package/bundled/ai/standards/prompt-regression.ai.yaml +94 -0
- package/bundled/ai/standards/property-based-testing.ai.yaml +105 -0
- package/bundled/ai/standards/release-quality-manifest.ai.yaml +135 -0
- package/bundled/ai/standards/release-readiness-gate.ai.yaml +77 -0
- package/bundled/ai/standards/replay-test.ai.yaml +111 -0
- package/bundled/ai/standards/runbook.ai.yaml +104 -0
- package/bundled/ai/standards/sast-advanced.ai.yaml +135 -0
- package/bundled/ai/standards/schema-evolution.ai.yaml +111 -0
- package/bundled/ai/standards/secret-management-standards.ai.yaml +105 -0
- package/bundled/ai/standards/secure-op.ai.yaml +365 -0
- package/bundled/ai/standards/security-testing.ai.yaml +171 -0
- package/bundled/ai/standards/server-ops-security.ai.yaml +274 -0
- package/bundled/ai/standards/slo-sli.ai.yaml +97 -0
- package/bundled/ai/standards/smoke-test.ai.yaml +87 -0
- package/bundled/ai/standards/supply-chain-attestation.ai.yaml +109 -0
- package/bundled/ai/standards/test-completeness-dimensions.ai.yaml +52 -5
- package/bundled/ai/standards/testing.ai.yaml +20 -13
- package/bundled/ai/standards/user-story-mapping.ai.yaml +108 -0
- package/bundled/core/accessibility-standards.md +58 -0
- package/bundled/core/adversarial-test.md +212 -0
- package/bundled/core/branch-completion.md +4 -0
- package/bundled/core/browser-compatibility-standards.md +220 -0
- package/bundled/core/chaos-injection-tests.md +116 -0
- package/bundled/core/checkin-standards.md +1 -0
- package/bundled/core/container-security.md +521 -0
- package/bundled/core/contract-testing-standards.md +182 -0
- package/bundled/core/cost-budget-test.md +69 -0
- package/bundled/core/cross-flow-regression.md +190 -0
- package/bundled/core/data-migration-testing.md +110 -0
- package/bundled/core/disaster-recovery-drill.md +73 -0
- package/bundled/core/flaky-test-management.md +73 -0
- package/bundled/core/flow-based-testing.md +275 -0
- package/bundled/core/full-coverage-testing.md +183 -0
- package/bundled/core/llm-output-validation.md +178 -0
- package/bundled/core/mock-boundary.md +100 -0
- package/bundled/core/mutation-testing.md +97 -0
- package/bundled/core/performance-standards.md +65 -0
- package/bundled/core/policy-as-code-testing.md +188 -0
- package/bundled/core/prompt-regression.md +72 -0
- package/bundled/core/property-based-testing.md +73 -0
- package/bundled/core/release-quality-manifest.md +193 -0
- package/bundled/core/release-readiness-gate.md +184 -0
- package/bundled/core/replay-test.md +86 -0
- package/bundled/core/sast-advanced.md +300 -0
- package/bundled/core/secure-op.md +314 -0
- package/bundled/core/security-testing.md +87 -0
- package/bundled/core/server-ops-security.md +493 -0
- package/bundled/core/smoke-test.md +65 -0
- package/bundled/core/supply-chain-attestation.md +117 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +3 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +5 -5
- package/bundled/locales/zh-TW/CHANGELOG.md +3 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +11 -0
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +11 -0
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +11 -0
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +11 -0
- package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +183 -79
- package/bundled/skills/README.md +4 -3
- package/bundled/skills/SKILL_NAMING.md +94 -0
- package/bundled/skills/ai-instruction-standards/SKILL.md +181 -88
- package/bundled/skills/atdd-assistant/SKILL.md +8 -0
- package/bundled/skills/bdd-assistant/SKILL.md +7 -0
- package/bundled/skills/checkin-assistant/SKILL.md +8 -0
- package/bundled/skills/code-review-assistant/SKILL.md +7 -0
- package/bundled/skills/journey-test-assistant/SKILL.md +203 -0
- package/bundled/skills/orchestrate/SKILL.md +167 -0
- package/bundled/skills/plan/SKILL.md +234 -0
- package/bundled/skills/pr-automation-assistant/SKILL.md +8 -0
- package/bundled/skills/push/SKILL.md +49 -2
- package/bundled/skills/{process-automation → skill-builder}/SKILL.md +1 -1
- package/bundled/skills/{forward-derivation → spec-derivation}/SKILL.md +1 -1
- package/bundled/skills/spec-driven-dev/SKILL.md +7 -0
- package/bundled/skills/sweep/SKILL.md +145 -0
- package/bundled/skills/tdd-assistant/SKILL.md +7 -0
- package/package.json +6 -6
- package/src/commands/check.js +43 -0
- package/src/commands/flow.js +8 -0
- package/src/commands/init.js +2 -1
- package/src/commands/start.js +14 -0
- package/src/commands/sweep.js +8 -0
- package/src/commands/update.js +10 -0
- package/src/commands/workflow.js +8 -0
- package/standards-registry.json +483 -5
- package/bundled/locales/zh-CN/skills/ac-coverage-assistant/SKILL.md +0 -190
- package/bundled/locales/zh-CN/skills/forward-derivation/SKILL.md +0 -71
- package/bundled/locales/zh-CN/skills/forward-derivation/guide.md +0 -130
- package/bundled/locales/zh-CN/skills/methodology-system/SKILL.md +0 -88
- package/bundled/locales/zh-CN/skills/methodology-system/create-methodology.md +0 -350
- package/bundled/locales/zh-CN/skills/methodology-system/guide.md +0 -131
- package/bundled/locales/zh-CN/skills/methodology-system/runtime.md +0 -279
- package/bundled/locales/zh-CN/skills/process-automation/SKILL.md +0 -143
- package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +0 -195
- package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +0 -178
- package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +0 -69
- package/bundled/locales/zh-TW/skills/forward-derivation/guide.md +0 -415
- package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +0 -86
- package/bundled/locales/zh-TW/skills/methodology-system/create-methodology.md +0 -350
- package/bundled/locales/zh-TW/skills/methodology-system/guide.md +0 -131
- package/bundled/locales/zh-TW/skills/methodology-system/runtime.md +0 -279
- package/bundled/locales/zh-TW/skills/process-automation/SKILL.md +0 -144
- /package/bundled/skills/{ac-coverage-assistant → ac-coverage}/SKILL.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/SKILL.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/create-methodology.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/guide.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/integrated-flow.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/prerequisite-check.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/runtime.md +0 -0
- /package/bundled/skills/{forward-derivation → spec-derivation}/guide.md +0 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestrate
|
|
3
|
+
version: 2.0.0
|
|
4
|
+
scope: universal
|
|
5
|
+
description: |
|
|
6
|
+
Orchestrate multi-task execution plans using Claude's native Agent tool (DAG-based, no external engine).
|
|
7
|
+
Use when: executing a plan.json file with parallel/sequential task dependencies.
|
|
8
|
+
Keywords: orchestrate, plan, execute, DAG, task plan, 編排, 執行計畫, 並行.
|
|
9
|
+
argument-hint: "<plan.json> [--dry-run]"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# /orchestrate — 任務計畫編排 Skill
|
|
13
|
+
|
|
14
|
+
## 用法
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
/orchestrate <plan.json> # 執行計畫
|
|
18
|
+
/orchestrate <plan.json> --dry-run # 僅驗證,不執行
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 執行流程
|
|
24
|
+
|
|
25
|
+
### Step 1: 讀取與解析計畫(Claude-native)
|
|
26
|
+
|
|
27
|
+
使用 Read tool 讀取 plan.json,直接由 Claude 解析:
|
|
28
|
+
|
|
29
|
+
1. 讀取 JSON 檔案,解析為任務清單
|
|
30
|
+
2. 驗證結構:`tasks` 非空、每個 task 含 `id`、`title`、`spec`
|
|
31
|
+
3. 安全掃描:檢查 `task.spec` 是否含危險指令(`rm -rf /`、`DROP DATABASE`、`git push --force`)
|
|
32
|
+
- 若發現安全問題,列出所有問題並**詢問使用者是否繼續**
|
|
33
|
+
4. 拓撲排序:依 `depends_on` 欄位將 tasks 分組為執行層(layers)
|
|
34
|
+
- Layer 0:沒有依賴的 tasks(可並行)
|
|
35
|
+
- Layer N:依賴全部在 Layer 0..N-1 中的 tasks
|
|
36
|
+
|
|
37
|
+
若 `validation.valid` 為 false,輸出錯誤訊息並停止。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### Step 2: 呈現執行計畫
|
|
42
|
+
|
|
43
|
+
向使用者顯示解析結果:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
計畫:<project> 品質:<quality>
|
|
47
|
+
──────────────────────────────────
|
|
48
|
+
Layer 0 (並行):T-001, T-002
|
|
49
|
+
Layer 1 (序列):T-003 (依賴 T-001)
|
|
50
|
+
Layer 2 (序列):T-004 (依賴 T-002, T-003)
|
|
51
|
+
──────────────────────────────────
|
|
52
|
+
共 4 個任務,3 個執行層
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
若使用 `--dry-run`:顯示以上摘要後**立即停止**,不啟動任何 Agent。
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### Step 3: 逐層執行
|
|
60
|
+
|
|
61
|
+
對 `layers` 陣列中的每一層:
|
|
62
|
+
|
|
63
|
+
1. **同層並行**:同一層的 tasks 在同一訊息中啟動多個 Agent tool
|
|
64
|
+
2. **Agent tool 參數**:
|
|
65
|
+
- `prompt`:task.spec + acceptance_criteria + user_intent 組合而成的執行提示
|
|
66
|
+
- `isolation: "worktree"`:每個 task 在獨立 git worktree 執行
|
|
67
|
+
- `description`:`"Task {task.id}: {task.title}"`
|
|
68
|
+
3. **等待完成**:所有同層 agents 完成後,才進入下一層
|
|
69
|
+
|
|
70
|
+
**Agent 提示範本**:
|
|
71
|
+
```
|
|
72
|
+
Task: {task.title}
|
|
73
|
+
|
|
74
|
+
Spec:
|
|
75
|
+
{task.spec}
|
|
76
|
+
|
|
77
|
+
Acceptance Criteria:
|
|
78
|
+
{task.acceptance_criteria 逐條列出}
|
|
79
|
+
|
|
80
|
+
User Intent:
|
|
81
|
+
{task.user_intent}
|
|
82
|
+
|
|
83
|
+
After completing the task, run: {task.verify_command}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### Step 4: 依賴失敗處理
|
|
89
|
+
|
|
90
|
+
如果某個 task 的 agent 回報失敗:
|
|
91
|
+
- 標記該 task 為 `failed`
|
|
92
|
+
- 後續層中 `depends_on` 包含該 task ID 的所有 tasks 標記為 `skipped`
|
|
93
|
+
- 繼續執行不受影響的 tasks
|
|
94
|
+
- 最終報告中標示失敗原因
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Step 5: Quality Gate
|
|
99
|
+
|
|
100
|
+
每個 task 完成後,若 task 定義了 `verify_command`:
|
|
101
|
+
|
|
102
|
+
1. 使用 Bash tool 執行 `verify_command`
|
|
103
|
+
2. **成功**:記錄 `status: "success"`
|
|
104
|
+
3. **失敗**:
|
|
105
|
+
- 若 `quality` 為 `"strict"` 或 `"standard"`:啟動 Fix Loop
|
|
106
|
+
- Fix Loop:將錯誤輸出回傳給 agent,重新執行(最多 3 次)
|
|
107
|
+
- 超過重試上限:標記為 `failed`
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### Step 6: Judge 審查(選用)
|
|
112
|
+
|
|
113
|
+
如果 task 定義了 `judge: true`:
|
|
114
|
+
- 啟動一個額外的 Agent tool 進行審查
|
|
115
|
+
- 提示:`審查 task {id} 的 git diff,依照 code-review 標準檢查`
|
|
116
|
+
- Judge 結果附加到最終報告
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### Step 7: 產出報告
|
|
121
|
+
|
|
122
|
+
彙整所有 task 結果,輸出執行報告:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"summary": {
|
|
127
|
+
"total_tasks": 4,
|
|
128
|
+
"succeeded": 3,
|
|
129
|
+
"failed": 1,
|
|
130
|
+
"skipped": 0,
|
|
131
|
+
"total_duration_ms": 120000
|
|
132
|
+
},
|
|
133
|
+
"tasks": [
|
|
134
|
+
{ "task_id": "T-001", "status": "success", "duration_ms": 30000 },
|
|
135
|
+
{ "task_id": "T-002", "status": "failed", "error": "..." },
|
|
136
|
+
{ "task_id": "T-003", "status": "skipped", "reason": "依賴任務失敗" }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 品質設定檔
|
|
144
|
+
|
|
145
|
+
| Profile | 行為 |
|
|
146
|
+
|---------|------|
|
|
147
|
+
| `strict` | 全部檢查 + Fix Loop 最多 5 次 |
|
|
148
|
+
| `standard` | lint + test + Fix Loop 最多 3 次(預設) |
|
|
149
|
+
| `minimal` | 僅跑 verify_command,不 Fix Loop |
|
|
150
|
+
| `none` | 不執行任何驗證 |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 重要注意事項
|
|
155
|
+
|
|
156
|
+
- 每個 Agent tool 的 `isolation: "worktree"` 會自動建立 git worktree
|
|
157
|
+
- `depends_on: []` 的 tasks 在同一層內全部並行
|
|
158
|
+
- 使用繁體中文回覆使用者
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 版本歷程
|
|
163
|
+
|
|
164
|
+
| 版本 | 日期 | 變更 |
|
|
165
|
+
|------|------|------|
|
|
166
|
+
| 2.0.0 | 2026-04-28 | 升格為 UDS 正式 Skill;Step 1 改為 Claude-native 解析(移除 plan-resolver-cli.js 依賴);新增 Quality Gate / Fix Loop 章節(XSPEC-097 Phase 3) |
|
|
167
|
+
| 1.0.0 | 2026-04-09 | 初始發布(DevAP packages/cli/skills/) |
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
version: 2.0.0
|
|
4
|
+
scope: universal
|
|
5
|
+
description: |
|
|
6
|
+
Generate plan.json from Spec documents, OpenSpec changes, or free-text requirements.
|
|
7
|
+
Use when: converting specifications into executable task plans for /orchestrate.
|
|
8
|
+
Keywords: plan, spec, task plan, 計畫, 規格, 任務, plan.json, DAG.
|
|
9
|
+
argument-hint: "[spec-file.md | openspec-dir/ | \"requirement text\" | (interactive)]"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# /plan — 從 Spec 自動生成 plan.json
|
|
13
|
+
|
|
14
|
+
## 用法
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
/plan <spec-file.md> # Spec 模式(自有格式 / SpecKit)
|
|
18
|
+
/plan <openspec-change-dir/> # OpenSpec 模式
|
|
19
|
+
/plan "需求描述文字" # 需求模式
|
|
20
|
+
/plan # 互動模式(自動偵測)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 執行流程
|
|
26
|
+
|
|
27
|
+
### Step 1: 輸入辨識與格式偵測
|
|
28
|
+
|
|
29
|
+
根據引數類型判斷使用模式:
|
|
30
|
+
|
|
31
|
+
**引數是 .md 檔案:**
|
|
32
|
+
1. 讀取檔案內容
|
|
33
|
+
2. 偵測格式:
|
|
34
|
+
- 含 `## Requirements` **且** `## Technical Design` → **自有格式**(SPEC-NNN-*.md)
|
|
35
|
+
- 含 `## Summary` **且** `## Detailed Design` → **SpecKit 格式**
|
|
36
|
+
- 其他 .md → 嘗試解析為通用 Spec(按自有格式處理,缺少的欄位由 AI 補充)
|
|
37
|
+
|
|
38
|
+
**引數是目錄:**
|
|
39
|
+
1. 檢查是否含 `proposal.md` + `tasks.md` → **OpenSpec 格式**
|
|
40
|
+
2. 否則報錯:「此目錄不符合 OpenSpec 結構」
|
|
41
|
+
|
|
42
|
+
**引數是字串描述(非檔案路徑):**
|
|
43
|
+
→ **需求模式**
|
|
44
|
+
|
|
45
|
+
**無引數:**
|
|
46
|
+
→ **互動模式**
|
|
47
|
+
1. 偵測 `openspec/` 目錄存在? → 列出 changes 讓使用者選擇
|
|
48
|
+
2. 偵測 `specs/*.md` 存在? → 列出可用 Spec 讓使用者選擇
|
|
49
|
+
3. 都沒有 → 進入需求模式問答
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Step 2: 專案 Context 收集
|
|
54
|
+
|
|
55
|
+
讀取目標專案的關鍵資訊:
|
|
56
|
+
|
|
57
|
+
1. **CLAUDE.md / AGENTS.md** — 語言、框架、測試工具、開發規範
|
|
58
|
+
2. **package.json / pyproject.toml** — 可用 scripts(build, test, lint)
|
|
59
|
+
|
|
60
|
+
從 Context 推斷:
|
|
61
|
+
- 主要語言(TypeScript / Python / 其他)
|
|
62
|
+
- 預設 verify_command(如 `pnpm build && pnpm test`、`pytest -x`)
|
|
63
|
+
- 預設 lint_command(如 `pnpm lint`、`ruff check .`)
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### Step 3: Spec 解析
|
|
68
|
+
|
|
69
|
+
依偵測到的格式,解析 Spec 內容:
|
|
70
|
+
|
|
71
|
+
#### 自有格式(SPEC-NNN-*.md)
|
|
72
|
+
|
|
73
|
+
提取以下區段:
|
|
74
|
+
- **Summary / Motivation** → 理解背景與需求動機
|
|
75
|
+
- **Requirements (REQ-NNN)** → 功能需求列表
|
|
76
|
+
- **Acceptance Criteria (AC-N)** → Given/When/Then 驗收條件
|
|
77
|
+
- **Technical Design** → Phase 分層、每個 Phase 的實作項目
|
|
78
|
+
- **Test Plan** → 測試清單
|
|
79
|
+
- **Risks** → 風險評估
|
|
80
|
+
|
|
81
|
+
#### OpenSpec(change 目錄)
|
|
82
|
+
|
|
83
|
+
讀取以下檔案:
|
|
84
|
+
- `proposal.md` → Why(動機)、What Changes(變更項目)、Impact
|
|
85
|
+
- `tasks.md` → `- [ ]` checklist 項目
|
|
86
|
+
- `design.md`(若存在)→ 技術決策
|
|
87
|
+
- `specs/*/spec.md`(若存在)→ Requirements(SHALL/MUST 語句)、Scenarios
|
|
88
|
+
|
|
89
|
+
#### SpecKit(SPEC-ID.md)
|
|
90
|
+
|
|
91
|
+
提取以下區段:
|
|
92
|
+
- **Summary / Motivation** → 背景
|
|
93
|
+
- **Detailed Design** → 技術實作步驟
|
|
94
|
+
- **Acceptance Criteria** → checkbox 驗收條件
|
|
95
|
+
- **Dependencies** → 外部依賴
|
|
96
|
+
- **Risks** → 風險
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Step 4: Task 切分
|
|
101
|
+
|
|
102
|
+
依格式套用不同映射規則:
|
|
103
|
+
|
|
104
|
+
#### 自有格式映射規則
|
|
105
|
+
|
|
106
|
+
| Spec 區段 | plan.json 欄位 | 映射規則 |
|
|
107
|
+
|-----------|---------------|----------|
|
|
108
|
+
| Technical Design > Phase | 一組 tasks | 每個 Phase 的每個實作項目 = 1 個 task |
|
|
109
|
+
| Phase 實作項目描述 | `task.spec` | 合併:項目描述 + 相關 REQ + 技術細節 |
|
|
110
|
+
| Acceptance Criteria (AC-N) | `task.acceptance_criteria` | 分配到最相關的 task |
|
|
111
|
+
| Summary / Motivation | `task.user_intent` | 萃取與 task 最相關的意圖 |
|
|
112
|
+
| Test Plan | `task.verify_command` | 推斷測試指令 |
|
|
113
|
+
|
|
114
|
+
#### OpenSpec 映射規則
|
|
115
|
+
|
|
116
|
+
| OpenSpec 檔案 | plan.json 欄位 | 映射規則 |
|
|
117
|
+
|--------------|---------------|----------|
|
|
118
|
+
| `tasks.md` 的 checklist 項目 | tasks | 每個 `- [ ]` 項目 = 1 個 task |
|
|
119
|
+
| `proposal.md` > Why | `task.user_intent` | 所有 tasks 共用 |
|
|
120
|
+
| `proposal.md` > What Changes | 融入 `task.spec` | 提供變更脈絡 |
|
|
121
|
+
| `design.md` 技術細節 | 融入 `task.spec` | 補充實作指引 |
|
|
122
|
+
| `specs/*/spec.md` > Scenarios | `task.acceptance_criteria` | 每個 Scenario 映射為一條 criteria |
|
|
123
|
+
| `specs/*/spec.md` > Requirements | 融入 `task.spec` | SHALL/MUST 語句轉為具體實作指引 |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Step 5: 依賴推斷
|
|
128
|
+
|
|
129
|
+
為 tasks 建立 `depends_on` 關係:
|
|
130
|
+
|
|
131
|
+
1. **Phase/Stage 順序**:後面的 Phase 的第一個 task depends_on 前面 Phase 的最後一個 task
|
|
132
|
+
2. **同 Phase 內順序**:型別定義 → 實作 → 整合 → 測試
|
|
133
|
+
3. **檔案依賴**:A 建立的檔案被 B import → B depends_on A
|
|
134
|
+
4. **無依賴的 tasks**:`depends_on: []`(可並行)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### Step 6: verify_command 推斷
|
|
139
|
+
|
|
140
|
+
依以下優先順序推斷:
|
|
141
|
+
|
|
142
|
+
1. **Test Plan / Scenarios 有明確測試項** → 對應測試指令
|
|
143
|
+
2. **TypeScript 專案** → `pnpm build && pnpm test`
|
|
144
|
+
3. **Python 專案** → `pytest -x`
|
|
145
|
+
4. **其他** → 使用 Step 2 收集的專案 scripts
|
|
146
|
+
5. **無法推斷** → 不設(後續品質警告會提醒)
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Step 7: 品質設定
|
|
151
|
+
|
|
152
|
+
- 預設 `quality: "standard"`
|
|
153
|
+
- 使用者可在互動確認時調整
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### Step 8: 組裝 plan.json
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"project": "<專案名稱>",
|
|
162
|
+
"quality": "standard",
|
|
163
|
+
"defaults": {
|
|
164
|
+
"max_turns": 30,
|
|
165
|
+
"max_budget_usd": 2.0,
|
|
166
|
+
"verify_command": "<推斷的預設驗證指令>"
|
|
167
|
+
},
|
|
168
|
+
"tasks": [
|
|
169
|
+
{
|
|
170
|
+
"id": "T-001",
|
|
171
|
+
"title": "<task 標題>",
|
|
172
|
+
"spec": "<詳細的 task 規格說明>",
|
|
173
|
+
"depends_on": [],
|
|
174
|
+
"verify_command": "<task 層級驗證指令(可選)>",
|
|
175
|
+
"acceptance_criteria": ["<驗收條件 1>"],
|
|
176
|
+
"user_intent": "<使用者意圖>"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**注意事項:**
|
|
183
|
+
- Task ID 格式:`T-NNN`(如 T-001, T-002)
|
|
184
|
+
- `spec` 欄位應詳盡——它是 agent 執行任務的唯一規格輸入
|
|
185
|
+
- `acceptance_criteria` 每條都必須是可觀察、可驗證的
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Step 9: 驗證(Claude-native)
|
|
190
|
+
|
|
191
|
+
Claude 對 plan.json 執行以下驗證(無需外部引擎):
|
|
192
|
+
|
|
193
|
+
1. **結構驗證**:`tasks` 陣列存在且非空、每個 task 含必填欄位(id, title, spec)
|
|
194
|
+
2. **DAG 合法性**:`depends_on` 中的所有 ID 均存在、無循環依賴
|
|
195
|
+
3. **安全掃描**:task.spec 不含危險指令(`rm -rf /`、`DROP DATABASE`、`git push --force`)
|
|
196
|
+
4. **品質警告**:task 缺少 verify_command、spec 過短(< 20 字)等
|
|
197
|
+
|
|
198
|
+
若發現問題,在呈現前先自動修正(若可修正)或標示警告。
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### Step 10: 呈現與確認
|
|
203
|
+
|
|
204
|
+
向使用者呈現生成結果:
|
|
205
|
+
|
|
206
|
+
1. **摘要表格**:
|
|
207
|
+
```
|
|
208
|
+
| Task ID | 標題 | 依賴 | 驗證指令 |
|
|
209
|
+
|---------|------|------|----------|
|
|
210
|
+
| T-001 | ... | - | ... |
|
|
211
|
+
| T-002 | ... | T-001| ... |
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
2. **DAG 拓撲**:
|
|
215
|
+
```
|
|
216
|
+
Layer 0: T-001, T-002(並行)
|
|
217
|
+
Layer 1: T-003(依賴 T-001)
|
|
218
|
+
Layer 2: T-004(依賴 T-002, T-003)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
3. **品質設定**:`quality: standard`
|
|
222
|
+
|
|
223
|
+
4. **品質警告**(若有)
|
|
224
|
+
|
|
225
|
+
5. **詢問使用者**:確認或修改?確認後寫入檔案(預設路徑:`plans/<spec-name>.plan.json`)
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 版本歷程
|
|
230
|
+
|
|
231
|
+
| 版本 | 日期 | 變更 |
|
|
232
|
+
|------|------|------|
|
|
233
|
+
| 2.0.0 | 2026-04-28 | 升格為 UDS 正式 Skill;移除 [DEVAP] 標記;Step 9 改為 Claude-native 驗證(XSPEC-097 Phase 3) |
|
|
234
|
+
| 1.0.0 | 2026-04-09 | 初始發布(DevAP packages/cli/skills/) |
|
|
@@ -8,6 +8,14 @@ description: |
|
|
|
8
8
|
allowed-tools: Read, Grep, Glob, Bash(git:*, gh:*)
|
|
9
9
|
argument-hint: "[branch name or PR number | 分支名稱或 PR 編號]"
|
|
10
10
|
---
|
|
11
|
+
<!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
|
|
12
|
+
PR lifecycle orchestration (5-step: CREATE→REVIEW→APPROVE→MERGE→CLEANUP,
|
|
13
|
+
size gate >400 lines block, CI gate, squash/merge strategy, gh CLI integration) extracted to:
|
|
14
|
+
- DevAP flow: dev-autopilot/.devap/flows/pr.flow.yaml
|
|
15
|
+
- DevAP CLI: devap pr (packages/cli/src/commands/pr.ts)
|
|
16
|
+
This Skill retains: PR description template, merge strategy decision matrix, auto-review trigger rules.
|
|
17
|
+
Use `devap pr` for enforced lifecycle; this Skill for template and rule reference.
|
|
18
|
+
-->
|
|
11
19
|
|
|
12
20
|
# PR Automation Assistant | PR 自動化助手
|
|
13
21
|
|
|
@@ -8,12 +8,11 @@ description: |
|
|
|
8
8
|
allowed-tools: Read, Bash(git:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(bun:*)
|
|
9
9
|
argument-hint: "[--force] [--target <branch>] [--skip-gates] [--no-pr]"
|
|
10
10
|
---
|
|
11
|
-
|
|
12
11
|
# Push Assistant | 推送助手
|
|
13
12
|
|
|
14
13
|
> **Language**: English | 繁體中文
|
|
15
14
|
|
|
16
|
-
**Version**:
|
|
15
|
+
**Version**: 2.0.0
|
|
17
16
|
**Created**: 2026-04-23
|
|
18
17
|
**Applicability**: Claude Code Skills
|
|
19
18
|
|
|
@@ -29,6 +28,53 @@ This skill implements [`.standards/push-standards.ai.yaml`](../../.standards/pus
|
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
31
|
+
## Workflow | 執行工作流程
|
|
32
|
+
|
|
33
|
+
When `/push` is invoked, Claude executes the following steps natively:
|
|
34
|
+
|
|
35
|
+
### Step 1: Detect Protected Branch
|
|
36
|
+
Run `git rev-parse --abbrev-ref HEAD` to get current branch.
|
|
37
|
+
Compare against `protected_branches` list (default: main, master, release/*, hotfix/*).
|
|
38
|
+
If protected: show warning + pending commits, require explicit user confirmation before proceeding.
|
|
39
|
+
|
|
40
|
+
### Step 2: Detect Force Push
|
|
41
|
+
If `--force` or `--force-with-lease` flag detected:
|
|
42
|
+
Run `git log origin/<branch>..HEAD --oneline` to find commits that will be overwritten.
|
|
43
|
+
Show count and author list. Require user to type `yes, force push` to proceed.
|
|
44
|
+
|
|
45
|
+
### Step 3: Run Pre-Push Quality Gates
|
|
46
|
+
Run each configured gate in sequence using Bash tool:
|
|
47
|
+
- `lint`: detect and run project lint command
|
|
48
|
+
- `test`: detect and run project test command
|
|
49
|
+
- `type-check` (optional): TypeScript type check
|
|
50
|
+
- `ac-coverage` (optional): acceptance criteria coverage
|
|
51
|
+
- `security-scan` (optional): security vulnerability scan
|
|
52
|
+
|
|
53
|
+
If any required gate fails: abort with error message.
|
|
54
|
+
|
|
55
|
+
### Step 4: Execute Push
|
|
56
|
+
Run `git push <remote> <branch> [--force]`.
|
|
57
|
+
If push fails: show git error and suggest remediation.
|
|
58
|
+
|
|
59
|
+
### Step 5: Emit Push Receipt
|
|
60
|
+
Output structured receipt to console (and optionally to `~/.uds/push-history.jsonl`):
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"branch": "<branch>",
|
|
64
|
+
"commit_sha": "<sha>",
|
|
65
|
+
"gates_passed": ["lint", "test"],
|
|
66
|
+
"force_push": false,
|
|
67
|
+
"timestamp": "<ISO8601>",
|
|
68
|
+
"target_remote": "origin"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 6: PR Integration
|
|
73
|
+
If `auto_pr=true` AND `repo_mode=team` AND no open PR exists for this branch:
|
|
74
|
+
Suggest running `/pr-automation-assistant` to create a Pull Request.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
32
78
|
## Features | 功能說明
|
|
33
79
|
|
|
34
80
|
### 1. Push Target Risk Detection | 推送目標風險偵測
|
|
@@ -192,6 +238,7 @@ After `/push` completes, the AI assistant should suggest:
|
|
|
192
238
|
|
|
193
239
|
| Version | Date | Changes |
|
|
194
240
|
|---------|------|---------|
|
|
241
|
+
| 2.0.0 | 2026-04-28 | Restore workflow execution steps (DevAP decomposition XSPEC-097); remove deprecation notice |
|
|
195
242
|
| 1.0.0 | 2026-04-23 | Initial release — XSPEC-081 Phase 1 |
|
|
196
243
|
|
|
197
244
|
---
|
|
@@ -5,6 +5,13 @@ description: "[UDS] Create or review specification documents for Spec-Driven Dev
|
|
|
5
5
|
allowed-tools: Read, Write, Grep, Glob, Bash(git:*)
|
|
6
6
|
argument-hint: "[spec name or feature | 規格名稱或功能]"
|
|
7
7
|
---
|
|
8
|
+
<!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
|
|
9
|
+
SDD lifecycle orchestration (7-phase state machine, phase transitions, gate checks) extracted to:
|
|
10
|
+
- DevAP flow: dev-autopilot/.devap/flows/sdd.flow.yaml
|
|
11
|
+
- DevAP CLI: devap sdd (packages/cli/src/commands/sdd.ts) with --phase jump support
|
|
12
|
+
This Skill retains: spec format definition, state descriptions, delta operations, decision tree.
|
|
13
|
+
Use `devap sdd` for enforced lifecycle; this Skill for spec structure reference.
|
|
14
|
+
-->
|
|
8
15
|
|
|
9
16
|
# Spec-Driven Development Assistant | 規格驅動開發助手
|
|
10
17
|
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sweep
|
|
3
|
+
scope: universal
|
|
4
|
+
description: |
|
|
5
|
+
Scan codebase for debug artifacts and code quality issues; optionally auto-fix safe patterns.
|
|
6
|
+
Use when: before committing, during PR review, or periodic codebase cleanup.
|
|
7
|
+
Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 掃描, 清理.
|
|
8
|
+
allowed-tools: Read, Grep, Glob, Bash(find:*), Edit, Write
|
|
9
|
+
argument-hint: "[--fix] [--report] [--path <dir>] [--exclude <pattern>]"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Sweep Assistant | 掃碼助手
|
|
13
|
+
|
|
14
|
+
> **Language**: English | 繁體中文
|
|
15
|
+
|
|
16
|
+
Scan the codebase for debug artifacts, code quality issues, and technical debt markers.
|
|
17
|
+
Optionally auto-fix safe patterns (console.log, debugger statements).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Scan Patterns | 掃描模式
|
|
22
|
+
|
|
23
|
+
| Pattern ID | Label | Auto-fixable | Description |
|
|
24
|
+
|------------|-------|-------------|-------------|
|
|
25
|
+
| `console-log` | console.log / console.debug / console.trace | ✅ Yes | Debug output left in production code |
|
|
26
|
+
| `debugger` | debugger statement | ✅ Yes | Debugger breakpoints left in code |
|
|
27
|
+
| `todo-fixme` | TODO / FIXME / HACK / XXX | ❌ Report only | Technical debt markers |
|
|
28
|
+
| `ts-any` | TypeScript `any` type | ❌ Report only | Type safety violations |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Usage | 使用方式
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
/sweep # Scan current directory, report findings
|
|
36
|
+
/sweep --fix # Scan and auto-fix fixable patterns
|
|
37
|
+
/sweep --report # Scan and save report to .devap/sweep-report.json
|
|
38
|
+
/sweep --path src/ # Scan specific directory
|
|
39
|
+
/sweep --exclude "**/*.test.ts" # Exclude patterns (glob)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Workflow | 執行工作流程
|
|
45
|
+
|
|
46
|
+
### Step 1: Discover Files
|
|
47
|
+
Use Glob tool to find all source files under the target path.
|
|
48
|
+
Default excludes: `node_modules/`, `dist/`, `.git/`, `*.min.js`, `coverage/`.
|
|
49
|
+
|
|
50
|
+
### Step 2: Scan Each Pattern
|
|
51
|
+
For each pattern, use Grep to find matches across all files.
|
|
52
|
+
Collect findings: `{ file, line, column, pattern_id, label, fixable, content }`.
|
|
53
|
+
|
|
54
|
+
### Step 3: Report Findings
|
|
55
|
+
Output a structured summary:
|
|
56
|
+
```
|
|
57
|
+
📊 Sweep Results
|
|
58
|
+
─────────────────────────────────────
|
|
59
|
+
console-log: 12 findings (auto-fixable)
|
|
60
|
+
debugger: 2 findings (auto-fixable)
|
|
61
|
+
todo-fixme: 28 findings (report only)
|
|
62
|
+
ts-any: 5 findings (report only)
|
|
63
|
+
─────────────────────────────────────
|
|
64
|
+
Total: 47 findings | Fixable: 14
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 4: HITL Gate (if --fix and findings > 20)
|
|
68
|
+
If `--fix` flag is set AND total fixable findings exceed 20:
|
|
69
|
+
**Pause and require explicit user confirmation** before applying fixes.
|
|
70
|
+
Show the list of files that will be modified.
|
|
71
|
+
|
|
72
|
+
### Step 5: Apply Fixes (if --fix confirmed)
|
|
73
|
+
For each fixable finding:
|
|
74
|
+
- `console-log`: Remove the line if it contains only the console statement
|
|
75
|
+
- `debugger`: Remove the line if it contains only the debugger statement
|
|
76
|
+
|
|
77
|
+
Use Edit tool to apply changes file by file.
|
|
78
|
+
Report: "Fixed N findings in M files."
|
|
79
|
+
|
|
80
|
+
### Step 6: Save Report (if --report)
|
|
81
|
+
Write findings to `.devap/sweep-report.json`:
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"timestamp": "<ISO8601>",
|
|
85
|
+
"total_findings": 47,
|
|
86
|
+
"fixable": 14,
|
|
87
|
+
"fixed": 14,
|
|
88
|
+
"findings_by_pattern": { "console-log": 12, "debugger": 2, "todo-fixme": 28, "ts-any": 5 },
|
|
89
|
+
"files_modified": ["src/auth.ts", "src/utils.ts"]
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Configuration | 設定
|
|
96
|
+
|
|
97
|
+
Configure via `uds.project.yaml`:
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
sweep:
|
|
101
|
+
default_path: "src/"
|
|
102
|
+
exclude_patterns:
|
|
103
|
+
- "**/*.test.ts"
|
|
104
|
+
- "**/*.spec.ts"
|
|
105
|
+
- "**/fixtures/**"
|
|
106
|
+
hitl_threshold: 20 # Require confirmation if fixable findings exceed this
|
|
107
|
+
patterns:
|
|
108
|
+
enabled:
|
|
109
|
+
- console-log
|
|
110
|
+
- debugger
|
|
111
|
+
- todo-fixme
|
|
112
|
+
- ts-any
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Next Steps Guidance | 下一步引導
|
|
118
|
+
|
|
119
|
+
After `/sweep` completes, suggest:
|
|
120
|
+
|
|
121
|
+
> - Run `/checkin` to verify overall code quality before committing
|
|
122
|
+
> - Run `/review` to review the cleaned-up changes
|
|
123
|
+
> - Run `/commit` to commit the fixes
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Related Standards | 相關標準
|
|
128
|
+
|
|
129
|
+
- [Checkin Standards](../../.standards/checkin-standards.ai.yaml) — Pre-commit quality gates
|
|
130
|
+
- [Code Review](../code-review-assistant/SKILL.md) — Code review assistant
|
|
131
|
+
- [Testing Guide](../testing-guide/SKILL.md) — Testing standards
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Version History | 版本歷程
|
|
136
|
+
|
|
137
|
+
| Version | Date | Changes |
|
|
138
|
+
|---------|------|---------|
|
|
139
|
+
| 1.0.0 | 2026-04-28 | Initial release — XSPEC-097 Phase 1 (from DevAP sweep module) |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## License | 授權
|
|
144
|
+
|
|
145
|
+
This skill is released under [MIT License](https://opensource.org/licenses/MIT) and [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
|
@@ -5,6 +5,13 @@ description: "[UDS] Guide through Test-Driven Development workflow"
|
|
|
5
5
|
allowed-tools: Read, Write, Grep, Glob, Bash(npm test:*), Bash(npx vitest:*)
|
|
6
6
|
argument-hint: "[feature or file | 功能或檔案]"
|
|
7
7
|
---
|
|
8
|
+
<!-- DEPRECATION NOTICE (XSPEC-086 Phase 4, 2026-04-28):
|
|
9
|
+
TDD flow orchestration (RED→GREEN→REFACTOR cycle, test execution gates) extracted to:
|
|
10
|
+
- DevAP flow: dev-autopilot/.devap/flows/tdd.flow.yaml
|
|
11
|
+
- DevAP CLI: devap tdd (packages/cli/src/commands/tdd.ts)
|
|
12
|
+
This Skill retains: TDD principles, FIRST rules, AAA format, language examples, workflow guide.
|
|
13
|
+
Use `devap tdd` for enforced interactive cycle; this Skill for practice reference.
|
|
14
|
+
-->
|
|
8
15
|
|
|
9
16
|
# TDD Assistant | TDD 助手
|
|
10
17
|
|