@wwkit/harness 1.0.47 → 1.0.49
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/package.json +4 -5
- package/skills/query/SKILL.md +0 -72
- package/skills/read-docs/SKILL.md +0 -134
- package/skills/read-docs/references/opencode/agents/cases.md +0 -206
- package/skills/read-docs/references/opencode/agents/design-pattern.md +0 -47
- package/skills/read-docs/references/opencode/agents/detail.md +0 -191
- package/skills/read-docs/references/opencode/agents/examples.md +0 -100
- package/skills/read-docs/references/opencode/agents/index.md +0 -309
- package/skills/read-docs/references/opencode/agents/parallel-dispatch.md +0 -149
- package/skills/read-docs/references/opencode/agents/subagent-internals.md +0 -217
- package/skills/read-docs/references/opencode/agents/workflow.md +0 -161
- package/skills/read-docs/references/opencode/cli/commands/acp.md +0 -32
- package/skills/read-docs/references/opencode/cli/commands/agent.md +0 -16
- package/skills/read-docs/references/opencode/cli/commands/attach.md +0 -20
- package/skills/read-docs/references/opencode/cli/commands/mcp.md +0 -37
- package/skills/read-docs/references/opencode/cli/commands/others.md +0 -49
- package/skills/read-docs/references/opencode/cli/commands/plugin.md +0 -13
- package/skills/read-docs/references/opencode/cli/commands/provider.md +0 -44
- package/skills/read-docs/references/opencode/cli/commands/run.md +0 -81
- package/skills/read-docs/references/opencode/cli/commands/serve.md +0 -84
- package/skills/read-docs/references/opencode/cli/commands/session.md +0 -38
- package/skills/read-docs/references/opencode/cli/commands/web.md +0 -15
- package/skills/read-docs/references/opencode/cli/env.md +0 -39
- package/skills/read-docs/references/opencode/cli/index.md +0 -19
- package/skills/read-docs/references/opencode/cli/tui.md +0 -35
- package/skills/read-docs/references/opencode/commands/examples.md +0 -42
- package/skills/read-docs/references/opencode/commands/index.md +0 -185
- package/skills/read-docs/references/opencode/config/provider.md +0 -152
- package/skills/read-docs/references/opencode/formatter/index.md +0 -71
- package/skills/read-docs/references/opencode/guide/config.md +0 -419
- package/skills/read-docs/references/opencode/guide/formatters.md +0 -70
- package/skills/read-docs/references/opencode/guide/index.md +0 -37
- package/skills/read-docs/references/opencode/guide/providers.md +0 -31
- package/skills/read-docs/references/opencode/guide/rules.md +0 -63
- package/skills/read-docs/references/opencode/plugins/examples.md +0 -75
- package/skills/read-docs/references/opencode/plugins/index.md +0 -188
- package/skills/read-docs/references/opencode/reference/index.md +0 -119
- package/skills/read-docs/references/opencode/rule/index.md +0 -78
- package/skills/read-docs/references/opencode/skills/detail.md +0 -113
- package/skills/read-docs/references/opencode/skills/examples.md +0 -141
- package/skills/read-docs/references/opencode/skills/index.md +0 -126
- package/skills/read-docs/references/opencode/skills/workflow.md +0 -146
- package/skills/read-docs/references/opencode/tests/agent.md +0 -10
- package/skills/read-docs/references/opencode/tests/config.md +0 -60
- package/skills/read-docs/references/opencode/tests/file.md +0 -12
- package/skills/read-docs/references/opencode/tests/serve.md +0 -18
- package/skills/read-docs/references/opencode/tests/session.md +0 -31
- package/skills/read-docs/references/opencode/tests/web.md +0 -17
- package/skills/read-docs/references/opencode/tools/arguments.md +0 -305
- package/skills/read-docs/references/opencode/tools/context.md +0 -18
- package/skills/read-docs/references/opencode/tools/custom.md +0 -111
- package/skills/read-docs/references/opencode/tools/detail.md +0 -104
- package/skills/read-docs/references/opencode/tools/examples.md +0 -71
- package/skills/read-docs/references/opencode/tools/index.md +0 -56
- package/skills/read-docs/references/opencode/tools/lsp.md +0 -26
- package/skills/read-docs/references/opencode/tools/mcp.md +0 -132
- package/skills/read-docs/references/opencode/train/README.md +0 -135
- package/skills/read-docs/references/opencode/train/agent-basic.md +0 -772
- package/skills/read-docs/references/opencode/train/command-basic.md +0 -668
- package/skills/read-docs/references/opencode/train/config-basic.md +0 -509
- package/skills/read-docs/references/opencode/train/index.md +0 -164
- package/skills/read-docs/references/opencode/train/practice.md +0 -873
- package/skills/read-docs/references/opencode/train/skill-basic.md +0 -608
- package/skills/read-docs/references/opencode/tui/commands/config.md +0 -32
- package/skills/read-docs/references/opencode/tui/commands/editor.md +0 -47
- package/skills/read-docs/references/opencode/tui/commands/index.md +0 -125
- package/skills/read-docs/references/opencode/tui/commands/init.md +0 -5
- package/skills/read-docs/references/opencode/tui/index.md +0 -26
- package/skills/read-docs/references/superpowers/bootstrap.md +0 -107
- package/skills/read-docs/references/superpowers/comparison.md +0 -77
- package/skills/read-docs/references/superpowers/context.md +0 -71
- package/skills/read-docs/references/superpowers/index.md +0 -58
- package/skills/read-docs/references/superpowers/parallel.md +0 -49
- package/skills/read-docs/references/superpowers/sdd.md +0 -183
- package/skills/read-docs/references/superpowers/skills.md +0 -68
- package/skills/read-docs/references/superpowers/workflow.md +0 -83
- package/skills/step-extract/SKILL.md +0 -205
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
# Subagent-Driven Development (SDD)
|
|
2
|
-
|
|
3
|
-
## 核心原则
|
|
4
|
-
|
|
5
|
-
> **Fresh subagent per task + task review (spec + quality) + broad final review = high quality, fast iteration**
|
|
6
|
-
|
|
7
|
-
## SDD 完整流程
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
11
|
-
│ Setup │
|
|
12
|
-
│ ├─ 确保在隔离工作区(using-git-worktrees) │
|
|
13
|
-
│ ├─ 创建 SDD 工作区目录: .superpowers/sdd/<plan-name>/ │
|
|
14
|
-
│ ├─ 检查 Ledger(progress.md)确定已完成任务 │
|
|
15
|
-
│ ├─ 读取计划,创建 todos │
|
|
16
|
-
│ └─ 预审计划冲突(任务矛盾、与约束冲突) │
|
|
17
|
-
├─────────────────────────────────────────────────────────────┤
|
|
18
|
-
│ Per Task Loop │
|
|
19
|
-
│ │ │
|
|
20
|
-
│ ├─ 1. 记录 BASE = git rev-parse HEAD │
|
|
21
|
-
│ ├─ 2. 提取任务 brief: scripts/task-brief PLAN N │
|
|
22
|
-
│ │ → .superpowers/sdd/<plan>/task-N-brief.md │
|
|
23
|
-
│ ├─ 3. 派发 implementer subagent │
|
|
24
|
-
│ │ prompt 包含: brief 路径 + report 路径 + 上下文 │
|
|
25
|
-
│ │ (不粘贴计划全文,不让 subagent 读整个计划) │
|
|
26
|
-
│ │ │
|
|
27
|
-
│ ├─ 4. 处理 implementer 报告 │
|
|
28
|
-
│ │ DONE → 生成 review package,派发 task reviewer │
|
|
29
|
-
│ │ DONE_WITH_CONCERNS → 读顾虑,决定是否先处理 │
|
|
30
|
-
│ │ NEEDS_CONTEXT → 补充上下文,重新派发 │
|
|
31
|
-
│ │ BLOCKED → 评估阻塞,换模型/拆任务/升级 │
|
|
32
|
-
│ │ │
|
|
33
|
-
│ ├─ 5. Task Review(两阶段) │
|
|
34
|
-
│ │ a. Spec Compliance: 对照 brief 检查实现 │
|
|
35
|
-
│ │ b. Code Quality: 清洁性/DRY/边界情况 │
|
|
36
|
-
│ │ verdict: ✅ + Approved → 完成任务 │
|
|
37
|
-
│ │ verdict: ❌ 或有 Critical/Important → 进入 fix loop │
|
|
38
|
-
│ │ │
|
|
39
|
-
│ ├─ 6. Fix Loop(最多 5 轮) │
|
|
40
|
-
│ │ Round 1-3: 恢复原 implementer(context 完整) │
|
|
41
|
-
│ │ Round 4-5: 新 implementer + 更强模型(fresh eyes) │
|
|
42
|
-
│ │ 每轮: fix → re-test → scoped re-review │
|
|
43
|
-
│ │ Round 5 仍有 open findings → Adjudicate │
|
|
44
|
-
│ │ │
|
|
45
|
-
│ ├─ 7. Adjudicate(仅 Round 5 触发) │
|
|
46
|
-
│ │ reviewer 错误/可争议 → park with ruling │
|
|
47
|
-
│ │ 真问题但不 load-bearing → park with ruling │
|
|
48
|
-
│ │ 真问题且 load-bearing → STOP, report BLOCKED │
|
|
49
|
-
│ │ │
|
|
50
|
-
│ └─ 8. 完成: 写 ledger, 标记 todo complete │
|
|
51
|
-
│ │
|
|
52
|
-
│ → 下一任务(串行,不并行) │
|
|
53
|
-
├─────────────────────────────────────────────────────────────┤
|
|
54
|
-
│ Final Review │
|
|
55
|
-
│ ├─ 生成全分支 review package (MERGE_BASE..HEAD) │
|
|
56
|
-
│ ├─ 派发 final reviewer(最强模型) │
|
|
57
|
-
│ ├─ 有 findings → 一次 fix dispatch + 一次 scoped re-review │
|
|
58
|
-
│ └─ 残留 load-bearing findings → 报告给用户 │
|
|
59
|
-
├─────────────────────────────────────────────────────────────┤
|
|
60
|
-
│ Finish │
|
|
61
|
-
│ ├─ 删除 SDD 工作区(git 历史是记录) │
|
|
62
|
-
│ └─ 调用 finishing-a-development-branch 技能 │
|
|
63
|
-
└─────────────────────────────────────────────────────────────┘
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Implementer Subagent 派发
|
|
67
|
-
|
|
68
|
-
**模板**: `implementer-prompt.md`
|
|
69
|
-
|
|
70
|
-
派发 prompt 结构:
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
Subagent (general-purpose):
|
|
74
|
-
description: "Implement Task N: [task name]"
|
|
75
|
-
model: [MODEL — 必填,按 Model Selection 选择]
|
|
76
|
-
prompt: |
|
|
77
|
-
You are implementing Task N: [task name]
|
|
78
|
-
|
|
79
|
-
## Task Description
|
|
80
|
-
Read your task brief first: [BRIEF_FILE]
|
|
81
|
-
|
|
82
|
-
## Context
|
|
83
|
-
[场景设置:任务在项目中的位置、依赖、架构上下文]
|
|
84
|
-
|
|
85
|
-
## Your Job
|
|
86
|
-
1. Implement exactly what the task specifies
|
|
87
|
-
2. Write tests (following TDD if task says to)
|
|
88
|
-
3. Verify implementation works
|
|
89
|
-
4. Commit your work
|
|
90
|
-
5. Self-review
|
|
91
|
-
6. Report back
|
|
92
|
-
|
|
93
|
-
## Report Format
|
|
94
|
-
Write your full report to [REPORT_FILE].
|
|
95
|
-
|
|
96
|
-
Then report back with ONLY (under 15 lines):
|
|
97
|
-
- Status: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
|
|
98
|
-
- Commits created
|
|
99
|
-
- One-line test summary
|
|
100
|
-
- Concerns
|
|
101
|
-
- Report file path
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
**关键设计**:
|
|
105
|
-
1. **文件传递上下文**:brief 和 report 都是文件,不经过 controller 的 context window
|
|
106
|
-
2. **简短返回**:implementer 只返回 ≤15 行的状态摘要,详情写文件
|
|
107
|
-
3. **model 必填**:省略 model 会继承 session 最贵模型
|
|
108
|
-
4. **不并行实现任务**:`Never dispatch multiple implementation subagents in parallel (conflicts)`
|
|
109
|
-
|
|
110
|
-
## Task Reviewer Subagent
|
|
111
|
-
|
|
112
|
-
**模板**: `task-reviewer-prompt.md`
|
|
113
|
-
|
|
114
|
-
Reviewer 获取三个文件路径 + 全局约束:
|
|
115
|
-
- BRIEF_FILE — 任务详情
|
|
116
|
-
- REPORT_FILE — implementer 的报告
|
|
117
|
-
- DIFF_FILE — review package(commits + stat + full diff with -U10 context)
|
|
118
|
-
|
|
119
|
-
**两阶段 review**:
|
|
120
|
-
1. **Spec Compliance**:Missing / Extra / Misunderstood
|
|
121
|
-
2. **Code Quality**:Clean separation / Error handling / DRY / Edge cases / Tests verify real behavior
|
|
122
|
-
|
|
123
|
-
**关键原则**:
|
|
124
|
-
- **不信任 implementer 报告**:`Treat the implementer's report as unverified claims`
|
|
125
|
-
- **不重新运行测试**:implementer 已运行并报告,reviewer 只在阅读代码产生具体疑虑时才跑 focused test
|
|
126
|
-
- **不做全库爬取**:`Do not crawl the broader codebase`
|
|
127
|
-
|
|
128
|
-
## Fix Loop 机制
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
Review 有 Critical/Important findings
|
|
132
|
-
│
|
|
133
|
-
▼
|
|
134
|
-
Round 1-3: 恢复原 implementer
|
|
135
|
-
├─ 发送 open findings verbatim
|
|
136
|
-
├─ implementer fix → re-test → append fix report
|
|
137
|
-
├─ 生成 scoped review package (FIX_BASE..HEAD)
|
|
138
|
-
└─ 派发 re-reviewer (re-review-prompt.md)
|
|
139
|
-
├─ ADDRESSED → 该 finding 关闭
|
|
140
|
-
└─ NOT ADDRESSED → 继续 open
|
|
141
|
-
│
|
|
142
|
-
▼ (有 open findings)
|
|
143
|
-
Round 4-5: 新 implementer + 更强模型
|
|
144
|
-
├─ "A prior implementer attempted this task [N] times; you own it now."
|
|
145
|
-
├─ 同样流程: fix → re-test → scoped re-review
|
|
146
|
-
└─ ...
|
|
147
|
-
│
|
|
148
|
-
▼ (Round 5 仍有 open findings)
|
|
149
|
-
Adjudicate (controller 自己裁决)
|
|
150
|
-
├─ reviewer 错误 → park with ruling
|
|
151
|
-
├─ 真但不 load-bearing → park with ruling
|
|
152
|
-
└─ 真且 load-bearing → STOP, report BLOCKED
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
**Re-review 是 scoped 的**:只验证 findings 是否解决 + 检查 fix diff 是否引入新问题。不重新审查未改动代码。out-of-scope 观察记入 ledger,不扩展 loop。
|
|
156
|
-
|
|
157
|
-
## SDD 工作区
|
|
158
|
-
|
|
159
|
-
每个计划有独立的工作区目录:
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
.superpowers/sdd/
|
|
163
|
-
.gitignore # 内容: *(忽略所有)
|
|
164
|
-
<plan-name>/
|
|
165
|
-
progress.md # Ledger
|
|
166
|
-
task-1-brief.md # 任务 1 的完整文本
|
|
167
|
-
task-1-report.md # 任务 1 implementer 的报告
|
|
168
|
-
review-a1b2..d4e5.diff # 任务 1 的 review package
|
|
169
|
-
...
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**设计原因**:
|
|
173
|
-
- `.superpowers/sdd/` 在 `.gitignore` 中,不污染 git status
|
|
174
|
-
- 不在 `.git/` 下(Claude Code 禁止 agent 写 `.git/`)
|
|
175
|
-
- 每计划独立目录,防止并发计划互相干扰
|
|
176
|
-
|
|
177
|
-
## 辅助脚本
|
|
178
|
-
|
|
179
|
-
| 脚本 | 作用 |
|
|
180
|
-
|------|------|
|
|
181
|
-
| `scripts/task-brief PLAN N` | 从计划文件提取第 N 个任务的完整文本到 `task-N-brief.md` |
|
|
182
|
-
| `scripts/review-package PLAN BASE HEAD` | 生成 diff 包(commits + stat + full diff -U10)到文件 |
|
|
183
|
-
| `scripts/sdd-workspace PLAN` | 解析并创建计划的工作区目录 |
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# 技能体系
|
|
2
|
-
|
|
3
|
-
## 技能列表
|
|
4
|
-
|
|
5
|
-
Superpowers 包含 14 个技能,覆盖完整的软件开发流程:
|
|
6
|
-
|
|
7
|
-
| 技能 | 阶段 | 说明 |
|
|
8
|
-
|------|------|------|
|
|
9
|
-
| `using-superpowers` | 元技能 | Bootstrap:如何发现和使用技能 |
|
|
10
|
-
| `brainstorming` | 需求 | 苏格拉底式设计对话,产出 spec |
|
|
11
|
-
| `writing-plans` | 规划 | 将 spec 拆解为 bite-sized 任务计划 |
|
|
12
|
-
| `using-git-worktrees` | 隔离 | 创建隔离工作区 |
|
|
13
|
-
| `subagent-driven-development` | 执行(SDD) | 每任务一个 subagent + 两阶段 review |
|
|
14
|
-
| `executing-plans` | 执行(inline) | 批量执行 + 检查点(无 subagent 时的替代) |
|
|
15
|
-
| `dispatching-parallel-agents` | 执行(并行) | 并行派发独立问题的修复 |
|
|
16
|
-
| `test-driven-development` | 实现 | RED-GREEN-REFACTOR |
|
|
17
|
-
| `systematic-debugging` | 调试 | 4 阶段根因分析 |
|
|
18
|
-
| `requesting-code-review` | 审查 | 派发 reviewer subagent |
|
|
19
|
-
| `receiving-code-review` | 审查 | 响应 review 反馈 |
|
|
20
|
-
| `verification-before-completion` | 验证 | 完成前验证 |
|
|
21
|
-
| `finishing-a-development-branch` | 收尾 | merge/PR/keep 决策 |
|
|
22
|
-
| `writing-skills` | 元技能 | 创建新技能 |
|
|
23
|
-
|
|
24
|
-
## 技能自动触发
|
|
25
|
-
|
|
26
|
-
`using-superpowers` 是所有技能的入口。它的核心规则:
|
|
27
|
-
|
|
28
|
-
> **Invoke relevant or requested skills BEFORE any response or action** — including clarifying questions, exploring the codebase, or checking files.
|
|
29
|
-
|
|
30
|
-
这意味着 agent 在回答任何问题(包括澄清问题)之前,必须先检查是否有相关技能。技能通过 `<SUBAGENT-STOP>` 标记跳过被派发为 subagent 的会话:
|
|
31
|
-
|
|
32
|
-
```markdown
|
|
33
|
-
<SUBAGENT-STOP>
|
|
34
|
-
If you were dispatched as a subagent to execute a specific task, ignore this skill.
|
|
35
|
-
</SUBAGENT-STOP>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### 验收测试
|
|
39
|
-
|
|
40
|
-
> A working integration auto-triggers the `brainstorming` skill before any code is written.
|
|
41
|
-
|
|
42
|
-
用户说 "Let's make a react todo list" 时,agent 应自动触发 `brainstorming` 技能。
|
|
43
|
-
|
|
44
|
-
## Red Flags 表
|
|
45
|
-
|
|
46
|
-
`using-superpowers` 包含一个 Red Flags 表,列出 agent 可能用来"合理化"跳过技能的借口:
|
|
47
|
-
|
|
48
|
-
| Thought | Reality |
|
|
49
|
-
|---------|---------|
|
|
50
|
-
| "This is just a simple question" | Questions are tasks. Check for skills. |
|
|
51
|
-
| "I need more context first" | Skill check comes BEFORE clarifying questions. |
|
|
52
|
-
| "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
|
|
53
|
-
| "I can check git/files quickly" | Files lack conversation context. Check for skills. |
|
|
54
|
-
| "This doesn't need a formal skill" | If a skill exists, use it. |
|
|
55
|
-
| "I remember this skill" | Skills evolve. Read current version. |
|
|
56
|
-
| "The skill is overkill" | Simple things become complex. Use it. |
|
|
57
|
-
| "I'll just do this one thing first" | Check BEFORE doing anything. |
|
|
58
|
-
|
|
59
|
-
## 技能优先级
|
|
60
|
-
|
|
61
|
-
> When multiple skills apply, process skills come first — they set the approach, then implementation skills carry it out.
|
|
62
|
-
|
|
63
|
-
- "Let's build X" → `brainstorming` first, then implementation skills
|
|
64
|
-
- "Fix this bug" → `systematic-debugging` first, then domain skills
|
|
65
|
-
|
|
66
|
-
## 用户指令优先级
|
|
67
|
-
|
|
68
|
-
> User instructions (CLAUDE.md, AGENTS.md, GEMINI.md, etc, direct requests) take precedence over skills, which in turn override default behavior. Only skip skill workflows or instructions when your human partner has explicitly told you to.
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# 主工作流
|
|
2
|
-
|
|
3
|
-
## 完整流程
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
brainstorming → writing-plans → using-git-worktrees →
|
|
7
|
-
subagent-driven-development (or executing-plans) →
|
|
8
|
-
requesting-code-review → finishing-a-development-branch
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Brainstorming 阶段
|
|
12
|
-
|
|
13
|
-
**触发**:用户说"构建 X" 或 "实现功能 Y"
|
|
14
|
-
|
|
15
|
-
**流程**:
|
|
16
|
-
1. 探索项目上下文(文件、文档、最近提交)
|
|
17
|
-
2. 逐个提问澄清需求(一次一个问题)
|
|
18
|
-
3. 提出 2-3 种方案 + 权衡 + 推荐
|
|
19
|
-
4. 分段展示设计,每段后获用户确认
|
|
20
|
-
5. 写设计文档到 `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
|
|
21
|
-
6. 自审 spec(占位符扫描、一致性、范围、歧义)
|
|
22
|
-
7. 用户审查 spec
|
|
23
|
-
8. 调用 `writing-plans` 技能
|
|
24
|
-
|
|
25
|
-
**硬门控**:在设计获批前,禁止写任何代码。
|
|
26
|
-
|
|
27
|
-
## Writing Plans 阶段
|
|
28
|
-
|
|
29
|
-
**输入**:已批准的 spec
|
|
30
|
-
|
|
31
|
-
**产出**:实现计划文件 `docs/superpowers/plans/YYYY-MM-DD-<feature>.md`
|
|
32
|
-
|
|
33
|
-
**计划格式**:
|
|
34
|
-
```markdown
|
|
35
|
-
# [Feature] Implementation Plan
|
|
36
|
-
|
|
37
|
-
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development
|
|
38
|
-
|
|
39
|
-
**Goal:** [一句话]
|
|
40
|
-
**Architecture:** [2-3 句]
|
|
41
|
-
**Tech Stack:** [技术栈]
|
|
42
|
-
|
|
43
|
-
## Global Constraints
|
|
44
|
-
[项目级约束 — 版本、命名、平台要求等]
|
|
45
|
-
|
|
46
|
-
### Task N: [Component Name]
|
|
47
|
-
**Files:** Create/Modify/Test 路径
|
|
48
|
-
**Interfaces:** Consumes/Produces
|
|
49
|
-
- [ ] Step 1: Write the failing test
|
|
50
|
-
- [ ] Step 2: Run test to verify it fails
|
|
51
|
-
- [ ] Step 3: Write minimal implementation
|
|
52
|
-
- [ ] Step 4: Run test to verify it passes
|
|
53
|
-
- [ ] Step 5: Commit
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**关键原则**:
|
|
57
|
-
- 每步 2-5 分钟
|
|
58
|
-
- 无占位符("TBD"、"add error handling" 等是计划失败)
|
|
59
|
-
- 每步包含完整代码
|
|
60
|
-
- TDD:先写失败测试,再实现
|
|
61
|
-
|
|
62
|
-
## 执行选择
|
|
63
|
-
|
|
64
|
-
计划完成后,提供两种执行方式:
|
|
65
|
-
|
|
66
|
-
| 方式 | 条件 | 特点 |
|
|
67
|
-
|------|------|------|
|
|
68
|
-
| Subagent-Driven Development(推荐) | 有 subagent 能力 | 每任务一个 fresh subagent + 两阶段 review |
|
|
69
|
-
| Executing Plans(inline) | 无 subagent | 批量执行 + 人工检查点 |
|
|
70
|
-
|
|
71
|
-
## Finishing 阶段
|
|
72
|
-
|
|
73
|
-
1. 运行全量测试
|
|
74
|
-
2. 检测环境(normal repo / worktree / detached HEAD)
|
|
75
|
-
3. 确认 base branch
|
|
76
|
-
4. 呈现选项:
|
|
77
|
-
- Merge back to base locally
|
|
78
|
-
- Push and create PR
|
|
79
|
-
- Keep as-is
|
|
80
|
-
5. 执行用户选择
|
|
81
|
-
6. 清理工作区(仅 Superpowers 创建的 worktree)
|
|
82
|
-
|
|
83
|
-
**关键**:集成决策是用户的,agent 只呈现菜单等待回答。
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-extract
|
|
3
|
-
description: Use when extracting actionable execution steps from guidance/tutorial documents to create a verification checklist. Triggers on: step extraction from docs, guide-to-checklist conversion, tutorial step parsing, 执行步骤提取, 验证步骤生成, 指导文档步骤提取. Reads a document path or directory, extracts main execution steps with preserved links and commands, outputs a verification steps MD in the same directory with notes and related links at the bottom.
|
|
4
|
-
license: MIT
|
|
5
|
-
metadata:
|
|
6
|
-
workflow: sequential
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# step-extract 技能(固定 Sprint 冲刺)
|
|
10
|
-
|
|
11
|
-
自包含执行步骤提取器:输入文档路径或目录,从指导文档中提取主要执行步骤(安装命令、配置操作、验证流程等),在文档同目录下输出验证步骤实施 MD 文档。步骤中保留相关链接与命令片段便于直接参考,注意点和相关文档链接放在文档底部。调用方直接传原始任务消息即可,无需预处理。
|
|
12
|
-
|
|
13
|
-
## 执行范式
|
|
14
|
-
|
|
15
|
-
每次调用 = 一个固定 Sprint,三个事件:
|
|
16
|
-
|
|
17
|
-
1. **Sprint Planning**:解析入参 → 定义 Sprint Goal → todowrite 落固定 4 项 Sprint Backlog(每项带 DoD)
|
|
18
|
-
2. **Sprint Execution**:逐项执行,每项 = 执行 → 验证 DoD → todowrite 勾单 Done
|
|
19
|
-
3. **Sprint Review**:对照 Sprint Goal 验证 Increment(验证步骤 MD + 输出报告)
|
|
20
|
-
|
|
21
|
-
**Sprint Goal** = `从指导文档中提取主要执行步骤,在文档同目录下输出验证步骤实施 MD 文档`。
|
|
22
|
-
|
|
23
|
-
## 输入参数
|
|
24
|
-
|
|
25
|
-
入参为调用方传入的**原始任务消息**,可为 JSON 对象、key=value 或自然语言等任意形态,agent 依据字段语义自主提取。字段清单:
|
|
26
|
-
|
|
27
|
-
| 字段 | 类型 | 必填 | 说明 |
|
|
28
|
-
|---|---|---|---|
|
|
29
|
-
| `source` | string | ✅ | 文档路径或目录路径(绝对或相对路径),支持 `.md` 文件 |
|
|
30
|
-
|
|
31
|
-
## 适用 / 不适用
|
|
32
|
-
|
|
33
|
-
**适用**:
|
|
34
|
-
- 指导文档、教程文档、操作手册的执行步骤提取
|
|
35
|
-
- 需要快速了解文档中"要做什么"而非"为什么做"的场景
|
|
36
|
-
- 多文档批量提取(传入目录路径)
|
|
37
|
-
|
|
38
|
-
**不适用**:
|
|
39
|
-
- 纯概念性/理论性文档(无执行步骤)
|
|
40
|
-
- API 参考文档(非步骤型内容)
|
|
41
|
-
- 需要理解文档深层逻辑而非执行步骤的场景
|
|
42
|
-
|
|
43
|
-
## Quick Reference
|
|
44
|
-
|
|
45
|
-
| Item | 做什么 | 关键操作 |
|
|
46
|
-
|---|---|---|
|
|
47
|
-
| 1 | 解析输入 + 读取文档 | 提取 `source` 路径 → `read` 读取文档内容 |
|
|
48
|
-
| 2 | 提取执行步骤 | 过滤背景/图片/元数据 → 保留命令/链接 → 收集注意点 |
|
|
49
|
-
| 3 | 生成验证步骤 MD | `write` 写入 `<原文件名>-steps.md` 到文档同目录 |
|
|
50
|
-
| 4 | 验证输出 + 报告 | `read` 验证输出文件 → 输出提取报告 |
|
|
51
|
-
|
|
52
|
-
## 固定 Sprint Backlog(todowrite 落单,覆盖历史 todos)
|
|
53
|
-
|
|
54
|
-
1. 解析输入 + 读取文档 | DoD: 输入路径已解析、文档已读取、文档内容已加载到上下文
|
|
55
|
-
2. 提取执行步骤 | DoD: 主要执行步骤已提取并编号、命令/代码片段保留、相关链接保留在步骤中、注意点已收集
|
|
56
|
-
3. 生成验证步骤 MD | DoD: 验证步骤 MD 已生成、注意点和相关文档链接放在底部、文件已写入文档同目录
|
|
57
|
-
4. 验证输出 + 输出报告 | DoD: 输出文件已验证内容完整、提取报告已输出
|
|
58
|
-
|
|
59
|
-
## Sprint Execution
|
|
60
|
-
|
|
61
|
-
按固定 4 项逐项执行(勾单机制:进入前 todowrite 标记 in_progress,完成后验证 DoD 并标记 completed)。
|
|
62
|
-
|
|
63
|
-
### Item 1:解析输入 + 读取文档
|
|
64
|
-
|
|
65
|
-
从原始任务消息中提取 `source`(文档路径或目录路径)。
|
|
66
|
-
|
|
67
|
-
**短路规则(命中即结束):**
|
|
68
|
-
|
|
69
|
-
1. `source` 为空或仅含空白 → stderr 报错结束
|
|
70
|
-
2. 路径不存在 → stderr 报错结束
|
|
71
|
-
|
|
72
|
-
未短路时:
|
|
73
|
-
|
|
74
|
-
- 若 `source` 为**目录**:用 `bash ls` 列出目录下的 `.md` 文件,逐个处理(每个文件独立执行 Item 2-3)
|
|
75
|
-
- 若 `source` 为**文件**:直接处理该文件
|
|
76
|
-
- 用 `read` 工具读取文档完整内容
|
|
77
|
-
|
|
78
|
-
### Item 2:提取执行步骤
|
|
79
|
-
|
|
80
|
-
从文档内容中提取主要执行步骤。
|
|
81
|
-
|
|
82
|
-
**提取标准:**
|
|
83
|
-
|
|
84
|
-
| 内容类型 | 处理方式 |
|
|
85
|
-
|---|---|
|
|
86
|
-
| 安装命令、配置步骤、执行命令 | ✅ 提取为编号步骤 |
|
|
87
|
-
| 步骤中的 URL 链接 | ✅ 保留在对应步骤中 |
|
|
88
|
-
| 命令/代码片段 | ✅ 保留,用 ` ``` ` 代码块包裹 |
|
|
89
|
-
| 环境准备、测试验证等章节标题 | ✅ 保留为章节结构 |
|
|
90
|
-
| 背景说明、概念介绍 | ❌ 过滤 |
|
|
91
|
-
| 图片引用(`alt`、`image`) | ❌ 过滤 |
|
|
92
|
-
| 元数据(日期、浏览量、评论数) | ❌ 过滤 |
|
|
93
|
-
| 注意事项、提示、警告 | 收集到底部"注意点"节 |
|
|
94
|
-
|
|
95
|
-
**步骤组织规则:**
|
|
96
|
-
|
|
97
|
-
- 按文档原有章节结构组织步骤(保留 `##` / `###` 层级)
|
|
98
|
-
- 每个章节内步骤连续编号(1, 2, 3...)
|
|
99
|
-
- 步骤描述简洁:动作 + 对象(如"安装 AIDK-installer"、"clone Demo 项目")
|
|
100
|
-
- 命令紧跟步骤描述,用代码块包裹
|
|
101
|
-
- 链接以"参考链接:[URL]"格式附在步骤末尾
|
|
102
|
-
|
|
103
|
-
**注意点收集规则:**
|
|
104
|
-
|
|
105
|
-
- 识别文档中的提示性内容:含"非必须"、"建议"、"注意"、"注意点"等关键词
|
|
106
|
-
- 识别文档中的限制性说明:含"受...影响"、"有概率不成功"等
|
|
107
|
-
- 收集为列表,输出到底部"注意点"节
|
|
108
|
-
|
|
109
|
-
### Item 3:生成验证步骤 MD
|
|
110
|
-
|
|
111
|
-
生成验证步骤实施 MD 文档,用 `write` 工具写入文档同目录。
|
|
112
|
-
|
|
113
|
-
**输出文件名**:`<原文件名>-steps.md`(如 `guide.md` → `guide-steps.md`)
|
|
114
|
-
|
|
115
|
-
**输出文档结构:**
|
|
116
|
-
|
|
117
|
-
```markdown
|
|
118
|
-
# [原文档标题] - 验证步骤
|
|
119
|
-
|
|
120
|
-
> 来源:[原文件名]
|
|
121
|
-
|
|
122
|
-
## [章节1名称]
|
|
123
|
-
|
|
124
|
-
1. [步骤1描述]
|
|
125
|
-
```bash
|
|
126
|
-
[命令]
|
|
127
|
-
```
|
|
128
|
-
参考链接:[URL]
|
|
129
|
-
|
|
130
|
-
2. [步骤2描述]
|
|
131
|
-
...
|
|
132
|
-
|
|
133
|
-
## [章节2名称]
|
|
134
|
-
|
|
135
|
-
1. [步骤1描述]
|
|
136
|
-
...
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## 注意点
|
|
141
|
-
|
|
142
|
-
- [注意点1]
|
|
143
|
-
- [注意点2]
|
|
144
|
-
|
|
145
|
-
## 相关文档链接
|
|
146
|
-
|
|
147
|
-
- [链接描述]:[URL]
|
|
148
|
-
- [链接描述]:[URL]
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
**底部内容规则:**
|
|
152
|
-
|
|
153
|
-
- **注意点**节:列出文档中的注意事项、提示、限制性说明
|
|
154
|
-
- **相关文档链接**节:列出文档中出现的所有参考性 URL(安装文档、下载链接、方案工具等),去重后列出
|
|
155
|
-
|
|
156
|
-
### Item 4:验证输出 + 输出报告
|
|
157
|
-
|
|
158
|
-
1. 用 `read` 工具读取生成的 MD 文件,验证内容完整
|
|
159
|
-
2. 输出提取报告:
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
## 步骤提取报告:[文件名]
|
|
163
|
-
|
|
164
|
-
### 输出文件
|
|
165
|
-
- 路径:[输出文件路径]
|
|
166
|
-
- 行数:[行数] 行
|
|
167
|
-
|
|
168
|
-
### 提取统计
|
|
169
|
-
- 执行步骤:[N] 项
|
|
170
|
-
- 保留链接:[N] 个
|
|
171
|
-
- 注意点:[N] 条
|
|
172
|
-
- 相关文档链接:[N] 个
|
|
173
|
-
|
|
174
|
-
### 章节概览
|
|
175
|
-
1. [章节1]:[N] 步
|
|
176
|
-
2. [章节2]:[N] 步
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## Common Mistakes
|
|
180
|
-
|
|
181
|
-
| 错误 | 修复方案 |
|
|
182
|
-
|---|---|
|
|
183
|
-
| 将背景说明提取为步骤 | 步骤必须是可执行的操作(含命令或具体操作),非描述性文字 |
|
|
184
|
-
| 将链接移到底部"相关文档链接" | 步骤中的链接保留在步骤中;底部仅放文档级参考链接 |
|
|
185
|
-
| 丢失命令/代码片段 | 所有命令和代码必须用代码块保留,不可省略 |
|
|
186
|
-
| 输出文件写入错误目录 | 必须写入 `source` 文档的同目录,非当前工作目录 |
|
|
187
|
-
| 未过滤图片引用 | `alt`、`image` 等纯图片标记必须过滤 |
|
|
188
|
-
|
|
189
|
-
## Sprint Review
|
|
190
|
-
|
|
191
|
-
本 skill 每次调用 = 无状态独立 Sprint,无跨轮次状态,故不进行 Retrospective。所有 Backlog Items 完成后:
|
|
192
|
-
|
|
193
|
-
- **对照 Sprint Goal 验证**:验证步骤 MD 是否已生成?是否从指导文档提取了主要执行步骤?是否在文档同目录下输出?步骤中是否保留了相关链接?注意点和相关文档链接是否放在底部?
|
|
194
|
-
- **验证 Increment**:本 skill 的 Increment = 验证步骤 MD + 输出报告,验证其已生成且内容完整。
|
|
195
|
-
|
|
196
|
-
## 约束
|
|
197
|
-
|
|
198
|
-
- 只处理已声明字段(`source`),忽略所有其他传入参数。
|
|
199
|
-
- **禁止使用 WebFetch 或任何网络请求**。
|
|
200
|
-
- 读文件用 `read` 工具;写文件用 `write` 工具;列目录用 `bash ls`。
|
|
201
|
-
- 输出文件必须写入 `source` 文档的同目录下,文件名格式为 `<原文件名>-steps.md`。
|
|
202
|
-
- 步骤中的相关链接必须保留在步骤中,不移动到底部。
|
|
203
|
-
- 注意点和相关文档链接放在文档底部。
|
|
204
|
-
- 过滤非步骤内容(背景说明、图片引用、元数据)。
|
|
205
|
-
- 目录输入时逐个文件处理,每个文件独立输出一个 `-steps.md`。
|