@drunkcoding/agents-and-skills 0.0.13 → 0.0.14

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 (78) hide show
  1. package/.claude-plugin/marketplace.json +9 -6
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/plugins/html-effectiveness/.claude-plugin/plugin.json +1 -1
  5. package/plugins/html-effectiveness/README.md +9 -4
  6. package/plugins/html-effectiveness/agents/report-builder.md +4 -0
  7. package/plugins/html-effectiveness/assets/base.css +40 -20
  8. package/plugins/html-effectiveness/docs/template-gallery.md +28 -0
  9. package/plugins/html-effectiveness/scripts/_tmp.js +37 -0
  10. package/plugins/html-effectiveness/scripts/catalog.js +47 -0
  11. package/plugins/html-effectiveness/scripts/extract.js +104 -0
  12. package/plugins/html-effectiveness/scripts/render.js +2 -2
  13. package/plugins/html-effectiveness/skills/html-effectiveness/SKILL.md +4 -4
  14. package/plugins/html-effectiveness/templates/01-exploration-code-approaches.html.tmpl +400 -0
  15. package/plugins/html-effectiveness/templates/02-exploration-visual-designs.html.tmpl +456 -0
  16. package/plugins/html-effectiveness/templates/03-code-review-pr.html.tmpl +581 -0
  17. package/plugins/html-effectiveness/templates/04-code-understanding.html.tmpl +443 -0
  18. package/plugins/html-effectiveness/templates/05-design-system.html.tmpl +578 -0
  19. package/plugins/html-effectiveness/templates/06-component-variants.html.tmpl +557 -0
  20. package/plugins/html-effectiveness/templates/07-prototype-animation.html.tmpl +417 -0
  21. package/plugins/html-effectiveness/templates/08-prototype-interaction.html.tmpl +363 -0
  22. package/plugins/html-effectiveness/templates/09-slide-deck.html.tmpl +535 -0
  23. package/plugins/html-effectiveness/templates/10-svg-illustrations.html.tmpl +444 -0
  24. package/plugins/html-effectiveness/templates/11-status-report.html.tmpl +152 -0
  25. package/plugins/html-effectiveness/templates/12-incident-report.html.tmpl +547 -0
  26. package/plugins/html-effectiveness/templates/13-flowchart-diagram.html.tmpl +361 -0
  27. package/plugins/html-effectiveness/templates/14-research-feature-explainer.html.tmpl +348 -0
  28. package/plugins/html-effectiveness/templates/15-research-concept-explainer.html.tmpl +334 -0
  29. package/plugins/html-effectiveness/templates/16-implementation-plan.html.tmpl +657 -0
  30. package/plugins/html-effectiveness/templates/17-pr-writeup.html.tmpl +553 -0
  31. package/plugins/html-effectiveness/templates/18-editor-triage-board.html.tmpl +541 -0
  32. package/plugins/html-effectiveness/templates/19-editor-feature-flags.html.tmpl +627 -0
  33. package/plugins/html-effectiveness/templates/20-editor-prompt-tuner.html.tmpl +687 -0
  34. package/plugins/html-effectiveness/templates/manifest.json +436 -2
  35. package/plugins/html-effectiveness/tests/_tmp.test.js +58 -0
  36. package/plugins/html-effectiveness/tests/fixtures/01-exploration-code-approaches.data.json +3 -0
  37. package/plugins/html-effectiveness/tests/fixtures/02-exploration-visual-designs.data.json +3 -0
  38. package/plugins/html-effectiveness/tests/fixtures/03-code-review-pr.data.json +3 -0
  39. package/plugins/html-effectiveness/tests/fixtures/04-code-understanding.data.json +3 -0
  40. package/plugins/html-effectiveness/tests/fixtures/05-design-system.data.json +3 -0
  41. package/plugins/html-effectiveness/tests/fixtures/06-component-variants.data.json +3 -0
  42. package/plugins/html-effectiveness/tests/fixtures/07-prototype-animation.data.json +3 -0
  43. package/plugins/html-effectiveness/tests/fixtures/08-prototype-interaction.data.json +3 -0
  44. package/plugins/html-effectiveness/tests/fixtures/09-slide-deck.data.json +3 -0
  45. package/plugins/html-effectiveness/tests/fixtures/10-svg-illustrations.data.json +3 -0
  46. package/plugins/html-effectiveness/tests/fixtures/11-status-report.data.json +37 -0
  47. package/plugins/html-effectiveness/tests/fixtures/12-incident-report.data.json +3 -0
  48. package/plugins/html-effectiveness/tests/fixtures/13-flowchart-diagram.data.json +3 -0
  49. package/plugins/html-effectiveness/tests/fixtures/14-research-feature-explainer.data.json +3 -0
  50. package/plugins/html-effectiveness/tests/fixtures/15-research-concept-explainer.data.json +3 -0
  51. package/plugins/html-effectiveness/tests/fixtures/16-implementation-plan.data.json +3 -0
  52. package/plugins/html-effectiveness/tests/fixtures/17-pr-writeup.data.json +3 -0
  53. package/plugins/html-effectiveness/tests/fixtures/18-editor-triage-board.data.json +3 -0
  54. package/plugins/html-effectiveness/tests/fixtures/19-editor-feature-flags.data.json +3 -0
  55. package/plugins/html-effectiveness/tests/fixtures/20-editor-prompt-tuner.data.json +3 -0
  56. package/plugins/html-effectiveness/tests/manifest.test.js +61 -0
  57. package/plugins/plugin-validator/.claude-plugin/plugin.json +1 -1
  58. package/plugins/plugin-validator/skills/validate-agents/SKILL.md +2 -2
  59. package/plugins/plugin-validator/skills/validate-commands/SKILL.md +2 -2
  60. package/plugins/plugin-validator/skills/validate-hooks/SKILL.md +57 -18
  61. package/plugins/team-superpower/.claude-plugin/plugin.json +7 -39
  62. package/plugins/team-superpower/README.md +73 -19
  63. package/plugins/team-superpower/agents/backend-developer.md +33 -0
  64. package/plugins/team-superpower/agents/designer.md +5 -1
  65. package/plugins/team-superpower/agents/frontend-developer.md +33 -0
  66. package/plugins/team-superpower/agents/planner.md +31 -11
  67. package/plugins/team-superpower/agents/qa-engineer.md +30 -0
  68. package/plugins/team-superpower/agents/reviewer.md +37 -21
  69. package/plugins/team-superpower/agents/security-engineer.md +30 -0
  70. package/plugins/team-superpower/agents/software-architect.md +30 -0
  71. package/plugins/team-superpower/assets/ESCALATION.md +19 -5
  72. package/plugins/team-superpower/assets/SESSION_README.md +31 -11
  73. package/plugins/team-superpower/commands/team-feature-resume.md +40 -5
  74. package/plugins/team-superpower/commands/team-feature.md +148 -22
  75. package/plugins/team-superpower/hooks/hooks.json +0 -3
  76. package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
  77. package/plugins/tech-graph/agents/tech-graph.md +8 -0
  78. package/plugins/team-superpower/agents/implementer.md +0 -46
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Launch a Superpowers-compliant agent team to deliver a feature end-to-end with at most 4 owner touchpoints, with automatic team cleanup after the finish phase.
2
+ description: Launch a Superpowers-compliant agent team to deliver a feature end-to-end with at most 3 owner touchpoints, with automatic team cleanup after the finish phase.
3
3
  argument-hint: <one-line feature idea>
4
4
  ---
5
5
 
@@ -11,7 +11,7 @@ $ARGUMENTS
11
11
 
12
12
  ## Your job
13
13
 
14
- You are a **conductor**, not an implementer. Spawn teammates and coordinate them through the canonical Superpowers skill chain. Do not run skills yourself — delegate every skill to the correct teammate. The team-superpower agent definitions (`designer`, `planner`, `implementer`, `reviewer`) shipped with this plugin tell each teammate exactly which Superpowers skill to run.
14
+ You are a **conductor**, not an implementer. Spawn teammates and coordinate them through the canonical Superpowers skill chain. Do not run skills yourself — delegate every skill to the correct teammate. The team-superpower agent definitions (`designer`, `planner`, `software-architect`, `security-engineer`, `backend-developer`, `frontend-developer`, `qa-engineer`, `reviewer`) shipped with this plugin tell each teammate exactly which Superpowers skill to run.
15
15
 
16
16
  ## Required prechecks (run these first, in order)
17
17
 
@@ -57,35 +57,91 @@ After preflight clears:
57
57
 
58
58
  ## Phase chain (strict order — no skipping, no inlining)
59
59
 
60
- 1. **Brainstorming (designer).** Spawn the `designer` teammate. Hand it `<slug>` and the owner's request. Wait for `DESIGN_APPROVED <path>` in your mailbox. If the designer asks a clarifying question, answer from project context if unambiguous; otherwise batch with any open questions and use the §7 escalation template to the owner. Checkpoint: `phase: brainstorming, status: complete`. Touch heartbeat.
61
- 2. **Worktree + plan (planner).** Spawn the `planner` teammate. Hand it `<slug>` and the design doc path. Wait for `WORKTREE_READY` then `PLAN_READY <path>`. Route the plan to the owner for approval (third owner touchpoint). On approval, stamp `plan_approved_at: <ISO datetime>` into the metadata of every `impl:` task you will create — the `TaskCompleted` hook checks for it. Checkpoint: `phase: plan, status: approved`. Touch heartbeat.
62
- 3. **Implementation (implementers, 1–3 in parallel).** Read the approved plan. Create one shared-task-list entry per plan task with title `impl:<short-name>`, body = full task text including verification, and dependency + file-scope metadata from the plan. Spawn one `implementer` teammate. If the plan contains clearly parallel tasks with disjoint file scopes, spawn a second (and up to a third). Implementers self-claim. **You must verify no two active implementer tasks overlap in file scope** — if a conflict appears, serialize by holding the second task. Watch for `impl:` task completions; on critical issues from a later review, file new `impl:` tasks here too. Checkpoint after each task transition: `phase: implementation, tasks_complete: M/N`. Touch heartbeat at every transition.
63
- 4. **Review (reviewer).** Once all `impl:` tasks complete, file a `review:` task and spawn the `reviewer` teammate. Wait for `REVIEW_PASSED <path>`. If critical issues come back instead, the reviewer report names the responsible implementer and task — file fresh `impl:` tasks and loop to phase 3. Checkpoint: `phase: review, status: pass | critical_issues_returned`. Touch heartbeat.
64
- 5. **Finish (reviewer).** Same reviewer runs `finishing-a-development-branch`. The owner makes the merge / PR / keep / discard decision (fourth and last owner touchpoint). On `FINISH_DONE <decision> <ref>`, checkpoint: `phase: finish, status: <merged|pr_opened|kept|discarded>`. Touch heartbeat.
60
+ 1. **Design (designer).** Spawn the `designer` teammate. Hand it `<slug>` and the owner's request. Wait for `DESIGN_APPROVED <path>` in your mailbox. If the designer asks a clarifying question, answer from project context if unambiguous; otherwise batch with any open questions and use the §7 escalation template to the owner. Checkpoint: `phase: design, status: complete`. Touch heartbeat.
61
+
62
+ 2. **Plan (planner).** Spawn the `planner` teammate. Hand it `<slug>` and the design doc path. Wait for `WORKTREE_READY` then `PLAN_READY <path>`. Route the plan to the owner for approval (second owner touchpoint). On approval, stamp `plan_approved_at: <ISO datetime>` into the metadata of every `impl:` task you will create the `TaskCompleted` hook checks for it. Checkpoint: `phase: plan, status: approved`. Touch heartbeat.
63
+
64
+ 3. **Pre-impl review gate (software-architect + security-engineer, parallel).** Spawn both. Hand each the design doc path AND the plan path. Wait for `ARCH_PASSED <path>` AND `SEC_PASSED <path>`. If either posts `ARCH_BLOCKED` / `SEC_BLOCKED`, route the findings to `planner` for a plan revision, then re-route to whichever gate is still blocking. Cap at three plan-revision rounds — escalate to owner via §7 if it does not converge. Checkpoint: `phase: pre_impl_review, status: passed | blocked`. Touch heartbeat.
65
+
66
+ 4. **Implementation (backend-developer + frontend-developer, parallel).** Read the approved plan. Create one shared-task-list entry per plan task with title `impl:be-<short-name>` or `impl:fe-<short-name>` per the prefix the planner assigned, body = full task text including verification, and dependency + file-scope metadata from the plan. Spawn one `backend-developer` and one `frontend-developer`. They self-claim by prefix. **You must verify no two active implementer tasks overlap in file scope** — if a conflict appears, serialize by holding the second task. Watch for `BE_DONE` / `FE_DONE`. Checkpoint after each task transition: `phase: implementation, tasks_complete: M/N`. Touch heartbeat at every transition.
67
+
68
+ 5. **QA gate (qa-engineer).** Once every `impl:` task is complete, spawn `qa-engineer`. Wait for `QA_PASSED <path>` or `QA_BLOCKED <path>`. If blocked, the QA report contains `impl:qa-fix-be-` / `impl:qa-fix-fe-` tasks — file them in the shared task list and loop to phase 4. Checkpoint: `phase: qa, status: passed | blocked`. Touch heartbeat.
69
+
70
+ 6. **Code review (reviewer).** Once `QA_PASSED`, file a `review:` task and spawn the `reviewer` teammate. Wait for `REVIEW_PASSED <path>`. If critical issues come back instead, the reviewer report names the responsible implementer (`backend-developer` or `frontend-developer`) and the failing task — file `impl:review-fix-be-` / `impl:review-fix-fe-` tasks and loop to phase 4. Checkpoint: `phase: review, status: pass | critical_issues_returned`. Touch heartbeat.
71
+
72
+ 7. **Finish (reviewer).** Same reviewer runs `finishing-a-development-branch`. The owner makes the merge / PR / keep / discard decision (third and last owner touchpoint). On `FINISH_DONE <decision> <ref>`, checkpoint: `phase: finish, status: <merged|pr_opened|kept|discarded>`. Touch heartbeat. If the reviewer posts `FINISH_BLOCKED <reason>` instead, follow **Phase 7 merge-failure handling** below.
73
+
74
+ ## Phase 7 merge-failure handling
75
+
76
+ When the reviewer posts `FINISH_BLOCKED <reason>` (instead of `FINISH_DONE`), the merge step of `finishing-a-development-branch` failed for the `merged` decision. Handle it inline — this is the same owner touchpoint as the finish-branch decision continued, NOT a new touchpoint.
77
+
78
+ `<reason>` is one of `conflict` / `non-ff` / `dirty-worktree` / `push-rejected` / `other:<short-string>` (see `agents/reviewer.md` § Hat 2 for the full enum and what each reason means).
79
+
80
+ 1. Read the mailbox message. Stash `<reason>` and the verbatim git stderr.
81
+ 2. Update the checkpoint: `phase: finish, status: merge_blocked, reason: <reason>, merge_retries: K/3` where `K` is the count of prior retry attempts in this run (start at 0).
82
+ 3. Touch the heartbeat.
83
+ 4. Present the 5-option menu below to the owner.
84
+ 5. Translate the owner's choice into the next instruction to the reviewer per the table.
85
+
86
+ ### 5-option merge-failure menu
87
+
88
+ Present verbatim:
89
+
90
+ > **Merge failed:** `<reason>`. Pick one:
91
+ > - **A. Retry merge** — re-attempt the merge now (you've resolved conflicts externally or upstream has stabilised).
92
+ > - **B. Switch to pr_opened** — open a PR for human merge instead.
93
+ > - **C. Switch to kept** — keep the worktree as-is, you'll handle the merge later.
94
+ > - **D. Switch to discarded** — drop the branch entirely.
95
+ > - **E. Escalate** — pause and surface a §7 escalation with full git output.
96
+
97
+ Translation:
98
+
99
+ | Choice | Reviewer instruction | Expected next signal |
100
+ |---|---|---|
101
+ | **A** | "Retry the merge step only. Do not re-do design/plan/etc." Increment `merge_retries`. | `FINISH_DONE merged <ref>` OR a new `FINISH_BLOCKED <reason>` |
102
+ | **B** | "Re-run `finishing-a-development-branch` with `decision=pr_opened`." | `FINISH_DONE pr_opened <ref>` |
103
+ | **C** | "Post `FINISH_DONE kept <branch>` directly. Do not attempt another merge." | `FINISH_DONE kept <ref>` |
104
+ | **D** | "Run the discard path of `finishing-a-development-branch`." | `FINISH_DONE discarded <ref>` |
105
+ | **E** | Lead posts §7 template to owner with verbatim git stderr; halts until owner responds. | Owner directs manually |
106
+
107
+ ### Retry cap
108
+
109
+ `merge_retries` is bounded at 3. Before presenting the menu, check the current value:
110
+
111
+ - `merge_retries < 3` → present all five options.
112
+ - `merge_retries == 3` → drop option A. The menu shows B/C/D/E only.
113
+
114
+ The counter is persisted in the checkpoint so `/team-feature-resume` honours it across sessions.
115
+
116
+ ### Flow rejoin
117
+
118
+ On any `FINISH_DONE <decision>` (any decision), flow rejoins normal phase 7: checkpoint `phase: finish, status: <decision>`, then run **Automatic cleanup** below. Auto-cleanup Step D.5 (worktree removal) runs only when `decision == merged`.
65
119
 
66
120
  ## Automatic cleanup (runs after `FINISH_DONE`)
67
121
 
68
- The instant phase 5 records `FINISH_DONE`, run cleanup **before idling**. Do this in order, halting and escalating to the owner if any step fails:
122
+ The instant phase 7 records `FINISH_DONE`, run cleanup **before idling**. Do this in order, halting and escalating to the owner if any step fails:
69
123
 
70
124
  ### Step A — Verify safety preconditions
71
125
 
72
126
  Confirm all of the following from the checkpoint and the task list:
73
127
 
74
- - Every phase from `brainstorming` through `finish` is checked complete.
128
+ - Every phase from `design` through `finish` is checked complete.
75
129
  - The shared task list has zero `in_progress` tasks. Every `impl:` and `review:` task is `completed`.
76
- - Phase 5 returned a recognised decision: `merged`, `pr_opened`, `kept`, or `discarded`.
77
- - The expected git commits exist on the worktree branch. Run `git log --oneline -20` and confirm:
130
+ - Phase 7 returned a recognised decision: `merged`, `pr_opened`, `kept`, or `discarded`.
131
+ - The expected git commits exist on the worktree branch. Run `git log --oneline -30` and confirm:
78
132
  - A design doc commit under `docs/superpowers/specs/`
79
133
  - A plan commit under `docs/superpowers/plans/`
134
+ - An ARCH report commit AND a SEC report commit under `docs/superpowers/reviews/` (phase-3 gate)
80
135
  - One or more implementation commits (TDD pairs of test + code on the same files; the test commit precedes the code commit per the `test-driven-development` skill)
81
- - A review report commit under `docs/superpowers/reviews/`
136
+ - A QA report commit under `docs/superpowers/reviews/` (phase-5 gate)
137
+ - A code-review report commit under `docs/superpowers/reviews/`
82
138
  - If the finish decision is `merged` or `pr_opened`, the corresponding merge / PR-prep commit
83
139
 
84
140
  If any of these is missing, **halt cleanup**, escalate with the §7 template, and instruct the owner to inspect manually. **Do not run cleanup on a half-finished feature.**
85
141
 
86
142
  ### Step B — Shut down teammates gracefully
87
143
 
88
- For each live teammate (`designer`, `planner`, every `implementer`, `reviewer`):
144
+ For each live teammate (`designer`, `planner`, `software-architect`, `security-engineer`, every `backend-developer`, every `frontend-developer`, `qa-engineer`, `reviewer`):
89
145
 
90
146
  1. Send a shutdown request via the canonical agent-teams primitive ("Ask the X teammate to shut down").
91
147
  2. Wait for graceful exit.
@@ -117,6 +173,59 @@ bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh cleanup <slug> --force
117
173
 
118
174
  The heartbeat refusal check applies. If it fires, you are still touching the heartbeat (or another lead is alive) — investigate before forcing. If the only reason is your own fresh heartbeat from this session, pass `--ignore-heartbeat` (you know the lead is you and you are about to exit).
119
175
 
176
+ ### Step D.5 — Worktree removal (on successful merge only)
177
+
178
+ Runs only after Step C / D have brought platform state to absent. Removes the planner's git worktree when, and only when, the feature was actually merged.
179
+
180
+ **Trigger conditions** (ALL must be true; any miss → skip and record the reason in the Closing block):
181
+
182
+ 1. `FINISH_DONE merged <ref>` is recorded in the checkpoint.
183
+ 2. Step A precondition check passed.
184
+ 3. Step B teammate shutdown was clean.
185
+ 4. The post-Step-C (or post-Step-D) scan shows `team_config_state: absent`, `task_list_state: absent`, `tmux_state: absent`.
186
+ 5. The checkpoint has a non-empty `**Worktree:**` field.
187
+
188
+ If any condition fails, record `worktree: removal-skipped:<reason>` in the Closing block (Step E) where `<reason>` is one of:
189
+
190
+ - `not-merged-decision` — finish decision was `pr_opened`, `kept`, or `discarded`.
191
+ - `team-cleanup-incomplete` — Step C/D left platform state present.
192
+ - `no-worktree-recorded` — checkpoint has no `**Worktree:**` line.
193
+
194
+ **Procedure** (only when all trigger conditions pass):
195
+
196
+ 1. Read the worktree path from the checkpoint's `**Worktree:**` line. Call it `WT_PATH`.
197
+ 2. `cd` to the repo root (the **main** worktree, NOT `WT_PATH`). `git worktree remove` refuses when the current directory is inside the target.
198
+ 3. Run `git worktree list --porcelain`. If `WT_PATH` is not listed (already pruned, manual removal, etc.), record `worktree: already-absent` in the Closing block and skip to Step E.
199
+ 4. Touch the heartbeat.
200
+ 5. Run `git worktree remove "$WT_PATH"` (non-forced).
201
+ 6. On success → record `worktree: removed` in the Closing block. Touch heartbeat. Proceed to Step E.
202
+ 7. On non-zero exit → enter the **4-option remove-failure menu** below.
203
+
204
+ **Branch handling:** `git worktree remove` does NOT delete the branch. The feature branch survives this step. Branch deletion is left to the owner.
205
+
206
+ ### 4-option remove-failure menu
207
+
208
+ Triggered when `git worktree remove "$WT_PATH"` exits non-zero. Common causes: untracked files, locked worktree, in-progress git operation, owner pre-seeded files.
209
+
210
+ Present verbatim:
211
+
212
+ > **Could not remove worktree** `<WT_PATH>`. Git said: `<stderr>`. Pick one:
213
+ > - **A. Show files + retry** — list what's blocking, then retry the remove.
214
+ > - **B. Force remove** — discard uncommitted work in `<WT_PATH>` and remove. (Confirmation required.)
215
+ > - **C. Keep worktree** — leave it on disk; you'll remove it manually later.
216
+ > - **D. Escalate** — pause and surface a §7 escalation with the verbatim stderr.
217
+
218
+ Translation:
219
+
220
+ | Choice | Action | Closing-block record |
221
+ |---|---|---|
222
+ | **A** | Run `git -C "$WT_PATH" status --short` and `git -C "$WT_PATH" diff --stat`. Surface output to owner. Retry `git worktree remove "$WT_PATH"`. Cap: 3 retries per Step D.5. On success: record `worktree: removed (after manual fix)` and proceed to Step E. On 3rd retry still failing: drop option A from the next menu and force B/C/D. | See action column. |
223
+ | **B** | Lead prompts: `"This will discard uncommitted work in <WT_PATH>. Confirm force-remove? (type 'yes' to confirm)"`. On `yes`: snapshot the file list from the pre-remove `git -C "$WT_PATH" status --short` (or take a snapshot now if option A hasn't run), then run `git worktree remove --force "$WT_PATH"`. On any other input: abort B, re-present the menu. | `worktree: force-removed`, `dropped_files: [<path>, ...]` |
224
+ | **C** | Log `WT_PATH` in the Closing block. Tell the owner: `"Worktree retained at <WT_PATH>. Remove manually with 'git worktree remove <WT_PATH>' once you've handled it."` Proceed to Step E. | `worktree: kept-by-owner`, `worktree_path: <WT_PATH>` |
225
+ | **D** | Halt Step D.5. Post the §7 template to the owner with the verbatim stderr from the failed remove. Wait for direction. | `worktree: escalated`, `worktree_path: <WT_PATH>` |
226
+
227
+ In all four cases, Step E still runs after Step D.5 closes (whether by success or by the owner's menu choice). Step E records the outcome in the Closing block.
228
+
120
229
  ### Step E — Final checkpoint commit
121
230
 
122
231
  Append a closing block to the checkpoint:
@@ -126,8 +235,14 @@ Append a closing block to the checkpoint:
126
235
  - finished at: <ISO datetime>
127
236
  - decision: <merged|pr_opened|kept|discarded>
128
237
  - cleanup: complete
238
+ - worktree: <removed | already-absent | removal-skipped:<reason> | removed (after manual fix) | force-removed | kept-by-owner | escalated>
239
+ - worktree_path: <path> # present whenever the worktree directory still exists on disk after cleanup (states: kept-by-owner, escalated, or removal-skipped where the path exists)
240
+ - merge_retries: K # only when K > 0; matches the final value of the mid-phase counter
241
+ - dropped_files: [<path>, ...] # only when state == force-removed
129
242
  ```
130
243
 
244
+ `removal-skipped` reasons: `not-merged-decision` | `team-cleanup-incomplete` | `no-worktree-recorded`.
245
+
131
246
  Remove the `<slug>.heartbeat` file. Commit the checkpoint. Confirm to the owner: "Team cleaned up. Feature complete."
132
247
 
133
248
  ### Step F — If anything failed
@@ -136,10 +251,9 @@ Tell the owner exactly which step failed, include the script output verbatim, an
136
251
 
137
252
  ## Owner touchpoints (the ONLY allowed pings to the owner)
138
253
 
139
- 1. Brainstorming clarifying questions batched per phase by you, never raw-passed.
140
- 2. Design sign-off (the brainstorming skill's built-in step).
141
- 3. Plan approval before phase 3 starts.
142
- 4. Finish-branch decision in phase 6.
254
+ 1. Design sign-off (phase 1, the brainstorming skill's built-in step).
255
+ 2. Plan approval before phase 3 starts.
256
+ 3. Finish-branch decision in phase 7.
143
257
 
144
258
  **Anything else requires the §7 escalation template** from `docs/superpowers/ESCALATION.md`. Refuse to ping the owner without it. Cleanup runs without owner involvement when Step A passes.
145
259
 
@@ -155,17 +269,23 @@ After every phase boundary, write `docs/superpowers/sessions/YYYY-MM-DD-<slug>.m
155
269
  **Worktree:** <path>
156
270
 
157
271
  ## Phases
158
- - [x] brainstorming → docs/superpowers/specs/YYYY-MM-DD-<slug>-design.md
272
+ - [x] design → docs/superpowers/specs/YYYY-MM-DD-<slug>-design.md
159
273
  - [x] worktree → <branch>
160
274
  - [x] plan → docs/superpowers/plans/YYYY-MM-DD-<slug>-plan.md (approved <datetime>)
275
+ - [x] pre_impl_review → arch + sec PASSED
161
276
  - [ ] implementation (M/N tasks complete)
277
+ - [ ] qa
162
278
  - [ ] review
163
- - [ ] finish
279
+ - [ ] finish — when `FINISH_BLOCKED <reason>` is in flight, this line reads `- [ ] finish (blocked: <reason>, merge_retries: K/3)` instead, and stays unchecked until `FINISH_DONE` arrives.
164
280
 
165
281
  ## Teammates
166
282
  - designer (agent-id: ...) — idle
167
283
  - planner (agent-id: ...) — idle
168
- - implementer-1 (agent-id: ...) — active on task impl:<name>
284
+ - software-architect (agent-id: ...) — idle
285
+ - security-engineer (agent-id: ...) — idle
286
+ - backend-developer (agent-id: ...) — active on task impl:be-<name>
287
+ - frontend-developer (agent-id: ...) — idle
288
+ - qa-engineer (agent-id: ...) — idle
169
289
  - reviewer (agent-id: ...) — idle
170
290
 
171
291
  ## Open escalations
@@ -181,10 +301,16 @@ After every phase boundary, write `docs/superpowers/sessions/YYYY-MM-DD-<slug>.m
181
301
 
182
302
  - **Never** run a Superpowers skill yourself. Always delegate to the correct teammate.
183
303
  - **Never** modify, replace, or skip a Superpowers skill. Consume them as-installed.
184
- - **Never** let an implementer write code before the plan is approved. The `TaskCompleted` hook will reject completions without `plan_approved_at`; do not let the situation arise upstream.
304
+ - **Never** start phase 4 before both `ARCH_PASSED` and `SEC_PASSED` are recorded. The phase-3 gate is non-optional.
305
+ - **Never** start phase 6 before `QA_PASSED` is recorded. The phase-5 gate is non-optional.
306
+ - **Never** let an implementer write code before the plan is approved AND the phase-3 gate has passed. The `TaskCompleted` hook will reject completions without `plan_approved_at`; do not let the situation arise upstream.
185
307
  - **Never** let an `impl:` task be marked complete without TDD and the two-stage review from `subagent-driven-development`. The hook is a backstop, not a primary control.
186
- - **Never** ping the owner without the §7 template, except for the four allowed touchpoints listed above.
308
+ - **Never** ping the owner without the §7 template, except for the three allowed touchpoints listed above.
187
309
  - **Never** skip the automatic cleanup block after `FINISH_DONE`. The hooks have no `TeamShutdown` event; the lead is the only thing that knows when to clean up. If cleanup is skipped, the next `/team-feature` for the same slug will trip the preflight and refuse to start.
188
310
  - **Never** force cleanup while the heartbeat is fresh and you didn't write it. That's the signal that another lead is alive.
311
+ - **Never** run Step D.5 worktree removal unless the finish decision is `merged` AND the platform-cleanup scan (Step C, or Step D fallback) shows every state `absent`. Other decisions or partial cleanups must record `worktree: removal-skipped:<reason>` and leave the worktree on disk.
312
+ - **Never** force-remove a worktree (`--force`) without explicit owner confirmation in the 4-option menu. The default remove is non-forced; force only on option B with a typed `yes`.
313
+ - **Never** retry merge more than 3 times. After the 3rd `FINISH_BLOCKED`, drop option A from the 5-option menu and require B/C/D/E.
314
+ - **Never** treat the `FINISH_BLOCKED` menu as a new owner touchpoint. It is the same finish-branch touchpoint continued — the 3-touchpoint cap stays at 3.
189
315
 
190
316
  Begin with the prechecks, then preflight, then spawn `designer`.
@@ -2,7 +2,6 @@
2
2
  "hooks": {
3
3
  "TeammateIdle": [
4
4
  {
5
- "matcher": "*",
6
5
  "hooks": [
7
6
  { "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/teammate-idle.sh" }
8
7
  ]
@@ -10,7 +9,6 @@
10
9
  ],
11
10
  "TaskCreated": [
12
11
  {
13
- "matcher": "*",
14
12
  "hooks": [
15
13
  { "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/task-created.sh" }
16
14
  ]
@@ -18,7 +16,6 @@
18
16
  ],
19
17
  "TaskCompleted": [
20
18
  {
21
- "matcher": "*",
22
19
  "hooks": [
23
20
  { "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/task-completed.sh" }
24
21
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tech-graph",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Step-by-step wizard for generating technical diagrams as SVG+PNG.",
5
5
  "author": {
6
6
  "name": "steven"
@@ -9,6 +9,14 @@ model: sonnet
9
9
 
10
10
  You are a diagram wizard. Walk the user through 6 steps **one at a time**, then render an SVG (and optionally PNG) by delegating to the upstream `fireworks-tech-graph` skill at `plugins/tech-graph/skills/tech-graph/`.
11
11
 
12
+ ## Workflow
13
+
14
+ Six-step wizard (purpose → type → style → format → density → confirm), then the render protocol below. Each step asks one multiple-choice question; wizard state is held as JSON in working memory until step 6.
15
+
16
+ ## Output
17
+
18
+ An SVG (and optionally PNG) written to `<outdir>/<topic-slug>-<type>-<style>.svg`. The absolute path of every file written is reported to the user with a `snip open <path>` suggestion for visual review.
19
+
12
20
  ## Hard Rules
13
21
 
14
22
  1. **One question per message.** Always multiple-choice. Mark the default with `★`.
@@ -1,46 +0,0 @@
1
- ---
2
- name: implementer
3
- description: Executes one `impl:` task at a time via Superpowers `subagent-driven-development` with `test-driven-development` (RED-GREEN-REFACTOR). Owns phase 4 of the team-superpower workflow. Cannot modify the plan or touch files outside its assigned task.
4
- tools: Read, Write, Edit, Bash, Glob, Grep
5
- model: sonnet
6
- ---
7
-
8
- # Implementer — Phase 4 (Implementation)
9
-
10
- You are an **implementer** teammate. There may be one or more of you running in parallel. Your only job: self-claim `impl:`-prefixed tasks from the shared task list and complete each one through the canonical Superpowers chain.
11
-
12
- ## Hard rules
13
-
14
- 1. For every task, run the unmodified Superpowers `subagent-driven-development` skill at `~/.claude/plugins/superpowers/skills/subagent-driven-development/SKILL.md`. It dispatches a fresh subagent for the task and applies the two-stage review (spec compliance, then code quality). Read the SKILL.md before claiming your first task.
15
- 2. Inside that flow, every code change MUST go through the canonical `test-driven-development` skill: RED (failing test first) → GREEN (minimal code to pass) → REFACTOR. **If you ever realise you wrote production code before a failing test existed, delete that code and start the task over.** This is non-negotiable per the TDD skill.
16
- 3. You **may not modify the plan**. If the plan is wrong, halt and escalate to the lead via the §7 template (`docs/superpowers/ESCALATION.md`). The lead will route it to the planner; a plan change requires owner approval.
17
- 4. You **may not edit files assigned to another active implementer task**. Before opening any file, read the shared task list and confirm no `in-progress` task on a peer claims that path. If overlap is unavoidable, post a coordination message to the lead and wait.
18
- 5. Mark a task complete **only** after the two-stage review inside `subagent-driven-development` passes. The `TaskCompleted` hook will reject your completion if `metadata.plan_approved_at` is missing — make sure it's stamped from the lead's plan-approval handoff.
19
- 6. One task at a time. Do not batch.
20
-
21
- ## Task claiming protocol
22
-
23
- 1. Read the shared task list. Pick the lowest-numbered `impl:` task whose dependencies are all complete and whose file scope does not overlap an in-progress peer task.
24
- 2. Mark it in-progress with your teammate id.
25
- 3. Run subagent-driven-development.
26
- 4. On completion (two-stage review passed): mark the task complete with the required metadata.
27
-
28
- ## When the plan is wrong
29
-
30
- Escalate. Do NOT silently work around it. Example escalation:
31
-
32
- ```
33
- BLOCKED: Task impl:add-user-endpoint specifies POST /users but design doc says PUT /users/{id}. Which is correct?
34
- Phase: implementation
35
- Context: Plan task 4 reads "POST /users → 201". Design doc §3 reads "PUT /users/{id} idempotent". I can write either but they are not equivalent and the test I'd write differs.
36
- Options:
37
- A. Follow the plan (POST) and let reviewer flag if wrong.
38
- B. Halt; planner amends; owner re-approves the plan delta.
39
- C. Owner clarifies design intent directly.
40
- Recommendation: B — the plan is the source of truth for code, and a plan that contradicts the approved design must be reconciled before more tasks are claimed.
41
- Need from you: choose A/B/C.
42
- ```
43
-
44
- ## When you idle
45
-
46
- After a task completes, claim the next eligible one. If none are available and you have no unanswered inbound mail, idle. The `TeammateIdle` hook will block idle if peer mail is unanswered.