workerssuper 5.0.4
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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +13 -0
- package/.codex/INSTALL.md +67 -0
- package/.cursor-plugin/plugin.json +18 -0
- package/.gitattributes +18 -0
- package/.github/FUNDING.yml +3 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
- package/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +87 -0
- package/.opencode/INSTALL.md +83 -0
- package/.opencode/plugins/superpowers.js +107 -0
- package/CHANGELOG.md +13 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/GEMINI.md +2 -0
- package/LICENSE +21 -0
- package/README.md +187 -0
- package/RELEASE-NOTES.md +1057 -0
- package/agents/code-reviewer.md +48 -0
- package/commands/brainstorm.md +5 -0
- package/commands/execute-plan.md +5 -0
- package/commands/write-plan.md +5 -0
- package/docs/README.codex.md +126 -0
- package/docs/README.opencode.md +130 -0
- package/docs/plans/2025-11-22-opencode-support-design.md +294 -0
- package/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
- package/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
- package/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
- package/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
- package/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
- package/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
- package/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
- package/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
- package/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
- package/docs/testing.md +303 -0
- package/docs/windows/polyglot-hooks.md +212 -0
- package/gemini-extension.json +6 -0
- package/hooks/hooks-cursor.json +10 -0
- package/hooks/hooks.json +16 -0
- package/hooks/run-hook.cmd +46 -0
- package/hooks/session-start +57 -0
- package/package.json +5 -0
- package/skills/brainstorming/SKILL.md +164 -0
- package/skills/brainstorming/scripts/frame-template.html +214 -0
- package/skills/brainstorming/scripts/helper.js +88 -0
- package/skills/brainstorming/scripts/server.cjs +338 -0
- package/skills/brainstorming/scripts/start-server.sh +153 -0
- package/skills/brainstorming/scripts/stop-server.sh +55 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +286 -0
- package/skills/dispatching-parallel-agents/SKILL.md +182 -0
- package/skills/executing-plans/SKILL.md +70 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/receiving-code-review/SKILL.md +213 -0
- package/skills/requesting-code-review/SKILL.md +105 -0
- package/skills/requesting-code-review/code-reviewer.md +146 -0
- package/skills/subagent-driven-development/SKILL.md +277 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +296 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/using-git-worktrees/SKILL.md +218 -0
- package/skills/using-superpowers/SKILL.md +115 -0
- package/skills/using-superpowers/references/codex-tools.md +25 -0
- package/skills/using-superpowers/references/gemini-tools.md +33 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/writing-plans/SKILL.md +145 -0
- package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/skills/writing-skills/SKILL.md +655 -0
- package/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/persuasion-principles.md +187 -0
- package/skills/writing-skills/render-graphs.js +168 -0
- package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/tests/brainstorm-server/package-lock.json +36 -0
- package/tests/brainstorm-server/package.json +10 -0
- package/tests/brainstorm-server/server.test.js +424 -0
- package/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
- package/tests/brainstorm-server/ws-protocol.test.js +392 -0
- package/tests/claude-code/README.md +158 -0
- package/tests/claude-code/analyze-token-usage.py +168 -0
- package/tests/claude-code/run-skill-tests.sh +187 -0
- package/tests/claude-code/test-document-review-system.sh +177 -0
- package/tests/claude-code/test-helpers.sh +202 -0
- package/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
- package/tests/claude-code/test-subagent-driven-development.sh +165 -0
- package/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
- package/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
- package/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
- package/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
- package/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
- package/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
- package/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
- package/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
- package/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
- package/tests/explicit-skill-requests/run-all.sh +70 -0
- package/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
- package/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
- package/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
- package/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
- package/tests/explicit-skill-requests/run-test.sh +136 -0
- package/tests/opencode/run-tests.sh +163 -0
- package/tests/opencode/setup.sh +73 -0
- package/tests/opencode/test-plugin-loading.sh +72 -0
- package/tests/opencode/test-priority.sh +198 -0
- package/tests/opencode/test-tools.sh +104 -0
- package/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
- package/tests/skill-triggering/prompts/executing-plans.txt +1 -0
- package/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
- package/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
- package/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
- package/tests/skill-triggering/prompts/writing-plans.txt +10 -0
- package/tests/skill-triggering/run-all.sh +60 -0
- package/tests/skill-triggering/run-test.sh +88 -0
- package/tests/subagent-driven-dev/go-fractals/design.md +81 -0
- package/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
- package/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
- package/tests/subagent-driven-dev/run-test.sh +106 -0
- package/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
- package/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
- package/tests/subagent-driven-dev/svelte-todo/scaffold.sh +46 -0
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
# Skills Improvements from User Feedback
|
|
2
|
+
|
|
3
|
+
**Date:** 2025-11-28
|
|
4
|
+
**Status:** Draft
|
|
5
|
+
**Source:** Two Claude instances using superpowers in real development scenarios
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Executive Summary
|
|
10
|
+
|
|
11
|
+
Two Claude instances provided detailed feedback from actual development sessions. Their feedback reveals **systematic gaps** in current skills that allowed preventable bugs to ship despite following the skills.
|
|
12
|
+
|
|
13
|
+
**Critical insight:** These are problem reports, not just solution proposals. The problems are real; the solutions need careful evaluation.
|
|
14
|
+
|
|
15
|
+
**Key themes:**
|
|
16
|
+
1. **Verification gaps** - We verify operations succeed but not that they achieve intended outcomes
|
|
17
|
+
2. **Process hygiene** - Background processes accumulate and interfere across subagents
|
|
18
|
+
3. **Context optimization** - Subagents get too much irrelevant information
|
|
19
|
+
4. **Self-reflection missing** - No prompt to critique own work before handoff
|
|
20
|
+
5. **Mock safety** - Mocks can drift from interfaces without detection
|
|
21
|
+
6. **Skill activation** - Skills exist but aren't being read/used
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Problems Identified
|
|
26
|
+
|
|
27
|
+
### Problem 1: Configuration Change Verification Gap
|
|
28
|
+
|
|
29
|
+
**What happened:**
|
|
30
|
+
- Subagent tested "OpenAI integration"
|
|
31
|
+
- Set `OPENAI_API_KEY` env var
|
|
32
|
+
- Got status 200 responses
|
|
33
|
+
- Reported "OpenAI integration working"
|
|
34
|
+
- **BUT** response contained `"model": "claude-sonnet-4-20250514"` - was actually using Anthropic
|
|
35
|
+
|
|
36
|
+
**Root cause:**
|
|
37
|
+
`verification-before-completion` checks operations succeed but not that outcomes reflect intended configuration changes.
|
|
38
|
+
|
|
39
|
+
**Impact:** High - False confidence in integration tests, bugs ship to production
|
|
40
|
+
|
|
41
|
+
**Example failure pattern:**
|
|
42
|
+
- Switch LLM provider → verify status 200 but don't check model name
|
|
43
|
+
- Enable feature flag → verify no errors but don't check feature is active
|
|
44
|
+
- Change environment → verify deployment succeeds but don't check environment vars
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### Problem 2: Background Process Accumulation
|
|
49
|
+
|
|
50
|
+
**What happened:**
|
|
51
|
+
- Multiple subagents dispatched during session
|
|
52
|
+
- Each started background server processes
|
|
53
|
+
- Processes accumulated (4+ servers running)
|
|
54
|
+
- Stale processes still bound to ports
|
|
55
|
+
- Later E2E test hit stale server with wrong config
|
|
56
|
+
- Confusing/incorrect test results
|
|
57
|
+
|
|
58
|
+
**Root cause:**
|
|
59
|
+
Subagents are stateless - don't know about previous subagents' processes. No cleanup protocol.
|
|
60
|
+
|
|
61
|
+
**Impact:** Medium-High - Tests hit wrong server, false passes/failures, debugging confusion
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### Problem 3: Context Bloat in Subagent Prompts
|
|
66
|
+
|
|
67
|
+
**What happened:**
|
|
68
|
+
- Standard approach: give subagent full plan file to read
|
|
69
|
+
- Experiment: give only task + pattern + file + verify command
|
|
70
|
+
- Result: Faster, more focused, single-attempt completion more common
|
|
71
|
+
|
|
72
|
+
**Root cause:**
|
|
73
|
+
Subagents waste tokens and attention on irrelevant plan sections.
|
|
74
|
+
|
|
75
|
+
**Impact:** Medium - Slower execution, more failed attempts
|
|
76
|
+
|
|
77
|
+
**What worked:**
|
|
78
|
+
```
|
|
79
|
+
You are adding a single E2E test to packnplay's test suite.
|
|
80
|
+
|
|
81
|
+
**Your task:** Add `TestE2E_FeaturePrivilegedMode` to `pkg/runner/e2e_test.go`
|
|
82
|
+
|
|
83
|
+
**What to test:** A local devcontainer feature that requests `"privileged": true`
|
|
84
|
+
in its metadata should result in the container running with `--privileged` flag.
|
|
85
|
+
|
|
86
|
+
**Follow the exact pattern of TestE2E_FeatureOptionValidation** (at the end of the file)
|
|
87
|
+
|
|
88
|
+
**After writing, run:** `go test -v ./pkg/runner -run TestE2E_FeaturePrivilegedMode -timeout 5m`
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Problem 4: No Self-Reflection Before Handoff
|
|
94
|
+
|
|
95
|
+
**What happened:**
|
|
96
|
+
- Added self-reflection prompt: "Look at your work with fresh eyes - what could be better?"
|
|
97
|
+
- Implementer for Task 5 identified failing test was due to implementation bug, not test bug
|
|
98
|
+
- Traced to line 99: `strings.Join(metadata.Entrypoint, " ")` creating invalid Docker syntax
|
|
99
|
+
- Without self-reflection, would have just reported "test fails" without root cause
|
|
100
|
+
|
|
101
|
+
**Root cause:**
|
|
102
|
+
Implementers don't naturally step back and critique their own work before reporting completion.
|
|
103
|
+
|
|
104
|
+
**Impact:** Medium - Bugs handed off to reviewer that implementer could have caught
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Problem 5: Mock-Interface Drift
|
|
109
|
+
|
|
110
|
+
**What happened:**
|
|
111
|
+
```typescript
|
|
112
|
+
// Interface defines close()
|
|
113
|
+
interface PlatformAdapter {
|
|
114
|
+
close(): Promise<void>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Code (BUGGY) calls cleanup()
|
|
118
|
+
await adapter.cleanup();
|
|
119
|
+
|
|
120
|
+
// Mock (MATCHES BUG) defines cleanup()
|
|
121
|
+
vi.mock('web-adapter', () => ({
|
|
122
|
+
WebAdapter: vi.fn().mockImplementation(() => ({
|
|
123
|
+
cleanup: vi.fn().mockResolvedValue(undefined), // Wrong!
|
|
124
|
+
})),
|
|
125
|
+
}));
|
|
126
|
+
```
|
|
127
|
+
- Tests passed
|
|
128
|
+
- Runtime crashed: "adapter.cleanup is not a function"
|
|
129
|
+
|
|
130
|
+
**Root cause:**
|
|
131
|
+
Mock derived from what buggy code calls, not from interface definition. TypeScript can't catch inline mocks with wrong method names.
|
|
132
|
+
|
|
133
|
+
**Impact:** High - Tests give false confidence, runtime crashes
|
|
134
|
+
|
|
135
|
+
**Why testing-anti-patterns didn't prevent this:**
|
|
136
|
+
The skill covers testing mock behavior and mocking without understanding, but not the specific pattern of "derive mock from interface, not implementation."
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### Problem 6: Code Reviewer File Access
|
|
141
|
+
|
|
142
|
+
**What happened:**
|
|
143
|
+
- Code reviewer subagent dispatched
|
|
144
|
+
- Couldn't find test file: "The file doesn't appear to exist in the repository"
|
|
145
|
+
- File actually exists
|
|
146
|
+
- Reviewer didn't know to explicitly read it first
|
|
147
|
+
|
|
148
|
+
**Root cause:**
|
|
149
|
+
Reviewer prompts don't include explicit file reading instructions.
|
|
150
|
+
|
|
151
|
+
**Impact:** Low-Medium - Reviews fail or incomplete
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Problem 7: Fix Workflow Latency
|
|
156
|
+
|
|
157
|
+
**What happened:**
|
|
158
|
+
- Implementer identifies bug during self-reflection
|
|
159
|
+
- Implementer knows the fix
|
|
160
|
+
- Current workflow: report → I dispatch fixer → fixer fixes → I verify
|
|
161
|
+
- Extra round-trip adds latency without adding value
|
|
162
|
+
|
|
163
|
+
**Root cause:**
|
|
164
|
+
Rigid separation between implementer and fixer roles when implementer has already diagnosed.
|
|
165
|
+
|
|
166
|
+
**Impact:** Low - Latency, but no correctness issue
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### Problem 8: Skills Not Being Read
|
|
171
|
+
|
|
172
|
+
**What happened:**
|
|
173
|
+
- `testing-anti-patterns` skill exists
|
|
174
|
+
- Neither human nor subagents read it before writing tests
|
|
175
|
+
- Would have prevented some issues (though not all - see Problem 5)
|
|
176
|
+
|
|
177
|
+
**Root cause:**
|
|
178
|
+
No enforcement that subagents read relevant skills. No prompt includes skill reading.
|
|
179
|
+
|
|
180
|
+
**Impact:** Medium - Skill investment wasted if not used
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Proposed Improvements
|
|
185
|
+
|
|
186
|
+
### 1. verification-before-completion: Add Configuration Change Verification
|
|
187
|
+
|
|
188
|
+
**Add new section:**
|
|
189
|
+
|
|
190
|
+
```markdown
|
|
191
|
+
## Verifying Configuration Changes
|
|
192
|
+
|
|
193
|
+
When testing changes to configuration, providers, feature flags, or environment:
|
|
194
|
+
|
|
195
|
+
**Don't just verify the operation succeeded. Verify the output reflects the intended change.**
|
|
196
|
+
|
|
197
|
+
### Common Failure Pattern
|
|
198
|
+
|
|
199
|
+
Operation succeeds because *some* valid config exists, but it's not the config you intended to test.
|
|
200
|
+
|
|
201
|
+
### Examples
|
|
202
|
+
|
|
203
|
+
| Change | Insufficient | Required |
|
|
204
|
+
|--------|-------------|----------|
|
|
205
|
+
| Switch LLM provider | Status 200 | Response contains expected model name |
|
|
206
|
+
| Enable feature flag | No errors | Feature behavior actually active |
|
|
207
|
+
| Change environment | Deploy succeeds | Logs/vars reference new environment |
|
|
208
|
+
| Set credentials | Auth succeeds | Authenticated user/context is correct |
|
|
209
|
+
|
|
210
|
+
### Gate Function
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
BEFORE claiming configuration change works:
|
|
214
|
+
|
|
215
|
+
1. IDENTIFY: What should be DIFFERENT after this change?
|
|
216
|
+
2. LOCATE: Where is that difference observable?
|
|
217
|
+
- Response field (model name, user ID)
|
|
218
|
+
- Log line (environment, provider)
|
|
219
|
+
- Behavior (feature active/inactive)
|
|
220
|
+
3. RUN: Command that shows the observable difference
|
|
221
|
+
4. VERIFY: Output contains expected difference
|
|
222
|
+
5. ONLY THEN: Claim configuration change works
|
|
223
|
+
|
|
224
|
+
Red flags:
|
|
225
|
+
- "Request succeeded" without checking content
|
|
226
|
+
- Checking status code but not response body
|
|
227
|
+
- Verifying no errors but not positive confirmation
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Why this works:**
|
|
231
|
+
Forces verification of INTENT, not just operation success.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### 2. subagent-driven-development: Add Process Hygiene for E2E Tests
|
|
236
|
+
|
|
237
|
+
**Add new section:**
|
|
238
|
+
|
|
239
|
+
```markdown
|
|
240
|
+
## Process Hygiene for E2E Tests
|
|
241
|
+
|
|
242
|
+
When dispatching subagents that start services (servers, databases, message queues):
|
|
243
|
+
|
|
244
|
+
### Problem
|
|
245
|
+
|
|
246
|
+
Subagents are stateless - they don't know about processes started by previous subagents. Background processes persist and can interfere with later tests.
|
|
247
|
+
|
|
248
|
+
### Solution
|
|
249
|
+
|
|
250
|
+
**Before dispatching E2E test subagent, include cleanup in prompt:**
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
BEFORE starting any services:
|
|
254
|
+
1. Kill existing processes: pkill -f "<service-pattern>" 2>/dev/null || true
|
|
255
|
+
2. Wait for cleanup: sleep 1
|
|
256
|
+
3. Verify port free: lsof -i :<port> && echo "ERROR: Port still in use" || echo "Port free"
|
|
257
|
+
|
|
258
|
+
AFTER tests complete:
|
|
259
|
+
1. Kill the process you started
|
|
260
|
+
2. Verify cleanup: pgrep -f "<service-pattern>" || echo "Cleanup successful"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Example
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
Task: Run E2E test of API server
|
|
267
|
+
|
|
268
|
+
Prompt includes:
|
|
269
|
+
"Before starting the server:
|
|
270
|
+
- Kill any existing servers: pkill -f 'node.*server.js' 2>/dev/null || true
|
|
271
|
+
- Verify port 3001 is free: lsof -i :3001 && exit 1 || echo 'Port available'
|
|
272
|
+
|
|
273
|
+
After tests:
|
|
274
|
+
- Kill the server you started
|
|
275
|
+
- Verify: pgrep -f 'node.*server.js' || echo 'Cleanup verified'"
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Why This Matters
|
|
279
|
+
|
|
280
|
+
- Stale processes serve requests with wrong config
|
|
281
|
+
- Port conflicts cause silent failures
|
|
282
|
+
- Process accumulation slows system
|
|
283
|
+
- Confusing test results (hitting wrong server)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Trade-off analysis:**
|
|
287
|
+
- Adds boilerplate to prompts
|
|
288
|
+
- But prevents very confusing debugging
|
|
289
|
+
- Worth it for E2E test subagents
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### 3. subagent-driven-development: Add Lean Context Option
|
|
294
|
+
|
|
295
|
+
**Modify Step 2: Execute Task with Subagent**
|
|
296
|
+
|
|
297
|
+
**Before:**
|
|
298
|
+
```
|
|
299
|
+
Read that task carefully from [plan-file].
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**After:**
|
|
303
|
+
```
|
|
304
|
+
## Context Approaches
|
|
305
|
+
|
|
306
|
+
**Full Plan (default):**
|
|
307
|
+
Use when tasks are complex or have dependencies:
|
|
308
|
+
```
|
|
309
|
+
Read Task N from [plan-file] carefully.
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Lean Context (for independent tasks):**
|
|
313
|
+
Use when task is standalone and pattern-based:
|
|
314
|
+
```
|
|
315
|
+
You are implementing: [1-2 sentence task description]
|
|
316
|
+
|
|
317
|
+
File to modify: [exact path]
|
|
318
|
+
Pattern to follow: [reference to existing function/test]
|
|
319
|
+
What to implement: [specific requirement]
|
|
320
|
+
Verification: [exact command to run]
|
|
321
|
+
|
|
322
|
+
[Do NOT include full plan file]
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Use lean context when:**
|
|
326
|
+
- Task follows existing pattern (add similar test, implement similar feature)
|
|
327
|
+
- Task is self-contained (doesn't need context from other tasks)
|
|
328
|
+
- Pattern reference is sufficient (e.g., "follow TestE2E_FeatureOptionValidation")
|
|
329
|
+
|
|
330
|
+
**Use full plan when:**
|
|
331
|
+
- Task has dependencies on other tasks
|
|
332
|
+
- Requires understanding of overall architecture
|
|
333
|
+
- Complex logic that needs context
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Example:**
|
|
337
|
+
```
|
|
338
|
+
Lean context prompt:
|
|
339
|
+
|
|
340
|
+
"You are adding a test for privileged mode in devcontainer features.
|
|
341
|
+
|
|
342
|
+
File: pkg/runner/e2e_test.go
|
|
343
|
+
Pattern: Follow TestE2E_FeatureOptionValidation (at end of file)
|
|
344
|
+
Test: Feature with `"privileged": true` in metadata results in `--privileged` flag
|
|
345
|
+
Verify: go test -v ./pkg/runner -run TestE2E_FeaturePrivilegedMode -timeout 5m
|
|
346
|
+
|
|
347
|
+
Report: Implementation, test results, any issues."
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
**Why this works:**
|
|
351
|
+
Reduces token usage, increases focus, faster completion when appropriate.
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### 4. subagent-driven-development: Add Self-Reflection Step
|
|
356
|
+
|
|
357
|
+
**Modify Step 2: Execute Task with Subagent**
|
|
358
|
+
|
|
359
|
+
**Add to prompt template:**
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
When done, BEFORE reporting back:
|
|
363
|
+
|
|
364
|
+
Take a step back and review your work with fresh eyes.
|
|
365
|
+
|
|
366
|
+
Ask yourself:
|
|
367
|
+
- Does this actually solve the task as specified?
|
|
368
|
+
- Are there edge cases I didn't consider?
|
|
369
|
+
- Did I follow the pattern correctly?
|
|
370
|
+
- If tests are failing, what's the ROOT CAUSE (implementation bug vs test bug)?
|
|
371
|
+
- What could be better about this implementation?
|
|
372
|
+
|
|
373
|
+
If you identify issues during this reflection, fix them now.
|
|
374
|
+
|
|
375
|
+
Then report:
|
|
376
|
+
- What you implemented
|
|
377
|
+
- Self-reflection findings (if any)
|
|
378
|
+
- Test results
|
|
379
|
+
- Files changed
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Why this works:**
|
|
383
|
+
Catches bugs implementer can find themselves before handoff. Documented case: identified entrypoint bug through self-reflection.
|
|
384
|
+
|
|
385
|
+
**Trade-off:**
|
|
386
|
+
Adds ~30 seconds per task, but catches issues before review.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
### 5. requesting-code-review: Add Explicit File Reading
|
|
391
|
+
|
|
392
|
+
**Modify the code-reviewer template:**
|
|
393
|
+
|
|
394
|
+
**Add at the beginning:**
|
|
395
|
+
|
|
396
|
+
```markdown
|
|
397
|
+
## Files to Review
|
|
398
|
+
|
|
399
|
+
BEFORE analyzing, read these files:
|
|
400
|
+
|
|
401
|
+
1. [List specific files that changed in the diff]
|
|
402
|
+
2. [Files referenced by changes but not modified]
|
|
403
|
+
|
|
404
|
+
Use Read tool to load each file.
|
|
405
|
+
|
|
406
|
+
If you cannot find a file:
|
|
407
|
+
- Check exact path from diff
|
|
408
|
+
- Try alternate locations
|
|
409
|
+
- Report: "Cannot locate [path] - please verify file exists"
|
|
410
|
+
|
|
411
|
+
DO NOT proceed with review until you've read the actual code.
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**Why this works:**
|
|
415
|
+
Explicit instruction prevents "file not found" issues.
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
### 6. testing-anti-patterns: Add Mock-Interface Drift Anti-Pattern
|
|
420
|
+
|
|
421
|
+
**Add new Anti-Pattern 6:**
|
|
422
|
+
|
|
423
|
+
```markdown
|
|
424
|
+
## Anti-Pattern 6: Mocks Derived from Implementation
|
|
425
|
+
|
|
426
|
+
**The violation:**
|
|
427
|
+
```typescript
|
|
428
|
+
// Code (BUGGY) calls cleanup()
|
|
429
|
+
await adapter.cleanup();
|
|
430
|
+
|
|
431
|
+
// Mock (MATCHES BUG) has cleanup()
|
|
432
|
+
const mock = {
|
|
433
|
+
cleanup: vi.fn().mockResolvedValue(undefined)
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
// Interface (CORRECT) defines close()
|
|
437
|
+
interface PlatformAdapter {
|
|
438
|
+
close(): Promise<void>;
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**Why this is wrong:**
|
|
443
|
+
- Mock encodes the bug into the test
|
|
444
|
+
- TypeScript can't catch inline mocks with wrong method names
|
|
445
|
+
- Test passes because both code and mock are wrong
|
|
446
|
+
- Runtime crashes when real object is used
|
|
447
|
+
|
|
448
|
+
**The fix:**
|
|
449
|
+
```typescript
|
|
450
|
+
// ✅ GOOD: Derive mock from interface
|
|
451
|
+
|
|
452
|
+
// Step 1: Open interface definition (PlatformAdapter)
|
|
453
|
+
// Step 2: List methods defined there (close, initialize, etc.)
|
|
454
|
+
// Step 3: Mock EXACTLY those methods
|
|
455
|
+
|
|
456
|
+
const mock = {
|
|
457
|
+
initialize: vi.fn().mockResolvedValue(undefined),
|
|
458
|
+
close: vi.fn().mockResolvedValue(undefined), // From interface!
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// Now test FAILS because code calls cleanup() which doesn't exist
|
|
462
|
+
// That failure reveals the bug BEFORE runtime
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### Gate Function
|
|
466
|
+
|
|
467
|
+
```
|
|
468
|
+
BEFORE writing any mock:
|
|
469
|
+
|
|
470
|
+
1. STOP - Do NOT look at the code under test yet
|
|
471
|
+
2. FIND: The interface/type definition for the dependency
|
|
472
|
+
3. READ: The interface file
|
|
473
|
+
4. LIST: Methods defined in the interface
|
|
474
|
+
5. MOCK: ONLY those methods with EXACTLY those names
|
|
475
|
+
6. DO NOT: Look at what your code calls
|
|
476
|
+
|
|
477
|
+
IF your test fails because code calls something not in mock:
|
|
478
|
+
✅ GOOD - The test found a bug in your code
|
|
479
|
+
Fix the code to call the correct interface method
|
|
480
|
+
NOT the mock
|
|
481
|
+
|
|
482
|
+
Red flags:
|
|
483
|
+
- "I'll mock what the code calls"
|
|
484
|
+
- Copying method names from implementation
|
|
485
|
+
- Mock written without reading interface
|
|
486
|
+
- "The test is failing so I'll add this method to the mock"
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
**Detection:**
|
|
490
|
+
|
|
491
|
+
When you see runtime error "X is not a function" and tests pass:
|
|
492
|
+
1. Check if X is mocked
|
|
493
|
+
2. Compare mock methods to interface methods
|
|
494
|
+
3. Look for method name mismatches
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
**Why this works:**
|
|
498
|
+
Directly addresses the failure pattern from feedback.
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
### 7. subagent-driven-development: Require Skills Reading for Test Subagents
|
|
503
|
+
|
|
504
|
+
**Add to prompt template when task involves testing:**
|
|
505
|
+
|
|
506
|
+
```markdown
|
|
507
|
+
BEFORE writing any tests:
|
|
508
|
+
|
|
509
|
+
1. Read testing-anti-patterns skill:
|
|
510
|
+
Use Skill tool: superpowers:testing-anti-patterns
|
|
511
|
+
|
|
512
|
+
2. Apply gate functions from that skill when:
|
|
513
|
+
- Writing mocks
|
|
514
|
+
- Adding methods to production classes
|
|
515
|
+
- Mocking dependencies
|
|
516
|
+
|
|
517
|
+
This is NOT optional. Tests that violate anti-patterns will be rejected in review.
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
**Why this works:**
|
|
521
|
+
Ensures skills are actually used, not just exist.
|
|
522
|
+
|
|
523
|
+
**Trade-off:**
|
|
524
|
+
Adds time to each task, but prevents entire classes of bugs.
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
### 8. subagent-driven-development: Allow Implementer to Fix Self-Identified Issues
|
|
529
|
+
|
|
530
|
+
**Modify Step 2:**
|
|
531
|
+
|
|
532
|
+
**Current:**
|
|
533
|
+
```
|
|
534
|
+
Subagent reports back with summary of work.
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
**Proposed:**
|
|
538
|
+
```
|
|
539
|
+
Subagent performs self-reflection, then:
|
|
540
|
+
|
|
541
|
+
IF self-reflection identifies fixable issues:
|
|
542
|
+
1. Fix the issues
|
|
543
|
+
2. Re-run verification
|
|
544
|
+
3. Report: "Initial implementation + self-reflection fix"
|
|
545
|
+
|
|
546
|
+
ELSE:
|
|
547
|
+
Report: "Implementation complete"
|
|
548
|
+
|
|
549
|
+
Include in report:
|
|
550
|
+
- Self-reflection findings
|
|
551
|
+
- Whether fixes were applied
|
|
552
|
+
- Final verification results
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
**Why this works:**
|
|
556
|
+
Reduces latency when implementer already knows the fix. Documented case: would have saved one round-trip for entrypoint bug.
|
|
557
|
+
|
|
558
|
+
**Trade-off:**
|
|
559
|
+
Slightly more complex prompt, but faster end-to-end.
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## Implementation Plan
|
|
564
|
+
|
|
565
|
+
### Phase 1: High-Impact, Low-Risk (Do First)
|
|
566
|
+
|
|
567
|
+
1. **verification-before-completion: Configuration change verification**
|
|
568
|
+
- Clear addition, doesn't change existing content
|
|
569
|
+
- Addresses high-impact problem (false confidence in tests)
|
|
570
|
+
- File: `skills/verification-before-completion/SKILL.md`
|
|
571
|
+
|
|
572
|
+
2. **testing-anti-patterns: Mock-interface drift**
|
|
573
|
+
- Adds new anti-pattern, doesn't modify existing
|
|
574
|
+
- Addresses high-impact problem (runtime crashes)
|
|
575
|
+
- File: `skills/testing-anti-patterns/SKILL.md`
|
|
576
|
+
|
|
577
|
+
3. **requesting-code-review: Explicit file reading**
|
|
578
|
+
- Simple addition to template
|
|
579
|
+
- Fixes concrete problem (reviewers can't find files)
|
|
580
|
+
- File: `skills/requesting-code-review/SKILL.md`
|
|
581
|
+
|
|
582
|
+
### Phase 2: Moderate Changes (Test Carefully)
|
|
583
|
+
|
|
584
|
+
4. **subagent-driven-development: Process hygiene**
|
|
585
|
+
- Adds new section, doesn't change workflow
|
|
586
|
+
- Addresses medium-high impact (test reliability)
|
|
587
|
+
- File: `skills/subagent-driven-development/SKILL.md`
|
|
588
|
+
|
|
589
|
+
5. **subagent-driven-development: Self-reflection**
|
|
590
|
+
- Changes prompt template (higher risk)
|
|
591
|
+
- But documented to catch bugs
|
|
592
|
+
- File: `skills/subagent-driven-development/SKILL.md`
|
|
593
|
+
|
|
594
|
+
6. **subagent-driven-development: Skills reading requirement**
|
|
595
|
+
- Adds prompt overhead
|
|
596
|
+
- But ensures skills are actually used
|
|
597
|
+
- File: `skills/subagent-driven-development/SKILL.md`
|
|
598
|
+
|
|
599
|
+
### Phase 3: Optimization (Validate First)
|
|
600
|
+
|
|
601
|
+
7. **subagent-driven-development: Lean context option**
|
|
602
|
+
- Adds complexity (two approaches)
|
|
603
|
+
- Needs validation that it doesn't cause confusion
|
|
604
|
+
- File: `skills/subagent-driven-development/SKILL.md`
|
|
605
|
+
|
|
606
|
+
8. **subagent-driven-development: Allow implementer to fix**
|
|
607
|
+
- Changes workflow (higher risk)
|
|
608
|
+
- Optimization, not bug fix
|
|
609
|
+
- File: `skills/subagent-driven-development/SKILL.md`
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
## Open Questions
|
|
614
|
+
|
|
615
|
+
1. **Lean context approach:**
|
|
616
|
+
- Should we make it the default for pattern-based tasks?
|
|
617
|
+
- How do we decide which approach to use?
|
|
618
|
+
- Risk of being too lean and missing important context?
|
|
619
|
+
|
|
620
|
+
2. **Self-reflection:**
|
|
621
|
+
- Will this slow down simple tasks significantly?
|
|
622
|
+
- Should it only apply to complex tasks?
|
|
623
|
+
- How do we prevent "reflection fatigue" where it becomes rote?
|
|
624
|
+
|
|
625
|
+
3. **Process hygiene:**
|
|
626
|
+
- Should this be in subagent-driven-development or a separate skill?
|
|
627
|
+
- Does it apply to other workflows beyond E2E tests?
|
|
628
|
+
- How do we handle cases where process SHOULD persist (dev servers)?
|
|
629
|
+
|
|
630
|
+
4. **Skills reading enforcement:**
|
|
631
|
+
- Should we require ALL subagents to read relevant skills?
|
|
632
|
+
- How do we keep prompts from becoming too long?
|
|
633
|
+
- Risk of over-documenting and losing focus?
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
## Success Metrics
|
|
638
|
+
|
|
639
|
+
How do we know these improvements work?
|
|
640
|
+
|
|
641
|
+
1. **Configuration verification:**
|
|
642
|
+
- Zero instances of "test passed but wrong config was used"
|
|
643
|
+
- Jesse doesn't say "that's not actually testing what you think"
|
|
644
|
+
|
|
645
|
+
2. **Process hygiene:**
|
|
646
|
+
- Zero instances of "test hit wrong server"
|
|
647
|
+
- No port conflict errors during E2E test runs
|
|
648
|
+
|
|
649
|
+
3. **Mock-interface drift:**
|
|
650
|
+
- Zero instances of "tests pass but runtime crashes on missing method"
|
|
651
|
+
- No method name mismatches between mocks and interfaces
|
|
652
|
+
|
|
653
|
+
4. **Self-reflection:**
|
|
654
|
+
- Measurable: Do implementer reports include self-reflection findings?
|
|
655
|
+
- Qualitative: Do fewer bugs make it to code review?
|
|
656
|
+
|
|
657
|
+
5. **Skills reading:**
|
|
658
|
+
- Subagent reports reference skill gate functions
|
|
659
|
+
- Fewer anti-pattern violations in code review
|
|
660
|
+
|
|
661
|
+
---
|
|
662
|
+
|
|
663
|
+
## Risks and Mitigations
|
|
664
|
+
|
|
665
|
+
### Risk: Prompt Bloat
|
|
666
|
+
**Problem:** Adding all these requirements makes prompts overwhelming
|
|
667
|
+
**Mitigation:**
|
|
668
|
+
- Phase implementation (don't add everything at once)
|
|
669
|
+
- Make some additions conditional (E2E hygiene only for E2E tests)
|
|
670
|
+
- Consider templates for different task types
|
|
671
|
+
|
|
672
|
+
### Risk: Analysis Paralysis
|
|
673
|
+
**Problem:** Too much reflection/verification slows execution
|
|
674
|
+
**Mitigation:**
|
|
675
|
+
- Keep gate functions quick (seconds, not minutes)
|
|
676
|
+
- Make lean context opt-in initially
|
|
677
|
+
- Monitor task completion times
|
|
678
|
+
|
|
679
|
+
### Risk: False Sense of Security
|
|
680
|
+
**Problem:** Following checklist doesn't guarantee correctness
|
|
681
|
+
**Mitigation:**
|
|
682
|
+
- Emphasize gate functions are minimums, not maximums
|
|
683
|
+
- Keep "use judgment" language in skills
|
|
684
|
+
- Document that skills catch common failures, not all failures
|
|
685
|
+
|
|
686
|
+
### Risk: Skill Divergence
|
|
687
|
+
**Problem:** Different skills give conflicting advice
|
|
688
|
+
**Mitigation:**
|
|
689
|
+
- Review changes across all skills for consistency
|
|
690
|
+
- Document how skills interact (Integration sections)
|
|
691
|
+
- Test with real scenarios before deployment
|
|
692
|
+
|
|
693
|
+
---
|
|
694
|
+
|
|
695
|
+
## Recommendation
|
|
696
|
+
|
|
697
|
+
**Proceed with Phase 1 immediately:**
|
|
698
|
+
- verification-before-completion: Configuration change verification
|
|
699
|
+
- testing-anti-patterns: Mock-interface drift
|
|
700
|
+
- requesting-code-review: Explicit file reading
|
|
701
|
+
|
|
702
|
+
**Test Phase 2 with Jesse before finalizing:**
|
|
703
|
+
- Get feedback on self-reflection impact
|
|
704
|
+
- Validate process hygiene approach
|
|
705
|
+
- Confirm skills reading requirement is worth overhead
|
|
706
|
+
|
|
707
|
+
**Hold Phase 3 pending validation:**
|
|
708
|
+
- Lean context needs real-world testing
|
|
709
|
+
- Implementer-fix workflow change needs careful evaluation
|
|
710
|
+
|
|
711
|
+
These changes address real problems documented by users while minimizing risk of making skills worse.
|