@drunkcoding/agents-and-skills 0.0.19 → 0.0.24

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 (30) hide show
  1. package/.claude-plugin/marketplace.json +5 -5
  2. package/package.json +1 -1
  3. package/plugins/auto-power/.claude-plugin/plugin.json +1 -1
  4. package/plugins/html-effectiveness/.claude-plugin/plugin.json +1 -1
  5. package/plugins/plugin-validator/.claude-plugin/plugin.json +1 -1
  6. package/plugins/team-superpower/.claude-plugin/plugin.json +1 -1
  7. package/plugins/team-superpower/README.md +186 -115
  8. package/plugins/team-superpower/agents/backend-developer.md +106 -74
  9. package/plugins/team-superpower/agents/feature-planner.md +66 -0
  10. package/plugins/team-superpower/agents/frontend-developer.md +109 -71
  11. package/plugins/team-superpower/agents/orchestrator.md +83 -0
  12. package/plugins/team-superpower/agents/qc-engineer.md +84 -0
  13. package/plugins/team-superpower/agents/security-engineer.md +79 -44
  14. package/plugins/team-superpower/agents/solution-architect.md +80 -0
  15. package/plugins/team-superpower/agents/team-leader.md +100 -0
  16. package/plugins/team-superpower/assets/CLAUDE.md.template +22 -18
  17. package/plugins/team-superpower/assets/ESCALATION.md +114 -66
  18. package/plugins/team-superpower/assets/SESSION_README.md +232 -159
  19. package/plugins/team-superpower/commands/team-feature.md +191 -645
  20. package/plugins/team-superpower/hooks/task-completed.sh +100 -182
  21. package/plugins/team-superpower/hooks/task-created.sh +55 -38
  22. package/plugins/team-superpower/hooks/teammate-idle.sh +118 -13
  23. package/plugins/team-superpower/scripts/team-state.sh +106 -37
  24. package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
  25. package/plugins/team-superpower/agents/designer.md +0 -65
  26. package/plugins/team-superpower/agents/planner.md +0 -242
  27. package/plugins/team-superpower/agents/qa-engineer.md +0 -103
  28. package/plugins/team-superpower/agents/reviewer.md +0 -175
  29. package/plugins/team-superpower/agents/software-architect.md +0 -60
  30. package/plugins/team-superpower/commands/team-feature-resume.md +0 -185
@@ -1,185 +0,0 @@
1
- ---
2
- description: Resume a team-superpower workflow from a committed checkpoint file in docs/superpowers/sessions/. Handles stale team state from a dead lead.
3
- argument-hint: <checkpoint-filename>
4
- ---
5
-
6
- You are the **lead** resuming an in-flight team-superpower workflow. `/resume` does not restore in-process teammates, so you reconstruct the team from the committed checkpoint and clean up any orphaned platform-side state along the way.
7
-
8
- Checkpoint argument:
9
-
10
- $ARGUMENTS
11
-
12
- ## Resume protocol (strict order)
13
-
14
- ### Step 1 — Locate the checkpoint
15
-
16
- If `$ARGUMENTS` is a bare filename, prefix `docs/superpowers/sessions/`. Read it. If it doesn't exist or fails to parse against the checkpoint format from `/team-feature`, halt and ask the owner to point you at the correct file.
17
-
18
- Extract `<slug>` from the checkpoint filename (`YYYY-MM-DD-<slug>.md`) and from the `**Team:**` line if present (`superpower-<slug>`). They must match.
19
-
20
- If the checkpoint has a `## Closing` block with `cleanup: complete`, halt: the feature already finished. Tell the owner.
21
-
22
- ### Step 2 — Verify environment
23
-
24
- Same prechecks as `/team-feature`:
25
- - Superpowers plugin installed
26
- - Claude Code ≥ 2.1.32
27
- - `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
28
-
29
- Halt on any failure.
30
-
31
- ### Step 2.5 — Superpowers version-pin check
32
-
33
- Read the checkpoint frontmatter (the YAML block between `---` markers at the top of the file). Extract `superpowers_version`. Read the currently-installed Superpowers version (`claude plugin list --json` → grep for `superpowers`). Compare:
34
-
35
- - **Versions match** → proceed.
36
- - **Versions differ** → halt and surface this 3-option menu to the owner:
37
-
38
- > **Superpowers version drifted** since this feature started:
39
- > - pinned in checkpoint: `<pinned>`
40
- > - currently installed: `<current>`
41
- >
42
- > Skill semantics may have shifted. Pick one:
43
- > - **A. Continue anyway** — accept the risk; semantics may differ mid-feature.
44
- > - **B. Roll back Superpowers** — owner runs `/plugin install superpowers@<pinned>` and re-runs `/team-feature-resume`. (Lead halts; cannot install plugins itself.)
45
- > - **C. Discard this feature** — halt resume; the owner manually cleans state via `/team-cleanup <slug>` and starts fresh.
46
-
47
- This is **not** counted as a touchpoint because it only happens on resume after a rare Superpowers update. On choice A, log `superpowers_pin_overridden: <pinned> → <current>` to the resume-log block; on choice B halt without changes; on choice C halt and instruct the owner to `/team-cleanup`.
48
-
49
- ### Step 3 — Preflight scan
50
-
51
- Run:
52
-
53
- ```bash
54
- bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh scan <slug>
55
- ```
56
-
57
- Decide based on the output:
58
-
59
- | Scan result | Interpretation | Action |
60
- |---|---|---|
61
- | All states `absent`, no heartbeat | Lead exited cleanly without auto-cleanup, or platform-side state was already wiped. | Proceed to Step 4 (fresh respawn). |
62
- | Team config `present`, heartbeat older than 10 min (`liveness: stale`) | Previous lead is dead, platform state lingers. | Run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh cleanup <slug> --force`. The heartbeat check will allow it because it's stale. Then proceed to Step 4. |
63
- | Team config `present`, heartbeat fresh (`liveness: LIKELY ALIVE`) | A lead may still be running. | **Halt.** Tell the owner you detected what looks like a live lead. Ask them to verify nothing is in flight before re-running. If the owner confirms the previous lead is dead, instruct them to run `/team-cleanup <slug>` (which will require `--ignore-heartbeat`) and then re-run this command. |
64
- | Team config `absent` but task_list or tmux still present | Partial cleanup from a previous attempt. | Run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh cleanup <slug> --force`. Proceed. |
65
-
66
- After any cleanup, re-run the scan and confirm `team_config_state: absent` before continuing.
67
-
68
- ### Step 4 — Identify resume point
69
-
70
- The next pending phase is the first unchecked box in the checkpoint's `## Phases` section. Open escalations in the checkpoint take precedence — resolve them before resuming.
71
-
72
- Read all the artefacts the next phase depends on:
73
- - If next phase is `plan` or later: design doc (path is in the checkpoint).
74
- - If next phase is `pre_impl_review` or later: plan + `plan_approved_at` timestamp.
75
- - If next phase is `implementation` or later: ARCH + SEC reports (both must be `*_PASSED`).
76
- - If next phase is `qa` or later: implementation commits on the worktree branch.
77
- - If next phase is `review` or later: QA report (`QA_PASSED`).
78
- - If next phase is `finish`: code-review report (`REVIEW_PASSED`).
79
-
80
- ### Step 4.a — Mid-phase 7 resume (merge_blocked)
81
-
82
- If the checkpoint's `## Phases` block shows `- [ ] finish (blocked: <reason>, merge_retries: K/3)`, the previous lead crashed inside phase-7 merge-failure handling. Resume protocol:
83
-
84
- 1. Read `<reason>` and `K` from the checkpoint line.
85
- 2. Re-spawn the reviewer (Hat 2 only; reviewer is reused).
86
- 3. Re-present the 5-option menu from `/team-feature` § Phase 7 merge-failure handling, with option A dropped if `K == 3`.
87
- 4. The owner's choice is translated and reviewer continues per the same translation table.
88
- 5. On the next `FINISH_DONE`, normal auto-cleanup runs (including Step D.5 if decision is `merged`).
89
-
90
- Do NOT re-run earlier phases. Their checkpoints stand.
91
-
92
- ### Step 4.b — Mid-Step-D.5 resume (worktree removal in flight)
93
-
94
- If the checkpoint's `## Closing` block exists but is incomplete (has `decision:` and `cleanup: complete` but is missing the `worktree:` line) AND the recorded decision is `merged`, the previous lead crashed inside Step D.5. Resume protocol:
95
-
96
- 1. Read `**Worktree origin:**` from the checkpoint. If it is `reused`, Step D.5 should never have run — abort the mid-Step-D.5 path: append `worktree: removal-skipped:reused-existing-worktree` to the Closing block, commit, and exit normally. The owner's pre-existing worktree stays on disk. Skip to Step 5 of the resume protocol only if there is still feature work to resume; otherwise the resume terminates here.
97
- 2. Verify Step A–D conditions still hold by running `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh scan <slug>` — all states must be `absent`. If anything is `present`, halt and instruct the owner to run `/team-cleanup <slug>` before resuming.
98
- 3. Re-run Step D.5 from the top: read `**Worktree:**`, `cd` to repo root, check `git worktree list --porcelain`, attempt non-forced remove. The procedure is idempotent — if the worktree was already removed in the prior session it'll be recorded as `already-absent`.
99
- 4. On remove failure, re-enter the 4-option remove-failure menu fresh (no carry-over retry count — the prior session's count was not persisted because Step D.5 retries are per-session, not per-run; this is intentional, the owner sees a fresh menu).
100
- 5. On completion, write the missing Closing-block fields (`worktree`, `worktree_path` if applicable, `dropped_files` if applicable) and commit.
101
-
102
- ### Step 5 — Reconstruct context
103
-
104
- - `cd` into the worktree path recorded in the checkpoint. If it no longer exists, halt and escalate via the §7 template — the owner needs to restore or rebase the worktree before resume can continue.
105
- - Recreate the team with the same name (`superpower-<slug>`) via the canonical `TeamCreate` tool:
106
- ```
107
- TeamCreate({
108
- team_name: "superpower-<slug>",
109
- agent_type: "team-lead",
110
- description: "<reuse the description from the previous run if recorded in the checkpoint; otherwise the owner's one-line request>"
111
- })
112
- ```
113
- TeamCreate is idempotent at the directory level — if `~/.claude/teams/superpower-<slug>/config.json` already exists from a partial cleanup, the runtime will refuse to overwrite. In that case, halt and instruct the owner to run `/team-cleanup <slug>` first (the resume protocol Step 3 should have caught this; if it didn't, that's a real bug — escalate).
114
- - Touch `docs/superpowers/sessions/<slug>.heartbeat` and update it at every phase boundary (same protocol as `/team-feature`).
115
-
116
- ### Step 6 — Re-read the shape marker
117
-
118
- Read `docs/superpowers/sessions/<slug>.shape` and `stack_shape` from the checkpoint frontmatter. They must match — if they disagree, halt and escalate (one was hand-edited). The shape determines which implementer to respawn:
119
-
120
- - `full-stack` → both `backend-developer` and `frontend-developer` are eligible to respawn.
121
- - `be-only` → only `backend-developer`. NEVER respawn `frontend-developer` for a `be-only` feature.
122
- - `fe-only` → only `frontend-developer`. NEVER respawn `backend-developer`.
123
-
124
- If the marker file is missing, re-derive shape from `CLAUDE.md` via `bash ${CLAUDE_PLUGIN_ROOT}/scripts/parse-claudemd.sh shape CLAUDE.md` and write the marker file before continuing.
125
-
126
- ### Step 6 (cont.) — Respawn only the teammates needed
127
-
128
- For the next phase, spawn the relevant role(s) using the canonical `Agent` primitive documented in `/team-feature` § "Create the team (canonical primitive)" — same `subagent_type` / `team_name` / `name` / `prompt` shape, and `team_name` MUST be `superpower-<slug>` so messages route to the existing inboxes under `~/.claude/teams/superpower-<slug>/inboxes/`. Do **not** respawn teammates whose phase is complete unless that phase needs them again later (e.g. reviewer is reused in phase 7 for finish; planner is re-spawned if phase 3 returned `ARCH_BLOCKED` / `SEC_BLOCKED` and the plan needs revision; backend-developer / frontend-developer are re-spawned for `impl:qa-fix-*` or `impl:review-fix-*` tasks). Phase-to-role map:
129
-
130
- | Next phase | Spawn |
131
- |---|---|
132
- | `design` | `designer` |
133
- | `plan` | `planner` |
134
- | `pre_impl_review` | `software-architect` + `security-engineer` (parallel) |
135
- | `implementation` | `backend-developer` and/or `frontend-developer`, **filtered by stack_shape** (be-only ⇒ BE only; fe-only ⇒ FE only; full-stack ⇒ both, route by prefix) |
136
- | `qa` | `qa-engineer` |
137
- | `review` | `reviewer` |
138
- | `finish` | `reviewer` |
139
- | `finish (blocked: ...)` | `reviewer` (Hat 2) — same reviewer instance; re-present the 5-option menu, honour the persisted `merge_retries` count |
140
-
141
- Hand each respawned teammate:
142
- - the slug
143
- - the relevant artefact paths
144
- - a note that this is a resume; they should pick up at the next pending task
145
-
146
- ### Step 7 — Re-import the shared task list
147
-
148
- If resuming inside phase 4 (implementation):
149
-
150
- 1. Read the plan.
151
- 2. Recreate any `impl:` tasks that were pending or in-progress at checkpoint time. The `TaskCreated` hook enforces the prefix; the `TaskCompleted` hook requires `plan_approved_at` metadata — carry the timestamp forward from the checkpoint.
152
- 3. Skip `impl:` tasks that the checkpoint records as `complete` and whose corresponding commits exist on the worktree branch (verify with `git log --oneline -- <task-files>`). If a checkpoint marks a task complete but the commits are missing, halt — that's tampered or corrupted state.
153
-
154
- ### Step 8 — Append a resume log entry
155
-
156
- Append to the checkpoint (atomic write — tmp + rename) and commit:
157
-
158
- ```markdown
159
- ## Resume log
160
- - resumed at: <ISO datetime>
161
- - next phase: <phase name>
162
- - respawned: <comma-separated role list>
163
- - preflight cleanup: <yes|no — what was cleaned>
164
- ```
165
-
166
- ### Step 9 — Resume the phase chain
167
-
168
- Continue per the same rules as `/team-feature`:
169
- - three allowed owner touchpoints (design sign-off, plan approval, finish-branch decision — `FINISH_BLOCKED` follow-up menus count as the same finish-branch touchpoint continued), nothing else without §7 template
170
- - checkpoint after every phase boundary, atomic writes
171
- - heartbeat touched at every phase boundary
172
- - automatic cleanup after `FINISH_DONE`
173
-
174
- ## Hard rules
175
-
176
- - **Never** restart a completed phase. If a phase is checked in the checkpoint and the corresponding artefact + commits exist, trust it.
177
- - **Never** assume teammates are still alive. They are not. Always respawn from the role definitions.
178
- - **Never** silently change a previously approved design or plan. If the resumed state contradicts them, halt and escalate.
179
- - **Never** skip Step 3 preflight. Stale team configs cause runtime errors and silently re-use the wrong session IDs.
180
- - **Never** force-cleanup state with a fresh heartbeat unless the owner has confirmed in writing the previous lead is dead.
181
- - **Never** skip the resume-log commit. It is the audit trail that proves the resume happened.
182
- - **Never** respawn an implementer for a shape that excludes it (`frontend-developer` in `be-only`, `backend-developer` in `fe-only`). The hooks will reject the implementer's task creations anyway, but spawning is your decision and you do not bypass the shape.
183
- - **Never** silently ignore a `superpowers_version` mismatch. Always surface the 3-option menu at Step 2.5.
184
-
185
- If anything in the checkpoint looks tampered with or inconsistent (e.g. plan marked approved but no plan file exists, completed task with missing commits), halt and escalate to the owner with the §7 template. Do not paper over.