@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.
Files changed (77) hide show
  1. package/README.md +112 -105
  2. package/README.zh.md +216 -0
  3. package/lib/catalog.d.ts +8 -2
  4. package/lib/catalog.d.ts.map +1 -1
  5. package/lib/catalog.js +64 -9
  6. package/lib/catalog.js.map +1 -1
  7. package/lib/client.js +120 -75
  8. package/lib/document.d.ts +8 -2
  9. package/lib/document.d.ts.map +1 -1
  10. package/lib/document.js +14 -4
  11. package/lib/document.js.map +1 -1
  12. package/lib/superpowers.d.ts +6 -0
  13. package/lib/superpowers.d.ts.map +1 -1
  14. package/lib/superpowers.js +25 -2
  15. package/lib/superpowers.js.map +1 -1
  16. package/lib/switches.d.ts +17 -18
  17. package/lib/switches.d.ts.map +1 -1
  18. package/lib/switches.js +78 -31
  19. package/lib/switches.js.map +1 -1
  20. package/package.json +3 -3
  21. package/skills/brainstorming/SKILL.md +234 -170
  22. package/skills/brainstorming/spec-document-reviewer-prompt.md +27 -25
  23. package/skills/brainstorming/visual-companion.md +84 -231
  24. package/skills/diagnosing-superpowers/SKILL.md +107 -43
  25. package/skills/diagnosing-superpowers/prompts/analyst-common.md +32 -18
  26. package/skills/diagnosing-superpowers/prompts/cost-and-time.md +25 -9
  27. package/skills/diagnosing-superpowers/prompts/plan-adherence.md +26 -12
  28. package/skills/diagnosing-superpowers/prompts/quality-evidence.md +23 -8
  29. package/skills/diagnosing-superpowers/prompts/repeated-work.md +25 -14
  30. package/skills/diagnosing-superpowers/prompts/request-conflicts.md +18 -9
  31. package/skills/diagnosing-superpowers/prompts/scrub-audit.md +23 -10
  32. package/skills/diagnosing-superpowers/prompts/scrub.md +25 -12
  33. package/skills/diagnosing-superpowers/prompts/similar-session.md +30 -22
  34. package/skills/diagnosing-superpowers/prompts/skill-timeline.md +26 -12
  35. package/skills/diagnosing-superpowers/prompts/stumbles.md +24 -12
  36. package/skills/diagnosing-superpowers/references/context-safety.md +15 -7
  37. package/skills/diagnosing-superpowers/references/github-issues.md +17 -9
  38. package/skills/diagnosing-superpowers/references/redaction-policy.md +27 -15
  39. package/skills/diagnosing-superpowers/references/session-discovery.md +31 -20
  40. package/skills/diagnosing-superpowers/templates/bundle-README.md +66 -40
  41. package/skills/diagnosing-superpowers/templates/case.md +49 -42
  42. package/skills/diagnosing-superpowers/templates/issue.md +32 -26
  43. package/skills/diagnosing-superpowers/templates/report.md +54 -48
  44. package/skills/dispatching-parallel-agents/SKILL.md +92 -90
  45. package/skills/executing-plans/SKILL.md +345 -197
  46. package/skills/finishing-a-development-branch/SKILL.md +107 -82
  47. package/skills/receiving-code-review/SKILL.md +129 -127
  48. package/skills/requesting-code-review/SKILL.md +52 -50
  49. package/skills/requesting-code-review/code-reviewer.md +132 -111
  50. package/skills/subagent-driven-development/SKILL.md +521 -298
  51. package/skills/subagent-driven-development/implementer-prompt.md +138 -117
  52. package/skills/subagent-driven-development/re-review-prompt.md +80 -48
  53. package/skills/subagent-driven-development/task-reviewer-prompt.md +189 -110
  54. package/skills/systematic-debugging/CREATION-LOG.md +85 -85
  55. package/skills/systematic-debugging/SKILL.md +221 -219
  56. package/skills/systematic-debugging/condition-based-waiting.md +48 -49
  57. package/skills/systematic-debugging/defense-in-depth.md +46 -46
  58. package/skills/systematic-debugging/root-cause-tracing.md +63 -63
  59. package/skills/systematic-debugging/test-academic.md +10 -10
  60. package/skills/systematic-debugging/test-pressure-1.md +40 -40
  61. package/skills/systematic-debugging/test-pressure-2.md +58 -58
  62. package/skills/systematic-debugging/test-pressure-3.md +48 -48
  63. package/skills/test-driven-development/SKILL.md +161 -153
  64. package/skills/test-driven-development/writing-good-tests.md +137 -84
  65. package/skills/using-git-worktrees/SKILL.md +74 -72
  66. package/skills/using-superpowers/SKILL.md +40 -39
  67. package/skills/using-superpowers/references/dsh-tools.md +36 -36
  68. package/skills/verification-before-completion/SKILL.md +85 -83
  69. package/skills/writing-plans/SKILL.md +123 -84
  70. package/skills/writing-skills/SKILL.md +419 -417
  71. package/skills/writing-skills/persuasion-principles.md +118 -118
  72. package/skills/writing-skills/testing-skills-with-subagents.md +190 -190
  73. package/skills/brainstorming/scripts/frame-template.html +0 -213
  74. package/skills/brainstorming/scripts/helper.js +0 -167
  75. package/skills/brainstorming/scripts/server.cjs +0 -715
  76. package/skills/brainstorming/scripts/start-server.sh +0 -204
  77. package/skills/brainstorming/scripts/stop-server.sh +0 -120
@@ -1,95 +1,97 @@
1
1
  ---
2
2
  name: dispatching-parallel-agents
3
- description: "Superpower Skill:面向 2 个以上无共享状态、无前后依赖的独立任务,并行委派多个 subagent 协同处理的高效分发模式。"
3
+ description: "Superpower Skill: Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies"
4
+ description_zh: "Superpower Skill:面向 2 个以上无共享状态、无前后依赖的独立任务,并行委派多个 subagent 协同处理的高效分发模式。"
4
5
  ---
5
6
 
6
- # 并行分发 agent
7
7
 
8
- ## 概述
8
+ # Dispatching Parallel Agents
9
9
 
10
- 你将任务委派给拥有隔离上下文的专用 agent。通过精确构造指令与上下文,确保它们保持专注并成功完成任务。它们不应继承你当前会话的上下文或历史——你需要按需精确构造所需信息。这也能保留你自身的上下文,用于统筹协调工作。
10
+ ## Overview
11
11
 
12
- 当存在多个互不相关的失败时(不同的测试文件、不同的子系统、不同的缺陷),串行排查会浪费大量时间。每一项排查都是独立的,可以并行进行。
12
+ You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
13
13
 
14
- **核心原则:** 每个独立的问题域分派一个 agent,让它们并发执行。
14
+ When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.
15
15
 
16
- ## 何时使用
16
+ **Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.
17
+
18
+ ## When to Use
17
19
 
18
20
  ```dot
19
21
  digraph when_to_use {
20
- "存在多个失败?" [shape=diamond];
21
- "是否相互独立?" [shape=diamond];
22
- "由单个 agent 统一排查" [shape=box];
23
- "每个问题域分配一个 agent" [shape=box];
24
- "能否并行执行?" [shape=diamond];
25
- "串行分发 agent" [shape=box];
26
- "并行分发" [shape=box];
27
-
28
- "存在多个失败?" -> "是否相互独立?" [label="是"];
29
- "是否相互独立?" -> "由单个 agent 统一排查" [label="否 - 存在关联"];
30
- "是否相互独立?" -> "能否并行执行?" [label="是"];
31
- "能否并行执行?" -> "并行分发" [label="是"];
32
- "能否并行执行?" -> "串行分发 agent" [label="否 - 存在共享状态"];
22
+ "Multiple failures?" [shape=diamond];
23
+ "Are they independent?" [shape=diamond];
24
+ "Single agent investigates all" [shape=box];
25
+ "One agent per problem domain" [shape=box];
26
+ "Can they work in parallel?" [shape=diamond];
27
+ "Sequential agents" [shape=box];
28
+ "Parallel dispatch" [shape=box];
29
+
30
+ "Multiple failures?" -> "Are they independent?" [label="yes"];
31
+ "Are they independent?" -> "Single agent investigates all" [label="no - related"];
32
+ "Are they independent?" -> "Can they work in parallel?" [label="yes"];
33
+ "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
34
+ "Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
33
35
  }
34
36
  ```
35
37
 
36
- **适用场景:**
37
- - 3 个以上测试文件失败,且根因各不相同
38
- - 多个子系统各自独立出现故障
39
- - 每个问题无需依赖其他问题的上下文即可理解
40
- - 各排查过程之间不存在共享状态
38
+ **Use when:**
39
+ - 3+ test files failing with different root causes
40
+ - Multiple subsystems broken independently
41
+ - Each problem can be understood without context from others
42
+ - No shared state between investigations
41
43
 
42
- **不适用场景:**
43
- - 失败之间存在关联(修复一个可能顺带修复其他)
44
- - 需要理解完整的系统状态
45
- - agent 之间会相互干扰
44
+ **Don't use when:**
45
+ - Failures are related (fix one might fix others)
46
+ - Need to understand full system state
47
+ - Agents would interfere with each other
46
48
 
47
- ## 使用模式
49
+ ## The Pattern
48
50
 
49
- ### 1. 识别独立的问题域
51
+ ### 1. Identify Independent Domains
50
52
 
51
- 按故障点对失败进行分组:
52
- - 文件 A 测试:工具审批流程
53
- - 文件 B 测试:批量完成行为
54
- - 文件 C 测试:中止功能
53
+ Group failures by what's broken:
54
+ - File A tests: Tool approval flow
55
+ - File B tests: Batch completion behavior
56
+ - File C tests: Abort functionality
55
57
 
56
- 每个领域都是独立的——修复工具审批不会影响中止相关的测试。
58
+ Each domain is independent - fixing tool approval doesn't affect abort tests.
57
59
 
58
- ### 2. 创建聚焦的 agent 任务
60
+ ### 2. Create Focused Agent Tasks
59
61
 
60
- 每个 agent 应获得:
61
- - **明确范围:** 单个测试文件或子系统
62
- - **清晰目标:** 让这些测试通过
63
- - **约束条件:** 不得改动其他代码
64
- - **预期输出:** 发现了什么、修复了什么的总结
62
+ Each agent gets:
63
+ - **Specific scope:** One test file or subsystem
64
+ - **Clear goal:** Make these tests pass
65
+ - **Constraints:** Don't change other code
66
+ - **Expected output:** Summary of what you found and fixed
65
67
 
66
- ### 3. 并行分发
68
+ ### 3. Dispatch in Parallel
67
69
 
68
- 在同一条回复中一次性发起全部三个 subagent 分发——它们将并行运行:
70
+ Issue all three subagent dispatches in the same response — they run in parallel:
69
71
 
70
72
  ```text
71
73
  Subagent (general-purpose): "Fix agent-tool-abort.test.ts failures"
72
74
  Subagent (general-purpose): "Fix batch-completion-behavior.test.ts failures"
73
75
  Subagent (general-purpose): "Fix tool-approval-race-conditions.test.ts failures"
74
- # 全部三个并发执行。
76
+ # All three run concurrently.
75
77
  ```
76
78
 
77
- 在同一条回复中发起多次分发调用 = 并行执行。每条回复只发一次 = 串行执行。
79
+ Multiple dispatch calls in one response = parallel execution. One per response = sequential.
78
80
 
79
- ### 4. 复核与集成
81
+ ### 4. Review and Integrate
80
82
 
81
- 当 agent 返回后:
82
- - 阅读每一份总结
83
- - 验证各修复之间是否存在冲突
84
- - 运行完整测试套件
85
- - 整合所有变更
83
+ When agents return:
84
+ - Read each summary
85
+ - Verify fixes don't conflict
86
+ - Run full test suite
87
+ - Integrate all changes
86
88
 
87
- ## agent prompt 结构
89
+ ## Agent Prompt Structure
88
90
 
89
- 优秀的 agent prompt应具备:
90
- 1. **聚焦** - 一个清晰的问题域
91
- 2. **自包含** - 包含理解问题所需的全部上下文
92
- 3. **输出明确** - agent 应该返回什么?
91
+ Good agent prompts are:
92
+ 1. **Focused** - One clear problem domain
93
+ 2. **Self-contained** - All context needed to understand the problem
94
+ 3. **Specific about output** - What should the agent return?
93
95
 
94
96
  ```markdown
95
97
  Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
@@ -112,56 +114,56 @@ Do NOT just increase timeouts - find the real issue.
112
114
  Return: Summary of what you found and what you fixed.
113
115
  ```
114
116
 
115
- ## 常见错误
117
+ ## Common Mistakes
116
118
 
117
- **[FAIL] 范围过大:** "修复所有测试" - agent 容易迷失方向
118
- **[OK] 具体明确:** "修复 agent-tool-abort.test.ts" - 范围聚焦
119
+ **[FAIL] Too broad:** "Fix all the tests" - agent gets lost
120
+ **[OK] Specific:** "Fix agent-tool-abort.test.ts" - focused scope
119
121
 
120
- **[FAIL] 缺乏上下文:** "修复竞态条件" - agent 不知道位置
121
- **[OK] 提供上下文:** 粘贴错误信息和测试名称
122
+ **[FAIL] No context:** "Fix the race condition" - agent doesn't know where
123
+ **[OK] Context:** Paste the error messages and test names
122
124
 
123
- **[FAIL] 缺少约束:** agent 可能会重构所有内容
124
- **[OK] 明确约束:** "不要改动生产代码" 或 "仅修复测试"
125
+ **[FAIL] No constraints:** Agent might refactor everything
126
+ **[OK] Constraints:** "Do NOT change production code" or "Fix tests only"
125
127
 
126
- **[FAIL] 输出模糊:** "修好它" - 你无法知道改了什么
127
- **[OK] 输出具体:** "返回根因与变更总结"
128
+ **[FAIL] Vague output:** "Fix it" - you don't know what changed
129
+ **[OK] Specific:** "Return summary of root cause and changes"
128
130
 
129
- ## 何时不应使用
131
+ ## When NOT to Use
130
132
 
131
- **存在关联的失败:** 修复一个可能顺带修复其他——应先一起排查
132
- **需要完整上下文:** 理解问题需要看到整个系统
133
- **探索式调试:** 尚不清楚哪里出了问题
134
- **存在共享状态:** agent 会相互干扰(编辑同一文件、占用同一资源)
133
+ **Related failures:** Fixing one might fix others - investigate together first
134
+ **Need full context:** Understanding requires seeing entire system
135
+ **Exploratory debugging:** You don't know what's broken yet
136
+ **Shared state:** Agents would interfere (editing same files, using same resources)
135
137
 
136
- ## 来自真实会话的示例
138
+ ## Real Example from Session
137
139
 
138
- **场景:** 大规模重构后,3 个文件共出现 6 个测试失败
140
+ **Scenario:** 6 test failures across 3 files after major refactoring
139
141
 
140
- **失败情况:**
141
- - agent-tool-abort.test.ts:3 个失败(时序问题)
142
- - batch-completion-behavior.test.ts:2 个失败(工具未执行)
143
- - tool-approval-race-conditions.test.ts:1 个失败(执行次数为 0)
142
+ **Failures:**
143
+ - agent-tool-abort.test.ts: 3 failures (timing issues)
144
+ - batch-completion-behavior.test.ts: 2 failures (tools not executing)
145
+ - tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)
144
146
 
145
- **决策:** 属于独立领域——中止逻辑、批量完成、竞态条件三者相互分离
147
+ **Decision:** Independent domains - abort logic separate from batch completion separate from race conditions
146
148
 
147
- **分发:**
149
+ **Dispatch:**
148
150
  ```
149
151
  Agent 1 → Fix agent-tool-abort.test.ts
150
152
  Agent 2 → Fix batch-completion-behavior.test.ts
151
153
  Agent 3 → Fix tool-approval-race-conditions.test.ts
152
154
  ```
153
155
 
154
- **结果:**
155
- - Agent 1:用基于事件的等待替代了固定超时
156
- - Agent 2:修复了事件结构缺陷(threadId 位置错误)
157
- - Agent 3:增加了对异步工具执行完成的等待
156
+ **Results:**
157
+ - Agent 1: Replaced timeouts with event-based waiting
158
+ - Agent 2: Fixed event structure bug (threadId in wrong place)
159
+ - Agent 3: Added wait for async tool execution to complete
158
160
 
159
- **集成:** 所有修复相互独立,无冲突,全量测试通过
161
+ **Integration:** All fixes independent, no conflicts, full suite green
160
162
 
161
- ## 验证
163
+ ## Verification
162
164
 
163
- agent 返回后:
164
- 1. **复核每份总结** - 理解变更内容
165
- 2. **检查是否存在冲突** - agent 是否编辑了同一段代码?
166
- 3. **运行全量测试** - 验证所有修复协同工作正常
167
- 4. **抽样检查** - agent 可能存在系统性错误
165
+ After agents return:
166
+ 1. **Review each summary** - Understand what changed
167
+ 2. **Check for conflicts** - Did agents edit same code?
168
+ 3. **Run full suite** - Verify all fixes work together
169
+ 4. **Spot check** - Agents can make systematic errors