@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.
- package/.claude-plugin/marketplace.json +5 -5
- package/package.json +1 -1
- package/plugins/auto-power/.claude-plugin/plugin.json +1 -1
- package/plugins/html-effectiveness/.claude-plugin/plugin.json +1 -1
- package/plugins/plugin-validator/.claude-plugin/plugin.json +1 -1
- package/plugins/team-superpower/.claude-plugin/plugin.json +1 -1
- package/plugins/team-superpower/README.md +186 -115
- package/plugins/team-superpower/agents/backend-developer.md +106 -74
- package/plugins/team-superpower/agents/feature-planner.md +66 -0
- package/plugins/team-superpower/agents/frontend-developer.md +109 -71
- package/plugins/team-superpower/agents/orchestrator.md +83 -0
- package/plugins/team-superpower/agents/qc-engineer.md +84 -0
- package/plugins/team-superpower/agents/security-engineer.md +79 -44
- package/plugins/team-superpower/agents/solution-architect.md +80 -0
- package/plugins/team-superpower/agents/team-leader.md +100 -0
- package/plugins/team-superpower/assets/CLAUDE.md.template +22 -18
- package/plugins/team-superpower/assets/ESCALATION.md +114 -66
- package/plugins/team-superpower/assets/SESSION_README.md +232 -159
- package/plugins/team-superpower/commands/team-feature.md +191 -645
- package/plugins/team-superpower/hooks/task-completed.sh +100 -182
- package/plugins/team-superpower/hooks/task-created.sh +55 -38
- package/plugins/team-superpower/hooks/teammate-idle.sh +118 -13
- package/plugins/team-superpower/scripts/team-state.sh +106 -37
- package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
- package/plugins/team-superpower/agents/designer.md +0 -65
- package/plugins/team-superpower/agents/planner.md +0 -242
- package/plugins/team-superpower/agents/qa-engineer.md +0 -103
- package/plugins/team-superpower/agents/reviewer.md +0 -175
- package/plugins/team-superpower/agents/software-architect.md +0 -60
- package/plugins/team-superpower/commands/team-feature-resume.md +0 -185
|
@@ -1,137 +1,168 @@
|
|
|
1
1
|
# Superpowers session workspace
|
|
2
2
|
|
|
3
|
-
This directory holds the
|
|
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".
|
|
4
28
|
|
|
5
29
|
## Customising for your project
|
|
6
30
|
|
|
7
|
-
Stack decisions, test/build commands, contract source-of-truth, CI provider,
|
|
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**.
|
|
8
35
|
|
|
9
36
|
### 1. Write a `team-superpower` block in CLAUDE.md
|
|
10
37
|
|
|
11
|
-
Copy `plugins/team-superpower/assets/CLAUDE.md.template` to your repo root as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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.
|
|
20
64
|
|
|
21
65
|
### 2. Auto-detection fallback
|
|
22
66
|
|
|
23
|
-
If `CLAUDE.md` is missing or has no `team-superpower` block, the lead runs
|
|
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.**
|
|
24
72
|
|
|
25
73
|
### 3. Shape-adaptive team
|
|
26
74
|
|
|
27
75
|
Once the block (or detection) is parsed, the lead decides the **stack shape**:
|
|
28
76
|
|
|
29
|
-
| Shape |
|
|
30
|
-
|
|
31
|
-
| `full-stack` |
|
|
32
|
-
| `be-only` |
|
|
33
|
-
| `fe-only` |
|
|
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.
|
|
34
86
|
|
|
35
|
-
The shape is written to `docs/superpowers/sessions/<slug>.shape`; the
|
|
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.
|
|
36
90
|
|
|
37
91
|
#### Concurrency model
|
|
38
92
|
|
|
39
|
-
The
|
|
93
|
+
Phase-gated. The roles listed above are the **lifetime** team size, not the
|
|
94
|
+
parallelism. Roles alive at any moment:
|
|
40
95
|
|
|
41
96
|
| Phase | Concurrent teammates |
|
|
42
97
|
|-------|----------------------|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| 5 QA | 1 (qa-engineer) |
|
|
48
|
-
| 6 review | 1 (reviewer) |
|
|
49
|
-
| 7 finish | 1 (reviewer, hat 2 — reused) |
|
|
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) |
|
|
50
102
|
|
|
51
|
-
|
|
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.
|
|
52
106
|
|
|
53
|
-
|
|
107
|
+
#### Within-phase stall watchdog
|
|
54
108
|
|
|
55
|
-
|
|
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.
|
|
56
113
|
|
|
57
|
-
|
|
114
|
+
#### Worktree reuse
|
|
58
115
|
|
|
59
|
-
|
|
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`.
|
|
60
120
|
|
|
61
|
-
| Where `/team-feature` is launched | Branch
|
|
121
|
+
| Where `/team-feature` is launched | Branch | Behavior |
|
|
62
122
|
|---|---|---|
|
|
63
|
-
| Linked worktree
|
|
64
|
-
| Linked worktree
|
|
65
|
-
| Main repo
|
|
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`. |
|
|
66
126
|
|
|
67
|
-
A reused worktree is owned by you, not the team —
|
|
68
|
-
|
|
69
|
-
The clean-test-baseline check still runs in both modes. If you reused a worktree with uncommitted changes that break the baseline, the planner halts with a §7 escalation asking you to stash or commit first.
|
|
127
|
+
A reused worktree is owned by you, not the team — auto-removal after merge
|
|
128
|
+
**does not run** when origin is `reused`.
|
|
70
129
|
|
|
71
130
|
### 4. Contract sync (full-stack only)
|
|
72
131
|
|
|
73
|
-
When both BE and FE are present and `contracts.source_of_truth != none`, the
|
|
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.
|
|
74
137
|
|
|
75
|
-
Mid-implementation contract drift uses `impl:contract-update-<topic
|
|
138
|
+
Mid-implementation contract drift uses `impl:contract-update-<topic>`.
|
|
76
139
|
|
|
77
|
-
### 5. CI gate before finish
|
|
140
|
+
### 5. CI gate before finish (phase H)
|
|
78
141
|
|
|
79
|
-
|
|
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.
|
|
80
147
|
|
|
81
148
|
### 6. Project-aware security checklist
|
|
82
149
|
|
|
83
|
-
`security-engineer` reads the `security` block and the stack info, then
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
### 8. Complexity assessment (v3 — mode and size)
|
|
90
|
-
|
|
91
|
-
In phase 0.5 the lead runs a heuristic ladder against the launch message and picks one of three modes:
|
|
92
|
-
|
|
93
|
-
- **solo** — lead does the work itself; 2 owner touchpoints (plan-and-diff + finish). Triggers on trivial keywords (typo, rename, bump, comment-out) or single-file launches.
|
|
94
|
-
- **single-agent** — one implementer (BE or FE) spawned; 3 touchpoints. Triggers on small-scope verbs + single-side signal + no discovery language.
|
|
95
|
-
- **team** — full v2 flow at the chosen size. Default.
|
|
96
|
-
|
|
97
|
-
When mode is `team`, the lead also picks a size:
|
|
98
|
-
|
|
99
|
-
- **minimal** — designer + planner + 1 BE + 1 FE + reviewer (5 teammates).
|
|
100
|
-
- **standard** (default) — adds qa-engineer (6 teammates).
|
|
101
|
-
- **full** — adds software-architect + security-engineer (8 teammates). Forced by `security.domain: payments | healthcare` or regulated keywords.
|
|
102
|
-
|
|
103
|
-
The decision lands in the checkpoint's `mode`, `size`, `mode_reasoning`, `overrides_applied` fields. Override per feature with `/team-feature --mode=<mode> --size=<size>`. Preview with `/team-feature --explain <message>` (prints the decision and exits).
|
|
104
|
-
|
|
105
|
-
If the lead picks an unexpected mode, read `mode_reasoning` in the checkpoint — it names the ladder rung and the matching keyword. Bias future launches by phrasing the request explicitly, or use the override flags.
|
|
106
|
-
|
|
107
|
-
### 9. Wave schedule (v3 — phase 4)
|
|
108
|
-
|
|
109
|
-
In phase 4 the lead reads the plan's `## Waves` section. Each wave's tasks have an explicit `Depends on:` list. Independent tasks within a wave run concurrently, up to **2 backend-developer instances + 2 frontend-developer instances at peak**. Subsequent waves wait for the previous wave to fully complete.
|
|
110
|
-
|
|
111
|
-
Read the plan's `## Waves` section to see how the planner decomposed the work. Each task carries `Files:` (paths) and `Depends on:` (task IDs) — the lead uses `Files:` for collision detection (`wave-collision-check.sh`) and `Depends on:` for wave ordering.
|
|
112
|
-
|
|
113
|
-
If two tasks in the same wave collide on a shared file, the wave **hard-fails**. The lead pings the planner with `WAVE_COLLISION`; planner adds a dependency edge between them so they end up in different waves; lead retries. Cap is 3 retries (`wave_replans: K/3` in the checkpoint), then owner escalation. Hard-failing is intentional — graceful serialization would mask planner bugs.
|
|
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.
|
|
114
155
|
|
|
115
|
-
|
|
156
|
+
### 7. Iteration cap (MAX_ITERATIONS)
|
|
116
157
|
|
|
117
|
-
|
|
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.
|
|
118
163
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Configure per project in CLAUDE.md `limits.max_iterations_per_task` (default 8). Lower for slow-feedback environments; never raise above 12 — past that, retry is masking a structural issue.
|
|
122
|
-
|
|
123
|
-
When you see an `ITERATION_CAP_EXCEEDED` escalation, the right move is usually to address the `one_change_to_fix:` field — it's the implementer's single best guess at the root cause.
|
|
124
|
-
|
|
125
|
-
### 11. Model fallback (v3 — preflight attestation)
|
|
126
|
-
|
|
127
|
-
Each agent role is pinned to a model (Opus for designer/architect/security/reviewer; Sonnet for planner/BE/FE/QA — see spec §11.3). At spawn, the lead captures each teammate's first heartbeat:
|
|
128
|
-
|
|
129
|
-
- `model_actual:` — the model the teammate is actually running on.
|
|
130
|
-
- `effort_set:` — the effort level it set on first turn.
|
|
131
|
-
|
|
132
|
-
If `model_actual` does not match the frontmatter `model:` pin (e.g. a usage-threshold fallback dropped Opus to Sonnet), the lead surfaces a single owner touchpoint asking whether to continue. This is a **recovery touchpoint** and does NOT count against the 3-touchpoint budget — it only fires on fallback.
|
|
133
|
-
|
|
134
|
-
If `effort_set` is missing or wrong, the lead logs a warning to the checkpoint but does not surface to the owner. Soft enforcement.
|
|
164
|
+
Configure per project in CLAUDE.md `limits.max_iterations_per_task` (default
|
|
165
|
+
8). Lower for slow-feedback environments; never raise above 12.
|
|
135
166
|
|
|
136
167
|
## Layout
|
|
137
168
|
|
|
@@ -139,13 +170,21 @@ If `effort_set` is missing or wrong, the lead logs a warning to the checkpoint b
|
|
|
139
170
|
docs/superpowers/
|
|
140
171
|
├── ESCALATION.md # template — referenced by every teammate
|
|
141
172
|
├── README.md # this file
|
|
142
|
-
├── specs/
|
|
143
|
-
├── plans/
|
|
144
|
-
├──
|
|
145
|
-
├── reviews/
|
|
146
|
-
├── reviews/
|
|
147
|
-
├──
|
|
148
|
-
└── sessions/
|
|
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
|
|
149
188
|
```
|
|
150
189
|
|
|
151
190
|
## How to launch
|
|
@@ -154,112 +193,146 @@ docs/superpowers/
|
|
|
154
193
|
/team-feature <one-line feature idea>
|
|
155
194
|
```
|
|
156
195
|
|
|
157
|
-
The lead handles prechecks, spawns the team,
|
|
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.**
|
|
158
203
|
|
|
159
204
|
## Owner touchpoints (max 3 per feature)
|
|
160
205
|
|
|
161
|
-
1. **
|
|
162
|
-
|
|
163
|
-
|
|
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.
|
|
164
210
|
|
|
165
|
-
|
|
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`.
|
|
166
214
|
|
|
167
215
|
## Reading a checkpoint
|
|
168
216
|
|
|
169
|
-
`sessions/YYYY-MM-DD-<slug>.md` is the source of truth for in-flight features.
|
|
217
|
+
`sessions/YYYY-MM-DD-<slug>.md` is the source of truth for in-flight features.
|
|
218
|
+
Each phase boundary appends or updates:
|
|
170
219
|
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
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`.
|
|
174
226
|
|
|
175
|
-
The lead commits this file after every phase transition. If the lead crashes,
|
|
227
|
+
The lead commits this file after every phase transition. If the lead crashes,
|
|
228
|
+
your feature lives in this file.
|
|
176
229
|
|
|
177
|
-
## Recovery —
|
|
230
|
+
## Recovery — auto-resume
|
|
178
231
|
|
|
179
|
-
If `/resume` drops the team mid-feature
|
|
232
|
+
If `/resume` drops the team mid-feature, re-run `/team-feature <slug>` from
|
|
233
|
+
the same worktree. The lead:
|
|
180
234
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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.
|
|
184
241
|
|
|
185
|
-
|
|
242
|
+
Completed phases are never redone. Partial commits are kept.
|
|
186
243
|
|
|
187
244
|
## Cleanup model
|
|
188
245
|
|
|
189
|
-
The lead is the only thing that knows when a team's work is done. There is no
|
|
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:
|
|
190
248
|
|
|
191
|
-
- **Automatic**, the happy path: `/team-feature` runs cleanup immediately
|
|
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.
|
|
192
254
|
|
|
193
255
|
### Closing-block fields
|
|
194
256
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- `
|
|
198
|
-
- `
|
|
199
|
-
- `
|
|
200
|
-
- `worktree: <state>` —
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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.
|
|
209
275
|
|
|
210
276
|
## Heartbeat protocol
|
|
211
277
|
|
|
212
|
-
The lead touches `docs/superpowers/sessions/<slug>.heartbeat` at every phase
|
|
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:
|
|
213
281
|
|
|
214
|
-
- mtime < 10 minutes → lead is likely alive; cleanup refuses without explicit
|
|
282
|
+
- mtime < 10 minutes → lead is likely alive; cleanup refuses without explicit
|
|
283
|
+
override.
|
|
215
284
|
- mtime ≥ 10 minutes (or file missing) → safe to clean up.
|
|
216
285
|
|
|
217
|
-
If you ever want to confirm liveness manually:
|
|
218
|
-
|
|
219
286
|
```bash
|
|
220
287
|
bash plugins/team-superpower/scripts/team-state.sh scan <slug>
|
|
288
|
+
bash plugins/team-superpower/scripts/team-state.sh members <slug>
|
|
221
289
|
```
|
|
222
290
|
|
|
223
291
|
## Troubleshooting
|
|
224
292
|
|
|
225
293
|
| Symptom | What it usually means | First thing to check |
|
|
226
294
|
|---|---|---|
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
|
|
|
237
|
-
| `
|
|
238
|
-
|
|
|
239
|
-
|
|
|
240
|
-
| `
|
|
241
|
-
|
|
|
242
|
-
| `FINISH_BLOCKED <reason>` from the reviewer | The merge step of `finishing-a-development-branch` failed (`conflict` / `non-ff` / `dirty-worktree` / `push-rejected`) | The lead surfaces a 5-option menu (retry / pr_opened / kept / discarded / escalate). Pick one; merge retries cap at 3. |
|
|
243
|
-
| `RETRY_PEER: try <role> first` | Lead bounced an escalation because the originator's class isn't `owner-only` and `Peer attempts` is empty | Originator mails the named role with the question, waits one cadence, then refiles citing the attempt. See `assets/ESCALATION.md` § Decision classes |
|
|
244
|
-
| `LOG_ASSUMPTION: tactical, log to checkpoint § Assumptions` | Lead bounced a `class=tactical` escalation | Originator logs one line under the session checkpoint's `## Assumptions` and proceeds. No owner touchpoint consumed |
|
|
245
|
-
| `git worktree remove` failed during cleanup | Step D.5 hit an uncommitted/untracked file or a locked worktree | Pick from the 4-option menu (show files + retry / force-remove with confirmation / keep / escalate). Force-remove discards uncommitted work — only confirm if you've checked the file list. |
|
|
246
|
-
| Auto-cleanup skipped after FINISH_DONE | One of Step A's preconditions failed (missing commits, in-progress tasks, etc.) | Read the lead's halt reason; once resolved, run `/team-cleanup <slug>` |
|
|
247
|
-
| Hook log noise | Hooks write tuning data to `.claude/hooks/log.jsonl` | Inspect the file; trim or refine matchers if a hook is over-triggering |
|
|
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
|
+
| `BLOCKED_IDLE_orchestrator_unhandled_team-leader_request` | team-leader sent something the lead hasn't acted on | Lead acts (spawn / restart / route) |
|
|
301
|
+
| `bad_prefix` on a new task | Lead created a task without the `impl:`/`review:`/`meta:`/`block:` prefix | Lead's bug — fix the task title |
|
|
302
|
+
| `bad_subprefix` on `impl:*` | Missing `be-` / `fe-` / `rework-` / `contract-update-` sub-prefix | Re-emit with correct prefix |
|
|
303
|
+
| `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 |
|
|
304
|
+
| `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 |
|
|
305
|
+
| `MISSING_REWORK_REFERENCE` on task complete | `impl:rework-*` commit body missing `Reworks: <orig-id>` line | Implementer amends the commit body and re-completes |
|
|
306
|
+
| `MIGRATION_RACE` on task complete | Two migration tasks were `in_progress` simultaneously | Lead should serialize migrations |
|
|
307
|
+
| `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 |
|
|
308
|
+
| `ARCH_BLOCKED` or `SEC_BLOCKED` from phase A | Pre-impl gate rejected the plan | Planner addresses the report, re-emits, re-runs the gate |
|
|
309
|
+
| Hook log noise | Hooks write tuning data to `.claude/hooks/log.jsonl` | Inspect; trim or refine matchers |
|
|
248
310
|
|
|
249
311
|
## Emergency bypass
|
|
250
312
|
|
|
251
|
-
`--dangerously-skip-permissions` will let a single task ship without the hooks
|
|
313
|
+
`--dangerously-skip-permissions` will let a single task ship without the hooks
|
|
314
|
+
firing. **Don't.** The hooks exist because Superpowers gates exist. Use the
|
|
315
|
+
escalation template to surface the blocker properly.
|
|
252
316
|
|
|
253
317
|
## Where the methodology lives
|
|
254
318
|
|
|
255
|
-
The team-superpower plugin is purely the coordination layer. The actual
|
|
319
|
+
The team-superpower plugin is purely the coordination layer. The actual
|
|
320
|
+
development discipline (TDD, plan format, two-stage review, branch hygiene) is
|
|
321
|
+
owned by the upstream [obra/superpowers](https://github.com/obra/superpowers)
|
|
322
|
+
skills. If a skill's behaviour changes, the team picks it up automatically —
|
|
323
|
+
agents reference skills by name, not by content.
|
|
256
324
|
|
|
257
325
|
## Session checkpoint § Assumptions
|
|
258
326
|
|
|
259
|
-
Every non-owner decision (tactical, cross-role with consensus, architectural
|
|
327
|
+
Every non-owner decision (tactical, cross-role with consensus, architectural
|
|
328
|
+
with sign-off) is logged as one line in the session checkpoint's
|
|
329
|
+
`## Assumptions` block. The qc-engineer scans this block at end-of-plan for
|
|
330
|
+
contradictions with the spec / plan; contradictions surface as QC findings.
|
|
331
|
+
Format:
|
|
260
332
|
|
|
261
333
|
```
|
|
262
334
|
- <ISO ts> <role> [class=<tactical|cross-role|architectural>]: <one-line decision> (peer: <role|none>, evidence: <link to mailbox msg | n/a>)
|
|
263
335
|
```
|
|
264
336
|
|
|
265
|
-
The owner sees the assumptions log at every phase boundary as part of the
|
|
337
|
+
The owner sees the assumptions log at every phase boundary as part of the
|
|
338
|
+
checkpoint commit.
|