claude-everything-workflow 0.1.9 → 0.2.3
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/AGENTS.md +20 -20
- package/CLAUDE.md +1 -5
- package/README.md +151 -113
- package/agents/e2e-runner.md +8 -141
- package/agents/harness-optimizer.md +3 -2
- package/commands/code-review.md +10 -15
- package/commands/learn.md +97 -0
- package/commands/pr.md +5 -6
- package/commands/to-spec.md +11 -0
- package/commands/verify.md +7 -11
- package/harness/manifest.json +346 -0
- package/hooks/check-code-size.js +33 -12
- package/hooks/check-console-log.js +72 -24
- package/package.json +10 -2
- package/rules/01-base.md +9 -49
- package/rules/02-code-size.md +5 -20
- package/rules/03-architecture.md +9 -61
- package/rules/04-error-handling.md +4 -26
- package/rules/05-git-workflow.md +12 -39
- package/rules/06-comments.md +3 -43
- package/rules/07-forbidden.md +8 -31
- package/rules/08-specialty-rules-index.md +18 -0
- package/rules/09-first-principles-adversarial-testing.md +6 -18
- package/rules/common/agent-orchestration.md +8 -47
- package/rules/common/context-hygiene.md +9 -72
- package/rules/common/harness-engineering.md +11 -38
- package/rules/common/hooks.md +13 -82
- package/rules/common/performance.md +8 -71
- package/rules/common/pr-automation.md +7 -68
- package/rules/common/skills-learning.md +12 -36
- package/rules/common/testing.md +16 -59
- package/scripts/cleanup-retired-skills.js +214 -0
- package/scripts/install-rules.js +100 -0
- package/scripts/install.ps1 +99 -87
- package/scripts/install.sh +77 -78
- package/scripts/learning/review-confidence.js +1 -4
- package/scripts/legacy-common-rule-hashes.json +78 -0
- package/scripts/merge-claude-settings.cjs +75 -0
- package/scripts/retired-skill-files.json +54 -0
- package/scripts/upstream-capability-baseline.json +27 -0
- package/scripts/upstream-capability-map.json +155 -0
- package/scripts/verify/core.js +91 -0
- package/scripts/verify/grilling-spec-gate-checks.js +266 -0
- package/scripts/verify/install-rules.test.js +156 -0
- package/scripts/verify/metadata-checks.js +747 -0
- package/scripts/verify/repository-checks.js +409 -0
- package/scripts/verify/runtime-checks.js +593 -0
- package/scripts/verify/skill-invocation.test.js +86 -0
- package/scripts/verify/skill-manifest-checks.js +197 -0
- package/scripts/verify/skill-manifest-checks.test.js +123 -0
- package/scripts/verify/workflow-checks.js +685 -0
- package/scripts/verify/workflow-ownership-fixtures.js +371 -0
- package/scripts/verify/workflow-ownership.js +780 -0
- package/scripts/verify-harness.js +18 -1075
- package/scripts/verify-upstream-capability-map.js +118 -0
- package/skills/README.md +28 -16
- package/skills/code-review/SKILL.md +63 -0
- package/skills/code-review/references/spec-reviewer-prompt.md +24 -0
- package/skills/code-review/references/standards-reviewer-prompt.md +35 -0
- package/skills/codebase-design/SKILL.md +63 -0
- package/skills/codebase-design/references/deepening.md +27 -0
- package/skills/codebase-design/references/design-it-twice.md +17 -0
- package/skills/continuous-learning-v2/SKILL.md +8 -8
- package/skills/continuous-learning-v2/config.json +0 -4
- package/skills/domain-modeling/SKILL.md +101 -0
- package/skills/e2e-testing/SKILL.md +20 -310
- package/skills/e2e-testing/references/playwright-patterns.md +324 -0
- package/skills/feature-acceptance/SKILL.md +89 -0
- package/skills/grilling/SKILL.md +83 -0
- package/skills/handoff/SKILL.md +55 -0
- package/skills/handoff/agents/openai.yaml +2 -0
- package/skills/implement/SKILL.md +48 -0
- package/skills/implement/references/ticket-delivery.md +43 -0
- package/skills/improve-codebase-architecture/SKILL.md +47 -0
- package/skills/improve-codebase-architecture/agents/openai.yaml +2 -0
- package/skills/iterative-retrieval/SKILL.md +10 -1
- package/skills/learn/README.md +2 -2
- package/skills/prototype/SKILL.md +50 -0
- package/skills/prototype/references/logic.md +28 -0
- package/skills/prototype/references/ui.md +30 -0
- package/skills/resolving-merge-conflicts/SKILL.md +27 -0
- package/skills/spec-gate/SKILL.md +149 -0
- package/skills/spec-gate/agents/openai.yaml +4 -0
- package/skills/spec-gate/references/spec-document-reviewer-prompt.md +31 -0
- package/skills/subagent-driven-development/SKILL.md +95 -414
- package/skills/systematic-debugging/SKILL.md +11 -49
- package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +129 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.js +75 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.sh +41 -0
- package/skills/test-driven-development/SKILL.md +24 -4
- package/skills/to-tickets/SKILL.md +96 -0
- package/skills/triage/SKILL.md +53 -0
- package/skills/triage/agents/openai.yaml +2 -0
- package/skills/triage/references/agent-brief.md +32 -0
- package/skills/triage/references/out-of-scope.md +14 -0
- package/skills/using-git-worktrees/SKILL.md +8 -5
- package/skills/using-superpowers/SKILL.md +76 -43
- package/skills/using-superpowers/references/process-outcomes.md +41 -0
- package/skills/verification-before-completion/SKILL.md +5 -4
- package/skills/visual-companion/SKILL.md +62 -0
- package/skills/visual-companion/agents/openai.yaml +4 -0
- package/skills/{brainstorming/visual-companion.md → visual-companion/references/guide.md} +1 -1
- package/skills/{brainstorming → visual-companion}/scripts/frame-template.html +42 -12
- package/skills/visual-companion/scripts/pages.cjs +28 -0
- package/skills/visual-companion/scripts/server-utils.cjs +82 -0
- package/skills/{brainstorming → visual-companion}/scripts/server.cjs +108 -248
- package/skills/{brainstorming → visual-companion}/scripts/start-server.sh +18 -4
- package/skills/visual-companion/scripts/websocket.cjs +86 -0
- package/agents/architect.md +0 -59
- package/agents/code-reviewer.md +0 -57
- package/agents/planner.md +0 -124
- package/agents/tdd-guide.md +0 -101
- package/commands/e2e.md +0 -28
- package/commands/evolve.md +0 -42
- package/commands/harness-audit.md +0 -27
- package/commands/instinct-status.md +0 -38
- package/commands/learn-eval.md +0 -91
- package/commands/projects.md +0 -27
- package/commands/promote.md +0 -29
- package/commands/prune.md +0 -46
- package/commands/tdd.md +0 -27
- package/homunculus/instincts/personal/always-test-first.md +0 -28
- package/homunculus/instincts/personal/pr-ci-quality-gate.md +0 -30
- package/rules/08-ecc-integration.md +0 -46
- package/rules/common/implementation.md +0 -25
- package/rules/common/security.md +0 -19
- package/skills/brainstorming/SKILL.md +0 -185
- package/skills/brainstorming/agents/openai.yaml +0 -3
- package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/skills/context-budget/SKILL.md +0 -59
- package/skills/discover-unknowns-zh/SKILL.md +0 -112
- package/skills/discover-unknowns-zh/agents/openai.yaml +0 -4
- package/skills/discover-unknowns-zh/references/prompt-patterns.md +0 -144
- package/skills/documentation-lookup/SKILL.md +0 -90
- package/skills/executing-plans/SKILL.md +0 -66
- package/skills/find-skills/SKILL.md +0 -142
- package/skills/skill-creator/LICENSE.txt +0 -202
- package/skills/skill-creator/SKILL.md +0 -356
- package/skills/skill-creator/references/output-patterns.md +0 -82
- package/skills/skill-creator/references/workflows.md +0 -28
- package/skills/skill-creator/scripts/init_skill.py +0 -303
- package/skills/skill-creator/scripts/package_skill.py +0 -110
- package/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/skills/subagent-driven-development/implementer-prompt.md +0 -139
- package/skills/subagent-driven-development/scripts/review-package +0 -44
- package/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
- package/skills/subagent-driven-development/scripts/task-brief +0 -40
- package/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
- package/skills/writing-plans/SKILL.md +0 -206
- package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
- /package/skills/{brainstorming → visual-companion}/scripts/helper.js +0 -0
- /package/skills/{brainstorming → visual-companion}/scripts/stop-server.sh +0 -0
|
@@ -1,425 +1,106 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: subagent-driven-development
|
|
3
|
-
description:
|
|
3
|
+
description: Dispatch approved independent frontier tickets in isolated worktrees; use only when router selects SDD.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Subagent-Driven Development
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**Core principle:** Fresh subagent per task + task review (spec + quality) + broad final review = high quality, fast iteration
|
|
13
|
-
|
|
14
|
-
**Narration:** between tool calls, narrate at most one short line — the
|
|
15
|
-
ledger and the tool results carry the record.
|
|
16
|
-
|
|
17
|
-
**Continuous execution:** Do not pause to check in with your human partner between tasks. Execute all tasks from the plan without stopping. The only reasons to stop are: BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.
|
|
8
|
+
Run several independent frontier tickets in parallel without reintroducing a long implementation plan.
|
|
9
|
+
Each fresh subagent receives one approved ticket, discovers current code details itself, and returns evidence
|
|
10
|
+
for review. The controller owns ticket selection, worktree isolation, review, tracker mutations and user
|
|
11
|
+
communication.
|
|
18
12
|
|
|
19
13
|
## When to Use
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
|
|
70
|
-
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
|
|
71
|
-
"Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
|
|
72
|
-
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
|
|
73
|
-
"Implementer subagent implements, tests, commits, self-reviews" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)";
|
|
74
|
-
"Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" -> "Task reviewer reports spec ✅ and quality approved?";
|
|
75
|
-
"Task reviewer reports spec ✅ and quality approved?" -> "Dispatch fix subagent for Critical/Important findings" [label="no"];
|
|
76
|
-
"Dispatch fix subagent for Critical/Important findings" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" [label="re-review"];
|
|
77
|
-
"Task reviewer reports spec ✅ and quality approved?" -> "Mark task complete in todo list and progress ledger" [label="yes"];
|
|
78
|
-
"Mark task complete in todo list and progress ledger" -> "More tasks remain?";
|
|
79
|
-
"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
|
|
80
|
-
"More tasks remain?" -> "Dispatch final code reviewer subagent (agents/code-reviewer.md)" [label="no"];
|
|
81
|
-
"Dispatch final code reviewer subagent (agents/code-reviewer.md)" -> "Use verification-before-completion, then /verify and /pr when requested";
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## Local Git Boundary
|
|
86
|
-
|
|
87
|
-
This workflow depends on per-task commits so review packages can compare each task's recorded `BASE` and `HEAD`. Use it only when the user has explicitly approved commit handling, PR handling, or SDD execution for the plan.
|
|
88
|
-
|
|
89
|
-
If commit handling is not approved, use `skills/executing-plans/SKILL.md` instead and keep changes uncommitted.
|
|
90
|
-
|
|
91
|
-
## Pre-Flight Plan Review
|
|
92
|
-
|
|
93
|
-
Before dispatching Task 1, scan the plan once for conflicts:
|
|
94
|
-
|
|
95
|
-
- tasks that contradict each other or the plan's Global Constraints
|
|
96
|
-
- anything the plan explicitly mandates that the review rubric treats as a
|
|
97
|
-
defect (a test that asserts nothing, verbatim duplication of a logic block)
|
|
98
|
-
|
|
99
|
-
Present everything you find to your human partner as one batched question —
|
|
100
|
-
each finding beside the plan text that mandates it, asking which governs —
|
|
101
|
-
before execution begins, not one interrupt per discovery mid-plan. If the
|
|
102
|
-
scan is clean, proceed without comment. The review loop remains the net for
|
|
103
|
-
conflicts that only emerge from implementation.
|
|
104
|
-
|
|
105
|
-
## Model Selection
|
|
106
|
-
|
|
107
|
-
Use the least powerful model that can handle each role to conserve cost and increase speed.
|
|
108
|
-
|
|
109
|
-
**Mechanical implementation tasks** (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.
|
|
110
|
-
|
|
111
|
-
**Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
|
|
112
|
-
|
|
113
|
-
**Architecture and design tasks**: use the most capable available model.
|
|
114
|
-
The final whole-branch review is one of these — dispatch it on the most
|
|
115
|
-
capable available model, not the session default.
|
|
116
|
-
|
|
117
|
-
**Review tasks**: choose the model with the same judgment, scaled to the
|
|
118
|
-
diff's size, complexity, and risk. A small mechanical diff does not need the
|
|
119
|
-
most capable model; a subtle concurrency change does.
|
|
120
|
-
|
|
121
|
-
**Always specify the model explicitly when dispatching a subagent.** An
|
|
122
|
-
omitted model inherits your session's model — often the most capable and
|
|
123
|
-
most expensive — which silently defeats this section.
|
|
124
|
-
|
|
125
|
-
**Turn count beats token price.** Wall-clock and context cost scale with how
|
|
126
|
-
many turns a subagent takes, and the cheapest models routinely take 2-3× the
|
|
127
|
-
turns on multi-step work — costing more overall. Use a mid-tier model as the
|
|
128
|
-
floor for reviewers and for implementers working from prose descriptions.
|
|
129
|
-
When the task's plan text contains the complete code to write, the
|
|
130
|
-
implementation is transcription plus testing: use the cheapest tier for
|
|
131
|
-
that implementer. Single-file mechanical fixes also take the cheapest tier.
|
|
132
|
-
|
|
133
|
-
**Task complexity signals (implementation tasks):**
|
|
134
|
-
- Touches 1-2 files with a complete spec → cheap model
|
|
135
|
-
- Touches multiple files with integration concerns → standard model
|
|
136
|
-
- Requires design judgment or broad codebase understanding → most capable model
|
|
137
|
-
|
|
138
|
-
## Handling Implementer Status
|
|
139
|
-
|
|
140
|
-
Implementer subagents report one of four statuses. Handle each appropriately:
|
|
141
|
-
|
|
142
|
-
**DONE:** Generate the review package (`scripts/review-package BASE HEAD`, from this skill's directory — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never `HEAD~1`, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer with the printed path.
|
|
143
|
-
|
|
144
|
-
**DONE_WITH_CONCERNS:** The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before review. If they're observations (e.g., "this file is getting large"), note them and proceed to review.
|
|
145
|
-
|
|
146
|
-
**NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
|
|
147
|
-
|
|
148
|
-
**BLOCKED:** The implementer cannot complete the task. Assess the blocker:
|
|
149
|
-
1. If it's a context problem, provide more context and re-dispatch with the same model
|
|
150
|
-
2. If the task requires more reasoning, re-dispatch with a more capable model
|
|
151
|
-
3. If the task is too large, break it into smaller pieces
|
|
152
|
-
4. If the plan itself is wrong, escalate to the human
|
|
153
|
-
|
|
154
|
-
**Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
|
|
155
|
-
|
|
156
|
-
## Handling Reviewer ⚠️ Items
|
|
157
|
-
|
|
158
|
-
The task reviewer may report "⚠️ Cannot verify from diff" items — requirements
|
|
159
|
-
that live in unchanged code or span tasks. These do not block the rest of the
|
|
160
|
-
review, but you must resolve each one yourself before marking the task
|
|
161
|
-
complete: you hold the plan and cross-task context the reviewer
|
|
162
|
-
lacks. If you confirm an item is a real gap, treat it as a failed spec
|
|
163
|
-
review — send it back to the implementer and re-review.
|
|
164
|
-
|
|
165
|
-
## Constructing Reviewer Prompts
|
|
166
|
-
|
|
167
|
-
Per-task reviews are task-scoped gates. The broad review happens once, at the
|
|
168
|
-
final whole-branch review. When you fill a reviewer template:
|
|
169
|
-
|
|
170
|
-
- Do not add open-ended directives like "check all uses" or "run race tests
|
|
171
|
-
if useful" without a concrete, task-specific reason
|
|
172
|
-
- Do not ask a reviewer to re-run tests the implementer already ran on the
|
|
173
|
-
same code — the implementer's report carries the test evidence
|
|
174
|
-
- Do not pre-judge findings for the reviewer — never instruct a reviewer to
|
|
175
|
-
ignore or not flag a specific issue. If you believe a finding would be a
|
|
176
|
-
false positive, let the reviewer raise it and adjudicate it in the review
|
|
177
|
-
loop. If the prompt you are writing contains "do not flag," "don't treat X
|
|
178
|
-
as a defect," "at most Minor," or "the plan chose" — stop: you are
|
|
179
|
-
pre-judging, usually to spare yourself a review loop.
|
|
180
|
-
- The global-constraints block you hand the reviewer is its attention
|
|
181
|
-
lens. Copy the binding requirements verbatim from the plan's Global
|
|
182
|
-
Constraints section or the spec: exact values, exact formats, and the
|
|
183
|
-
stated relationships between components ("same layout as X", "matches
|
|
184
|
-
Y"). The reviewer's template already carries the process rules (YAGNI,
|
|
185
|
-
test hygiene, review method) — the constraints block is for what THIS
|
|
186
|
-
project's spec demands.
|
|
187
|
-
- Hand the reviewer its diff as a file: run this skill's
|
|
188
|
-
`scripts/review-package BASE HEAD` and pass the reviewer the file path
|
|
189
|
-
it prints (or, without bash: `git log --oneline`, `git diff --stat`,
|
|
190
|
-
and `git diff -U10` for the range, redirected to one uniquely named
|
|
191
|
-
file). The output never enters your own context, and the reviewer sees
|
|
192
|
-
the commit list, stat summary, and full diff with context in one Read
|
|
193
|
-
call. Use the BASE you recorded before dispatching the implementer —
|
|
194
|
-
never `HEAD~1`, which silently truncates multi-commit tasks.
|
|
195
|
-
- A dispatch prompt describes one task, not the session's history. Do not
|
|
196
|
-
paste accumulated prior-task summaries ("state after Tasks 1-3") into
|
|
197
|
-
later dispatches — a real session's dispatch hit 42k chars of which 99%
|
|
198
|
-
was pasted history. A fresh subagent needs its task, the interfaces it
|
|
199
|
-
touches, and the global constraints. Nothing else.
|
|
200
|
-
- Dispatch fix subagents for Critical and Important findings. Record Minor
|
|
201
|
-
findings in the progress ledger as you go, and point the final
|
|
202
|
-
whole-branch review at that list so it can triage which must be fixed
|
|
203
|
-
before merge. A roll-up nobody reads is a silent discard.
|
|
204
|
-
- A finding labeled plan-mandated — or any finding that conflicts with
|
|
205
|
-
what the plan's text requires — is the human's decision, like any plan
|
|
206
|
-
contradiction: present the finding and the plan text, ask which governs.
|
|
207
|
-
Do not dismiss the finding because the plan mandates it, and do not
|
|
208
|
-
dispatch a fix that contradicts the plan without asking.
|
|
209
|
-
- The final whole-branch review gets a package too: run
|
|
210
|
-
`scripts/review-package MERGE_BASE HEAD` (MERGE_BASE = the commit the
|
|
211
|
-
branch started from, e.g. `git merge-base main HEAD`) and include the
|
|
212
|
-
printed path in the final review dispatch, so the final reviewer reads
|
|
213
|
-
one file instead of re-deriving the branch diff with git commands.
|
|
214
|
-
- Every fix dispatch carries the implementer contract: the fix subagent
|
|
215
|
-
re-runs the tests covering its change and reports the results. Name the
|
|
216
|
-
covering test files in the dispatch — a one-line fix does not need the
|
|
217
|
-
whole suite. Before re-dispatching the reviewer, confirm the fix report
|
|
218
|
-
contains the covering tests, the command run, and the output; dispatch
|
|
219
|
-
the re-review once all three are present.
|
|
220
|
-
- If the final whole-branch review returns findings, dispatch ONE fix
|
|
221
|
-
subagent with the complete findings list — not one fixer per finding.
|
|
222
|
-
Per-finding fixers each rebuild context and re-run suites; a real
|
|
223
|
-
session's final-review fix wave cost more than all its tasks combined.
|
|
224
|
-
|
|
225
|
-
## File Handoffs
|
|
226
|
-
|
|
227
|
-
Everything you paste into a dispatch prompt — and everything a subagent
|
|
228
|
-
prints back — stays resident in your context for the rest of the session
|
|
229
|
-
and is re-read on every later turn. Hand artifacts over as files:
|
|
230
|
-
|
|
231
|
-
- **Task brief:** before dispatching an implementer, run this skill's
|
|
232
|
-
`scripts/task-brief PLAN_FILE N` — it extracts the task's full text to a
|
|
233
|
-
uniquely named file and prints the path. Compose the dispatch so the
|
|
234
|
-
brief stays the single source of requirements. Your dispatch should
|
|
235
|
-
contain: (1) one line on where this task fits in the project; (2) the
|
|
236
|
-
brief path, introduced as "read this first — it is your requirements,
|
|
237
|
-
with the exact values to use verbatim"; (3) interfaces and decisions
|
|
238
|
-
from earlier tasks that the brief cannot know; (4) your resolution of
|
|
239
|
-
any ambiguity you noticed in the brief; (5) the report-file path and
|
|
240
|
-
report contract. Exact values (numbers, magic strings, signatures, test
|
|
241
|
-
cases) appear only in the brief.
|
|
242
|
-
- **Report file:** name the implementer's report file after the brief
|
|
243
|
-
(brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
|
|
244
|
-
the dispatch prompt. The implementer writes the full report there and
|
|
245
|
-
returns only status, commits, a one-line test summary, and concerns.
|
|
246
|
-
- **Reviewer inputs:** the task reviewer gets three paths — the same brief
|
|
247
|
-
file, the report file, and the review package — plus the global
|
|
248
|
-
constraints that bind the task.
|
|
249
|
-
- Fix dispatches append their fix report (with test results) to the same
|
|
250
|
-
report file and return a short summary; re-reviews read the updated file.
|
|
251
|
-
|
|
252
|
-
## Durable Progress
|
|
253
|
-
|
|
254
|
-
Conversation memory does not survive compaction. In real sessions,
|
|
255
|
-
controllers that lost their place have re-dispatched entire completed task
|
|
256
|
-
sequences — the single most expensive failure observed. Track progress in
|
|
257
|
-
a ledger file, not only in todos.
|
|
258
|
-
|
|
259
|
-
- At skill start, check for a ledger:
|
|
260
|
-
`cat "$(git rev-parse --show-toplevel)/.superpowers/sdd/progress.md"`. Tasks listed there
|
|
261
|
-
as complete are DONE — do not re-dispatch them; resume at the first task
|
|
262
|
-
not marked complete.
|
|
263
|
-
- When a task's review comes back clean, append one line to the ledger in
|
|
264
|
-
the same message as your other bookkeeping:
|
|
265
|
-
`Task N: complete (commits <base7>..<head7>, review clean)`.
|
|
266
|
-
- The ledger is your recovery map: the commits it names exist in git even
|
|
267
|
-
when your context no longer remembers creating them. After compaction,
|
|
268
|
-
trust the ledger and `git log` over your own recollection.
|
|
269
|
-
- `git clean -fdx` will destroy the ledger (it's git-ignored scratch); if
|
|
270
|
-
that happens, recover from `git log`.
|
|
271
|
-
|
|
272
|
-
## Prompt Templates
|
|
273
|
-
|
|
274
|
-
- [implementer-prompt.md](implementer-prompt.md) - Dispatch implementer subagent
|
|
275
|
-
- [task-reviewer-prompt.md](task-reviewer-prompt.md) - Dispatch task reviewer subagent (spec compliance + code quality)
|
|
276
|
-
- Final whole-branch review: use `agents/code-reviewer.md`, adding `agents/security-reviewer.md` or `agents/database-reviewer.md` when the touched area warrants it.
|
|
277
|
-
|
|
278
|
-
## Example Workflow
|
|
279
|
-
|
|
280
|
-
```
|
|
281
|
-
You: I'm using Subagent-Driven Development to execute this plan.
|
|
282
|
-
|
|
283
|
-
[Read plan file once: docs/superpowers/plans/feature-plan.md]
|
|
284
|
-
[Create todos for all tasks]
|
|
285
|
-
|
|
286
|
-
Task 1: Hook installation script
|
|
287
|
-
|
|
288
|
-
[Run task-brief for Task 1; dispatch implementer with brief + report paths + context]
|
|
289
|
-
|
|
290
|
-
Implementer: "Before I begin - should the hook be installed at user or system level?"
|
|
291
|
-
|
|
292
|
-
You: "User level (~/.config/superpowers/hooks/)"
|
|
293
|
-
|
|
294
|
-
Implementer: "Got it. Implementing now..."
|
|
295
|
-
[Later] Implementer:
|
|
296
|
-
- Implemented install-hook command
|
|
297
|
-
- Added tests, 5/5 passing
|
|
298
|
-
- Self-review: Found I missed --force flag, added it
|
|
299
|
-
- Committed
|
|
300
|
-
|
|
301
|
-
[Run review-package, dispatch task reviewer with the printed path]
|
|
302
|
-
Task reviewer: Spec ✅ - all requirements met, nothing extra.
|
|
303
|
-
Strengths: Good test coverage, clean. Issues: None. Task quality: Approved.
|
|
304
|
-
|
|
305
|
-
[Mark Task 1 complete]
|
|
306
|
-
|
|
307
|
-
Task 2: Recovery modes
|
|
308
|
-
|
|
309
|
-
[Run task-brief for Task 2; dispatch implementer with brief + report paths + context]
|
|
310
|
-
|
|
311
|
-
Implementer: [No questions, proceeds]
|
|
312
|
-
Implementer:
|
|
313
|
-
- Added verify/repair modes
|
|
314
|
-
- 8/8 tests passing
|
|
315
|
-
- Self-review: All good
|
|
316
|
-
- Committed
|
|
317
|
-
|
|
318
|
-
[Run review-package, dispatch task reviewer with the printed path]
|
|
319
|
-
Task reviewer: Spec ❌:
|
|
320
|
-
- Missing: Progress reporting (spec says "report every 100 items")
|
|
321
|
-
- Extra: Added --json flag (not requested)
|
|
322
|
-
Issues (Important): Magic number (100)
|
|
323
|
-
|
|
324
|
-
[Dispatch fix subagent with all findings]
|
|
325
|
-
Fixer: Removed --json flag, added progress reporting, extracted PROGRESS_INTERVAL constant
|
|
326
|
-
|
|
327
|
-
[Task reviewer reviews again]
|
|
328
|
-
Task reviewer: Spec ✅. Task quality: Approved.
|
|
329
|
-
|
|
330
|
-
[Mark Task 2 complete]
|
|
331
|
-
|
|
332
|
-
...
|
|
333
|
-
|
|
334
|
-
[After all tasks]
|
|
335
|
-
[Dispatch final code-reviewer]
|
|
336
|
-
Final reviewer: All requirements met, ready to merge
|
|
337
|
-
|
|
338
|
-
Done!
|
|
15
|
+
Use only when all of the following are true:
|
|
16
|
+
|
|
17
|
+
- the router is executing a user-authorized delivery scope and records why SDD is safer or faster than
|
|
18
|
+
serial `implement`;
|
|
19
|
+
- at least two selected tickets are `ready-for-agent`, unclaimed and have no unresolved blocker;
|
|
20
|
+
- the tickets do not modify the same files, shared migration, release boundary or external state;
|
|
21
|
+
- each ticket can finish in one fresh subagent context.
|
|
22
|
+
|
|
23
|
+
Announce the selected topology and its reason in one line, then continue. Otherwise use `implement` for
|
|
24
|
+
one ticket. Do not manufacture extra tickets merely to justify parallelism.
|
|
25
|
+
|
|
26
|
+
## Prepare
|
|
27
|
+
|
|
28
|
+
1. Read the full source ticket and its blocker status; record its acceptance criteria and the user-approved
|
|
29
|
+
scope.
|
|
30
|
+
2. Confirm the selected tickets form the frontier and have no overlapping write surface. If overlap is
|
|
31
|
+
uncertain, run them sequentially.
|
|
32
|
+
3. Create one clean controller-owned integration worktree at the common base, plus one separate worktree
|
|
33
|
+
and branch per ticket using `skills/using-git-worktrees/SKILL.md`. The integration worktree is the only
|
|
34
|
+
delivery target; do not share a checkout between implementers.
|
|
35
|
+
4. Record the common base and every worktree path. The integration worktree must have no unrelated dirty
|
|
36
|
+
or untracked files before the first diff is applied.
|
|
37
|
+
5. Do not generate a detailed implementation plan, task brief file, or code skeleton. The ticket is the
|
|
38
|
+
implementation contract.
|
|
39
|
+
|
|
40
|
+
## Dispatch
|
|
41
|
+
|
|
42
|
+
For each ticket, dispatch one fresh subagent with only:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
Ticket: <reference and full body>
|
|
46
|
+
Worktree: <absolute path>
|
|
47
|
+
Base: <commit>
|
|
48
|
+
Context: <why this behavior exists, confirmed interfaces, and completed blockers>
|
|
49
|
+
|
|
50
|
+
Implement only this ticket. Inspect the current code to choose files and implementation details.
|
|
51
|
+
Use test-driven-development for behavior changes. Keep the ticket's acceptance criteria as the
|
|
52
|
+
source of truth; do not expand scope or start another ticket.
|
|
53
|
+
|
|
54
|
+
Do not stage, commit, push, open a PR, claim/resolve/comment on a tracker, or perform any other external
|
|
55
|
+
mutation. Leave only this ticket's worktree diff, including task-owned untracked files.
|
|
56
|
+
|
|
57
|
+
Before reporting, run focused verification and report the diff for the controller's review:
|
|
58
|
+
- status: DONE | BLOCKED | NEEDS_DECISION
|
|
59
|
+
- changed files and tests run
|
|
60
|
+
- task-owned untracked files created since dispatch
|
|
61
|
+
- RED/GREEN evidence when TDD applied
|
|
62
|
+
- unresolved risk or assumption
|
|
339
63
|
```
|
|
340
64
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
-
|
|
351
|
-
|
|
352
|
-
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
- Skip scene-setting context (subagent needs to understand where task fits)
|
|
384
|
-
- Ignore subagent questions (answer before letting them proceed)
|
|
385
|
-
- Accept "close enough" on spec compliance (reviewer found spec issues = not done)
|
|
386
|
-
- Skip review loops (reviewer found issues = implementer fixes = review again)
|
|
387
|
-
- Let implementer self-review replace actual review (both are needed)
|
|
388
|
-
- Tell a reviewer what not to flag, or pre-rate a finding's severity in the
|
|
389
|
-
dispatch prompt ("treat it as Minor at most") — the plan's example code is
|
|
390
|
-
a starting point, not evidence that its weaknesses were chosen
|
|
391
|
-
- Dispatch a task reviewer without a diff file — generate it first
|
|
392
|
-
(`scripts/review-package BASE HEAD`) and name the printed path in the
|
|
393
|
-
prompt
|
|
394
|
-
- Move to next task while the review has open Critical/Important issues
|
|
395
|
-
- Re-dispatch a task the progress ledger already marks complete — check
|
|
396
|
-
the ledger (and `git log`) after any compaction or resume
|
|
397
|
-
|
|
398
|
-
**If subagent asks questions:**
|
|
399
|
-
- Answer clearly and completely
|
|
400
|
-
- Provide additional context if needed
|
|
401
|
-
- Don't rush them into implementation
|
|
402
|
-
|
|
403
|
-
**If reviewer finds issues:**
|
|
404
|
-
- Implementer (same subagent) fixes them
|
|
405
|
-
- Reviewer reviews again
|
|
406
|
-
- Repeat until approved
|
|
407
|
-
- Don't skip the re-review
|
|
408
|
-
|
|
409
|
-
**If subagent fails task:**
|
|
410
|
-
- Dispatch fix subagent with specific instructions
|
|
411
|
-
- Don't try to fix manually (context pollution)
|
|
412
|
-
|
|
413
|
-
## Integration
|
|
414
|
-
|
|
415
|
-
**Required workflow skills:**
|
|
416
|
-
- **skills/using-git-worktrees/SKILL.md** - Ensures isolated workspace when needed
|
|
417
|
-
- **skills/writing-plans/SKILL.md** - Creates the plan this skill executes
|
|
418
|
-
- **agents/code-reviewer.md** - Final whole-branch review template
|
|
419
|
-
- **skills/verification-before-completion/SKILL.md** - Fresh evidence gate before completion claims
|
|
420
|
-
|
|
421
|
-
**Subagents should use:**
|
|
422
|
-
- **skills/test-driven-development/SKILL.md** - Subagents follow TDD for behavior-changing tasks
|
|
423
|
-
|
|
424
|
-
**Alternative workflow:**
|
|
425
|
-
- **skills/executing-plans/SKILL.md** - Use when task coupling is high, commit handling is not approved, or same-session SDD is not appropriate
|
|
65
|
+
If an agent finds a consequential decision, stop that ticket and return it to `using-superpowers`; do not
|
|
66
|
+
let a parallel worker decide it unilaterally.
|
|
67
|
+
|
|
68
|
+
## Review, Integrate and Resolve
|
|
69
|
+
|
|
70
|
+
1. Review each completed ticket against its ticket body and its worker review package. That package must
|
|
71
|
+
include tracked, staged, unstaged and task-owned untracked files from the recorded worker base. Run the
|
|
72
|
+
ticket's required verification, then use `skills/code-review/SKILL.md`; the ticket is the Spec source.
|
|
73
|
+
2. For each ticket that passes, generate an applyable binary patch from its recorded worker base. Record
|
|
74
|
+
task-owned untracked files before and after dispatch, then append a `git diff --binary --no-index`
|
|
75
|
+
patch for every new untracked file. Apply both tracked and untracked patches with a three-way apply to
|
|
76
|
+
the controller-owned integration worktree. Never copy files between worktrees.
|
|
77
|
+
3. Confirm every applied tracked and task-owned untracked file is present in the integration worktree, run
|
|
78
|
+
`git diff --check`, and run the ticket's integration-sensitive verification. An apply conflict or
|
|
79
|
+
regression keeps that ticket `in-progress`; do not resolve it or silently discard its worker diff.
|
|
80
|
+
4. After every selected ticket is integrated, use `skills/code-review/SKILL.md` against the complete
|
|
81
|
+
integration worktree package from the common base. Include its tracked, staged, unstaged and
|
|
82
|
+
task-owned untracked files, and give every selected ticket body as the combined Spec source. Then run
|
|
83
|
+
the combined verification required by the selected tickets. Do not resolve any selected ticket until
|
|
84
|
+
this integrate-and-verify gate passes.
|
|
85
|
+
5. Update a local tracker only for integrated tickets that pass the gate. External claim, comment or close
|
|
86
|
+
operations still require the confirmation specified by `implement`.
|
|
87
|
+
6. Refresh the graph after every resolve and return it to the router. The router may select the next
|
|
88
|
+
topology only for frontier tickets that remain inside the same user-authorized delivery scope.
|
|
89
|
+
|
|
90
|
+
## Boundaries
|
|
91
|
+
|
|
92
|
+
- One fresh subagent owns one ticket and one separate worktree.
|
|
93
|
+
- Do not generate a detailed implementation plan or depend on file-by-file instructions.
|
|
94
|
+
- Do not parallelize tickets with a real dependency, overlapping files, shared migrations or shared external
|
|
95
|
+
side effects.
|
|
96
|
+
- Do not auto-commit, push, open a PR or close an external Issue. A topology choice does not authorize
|
|
97
|
+
external tracker mutation or a new product scope.
|
|
98
|
+
- Keep the integration worktree and its uncommitted, task-owned diff as the handoff target until the user
|
|
99
|
+
separately authorizes commit, push, PR or cleanup.
|
|
100
|
+
|
|
101
|
+
## Example
|
|
102
|
+
|
|
103
|
+
Tickets `01` and `02` are both unblocked and modify different packages. The router selects SDD, creates one
|
|
104
|
+
integration worktree plus two worker worktrees, then dispatches two fresh subagents. Each implements and
|
|
105
|
+
verifies only its own ticket. Review both worker diffs, apply passing diffs to the integration worktree, and
|
|
106
|
+
run the combined gate before resolving either ticket or returning the unlocked frontier to the router.
|
|
@@ -1,59 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: systematic-debugging
|
|
3
|
-
description:
|
|
3
|
+
description: Diagnose bugs, recurring or flaky failures, slowness, and performance regressions; exclude expected TDD RED.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Systematic Debugging
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## 分级入口
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- 已确认失败原因正确的预期 TDD RED:回到实现的 GREEN,不加载完整诊断参考。
|
|
11
|
+
- 原因已由错误信息和调用链证实的普通失败:最小修复并重跑对应验证,不制造多个假设。
|
|
12
|
+
- 根因不明、修复后仍重复失败、flaky 或性能回归:进入完整诊断。先取得可重复的反馈,
|
|
13
|
+
再读取 `references/diagnosing-bugs.upstream.md`,按其中适用阶段执行;跳过不适用阶段时记录依据。
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
Do not propose or apply a fix until Phase 1 identifies a credible root cause and Phase 3 has tested the hypothesis with the smallest useful check.
|
|
14
|
-
</HARD-GATE>
|
|
15
|
+
所有路径都保留原始症状和修复后的验证证据。不能把非目标错误当作预期 RED,也不能跳过真实失败。
|
|
15
16
|
|
|
16
|
-
##
|
|
17
|
+
## 项目运行适配
|
|
17
18
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
- Identify what changed recently and which boundary it crosses.
|
|
22
|
-
|
|
23
|
-
Output: one sentence naming the likely root cause and the evidence for it.
|
|
24
|
-
|
|
25
|
-
## Phase 2: Pattern Analysis
|
|
26
|
-
|
|
27
|
-
- Check whether the same pattern appears elsewhere in the codebase.
|
|
28
|
-
- Compare against nearby working implementations.
|
|
29
|
-
- Decide whether this is a local bug, contract mismatch, missing test, environment issue, or design gap.
|
|
30
|
-
|
|
31
|
-
Output: the smallest affected scope and any similar files that should or should not change.
|
|
32
|
-
|
|
33
|
-
## Phase 3: Hypothesis Test
|
|
34
|
-
|
|
35
|
-
- Form one falsifiable hypothesis.
|
|
36
|
-
- Run or add the smallest diagnostic check that can prove or disprove it.
|
|
37
|
-
- If the hypothesis fails, return to Phase 1 with the new evidence.
|
|
38
|
-
- After two failed fix hypotheses, stop and reassess the design before trying another fix.
|
|
39
|
-
|
|
40
|
-
Output: confirmed hypothesis or reason for returning to investigation.
|
|
41
|
-
|
|
42
|
-
## Phase 4: Fix And Verify
|
|
43
|
-
|
|
44
|
-
- Add or update the failing test first when the project has a suitable test path.
|
|
45
|
-
- Apply one focused fix at the source of the root cause.
|
|
46
|
-
- Run the failing test or reproduction command.
|
|
47
|
-
- Run the task's required verification from the plan.
|
|
48
|
-
- Remove diagnostic logging or temporary probes.
|
|
49
|
-
|
|
50
|
-
Output: root cause, fix summary, commands run, result, and remaining risk.
|
|
51
|
-
|
|
52
|
-
## Return To Plan
|
|
53
|
-
|
|
54
|
-
After the fix is verified, return to the original task:
|
|
55
|
-
|
|
56
|
-
- Re-run the task's normal test command.
|
|
57
|
-
- Re-run requirement/spec compliance review.
|
|
58
|
-
- Re-run code quality review.
|
|
59
|
-
- Only then mark the task complete.
|
|
19
|
+
上游六阶段原文及 `scripts/hitl-loop.template.sh` 作为上游原始 Bash 模板留档,保持原样。
|
|
20
|
+
当上游原文提到 HITL Bash 或 `.sh` 路径时,项目实际运行一律替换为
|
|
21
|
+
`scripts/hitl-loop.template.js`。它是 HITL 的唯一运行入口;不要执行留档的 Bash 模板。
|