@wenaixi/dsh-superpower 7.4.1 → 7.5.2
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/README.md +112 -105
- package/README.zh.md +218 -0
- package/lib/catalog.d.ts +8 -2
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +64 -9
- package/lib/catalog.js.map +1 -1
- package/lib/client.js +68 -22
- package/lib/document.d.ts +8 -2
- package/lib/document.d.ts.map +1 -1
- package/lib/document.js +14 -4
- package/lib/document.js.map +1 -1
- package/lib/superpowers.d.ts +2 -0
- package/lib/superpowers.d.ts.map +1 -1
- package/lib/superpowers.js +32 -0
- package/lib/superpowers.js.map +1 -1
- package/lib/switches.d.ts +2 -10
- package/lib/switches.d.ts.map +1 -1
- package/lib/switches.js +33 -5
- package/lib/switches.js.map +1 -1
- package/package.json +3 -3
- package/skills/brainstorming/SKILL.md +235 -171
- package/skills/brainstorming/spec-document-reviewer-prompt.md +27 -25
- package/skills/brainstorming/visual-companion.md +65 -69
- package/skills/diagnosing-superpowers/SKILL.md +107 -43
- package/skills/diagnosing-superpowers/prompts/analyst-common.md +32 -18
- package/skills/diagnosing-superpowers/prompts/cost-and-time.md +25 -9
- package/skills/diagnosing-superpowers/prompts/plan-adherence.md +26 -12
- package/skills/diagnosing-superpowers/prompts/quality-evidence.md +23 -8
- package/skills/diagnosing-superpowers/prompts/repeated-work.md +25 -14
- package/skills/diagnosing-superpowers/prompts/request-conflicts.md +18 -9
- package/skills/diagnosing-superpowers/prompts/scrub-audit.md +23 -10
- package/skills/diagnosing-superpowers/prompts/scrub.md +25 -12
- package/skills/diagnosing-superpowers/prompts/similar-session.md +30 -22
- package/skills/diagnosing-superpowers/prompts/skill-timeline.md +26 -12
- package/skills/diagnosing-superpowers/prompts/stumbles.md +24 -12
- package/skills/diagnosing-superpowers/references/context-safety.md +15 -7
- package/skills/diagnosing-superpowers/references/github-issues.md +17 -9
- package/skills/diagnosing-superpowers/references/redaction-policy.md +27 -15
- package/skills/diagnosing-superpowers/references/session-discovery.md +31 -20
- package/skills/diagnosing-superpowers/templates/bundle-README.md +66 -40
- package/skills/diagnosing-superpowers/templates/case.md +49 -42
- package/skills/diagnosing-superpowers/templates/issue.md +32 -26
- package/skills/diagnosing-superpowers/templates/report.md +54 -48
- package/skills/dispatching-parallel-agents/SKILL.md +92 -90
- package/skills/executing-plans/SKILL.md +345 -197
- package/skills/finishing-a-development-branch/SKILL.md +107 -82
- package/skills/receiving-code-review/SKILL.md +129 -127
- package/skills/requesting-code-review/SKILL.md +52 -50
- package/skills/requesting-code-review/code-reviewer.md +132 -111
- package/skills/subagent-driven-development/SKILL.md +521 -298
- package/skills/subagent-driven-development/implementer-prompt.md +138 -117
- package/skills/subagent-driven-development/re-review-prompt.md +80 -48
- package/skills/subagent-driven-development/task-reviewer-prompt.md +189 -110
- package/skills/systematic-debugging/CREATION-LOG.md +85 -85
- package/skills/systematic-debugging/SKILL.md +221 -219
- package/skills/systematic-debugging/condition-based-waiting.md +48 -49
- package/skills/systematic-debugging/defense-in-depth.md +46 -46
- package/skills/systematic-debugging/root-cause-tracing.md +63 -63
- package/skills/systematic-debugging/test-academic.md +10 -10
- package/skills/systematic-debugging/test-pressure-1.md +40 -40
- package/skills/systematic-debugging/test-pressure-2.md +58 -58
- package/skills/systematic-debugging/test-pressure-3.md +48 -48
- package/skills/test-driven-development/SKILL.md +161 -153
- package/skills/test-driven-development/writing-good-tests.md +137 -84
- package/skills/using-git-worktrees/SKILL.md +74 -72
- package/skills/using-superpowers/SKILL.md +40 -39
- package/skills/using-superpowers/references/dsh-tools.md +36 -36
- package/skills/verification-before-completion/SKILL.md +85 -83
- package/skills/writing-plans/SKILL.md +123 -84
- package/skills/writing-skills/SKILL.md +419 -417
- package/skills/writing-skills/persuasion-principles.md +118 -118
- package/skills/writing-skills/testing-skills-with-subagents.md +190 -190
|
@@ -1,92 +1,113 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: writing-plans
|
|
3
|
-
description: "Superpower Skill
|
|
3
|
+
description: "Superpower Skill: Use when you have a spec or requirements for a multi-step task, before touching code"
|
|
4
|
+
description_zh: "Superpower Skill:当已具备清晰的需求规格或多步骤 task description 且尚未开始编码时使用,用于把需求拆解为结构清晰、粒度可控、可直接执行、可测试与可验证的完整实施计划。"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# 编写计划
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# Writing Plans
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Overview
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Write implementation plans for an engineer who has not seen this codebase or this spec. Assume they write idiomatic code in the project's language once they know the exact interface and the exact test, and that they will make a reasonable choice wherever the plan leaves one open. What they cannot know is what you decided: which files, which names and signatures, which values from the spec, which tests prove each task. Document those. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- (如用户已指定计划存放位置,则以用户偏好为准)
|
|
16
|
+
**Context:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
**Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
|
+
- (User preferences for plan location override this default)
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
## Scope Check
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## File Structure
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
- 人对能一次性完整装入上下文的代码推理最准确,聚焦的文件也更利于可靠地编辑。优先选择小而聚焦的文件,而非承载过多职责的大文件。
|
|
29
|
-
- 会一同变更的文件应放在一起。按职责拆分,而非按技术分层。
|
|
30
|
-
- 在现有代码库中遵循既有模式。若项目本身采用大文件结构,不要擅自重构;但若你正修改的文件已过于臃肿,在计划中安排一次拆分是合理的。
|
|
27
|
+
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
- Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
|
|
30
|
+
- You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
|
|
31
|
+
- Files that change together should live together. Split by responsibility, not by technical layer.
|
|
32
|
+
- In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
## Task Right-Sizing
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
A task is the smallest unit that carries its own test cycle and is worth a
|
|
39
|
+
fresh reviewer's gate. When drawing task boundaries: fold setup,
|
|
40
|
+
configuration, scaffolding, and documentation steps into the task whose
|
|
41
|
+
deliverable needs them; split only where a reviewer could meaningfully
|
|
42
|
+
reject one task while approving its neighbor. Each task ends with an
|
|
43
|
+
independently testable deliverable.
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
- “编写失败的测试”——一个步骤
|
|
42
|
-
- “运行它,确认它确实失败”——一个步骤
|
|
43
|
-
- “编写让测试通过的最小实现”——一个步骤
|
|
44
|
-
- “运行测试,确认它们通过”——一个步骤
|
|
45
|
-
- “提交”——一个步骤
|
|
45
|
+
## Step Granularity
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
**Each step is one action with a checkable result:**
|
|
48
|
+
- "Write the failing test" - step
|
|
49
|
+
- "Run it to make sure it fails" - step
|
|
50
|
+
- "Implement the minimal code to make the test pass" - step
|
|
51
|
+
- "Run the tests and make sure they pass" - step
|
|
52
|
+
- "Commit" - step
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
## Plan Document Header
|
|
55
|
+
|
|
56
|
+
**Every plan MUST start with this header:**
|
|
50
57
|
|
|
51
58
|
```markdown
|
|
52
|
-
# [
|
|
59
|
+
# [Feature Name] Implementation Plan
|
|
53
60
|
|
|
54
|
-
>
|
|
61
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
55
62
|
|
|
56
|
-
|
|
63
|
+
**Goal:** [One sentence describing what this builds]
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
**Architecture:** [2-3 sentences about approach]
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
61
68
|
|
|
62
|
-
|
|
69
|
+
**Spec:** [path to the spec/design doc this plan implements — the plan
|
|
70
|
+
argues from the spec, so the spec travels with it; executors read both]
|
|
63
71
|
|
|
64
|
-
##
|
|
72
|
+
## Global Constraints
|
|
65
73
|
|
|
66
|
-
[
|
|
74
|
+
[The spec's project-wide requirements — version floors, dependency limits,
|
|
75
|
+
naming and copy rules, platform requirements — one line each, with exact
|
|
76
|
+
values copied verbatim from the spec. Every task's requirements implicitly
|
|
77
|
+
include this section.]
|
|
67
78
|
|
|
68
79
|
## Review Focus
|
|
69
80
|
|
|
70
|
-
[
|
|
81
|
+
[The five input classes or failure modes the spec implies but no task's
|
|
82
|
+
tests exercise that are most likely to bite a person using this software
|
|
83
|
+
— one line each, naming the input or condition and the behavior a
|
|
84
|
+
reasonable person would expect, most likely first. The spec is a vision
|
|
85
|
+
document: it says what the software must do, not everything it will
|
|
86
|
+
meet, and its silence on an input is not permission for that input to
|
|
87
|
+
break the program. Write the list here, once, with the spec in front of
|
|
88
|
+
you. Then, for each line, add the test that pins it to the task that
|
|
89
|
+
owns the code, in that task's own step style.]
|
|
71
90
|
|
|
72
91
|
---
|
|
73
92
|
```
|
|
74
93
|
|
|
75
|
-
##
|
|
94
|
+
## Task Structure
|
|
76
95
|
|
|
77
96
|
````markdown
|
|
78
|
-
###
|
|
97
|
+
### Task N: [Component Name]
|
|
79
98
|
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
99
|
+
**Files:**
|
|
100
|
+
- Create: `exact/path/to/file.py`
|
|
101
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
102
|
+
- Test: `tests/exact/path/to/test.py`
|
|
84
103
|
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
104
|
+
**Interfaces:**
|
|
105
|
+
- Consumes: [what this task uses from earlier tasks — exact signatures]
|
|
106
|
+
- Produces: [what later tasks rely on — exact function names, parameter
|
|
107
|
+
and return types. A task's implementer sees only their own task; this
|
|
108
|
+
block is how they learn the names and types neighboring tasks use.]
|
|
88
109
|
|
|
89
|
-
- [ ]
|
|
110
|
+
- [ ] **Step 1: Write the failing test**
|
|
90
111
|
|
|
91
112
|
```python
|
|
92
113
|
def test_specific_behavior():
|
|
@@ -94,21 +115,23 @@ def test_specific_behavior():
|
|
|
94
115
|
assert result == expected
|
|
95
116
|
```
|
|
96
117
|
|
|
97
|
-
- [ ]
|
|
118
|
+
- [ ] **Step 2: Run test to verify it fails**
|
|
98
119
|
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
121
|
+
Expected: FAIL with "function not defined"
|
|
101
122
|
|
|
102
|
-
- [ ]
|
|
123
|
+
- [ ] **Step 3: Implement `function(input: InputType) -> ResultType` in `exact/path/to/file.py`**
|
|
103
124
|
|
|
104
|
-
|
|
125
|
+
One line on the approach when the signature and the test leave a choice
|
|
126
|
+
(which library call, which data structure); a code block only for an
|
|
127
|
+
algorithm they do not determine.
|
|
105
128
|
|
|
106
|
-
- [ ]
|
|
129
|
+
- [ ] **Step 4: Run test to verify it passes**
|
|
107
130
|
|
|
108
|
-
|
|
109
|
-
|
|
131
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
132
|
+
Expected: PASS
|
|
110
133
|
|
|
111
|
-
- [ ]
|
|
134
|
+
- [ ] **Step 5: Commit**
|
|
112
135
|
|
|
113
136
|
```bash
|
|
114
137
|
git add tests/path/test.py src/path/file.py
|
|
@@ -116,52 +139,68 @@ git commit -m "feat: add specific feature"
|
|
|
116
139
|
```
|
|
117
140
|
````
|
|
118
141
|
|
|
119
|
-
##
|
|
142
|
+
## What a Step Contains
|
|
120
143
|
|
|
121
|
-
|
|
144
|
+
A step is done when the implementer can write exactly one reasonable thing
|
|
145
|
+
from it. That is the whole requirement: unambiguous, not complete. Each kind
|
|
146
|
+
of step carries what makes it unambiguous and nothing more:
|
|
122
147
|
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
|
|
148
|
+
- **A test step:** the test's name and its assertions, as code, with the
|
|
149
|
+
spec's exact values in them.
|
|
150
|
+
- **A code step:** the exact signature (name, parameters, return type), the
|
|
151
|
+
file it lives in, and the specific values the spec pins. The implementer
|
|
152
|
+
writes the body. A body appears only for an algorithm the signature and
|
|
153
|
+
tests do not determine, or for exact copy the spec fixes.
|
|
154
|
+
- **A verification step:** the command to run and the output that means it
|
|
155
|
+
passed.
|
|
156
|
+
- **A reference to another task:** that task's Interfaces block says what
|
|
157
|
+
to use; the plan does not repeat that task's code.
|
|
127
158
|
|
|
128
|
-
|
|
159
|
+
A plan is the set of decisions the implementer cannot make alone. A plan
|
|
160
|
+
longer than the code it describes has written the code instead. Lines that
|
|
161
|
+
decide nothing ("TBD", "handle edge cases", "add appropriate validation",
|
|
162
|
+
"write tests for the above", a type or function no task defines) are the
|
|
163
|
+
opposite failure, and the self-review catches both.
|
|
129
164
|
|
|
130
|
-
##
|
|
165
|
+
## Self-Review
|
|
131
166
|
|
|
132
|
-
|
|
167
|
+
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
|
|
133
168
|
|
|
134
|
-
**1.
|
|
169
|
+
**1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
|
|
135
170
|
|
|
136
|
-
**2.
|
|
171
|
+
**2. Step scan:** Every step must let the implementer write exactly one reasonable thing, and no step may carry more than that: a line that decides nothing is a gap, a function body the signature and tests already determine is a transcript. Fix both.
|
|
137
172
|
|
|
138
|
-
**3.
|
|
173
|
+
**3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
|
|
139
174
|
|
|
140
|
-
**4. Review Focus
|
|
175
|
+
**4. Review Focus:** For each input class or failure mode the spec implies, is there a task whose tests exercise it? The five uncovered ones most likely to bite a person go in the Review Focus section, and each line there gets its test added to the owning task. An empty section means you checked and found none, not that you skipped the check.
|
|
141
176
|
|
|
142
|
-
**5.
|
|
177
|
+
**5. Proportion:** Compare the plan's length to the spec's. A plan several times longer than the spec it implements is a transcript of the program, not a plan. If code blocks are most of the document, replace bodies with signatures, test names and assertions, and check that each step is still unambiguous.
|
|
143
178
|
|
|
144
|
-
|
|
179
|
+
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
|
|
145
180
|
|
|
146
|
-
##
|
|
181
|
+
## Execution Handoff
|
|
147
182
|
|
|
148
|
-
|
|
183
|
+
After saving and self-reviewing the plan, link it for your human partner
|
|
184
|
+
to read. If they have already explicitly supplied an execution method, ask
|
|
185
|
+
them to review the plan and confirm it captures what they want; wait for that
|
|
186
|
+
review before implementation, then use the preserved method. Otherwise, ask
|
|
187
|
+
them to review the plan and choose an execution method before implementation.
|
|
149
188
|
|
|
150
|
-
|
|
189
|
+
**When no execution method has already been supplied:**
|
|
151
190
|
|
|
152
|
-
|
|
191
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Please review the plan. Which execution approach would you prefer?**
|
|
153
192
|
|
|
154
|
-
- **
|
|
155
|
-
-
|
|
193
|
+
- **Subagent-driven** - A fresh subagent implements each task and a fresh reviewer checks it before the next one starts, then a whole-branch review at the end. Most thorough; costs a fresh context per task and per review.
|
|
194
|
+
- **Native** - I implement every task myself in this session, the way this harness runs work, then one fresh reviewer on the most capable model checks the whole branch. Cheapest and fastest; no independent review until the end. Runs well with a mid-tier session model, since the plan carries the design.
|
|
156
195
|
|
|
157
|
-
|
|
196
|
+
**For this plan I recommend <one of the two>, because <one sentence from the plan: how much the tasks depend on each other's interfaces, how many there are, what a shipped mistake would cost>. Does the plan capture what you want, and which approach should we use?"**
|
|
158
197
|
|
|
159
|
-
|
|
198
|
+
**When an execution method has already been supplied:**
|
|
160
199
|
|
|
161
|
-
|
|
200
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Please review the plan. Does it capture what you want?"**
|
|
162
201
|
|
|
163
|
-
|
|
164
|
-
-
|
|
202
|
+
**If Subagent-driven chosen:**
|
|
203
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
|
|
165
204
|
|
|
166
|
-
|
|
167
|
-
-
|
|
205
|
+
**If Native chosen:**
|
|
206
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
|