@wenaixi/dsh-superpower 7.3.0 → 7.5.1
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 +216 -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 +120 -75
- 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 +6 -0
- package/lib/superpowers.d.ts.map +1 -1
- package/lib/superpowers.js +25 -2
- package/lib/superpowers.js.map +1 -1
- package/lib/switches.d.ts +17 -18
- package/lib/switches.d.ts.map +1 -1
- package/lib/switches.js +78 -31
- package/lib/switches.js.map +1 -1
- package/package.json +3 -3
- package/skills/brainstorming/SKILL.md +234 -170
- package/skills/brainstorming/spec-document-reviewer-prompt.md +27 -25
- package/skills/brainstorming/visual-companion.md +84 -231
- 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
- package/skills/brainstorming/scripts/frame-template.html +0 -213
- package/skills/brainstorming/scripts/helper.js +0 -167
- package/skills/brainstorming/scripts/server.cjs +0 -715
- package/skills/brainstorming/scripts/start-server.sh +0 -204
- package/skills/brainstorming/scripts/stop-server.sh +0 -120
|
@@ -1,267 +1,120 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Visual Companion Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Browser-based visual brainstorming companion for showing mockups, diagrams, and options, built on DSH's official document preview.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## When to Use
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Decide per-question, not per-session. The test: **would the user understand this better by seeing it than reading it?**
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Use the browser preview** when the content itself is visual:
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
11
|
+
- **UI mockups** — wireframes, layouts, navigation structures, component designs
|
|
12
|
+
- **Architecture diagrams** — system components, data flow, relationship maps
|
|
13
|
+
- **Side-by-side visual comparisons** — comparing two layouts, two color schemes, two design directions
|
|
14
|
+
- **Design polish** — when the question is about look and feel, spacing, visual hierarchy
|
|
15
|
+
- **Spatial relationships** — state machines, flowcharts, entity relationships rendered as diagrams
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
**Use the terminal** when the content is text or tabular:
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
19
|
+
- **Requirements and scope questions** — "what does X mean?", "which features are in scope?"
|
|
20
|
+
- **Conceptual A/B/C choices** — picking between approaches described in words
|
|
21
|
+
- **Tradeoff lists** — pros/cons, comparison tables
|
|
22
|
+
- **Technical decisions** — API design, data modeling, architectural approach selection
|
|
23
|
+
- **Clarifying questions** — anything where the answer is words, not a visual preference
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
A question *about* a UI topic is not automatically a visual question. "What kind of wizard do you want?" is conceptual — use the terminal. "Which of these wizard layouts feels right?" is visual — use the browser preview.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## How It Works
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
You write HTML to a convention directory in the workspace; DSH's document preview reads and renders it. The user opens the file in the document sidebar to see it.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
**Selection results are not sent back to you automatically.** The preview is an isolated iframe document and cannot deliver your user's choices to the session. So: ask the user to answer in the terminal. Never claim to have read a click inside the preview.
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Writing Files
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
# 在用户批准 companion 后启动。--open 会在首屏自动打开其浏览器;
|
|
37
|
-
# --project-dir 持久化原型并支持同端口重启。
|
|
38
|
-
bash scripts/start-server.sh --project-dir /path/to/project --open
|
|
35
|
+
Write every page as a self-contained HTML document. Three hard requirements:
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# "state_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/state"}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
保存响应中的 `screen_dir` 和 `state_dir`。使用 `--open` 时,浏览器会在你推送首屏时自动打开——你无需让用户手动打开,但仍需分享 URL 作为备用方案(无头/远程环境无法自动打开)。
|
|
47
|
-
|
|
48
|
-
**URL 中包含会话密钥(`?key=…`)。** 服务器会拒绝任何不带该密钥的请求,因此务必向用户提供 `url` 字段中的**完整** URL——不要去除查询字符串,也不要只给裸的 `http://host:port`。该密钥用于控制 HTTP 和 WebSocket 访问,防止随意的浏览器标签页或同一网络中的其他机器读取页面或注入事件。首次加载后,浏览器会通过 Cookie 记住该密钥,因此重新加载和访问 `/files/*` 资源时无需重复携带。
|
|
49
|
-
|
|
50
|
-
**查找连接信息:** 服务器会将启动时的 JSON 写入 `$STATE_DIR/server-info`。如果你在后台启动了服务器且未捕获标准输出,可读取该文件以获取 URL 和端口。使用 `--project-dir` 时,请在 `<project>/.superpowers/brainstorm/` 下查找会话目录。
|
|
51
|
-
|
|
52
|
-
**注意:** 将项目根目录作为 `--project-dir` 传入,这样原型会持久化到 `.superpowers/brainstorm/` 并在服务器重启后依然保留。若不传,文件会写入 `/tmp` 并被清理。如果 `.gitignore` 中尚未包含 `.superpowers/`,请提醒用户添加。
|
|
53
|
-
|
|
54
|
-
**在 DSH 中启动服务器:**
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
# 在 DSH 中使用 pwsh(Windows 首选)或 bash 工具,传入 run_in_background: true
|
|
58
|
-
bash scripts/start-server.sh --project-dir /path/to/project --open --foreground
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
服务器必须在后台持续运行并跨越 turn。在 DSH 工具调用中使用 `run_in_background: true`,然后在下一轮读取 `$STATE_DIR/server-info` 以获取 URL 和端口。
|
|
62
|
-
|
|
63
|
-
如果 URL 在你的浏览器中无法访问(在远程/容器化环境中很常见),请绑定非回环地址:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
bash scripts/start-server.sh \
|
|
67
|
-
--project-dir /path/to/project \
|
|
68
|
-
--host 0.0.0.0 \
|
|
69
|
-
--url-host localhost
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
使用 `--url-host` 控制返回的 URL JSON 中显示的主机名。
|
|
73
|
-
|
|
74
|
-
## 循环流程
|
|
75
|
-
|
|
76
|
-
1. **检查服务器是否存活**,然后**向 `screen_dir` 写入 HTML 新文件**:
|
|
77
|
-
- **必须:在引用 URL 或推送页面前确认服务器存活。** 检查 `$STATE_DIR/server-info` 是否存在且 `$STATE_DIR/server-stopped` 是否不存在。如果已关闭,请使用**相同的 `--project-dir`** 通过 `start-server.sh` 重启——它会复用同一端口,用户的已打开标签页会自动重连(服务器宕机期间会显示“已暂停”遮罩),无需发送新 URL。服务器在空闲 4 小时后自动退出(可通过 `--idle-timeout-minutes` 配置)。
|
|
78
|
-
- 使用语义化文件名:`platform.html`、`visual-style.html`、`layout.html`
|
|
79
|
-
- **不要复用文件名**——每个页面都使用全新文件
|
|
80
|
-
- 使用你的文件创建工具——**不要使用 cat/heredoc**(会在终端产生大量噪音)
|
|
81
|
-
- 服务器自动提供最新的文件
|
|
82
|
-
|
|
83
|
-
2. **告知用户预期内容并结束本轮:**
|
|
84
|
-
- 提醒他们 URL(每一步都要,不只是第一步)
|
|
85
|
-
- 简要文字概括屏幕内容(例如:“正在展示首页的 3 种布局方案”)
|
|
86
|
-
- 请他们在终端中回应:“请查看后告诉我你的想法。如果愿意,可以点击选择一个选项。”
|
|
87
|
-
|
|
88
|
-
3. **在你的下一轮**——用户在终端回应后:
|
|
89
|
-
- 如果存在,读取 `$STATE_DIR/events`——其中包含用户在浏览器中的交互(点击、选择),以 JSON 行格式记录
|
|
90
|
-
- 将其与用户的终端文本合并,以获得完整信息
|
|
91
|
-
- 终端消息是主要反馈;`state_dir/events` 提供结构化的交互数据
|
|
37
|
+
1. **Full document.** The official preview wraps nothing and provides no ready-made CSS classes. `<div class="options">` means nothing here; nothing renders on the page.
|
|
38
|
+
2. **Self-contained.** Do not reference external relative CSS or scripts — relative dependencies are bundled only when interactive preview is enabled. A single file is safest.
|
|
39
|
+
3. **No outside-iframe capabilities.** The preview document does not share the host page context; `window.parent` gets nothing.
|
|
92
40
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
5. **回到终端时卸载**——当下一步不需要浏览器时(例如澄清问题、权衡讨论),推送一个等待页面以清除过时内容:
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<!-- filename: waiting.html (or waiting-2.html, etc.) -->
|
|
99
|
-
<div style="display:flex;align-items:center;justify-content:center;min-height:60vh">
|
|
100
|
-
<p class="subtitle">Continuing in terminal...</p>
|
|
101
|
-
</div>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
这样可避免用户在对话已推进后仍盯着已解决的选择。当下一个可视化问题出现时,像往常一样推送新的内容文件即可。
|
|
105
|
-
|
|
106
|
-
6. 重复上述流程直至完成。
|
|
107
|
-
|
|
108
|
-
## 编写内容片段
|
|
109
|
-
|
|
110
|
-
只需编写页面内部的内容。服务器会自动将其包裹到框架模板中(页头、主题 CSS、连接状态及所有交互基础设施)。
|
|
111
|
-
|
|
112
|
-
**最小示例:**
|
|
41
|
+
### Minimal example
|
|
113
42
|
|
|
114
43
|
```html
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
44
|
+
<!DOCTYPE html>
|
|
45
|
+
<html lang="en">
|
|
46
|
+
<head>
|
|
47
|
+
<meta charset="utf-8">
|
|
48
|
+
<title>Layout options</title>
|
|
49
|
+
<style>
|
|
50
|
+
body { font: 15px/1.7 system-ui, sans-serif; margin: 0; padding: 40px; }
|
|
51
|
+
h1 { font-size: 20px; margin: 0 0 6px; }
|
|
52
|
+
.subtitle { margin: 0 0 32px; color: #5b616e; }
|
|
53
|
+
.cards { display: flex; gap: 20px; flex-wrap: wrap; }
|
|
54
|
+
.card { flex: 1 1 280px; border: 1px solid #dfe2e8; border-radius: 10px; padding: 20px; }
|
|
55
|
+
.card h3 { margin: 0 0 8px; font-size: 16px; }
|
|
56
|
+
.card p { margin: 0; color: #5b616e; }
|
|
57
|
+
</style>
|
|
58
|
+
</head>
|
|
59
|
+
<body>
|
|
60
|
+
<h1>Which layout fits better?</h1>
|
|
61
|
+
<p class="subtitle">Consider readability and visual hierarchy</p>
|
|
62
|
+
<div class="cards">
|
|
63
|
+
<div class="card">
|
|
64
|
+
<h3>A Single column</h3>
|
|
65
|
+
<p>Best reading experience, lowest information density</p>
|
|
124
66
|
</div>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<div class="content">
|
|
129
|
-
<h3>Two Column</h3>
|
|
130
|
-
<p>Sidebar navigation with main content</p>
|
|
67
|
+
<div class="card">
|
|
68
|
+
<h3>B Two columns</h3>
|
|
69
|
+
<p>Higher space utilization, needs extra style constraints</p>
|
|
131
70
|
</div>
|
|
132
71
|
</div>
|
|
133
|
-
</
|
|
72
|
+
</body>
|
|
73
|
+
</html>
|
|
134
74
|
```
|
|
135
75
|
|
|
136
|
-
|
|
76
|
+
In dark environments, switch colors to follow `prefers-color-scheme` or use neutral grays.
|
|
137
77
|
|
|
138
|
-
##
|
|
78
|
+
## Directory and Naming
|
|
139
79
|
|
|
140
|
-
|
|
80
|
+
Convention directory: `.superpowers/brainstorm/` under the project root. Delete it yourself when the session ends.
|
|
141
81
|
|
|
142
|
-
|
|
82
|
+
- Use semantic names: `platform.html`, `visual-style.html`, `layout.html`
|
|
83
|
+
- Do not reuse filenames — write a new file each iteration, `layout-v2.html`, `layout-v3.html`
|
|
84
|
+
- The user opens the specific file they were told about; tell them the new filename when you rewrite
|
|
143
85
|
|
|
144
|
-
|
|
145
|
-
<div class="options">
|
|
146
|
-
<div class="option" data-choice="a" onclick="toggleSelect(this)">
|
|
147
|
-
<div class="letter">A</div>
|
|
148
|
-
<div class="content">
|
|
149
|
-
<h3>Title</h3>
|
|
150
|
-
<p>Description</p>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
```
|
|
86
|
+
If the project's `.gitignore` does not yet include `.superpowers/`, remind the user to add it.
|
|
155
87
|
|
|
156
|
-
|
|
88
|
+
## Loop Flow
|
|
157
89
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
90
|
+
1. **Write HTML** to the convention directory with file tools, not `cat`/heredoc (they flood the terminal).
|
|
91
|
+
2. **Tell the user what to expect and end the turn**:
|
|
92
|
+
- Remind the file path and how to open it in the right-hand document sidebar;
|
|
93
|
+
- Summarize in words what this page shows (e.g. "showing 3 layout options for the homepage");
|
|
94
|
+
- Ask them to answer in the terminal, and say where.
|
|
95
|
+
3. **Read the user's terminal reply.** This is the only selection return channel.
|
|
96
|
+
4. **Iterate or move on** — if feedback changes the current page, write a new version file.
|
|
97
|
+
5. **Clean up when back in the terminal** — delete HTML files no longer needed, so the user does not see stale problems in the document sidebar.
|
|
98
|
+
6. Repeat until done.
|
|
163
99
|
|
|
164
|
-
|
|
100
|
+
## Per-Question Decisions
|
|
165
101
|
|
|
166
|
-
|
|
167
|
-
<div class="cards">
|
|
168
|
-
<div class="card" data-choice="design1" onclick="toggleSelect(this)">
|
|
169
|
-
<div class="card-image"><!-- mockup content --></div>
|
|
170
|
-
<div class="card-body">
|
|
171
|
-
<h3>Name</h3>
|
|
172
|
-
<p>Description</p>
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### 原型容器
|
|
179
|
-
|
|
180
|
-
```html
|
|
181
|
-
<div class="mockup">
|
|
182
|
-
<div class="mockup-header">Preview: Dashboard Layout</div>
|
|
183
|
-
<div class="mockup-body"><!-- your mockup HTML --></div>
|
|
184
|
-
</div>
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### 分栏视图(并排)
|
|
188
|
-
|
|
189
|
-
```html
|
|
190
|
-
<div class="split">
|
|
191
|
-
<div class="mockup"><!-- left --></div>
|
|
192
|
-
<div class="mockup"><!-- right --></div>
|
|
193
|
-
</div>
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### 优缺点
|
|
197
|
-
|
|
198
|
-
```html
|
|
199
|
-
<div class="pros-cons">
|
|
200
|
-
<div class="pros"><h4>Pros</h4><ul><li>Benefit</li></ul></div>
|
|
201
|
-
<div class="cons"><h4>Cons</h4><ul><li>Drawback</li></ul></div>
|
|
202
|
-
</div>
|
|
203
|
-
```
|
|
102
|
+
Even after the user accepts the preview, decide per question whether it is worth drawing:
|
|
204
103
|
|
|
205
|
-
|
|
104
|
+
- **Use preview** for visual content — mockups, wireframes, layout comparisons, architecture diagrams, side-by-side visual designs
|
|
105
|
+
- **Use terminal** for text content — requirement questions, conceptual choices, tradeoff lists, A/B/C/D text options, scope decisions
|
|
206
106
|
|
|
207
|
-
|
|
208
|
-
<div class="mock-nav">Logo | Home | About | Contact</div>
|
|
209
|
-
<div style="display: flex;">
|
|
210
|
-
<div class="mock-sidebar">Navigation</div>
|
|
211
|
-
<div class="mock-content">Main content area</div>
|
|
212
|
-
</div>
|
|
213
|
-
<button class="mock-button">Action Button</button>
|
|
214
|
-
<input class="mock-input" placeholder="Input field">
|
|
215
|
-
<div class="placeholder">Placeholder area</div>
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### 排版与区块
|
|
219
|
-
|
|
220
|
-
- `h2` — 页面标题
|
|
221
|
-
- `h3` — 区块标题
|
|
222
|
-
- `.subtitle` — 标题下方的次级文本
|
|
223
|
-
- `.section` — 带底部边距的内容块
|
|
224
|
-
- `.label` — 小号大写标签文本
|
|
225
|
-
|
|
226
|
-
## 浏览器事件格式
|
|
227
|
-
|
|
228
|
-
当用户在浏览器中点击选项时,其交互会被记录到 `$STATE_DIR/events`(每行一个 JSON 对象)。当你推送新页面时,该文件会自动清空。
|
|
229
|
-
|
|
230
|
-
```jsonl
|
|
231
|
-
{"type":"click","choice":"a","text":"Option A - Simple Layout","timestamp":1706000101}
|
|
232
|
-
{"type":"click","choice":"c","text":"Option C - Complex Grid","timestamp":1706000108}
|
|
233
|
-
{"type":"click","choice":"b","text":"Option B - Hybrid","timestamp":1706000115}
|
|
234
|
-
```
|
|
107
|
+
A question about a UI topic is not necessarily visual. "What does personality mean in this context?" is conceptual — use the terminal. "Which wizard layout feels better?" is visual — use the preview.
|
|
235
108
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
如果 `$STATE_DIR/events` 不存在,说明用户未与浏览器交互——仅使用其终端文本即可。
|
|
239
|
-
|
|
240
|
-
## 设计建议
|
|
241
|
-
|
|
242
|
-
- **根据问题匹配保真度**——布局问题用线框图,视觉打磨问题再做精细化
|
|
243
|
-
- **在每页上说明问题**——“哪种布局更显专业?”而非仅仅“选一个”
|
|
244
|
-
- **先迭代再推进**——如果反馈改变了当前页面,先写一个新版本
|
|
245
|
-
- **每屏最多 2-4 个选项**
|
|
246
|
-
- **在重要场景使用真实内容**——例如摄影作品集应使用真实图片(Unsplash)。占位内容会掩盖设计问题。
|
|
247
|
-
- **保持原型简洁**——聚焦布局与结构,而非像素级完美
|
|
248
|
-
|
|
249
|
-
## 文件命名
|
|
250
|
-
|
|
251
|
-
- 使用语义化名称:`platform.html`、`visual-style.html`、`layout.html`
|
|
252
|
-
- 不要复用文件名——每个页面必须是新文件
|
|
253
|
-
- 迭代时:追加版本后缀,如 `layout-v2.html`、`layout-v3.html`
|
|
254
|
-
- 服务器按修改时间提供最新的文件
|
|
255
|
-
|
|
256
|
-
## 清理
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
bash scripts/stop-server.sh $SESSION_DIR
|
|
260
|
-
```
|
|
109
|
+
## Design Advice
|
|
261
110
|
|
|
262
|
-
|
|
111
|
+
- **Match fidelity to the question** — wireframes for layout questions, polish only for visual-fidelity questions
|
|
112
|
+
- **State the question on each page** — "Which looks more professional?" rather than just "pick one"
|
|
113
|
+
- **Iterate before pushing** — if feedback changes the page, write a new version first
|
|
114
|
+
- **At most 2-4 options per screen**
|
|
115
|
+
- **Use real content for important scenarios** — real copy and colors expose problems better than placeholder text
|
|
116
|
+
- **Keep mockups lean** — focus on layout and structure, not pixel perfection
|
|
263
117
|
|
|
264
|
-
##
|
|
118
|
+
## Cleanup
|
|
265
119
|
|
|
266
|
-
|
|
267
|
-
- 辅助脚本(客户端):`scripts/helper.js`
|
|
120
|
+
Delete every HTML file written this session. If a project directory was used, remind the user that the directory is in `.gitignore`.
|
|
@@ -1,58 +1,122 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: diagnosing-superpowers
|
|
3
|
-
description: "Superpower Skill
|
|
3
|
+
description: "Superpower Skill: Use when a superpowers session went wrong and your human partner wants to know why - repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, it took too long, why is it so expensive, what is it doing - or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness."
|
|
4
|
+
description_zh: "Superpower Skill:当 superpowers 会话出错、human partner 想查原因(重复工作、忽略计划、技能未触发、耗时过长、成本过高、结果不佳)或想为维护者建缺陷报告时,适用当前或历史会话。"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# 诊断 superpowers
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# Diagnosing Superpowers
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Overview
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Pin down with your human partner what went wrong in a session, read the
|
|
13
|
+
transcripts on disk, and report what happened with evidence. You report;
|
|
14
|
+
you do not diagnose superpowers. Whoever triages the bundle or the issue
|
|
15
|
+
decides whether superpowers changes.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
**Core principle:** Every finding cites `path:line`. No citation, no
|
|
18
|
+
finding. Every number comes from the transcript or from a command you ran,
|
|
19
|
+
never from memory.
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
## Workflow
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
2. **定位。** 使用 `references/session-discovery.md` 把每个会话解析为经过验证的绝对文件系统路径。通过引用其首个 prompt 与时间戳来确认历史会话,并列出你拒绝的每个候选及其原因,没有则写"无"。枚举 subagent transcript。创建 `~/.superpowers/diagnosing-superpowers/<session-id>/`,把路径告诉你的 human partner,并按 `templates/case.md` 在其中填写 case 文件,遵循其对环境与技能观察的来源(provenance)规则。
|
|
20
|
-
3. **分诊。** 亲自阅读报告问题周围的区域。然后按维度并行派出分析师 subagent,每个 subagent 获得 case 文件路径、`prompts/analyst-common.md` 以及 `prompts/` 中的一个维度文件:`skill-timeline.md`、`plan-adherence.md`、`repeated-work.md`、`stumbles.md`、`quality-evidence.md`、`request-conflicts.md`、`cost-and-time.md`。transcript 较长时按回合范围拆分维度。丢弃任何缺少 `path:line` 的返回发现。
|
|
21
|
-
4. **报告。** 按顺序填满 `templates/report.md` 的每一节,写入 workspace,展示并给出路径。检查引用的内容实际证明了什么,并保留支撑性 case;符号链接别名不是冗余副本。
|
|
22
|
-
5. **GitHub issues** — 当报告 §7 显示"可能(possible)"或"很可能(likely)",或你的 human partner 要求时。按 `references/github-issues.md` 搜索已开与已关闭 issue 中的症状。展示匹配项并建议把报告附加到最接近的一条。若无匹配,填写 `templates/issue.md`,写入 workspace,展示确切文本,仅在批准后创建 issue。`gh` 无法附加文件;若存在 bundle,把路径交给你的 human partner 在浏览器中附加。
|
|
23
|
-
6. **导出** — 仅当你的 human partner 要求 bundle 时;绝不未经要求构建。若收集阶段的目标是缺陷报告,说一次"可按需提供已脱敏的 bundle",然后等待。询问脱敏级别,说明各级包含什么:skeleton(无工具结果正文)、evidence(仅被引用事件有正文)、full。按 `templates/bundle-README.md` 构建 bundle,派出 `prompts/scrub.md`,然后 `prompts/scrub-audit.md`,重复两者直到审计返回 CLEAN。完成 bundle 模板的证据检查与对账后,再展示最终脱敏日志、文件清单与隐私和证据结论。仅在批准后归档(`zip -r` 或 `tar -czf`)。给出归档路径时,说明其包含内容、指出脱敏日志中的替换,并说明脱敏可能遗漏:他们必须在分享前审阅每个文件。
|
|
24
|
-
7. **相似会话** — 应要求时。把已确认的发现转为签名(signature),按 mtime 与大小列出候选,找出标记行号,对每个候选并行派出 `prompts/similar-session.md`,并把报告 §9 追加进去。
|
|
23
|
+
Create a todo per step. Steps 5–7 run only on their stated condition.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
1. **Problem intake.** Ask one question at a time until you can write a
|
|
26
|
+
statement naming the session(s), the turn range if known, what your
|
|
27
|
+
partner expected, what happened, and the observable they care about
|
|
28
|
+
(wall-clock, tokens, repeated actions, one specific action). "It took
|
|
29
|
+
too long" is a complaint, not a problem statement. Note whether the
|
|
30
|
+
goal is a superpowers bug report.
|
|
31
|
+
2. **Locate.** Resolve each session to verified absolute filesystem paths using
|
|
32
|
+
`references/session-discovery.md`. Confirm a past session by quoting its
|
|
33
|
+
first prompt and timestamp, and list every candidate you rejected with the
|
|
34
|
+
reason, or "none". Enumerate subagent transcripts. Create
|
|
35
|
+
`~/.superpowers/diagnosing-superpowers/<session-id>/`, tell your
|
|
36
|
+
partner the path, and fill `templates/case.md` there, following its
|
|
37
|
+
provenance rules for environment and skill observations.
|
|
38
|
+
3. **Triage.** Read the region around the reported problem yourself. Then
|
|
39
|
+
dispatch one analyst subagent per dimension in parallel, each given the
|
|
40
|
+
case file path, `prompts/analyst-common.md`, and one dimension file from
|
|
41
|
+
`prompts/`: `skill-timeline.md`,
|
|
42
|
+
`plan-adherence.md`, `repeated-work.md`, `stumbles.md`,
|
|
43
|
+
`quality-evidence.md`, `request-conflicts.md`, `cost-and-time.md`.
|
|
44
|
+
Split a dimension by turn range when the transcript is long. Discard
|
|
45
|
+
any returned finding without `path:line`.
|
|
46
|
+
4. **Report.** Fill every section of `templates/report.md` in order, write
|
|
47
|
+
it to the workspace, show it, and give the path. Check what cited content
|
|
48
|
+
actually proves and preserve the supporting case; a symlink alias is not a
|
|
49
|
+
redundant copy.
|
|
50
|
+
5. **GitHub issues** — when report §7 says possible or likely, or your
|
|
51
|
+
partner asks. Search open and closed issues for the symptoms per
|
|
52
|
+
`references/github-issues.md`. Show matches and suggest adding the
|
|
53
|
+
report to the closest. If none match, fill `templates/issue.md`, write
|
|
54
|
+
it to the workspace, show the exact text, and create the issue only
|
|
55
|
+
after approval. `gh` cannot attach files; if a bundle exists, give
|
|
56
|
+
your partner its path to attach in the browser.
|
|
57
|
+
6. **Export** — only when your partner asks for a bundle; never build one
|
|
58
|
+
unprompted. If the intake goal was a bug report, say once that a
|
|
59
|
+
scrubbed bundle is available on request, then wait. Ask the redaction
|
|
60
|
+
level, stating what each includes: skeleton (no tool-result bodies),
|
|
61
|
+
evidence (bodies only for cited events), full. Build the bundle per
|
|
62
|
+
`templates/bundle-README.md`, dispatch `prompts/scrub.md`, then
|
|
63
|
+
`prompts/scrub-audit.md`, repeating both until the audit returns CLEAN.
|
|
64
|
+
Complete the bundle template's evidence check and reconciliation before
|
|
65
|
+
showing the final scrub log, file list, and privacy and evidence outcomes.
|
|
66
|
+
Archive (`zip -r` or `tar -czf`) only after approval. With the archive
|
|
67
|
+
path, state what it contains, point at the scrub log for replacements, and
|
|
68
|
+
say scrubbing can miss things: they must review every file before sharing.
|
|
69
|
+
7. **Similar sessions** — when asked. Turn confirmed findings into a
|
|
70
|
+
signature, list candidates by mtime and size, find marker line numbers,
|
|
71
|
+
dispatch `prompts/similar-session.md` per candidate in parallel, and
|
|
72
|
+
append report §9.
|
|
27
73
|
|
|
28
|
-
|
|
74
|
+
## Quick reference
|
|
29
75
|
|
|
30
|
-
|
|
76
|
+
All seven analysts always run. This table says which region to read
|
|
77
|
+
yourself in step 3 and which findings to lead with in the verdict.
|
|
78
|
+
|
|
79
|
+
| Complaint | Read first, lead with |
|
|
31
80
|
|---|---|
|
|
32
|
-
| "
|
|
33
|
-
| "
|
|
34
|
-
| "
|
|
35
|
-
| "
|
|
36
|
-
| "
|
|
37
|
-
| "
|
|
38
|
-
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
81
|
+
| "It took too long" | cost-and-time, stumbles |
|
|
82
|
+
| "Why did it do this extra work?" | repeated-work, plan-adherence |
|
|
83
|
+
| "Why is it so expensive?" | cost-and-time |
|
|
84
|
+
| "What the hell is it doing?" (still running) | skill-timeline; note in-progress in coverage |
|
|
85
|
+
| "It ignored the plan" | plan-adherence, compaction lines first |
|
|
86
|
+
| "Skill X never fired" | skill-timeline |
|
|
87
|
+
|
|
88
|
+
## Hard rules
|
|
89
|
+
|
|
90
|
+
- **Context safety.** One transcript line can be a megabyte. Follow
|
|
91
|
+
`references/context-safety.md` on every session file, every time.
|
|
92
|
+
- **Read-only.** Never modify, move, or delete a session file.
|
|
93
|
+
- **Exact paths to subagents.** A subagent's "current session" is its
|
|
94
|
+
own. Pass absolute paths and ids.
|
|
95
|
+
- **Human prompts only.** Hook output, system reminders, and tool results
|
|
96
|
+
are not your partner's words. In a subagent transcript, "user" is the
|
|
97
|
+
parent agent.
|
|
98
|
+
- **No superpowers diagnosis.** Report §7 states involvement and stops.
|
|
99
|
+
Never name a defect in a skill or propose a change. Your partner
|
|
100
|
+
pressing for a fix does not waive this; point at the issue step and
|
|
101
|
+
mention that a bundle is available on request. No advice to your
|
|
102
|
+
partner either.
|
|
103
|
+
- **Approval gates.** No archive before your partner has seen the scrub
|
|
104
|
+
log and file list. No issue or comment before they approve the exact
|
|
105
|
+
text.
|
|
106
|
+
- **Intake before analysis.** Nothing in steps 2–7 starts until your
|
|
107
|
+
partner has answered. If they are away, write the questions and stop.
|
|
108
|
+
A statement you reconstructed for them is not an answer. An
|
|
109
|
+
already-scoped request — one specific event, what is running now, or
|
|
110
|
+
the analysis to run — is itself the statement: answer it, then ask.
|
|
111
|
+
A whole-session "why" is a complaint.
|
|
112
|
+
|
|
113
|
+
## Red Flags
|
|
114
|
+
|
|
115
|
+
| Thought | Reality |
|
|
52
116
|
|---------|---------|
|
|
53
|
-
| "
|
|
54
|
-
| "
|
|
55
|
-
| "
|
|
56
|
-
| "
|
|
57
|
-
| "
|
|
58
|
-
| "
|
|
117
|
+
| "The problem is obvious, skip intake" | The problem statement scopes everything. Ask. |
|
|
118
|
+
| "They're away, so I'll reconstruct the statement" | You cannot reconstruct what they wanted. Write the questions and stop. |
|
|
119
|
+
| "I'll sweep everything now and ask at the end" | An unscoped sweep spends their budget on the wrong question. Ask first. |
|
|
120
|
+
| "They want a bug report, so I'll build the bundle now" | The bundle is their session data, packaged. Build it only when they ask for it. |
|
|
121
|
+
| "Small, targeted edit, no restructuring needed" | Not your call, however small. Report the evidence; the triager decides. |
|
|
122
|
+
| "The price per token is well known" | Numbers you did not compute from the transcript are invented. Cite or drop. |
|
|
@@ -1,24 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
You are an analyst subagent. You read a coding-agent session transcript on
|
|
2
|
+
disk and return findings with evidence. You do not fix anything, you do not
|
|
3
|
+
modify any file under the session store, and you do not say what
|
|
4
|
+
superpowers should change.
|
|
5
|
+
|
|
6
|
+
Inputs (from your dispatcher):
|
|
7
|
+
- CASE: absolute path of the case file. Read it first. It names the session
|
|
8
|
+
files, the discovered sources and record meanings to use, and the
|
|
9
|
+
context-safety rules you must follow. Use the recorded meanings rather than
|
|
10
|
+
repeating discovery or assuming a harness format.
|
|
11
|
+
- RANGE (optional): a turn range or line range. If present, analyze only
|
|
12
|
+
that range and say so in your Checked line.
|
|
13
|
+
|
|
14
|
+
Context safety: follow `references/context-safety.md`, named in CASE, on
|
|
15
|
+
every file before reading it, and extract fields with the recorded commands or
|
|
16
|
+
queries. "The current session" is not a thing you can look at: use only the
|
|
17
|
+
paths in CASE.
|
|
18
|
+
|
|
19
|
+
Human prompts are the records the case file identifies as human-typed. Hook
|
|
20
|
+
output, system reminders, and tool results are not human prompts. In a subagent
|
|
21
|
+
transcript, "user" is the parent agent.
|
|
22
|
+
|
|
23
|
+
Return format (nothing else):
|
|
12
24
|
|
|
13
25
|
```
|
|
14
|
-
##
|
|
26
|
+
## <Dimension> findings
|
|
15
27
|
|
|
16
|
-
- finding:
|
|
17
|
-
evidence:
|
|
18
|
-
turns:
|
|
19
|
-
confidence:
|
|
28
|
+
- finding: <one sentence, what happened>
|
|
29
|
+
evidence: <absolute path>:<line> — "<quote, at most 200 characters>"
|
|
30
|
+
turns: <first human turn>–<last human turn>
|
|
31
|
+
confidence: high | medium | low
|
|
20
32
|
|
|
21
|
-
Checked:
|
|
33
|
+
Checked: <what you examined: files, line ranges, commands used>
|
|
22
34
|
```
|
|
23
35
|
|
|
24
|
-
|
|
36
|
+
The dispatcher discards any finding without a `path:line`, so do not
|
|
37
|
+
write one. If you found nothing, return `- none found` and the Checked
|
|
38
|
+
line.
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
Read `prompts/analyst-common.md` first; it gives your role, inputs,
|
|
2
|
+
context-safety rules, and the return format. This file adds the dimension.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Dimension: Cost and time
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Account for where tokens and wall-clock went.
|
|
6
7
|
|
|
7
|
-
1.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
1. Tokens. Use only the usage records and counter meanings established in the
|
|
9
|
+
case file. State whether each counter is incremental or cumulative before
|
|
10
|
+
calculating totals; difference cumulative observations without turning a
|
|
11
|
+
missing observation into zero. Report the five turns with the largest
|
|
12
|
+
supported totals and the supported totals per associated session.
|
|
13
|
+
2. Wall-clock. Use the evidenced timestamp fields, event boundaries, and units
|
|
14
|
+
recorded in the case file. Report the five longest supported turns and any
|
|
15
|
+
gap longer than ten minutes between consecutive events (idle, waiting on an
|
|
16
|
+
associated session, or waiting on your human partner; say which only when
|
|
17
|
+
the records show it).
|
|
18
|
+
3. Largest tool results: use the case file's evidenced tool-result records to
|
|
19
|
+
report the ten largest results with their tool and turn. Measure records
|
|
20
|
+
before extracting bounded content.
|
|
21
|
+
4. Compactions: count and locate records whose meaning as compaction events was
|
|
22
|
+
established during discovery. Report available before/after counters and
|
|
23
|
+
what the session was doing when each fired; mark unsupported fields absent.
|
|
24
|
+
5. Associated sessions: count them and report supported usage, duration, and
|
|
25
|
+
dispatching turn for each.
|
|
26
|
+
6. Report the turns, subagents, tools, or repeats that dominate the
|
|
27
|
+
totals, with numbers. Do not speculate about why a
|
|
28
|
+
turn was expensive beyond what the transcript shows.
|