@drunkcoding/agents-and-skills 0.0.25 → 0.0.26

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 (41) hide show
  1. package/.claude-plugin/marketplace.json +14 -33
  2. package/README.md +1 -0
  3. package/package.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-share/.claude-plugin/plugin.json +17 -0
  7. package/plugins/team-share/README.md +30 -0
  8. package/plugins/team-share/agents/team-share.md +140 -0
  9. package/plugins/team-share/commands/team-share.md +4 -0
  10. package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
  11. package/plugins/auto-power/.claude-plugin/plugin.json +0 -17
  12. package/plugins/auto-power/README.md +0 -80
  13. package/plugins/auto-power/assets/CHECKPOINT_SCHEMA.md +0 -69
  14. package/plugins/auto-power/assets/ESCALATION_TEMPLATE.md +0 -67
  15. package/plugins/auto-power/commands/auto-power-resume.md +0 -32
  16. package/plugins/auto-power/commands/auto-power.md +0 -46
  17. package/plugins/auto-power/skills/auto-power-runtime/SKILL.md +0 -220
  18. package/plugins/team-superpower/.claude-plugin/plugin.json +0 -21
  19. package/plugins/team-superpower/README.md +0 -294
  20. package/plugins/team-superpower/agents/backend-developer.md +0 -221
  21. package/plugins/team-superpower/agents/feature-planner.md +0 -66
  22. package/plugins/team-superpower/agents/frontend-developer.md +0 -242
  23. package/plugins/team-superpower/agents/qc-engineer.md +0 -84
  24. package/plugins/team-superpower/agents/security-engineer.md +0 -175
  25. package/plugins/team-superpower/agents/solution-architect.md +0 -80
  26. package/plugins/team-superpower/agents/team-leader.md +0 -100
  27. package/plugins/team-superpower/assets/AGENTS.md.template +0 -23
  28. package/plugins/team-superpower/assets/CLAUDE.md.template +0 -117
  29. package/plugins/team-superpower/assets/ESCALATION.md +0 -142
  30. package/plugins/team-superpower/assets/SESSION_README.md +0 -337
  31. package/plugins/team-superpower/commands/team-cleanup.md +0 -70
  32. package/plugins/team-superpower/commands/team-feature.md +0 -319
  33. package/plugins/team-superpower/hooks/hooks.json +0 -25
  34. package/plugins/team-superpower/hooks/task-completed.sh +0 -254
  35. package/plugins/team-superpower/hooks/task-created.sh +0 -174
  36. package/plugins/team-superpower/hooks/teammate-idle.sh +0 -142
  37. package/plugins/team-superpower/scripts/assess-complexity.sh +0 -194
  38. package/plugins/team-superpower/scripts/detect-stack.sh +0 -473
  39. package/plugins/team-superpower/scripts/parse-claudemd.sh +0 -194
  40. package/plugins/team-superpower/scripts/team-state.sh +0 -313
  41. package/plugins/team-superpower/scripts/wave-collision-check.sh +0 -60
@@ -1,337 +0,0 @@
1
- # Superpowers session workspace
2
-
3
- This directory holds the artefacts produced by `/team-feature` runs. The
4
- team-superpower plugin seeds it on first use; afterwards the spec / plan /
5
- handover / review / checkpoint files for each feature are written by the team
6
- and committed.
7
-
8
- ## v5 at a glance
9
-
10
- - **One team per feature.** A single `TeamCreate superpower-<slug>` runs the
11
- whole lifecycle. Membership rolls forward by spawn + shutdown across phases
12
- A–H — no nested teams, no concurrent teams.
13
- - **Lead is the sole spawner.** `team-leader` composes wave briefs and posts
14
- `SPAWN_REQUEST` to lead; lead reads the brief, files tasks, spawns
15
- implementers, replies `SPAWN_DONE`. The same channel carries
16
- `RESTART_REQUEST` when the team is architecturally stuck.
17
- - **No per-task QA loop.** Implementers run lint + typecheck + format before
18
- every commit; the output is captured to
19
- `.team-superpower/static-check-<task-id>.log` and the `TaskCompleted` hook
20
- rejects any completion without an `exit=0` line.
21
- - **Phase-end review.** team-leader runs a consolidated SOLID/DRY/domain pass
22
- at the end of every plan-phase and emits `impl:rework-*` tasks where needed.
23
- - **End-of-plan QC.** Lead spawns one `qc-engineer` after `PLAN_COMPLETE`. Up
24
- to 3 rework rounds (`limits.max_qc_rounds`), then owner escalation.
25
- - **Restart on stuck.** Up to 2 `RESTART_REQUEST` cycles
26
- (`limits.max_cycle_restarts`); a third escalates to the owner as "feature
27
- not tractable".
28
-
29
- ## Customising for your project
30
-
31
- Stack decisions, test/build commands, contract source-of-truth, CI provider,
32
- and security posture are all driven by a `team-superpower` fenced block in your
33
- repo-root `CLAUDE.md`. The plugin reads it on every run; it **never
34
- overwrites it**.
35
-
36
- ### 1. Write a `team-superpower` block in CLAUDE.md
37
-
38
- Copy `plugins/team-superpower/assets/CLAUDE.md.template` to your repo root as
39
- `CLAUDE.md` (or paste the `team-superpower` block into your existing CLAUDE.md).
40
- The block recognises:
41
-
42
- - `backend` — `language`, `framework`, `test_framework`, `build_command`,
43
- `test_command`, `format_command`, `lint_command`, `typecheck_command`,
44
- `migration_tool`, `package_manager`. Set `backend: none` to declare a
45
- frontend-only repo.
46
- - `frontend` — `language`, `framework`, `bundler`, `test_framework`,
47
- `e2e_framework`, `ui_library`, `package_manager`, `build_command`,
48
- `test_command`, `lint_command`, `typecheck_command`, `format_command`. Set
49
- `frontend: none` to declare a backend-only repo.
50
- - `contracts` — `source_of_truth` (`openapi` / `grpc` / `graphql` /
51
- `typescript` / `none`), `openapi_path`, `ts_gen_command`.
52
- - `ci` — `provider`, `workflow_path`, `required_checks`,
53
- `poll_timeout_minutes` (default 20). Used by team-leader at the
54
- finish-branch decision (phase H).
55
- - `security` — `domain` (`payments` / `healthcare` / `generic` /
56
- `internal-only`), `pii`, `public_endpoints`, `data_at_rest`. Drives whether
57
- `security-engineer` is spawned in phase A.
58
- - `limits` — `phase_stall_minutes`, `max_tasks_per_implementer`,
59
- `max_concurrent_teammates`, `max_iterations_per_task`, `task_token_budget`,
60
- `retrieval_budget_per_task`, `max_qc_rounds`, `max_cycle_restarts`.
61
-
62
- Free-form prose around the block (e.g. a `## Conventions` section with
63
- project-specific rules) is passed to every teammate as project context.
64
-
65
- ### 2. Auto-detection fallback
66
-
67
- If `CLAUDE.md` is missing or has no `team-superpower` block, the lead runs
68
- `scripts/detect-stack.sh` in phase 0 and writes its best guess to
69
- `docs/superpowers/stack.detected.md`, then halts and asks you to review the
70
- `# CONFIRM:` lines and paste the corrected block into CLAUDE.md. **The plugin
71
- will not edit your CLAUDE.md for you.**
72
-
73
- ### 3. Shape-adaptive team
74
-
75
- Once the block (or detection) is parsed, the lead decides the **stack shape**:
76
-
77
- | Shape | Phase-A roles | Implementation roles |
78
- |-------|---------------|----------------------|
79
- | `full-stack` | solution-architect, feature-planner, (security-engineer) | backend-developer, frontend-developer |
80
- | `be-only` | solution-architect, feature-planner, (security-engineer) | backend-developer |
81
- | `fe-only` | solution-architect, feature-planner, (security-engineer) | frontend-developer |
82
-
83
- `security-engineer` is added only when `security.domain ∈
84
- {payments, healthcare}` OR `security.pii: yes`. Otherwise solution-architect
85
- runs a lightweight security pass alone.
86
-
87
- The shape is written to `docs/superpowers/sessions/<slug>.shape`; the
88
- `TaskCreated` hook reads it to reject `impl:fe-*` in BE-only repos and
89
- vice-versa.
90
-
91
- #### Concurrency model
92
-
93
- Phase-gated. The roles listed above are the **lifetime** team size, not the
94
- parallelism. Roles alive at any moment:
95
-
96
- | Phase | Concurrent teammates |
97
- |-------|----------------------|
98
- | A — analytics | solution-architect + feature-planner (+ security-engineer when in scope) |
99
- | B–F — implementation | team-leader + 1–N implementers (capped by `limits.max_concurrent_teammates`, default 5) |
100
- | G — end-of-plan QC | team-leader + qc-engineer |
101
- | H — finish | team-leader (drives CI gate + finish-branch decision) |
102
-
103
- Phase-A members shut down at `HANDOVER_READY`. No standby. If the team hits an
104
- architectural blocker mid-implementation, team-leader posts `RESTART_REQUEST`
105
- and lead re-runs phase A with the handover + partial commits as input.
106
-
107
- #### Within-phase stall watchdog
108
-
109
- If lead detects no mailbox activity or shared-task-list transitions for
110
- `limits.phase_stall_minutes` (default 30) within a phase, it pings the active
111
- teammate; if the next 30-minute window is also silent, it surfaces a §7
112
- escalation.
113
-
114
- #### Worktree reuse
115
-
116
- If you launch `/team-feature` from inside a linked git worktree on a feature
117
- branch, the planner reuses that worktree instead of nesting a new one. The
118
- signal `WORKTREE_READY <path> <branch> <origin>` carries `origin: reused` and
119
- the checkpoint records `**Worktree origin:** reused`.
120
-
121
- | Where `/team-feature` is launched | Branch | Behavior |
122
- |---|---|---|
123
- | Linked worktree | feature branch | **Reuse** the current worktree. |
124
- | Linked worktree | `main`, `master`, `develop`, `dev`, `release/*`, `releases/*` | **Halt.** Switch to a feature branch and re-run. |
125
- | Main repo | any | **Create** a fresh worktree via Superpowers `using-git-worktrees`. |
126
-
127
- A reused worktree is owned by you, not the team — auto-removal after merge
128
- **does not run** when origin is `reused`.
129
-
130
- ### 4. Contract sync (full-stack only)
131
-
132
- When both BE and FE are present and `contracts.source_of_truth != none`, the
133
- planner emits `impl:be-contract-publish-<slug>` as the first phase-B task. The
134
- lead does not assign any `impl:fe-*` task until the backend-developer posts
135
- `CONTRACT_PUBLISHED`. Every `impl:fe-*` task has
136
- `depends_on: [impl:be-contract-publish-<slug>]` in its metadata.
137
-
138
- Mid-implementation contract drift uses `impl:contract-update-<topic>`.
139
-
140
- ### 5. CI gate before finish (phase H)
141
-
142
- team-leader pushes the branch in phase H, then (when `ci.provider != none`)
143
- polls the CI provider for `ci.required_checks` up to `ci.poll_timeout_minutes`
144
- (default 20). On green the finish-branch menu surfaces. On red the
145
- merge-failure menu surfaces with an extra "Show CI logs" option. On timeout a
146
- 3-option menu (re-poll / switch to `pr_opened` / escalate) surfaces.
147
-
148
- ### 6. Project-aware security checklist
149
-
150
- `security-engineer` reads the `security` block and the stack info, then
151
- expands its checklist accordingly. A `domain: payments` repo gets idempotency
152
- / audit-trail / PCI items; a `data_at_rest: sql` repo gets parameterised-query
153
- items; a no-FE repo skips XSS items entirely. The output report uses ✅/⚠️/❌
154
- markers — any ❌ blocks phase B.
155
-
156
- ### 7. Iteration cap (MAX_ITERATIONS)
157
-
158
- Every `impl:` task carries an `iteration_count:`. If an implementer retries
159
- the same failing test 8 times it halts and posts a §7 escalation with
160
- `what_failed:`, `one_change_to_fix:`, and `class:`. The `task-completed` hook
161
- rejects completions where `iteration_count > 8` unless a `reflection:` block
162
- is attached.
163
-
164
- Configure per project in CLAUDE.md `limits.max_iterations_per_task` (default
165
- 8). Lower for slow-feedback environments; never raise above 12.
166
-
167
- ## Layout
168
-
169
- ```
170
- docs/superpowers/
171
- ├── ESCALATION.md # template — referenced by every teammate
172
- ├── README.md # this file
173
- ├── specs/ YYYY-MM-DD-<slug>-spec.md # owner+architect, phase A
174
- ├── plans/ YYYY-MM-DD-<slug>-plan.md # feature-planner, phase A
175
- ├── handovers/ YYYY-MM-DD-<slug>-handover.md # solution-architect, end of phase A
176
- ├── reviews/ YYYY-MM-DD-<slug>-security.md # security-engineer, phase A (if spawned)
177
- ├── reviews/ YYYY-MM-DD-<slug>-qc.md # qc-engineer, phase G
178
- ├── sessions/ YYYY-MM-DD-<slug>.md # checkpoint, updated by lead each phase
179
- └── sessions/ <slug>.shape # stack shape marker (be-only|fe-only|full-stack)
180
- ```
181
-
182
- Per-feature scratch (lives next to the worktree):
183
-
184
- ```
185
- .team-superpower/
186
- ├── spawn-briefs/ wave-<plan-phase>.<wave>.md # team-leader, one per wave
187
- └── static-check-<task-id>.log # implementer, one per impl: task
188
- ```
189
-
190
- ## How to launch
191
-
192
- ```text
193
- /team-feature <one-line feature idea>
194
- ```
195
-
196
- The lead handles prechecks, spawns the analytics team for phase A, drives the
197
- hand-off to team-leader, and supervises through phase H.
198
-
199
- To resume an in-flight feature drop back into the same worktree and re-run
200
- `/team-feature` — the lead detects the existing `~/.claude/teams/superpower-<slug>/`
201
- directory and continues from the checkpoint. **There is no separate resume
202
- command in v5.**
203
-
204
- ## Owner touchpoints (max 3 per feature)
205
-
206
- 1. **Spec sign-off** (mid phase A). Solution-architect batches all clarifying
207
- questions before this point.
208
- 2. **Plan approval** (end phase A). Before handover to team-leader.
209
- 3. **Finish-branch decision** (in phase H). Merge / PR / keep / discard.
210
-
211
- Recovery touchpoints (`RESTART_REQUEST`, model fallback, CI timeout) are
212
- **not** counted against the 3-touchpoint budget. Anything else that reaches
213
- you must use the §7 escalation template in `ESCALATION.md`.
214
-
215
- ## Reading a checkpoint
216
-
217
- `sessions/YYYY-MM-DD-<slug>.md` is the source of truth for in-flight features.
218
- Each phase boundary appends or updates:
219
-
220
- - `## Phases` — checklist, file paths to the artefacts.
221
- - `## Teammates` — role, agent id, current task or `idle`.
222
- - `## Open escalations` — anything blocking the owner or a peer.
223
- - `## Assumptions` — one line per non-owner decision (tactical, cross-role,
224
- architectural).
225
- - `## Cycle history` — append a row on every `RESTART_REQUEST`.
226
-
227
- The lead commits this file after every phase transition. If the lead crashes,
228
- your feature lives in this file.
229
-
230
- ## Recovery — auto-resume
231
-
232
- If `/resume` drops the team mid-feature, re-run `/team-feature <slug>` from
233
- the same worktree. The lead:
234
-
235
- 1. Reads `~/.claude/teams/superpower-<slug>/config.json` to know which roles
236
- were alive.
237
- 2. Reads `docs/superpowers/sessions/<slug>.md` to know which phase is current.
238
- 3. If past phase A, reads `docs/superpowers/handovers/<date>-<slug>-handover.md`.
239
- 4. Re-spawns the right teammates (skipping completed phases). A
240
- `Resume: <ISO ts>` line is appended to the checkpoint for the audit trail.
241
-
242
- Completed phases are never redone. Partial commits are kept.
243
-
244
- ## Cleanup model
245
-
246
- The lead is the only thing that knows when a team's work is done. There is no
247
- `TeamShutdown` hook event, so cleanup is driven by the slash commands:
248
-
249
- - **Automatic**, the happy path: `/team-feature` runs cleanup immediately
250
- after `FINISH_DONE`. The lead verifies all phases complete, all expected
251
- commits in place, every teammate idle, then invokes the canonical "clean up
252
- the team" primitive and confirms with a final scan. A `## Closing` block is
253
- appended to the checkpoint.
254
-
255
- ### Closing-block fields
256
-
257
- - `finished at: <ISO datetime>`
258
- - `decision: <merged|pr_opened|kept|discarded>`
259
- - `cleanup: complete`
260
- - `cycle_restart_count: <N>` — how many `RESTART_REQUEST` cycles ran.
261
- - `qc_rounds: <N>` — end-of-plan QC rounds consumed.
262
- - `worktree: <state>` — `removed` | `already-absent` | `removal-skipped:<reason>` | `kept-by-owner` | `escalated`.
263
-
264
- - **Manual**, the orphan path: if a lead crashed and left
265
- `~/.claude/teams/superpower-<slug>/` behind, run `/team-cleanup <slug>` from
266
- a fresh session. The slash command dry-runs first, prints what would be
267
- removed, asks for confirmation, then applies. The heartbeat file
268
- (`docs/superpowers/sessions/<slug>.heartbeat`) protects against wiping a
269
- live team.
270
-
271
- Project-side artefacts (`specs/`, `plans/`, `handovers/`, `reviews/`, and the
272
- checkpoint itself) are **always preserved**. Only platform-side state under
273
- `~/.claude/teams/superpower-<slug>/` and `~/.claude/tasks/superpower-<slug>/`
274
- plus the per-feature scratch under `.team-superpower/` is removed.
275
-
276
- ## Heartbeat protocol
277
-
278
- The lead touches `docs/superpowers/sessions/<slug>.heartbeat` at every phase
279
- boundary. Future sessions read its mtime to decide whether a previous lead is
280
- still alive:
281
-
282
- - mtime < 10 minutes → lead is likely alive; cleanup refuses without explicit
283
- override.
284
- - mtime ≥ 10 minutes (or file missing) → safe to clean up.
285
-
286
- ```bash
287
- bash plugins/team-superpower/scripts/team-state.sh scan <slug>
288
- bash plugins/team-superpower/scripts/team-state.sh members <slug>
289
- ```
290
-
291
- ## Troubleshooting
292
-
293
- | Symptom | What it usually means | First thing to check |
294
- |---|---|---|
295
- | `BLOCKED_IDLE_implementer_owes_team-leader_reply` | Implementer tried to idle with an unanswered message from team-leader | Open the implementer's mailbox, reply or escalate |
296
- | `BLOCKED_IDLE_team-leader_awaiting_lead_on_spawn_or_restart` | team-leader sent SPAWN_REQUEST or RESTART_REQUEST and lead hasn't replied | Look at lead's mailbox; if dropped, re-post |
297
- | `BLOCKED_IDLE_team-leader_owes_implementer_escalate_reply` | An implementer sent ESCALATE that team-leader hasn't routed | Route it (tactical/cross-role/architectural) or escalate to owner |
298
- | `BLOCKED_IDLE_qc-engineer_awaiting_lead_ack` | qc-engineer posted QC_REWORK_NEEDED and lead hasn't replied | Lead acknowledges, files `impl:rework-*` via team-leader |
299
- | `BLOCKED_IDLE_phaseA_awaiting_owner_signoff` | analytics team sent HANDOVER_READY / SEC_PASSED / SEC_BLOCKED with no reply | Owner reviews and replies |
300
- | `bad_prefix` on a new task | Lead created a task without the `impl:`/`review:`/`meta:`/`block:` prefix | Lead's bug — fix the task title |
301
- | `bad_subprefix` on `impl:*` | Missing `be-` / `fe-` / `rework-` / `contract-update-` sub-prefix | Re-emit with correct prefix |
302
- | `INVALID_WAVE_REFERENCE` on a new task | Wave metadata missing or not in `<plan-phase>.<wave>` / `<plan-phase>.rework` / `qc-rework` shape | Fix the wave metadata before re-creating |
303
- | `MISSING_STATIC_CHECKS` on task complete | `.team-superpower/static-check-<task-id>.log` missing or has a non-zero `exit=` line | Implementer re-runs lint/typecheck/format, captures log, re-commits |
304
- | `MISSING_REWORK_REFERENCE` on task complete | `impl:rework-*` commit body missing `Reworks: <orig-id>` line | Implementer amends the commit body and re-completes |
305
- | `MIGRATION_RACE` on task complete | Two migration tasks were `in_progress` simultaneously | Lead should serialize migrations |
306
- | `EMPTY_CONTRACT_PUBLISH` on task complete | A contract-publish task completed but no commit touched a contract file | Backend-developer didn't actually publish; investigate and re-run |
307
- | `ARCH_BLOCKED` or `SEC_BLOCKED` from phase A | Pre-impl gate rejected the plan | Planner addresses the report, re-emits, re-runs the gate |
308
- | Hook log noise | Hooks write tuning data to `.claude/hooks/log.jsonl` | Inspect; trim or refine matchers |
309
-
310
- ## Emergency bypass
311
-
312
- `--dangerously-skip-permissions` will let a single task ship without the hooks
313
- firing. **Don't.** The hooks exist because Superpowers gates exist. Use the
314
- escalation template to surface the blocker properly.
315
-
316
- ## Where the methodology lives
317
-
318
- The team-superpower plugin is purely the coordination layer. The actual
319
- development discipline (TDD, plan format, two-stage review, branch hygiene) is
320
- owned by the upstream [obra/superpowers](https://github.com/obra/superpowers)
321
- skills. If a skill's behaviour changes, the team picks it up automatically —
322
- agents reference skills by name, not by content.
323
-
324
- ## Session checkpoint § Assumptions
325
-
326
- Every non-owner decision (tactical, cross-role with consensus, architectural
327
- with sign-off) is logged as one line in the session checkpoint's
328
- `## Assumptions` block. The qc-engineer scans this block at end-of-plan for
329
- contradictions with the spec / plan; contradictions surface as QC findings.
330
- Format:
331
-
332
- ```
333
- - <ISO ts> <role> [class=<tactical|cross-role|architectural>]: <one-line decision> (peer: <role|none>, evidence: <link to mailbox msg | n/a>)
334
- ```
335
-
336
- The owner sees the assumptions log at every phase boundary as part of the
337
- checkpoint commit.
@@ -1,70 +0,0 @@
1
- ---
2
- description: Inspect and clean up team-superpower team state — orphaned configs, task lists, tmux sessions left by a dead lead.
3
- argument-hint: [slug] | --all
4
- ---
5
-
6
- Inspect and (with owner confirmation) remove orphaned team-superpower state from `~/.claude/teams/superpower-*/` and `~/.claude/tasks/superpower-*/`. Preserves project-side artefacts (`docs/superpowers/{specs,plans,reviews}`) — only platform-side state is removed.
7
-
8
- Argument:
9
-
10
- $ARGUMENTS
11
-
12
- ## What "orphaned" means
13
-
14
- A team is orphaned when:
15
-
16
- - Its team config lives at `~/.claude/teams/superpower-<slug>/` but the lead process is dead, so no Claude Code session can talk to it.
17
- - The agent-teams runtime can't reuse it because the lead-for-a-team is fixed for that team's lifetime (per [docs](https://code.claude.com/docs/en/agent-teams)).
18
- - The canonical "ask the lead to clean up" path is unavailable because there is no lead.
19
-
20
- This command is the manual fallback for that case. **If a live lead exists, do not use this command** — message the lead and ask it to "clean up the team" via the native primitive instead.
21
-
22
- ## Procedure
23
-
24
- Run the helper script `${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh` to do the work. It accepts a subcommand and treats every destructive operation as opt-in (`--force`).
25
-
26
- ### Step 1 — Decide scope
27
-
28
- - If `$ARGUMENTS` is empty: run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh scan` and show the output to the owner. Ask which slug to clean (or `--all`).
29
- - If `$ARGUMENTS` is `--all`: enumerate every slug from the scan and process each in turn.
30
- - Otherwise treat `$ARGUMENTS` as the slug.
31
-
32
- ### Step 2 — Inspect
33
-
34
- For the chosen slug, run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh scan <slug>`. Quote the output verbatim to the owner. Pay attention to the `liveness` line:
35
-
36
- | `liveness` | What it means | What to do |
37
- |---|---|---|
38
- | `LIKELY ALIVE` | Heartbeat is < 10min old | **Stop.** Tell the owner the previous lead may still be running. Ask them to verify nothing is in flight before forcing cleanup. |
39
- | `stale` or `unknown` | Heartbeat old or absent | Proceed to step 3. |
40
-
41
- ### Step 3 — Dry-run
42
-
43
- Run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh cleanup <slug>` (no `--force`). Exit code 1 with a "would remove" list is expected. Quote the list to the owner.
44
-
45
- If exit code is 4, there is nothing to clean — report and exit.
46
-
47
- ### Step 4 — Confirm and apply
48
-
49
- Ask the owner to confirm the dry-run list. On confirmation, run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh cleanup <slug> --force`.
50
-
51
- - Exit code 0: report success and show the appended `## Cleanup` block from the checkpoint.
52
- - Exit code 3 (heartbeat refusal): the owner confirmed nothing is in flight, but the heartbeat is fresh. Re-run with `--force --ignore-heartbeat` only after the owner re-confirms in writing (in the chat) that the previous lead is dead.
53
-
54
- ### Step 5 — Verify
55
-
56
- Re-run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh scan <slug>` and confirm `team_config_state: absent` and `task_list_state: absent`.
57
-
58
- ## What this command will NOT do
59
-
60
- - It will not touch any project-side files except to append a `## Cleanup` block to the checkpoint markdown.
61
- - It will not delete the design doc, plan, or review report — those are the durable record of the work and are kept regardless.
62
- - It will not run when there is a live lead. The heartbeat refusal is the safety check.
63
- - It will not iterate `--all` without per-slug owner confirmation when any slug shows `LIKELY ALIVE`.
64
-
65
- ## When to use
66
-
67
- - After `/resume` left a team config behind that no current session can talk to.
68
- - After a crash or kill of the lead mid-feature.
69
- - Before `/team-feature` if the preflight scan there reports orphaned state.
70
- - Routinely after an in-flight feature is abandoned.