@drunkcoding/agents-and-skills 0.0.24 → 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.
- package/.claude-plugin/marketplace.json +14 -33
- package/README.md +1 -0
- package/package.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-share/.claude-plugin/plugin.json +17 -0
- package/plugins/team-share/README.md +30 -0
- package/plugins/team-share/agents/team-share.md +140 -0
- package/plugins/team-share/commands/team-share.md +4 -0
- package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
- package/plugins/auto-power/.claude-plugin/plugin.json +0 -17
- package/plugins/auto-power/README.md +0 -80
- package/plugins/auto-power/assets/CHECKPOINT_SCHEMA.md +0 -69
- package/plugins/auto-power/assets/ESCALATION_TEMPLATE.md +0 -67
- package/plugins/auto-power/commands/auto-power-resume.md +0 -32
- package/plugins/auto-power/commands/auto-power.md +0 -46
- package/plugins/auto-power/skills/auto-power-runtime/SKILL.md +0 -220
- package/plugins/team-superpower/.claude-plugin/plugin.json +0 -21
- package/plugins/team-superpower/README.md +0 -294
- package/plugins/team-superpower/agents/backend-developer.md +0 -221
- package/plugins/team-superpower/agents/feature-planner.md +0 -66
- package/plugins/team-superpower/agents/frontend-developer.md +0 -242
- package/plugins/team-superpower/agents/orchestrator.md +0 -83
- package/plugins/team-superpower/agents/qc-engineer.md +0 -84
- package/plugins/team-superpower/agents/security-engineer.md +0 -175
- package/plugins/team-superpower/agents/solution-architect.md +0 -80
- package/plugins/team-superpower/agents/team-leader.md +0 -100
- package/plugins/team-superpower/assets/AGENTS.md.template +0 -23
- package/plugins/team-superpower/assets/CLAUDE.md.template +0 -117
- package/plugins/team-superpower/assets/ESCALATION.md +0 -142
- package/plugins/team-superpower/assets/SESSION_README.md +0 -338
- package/plugins/team-superpower/commands/team-cleanup.md +0 -70
- package/plugins/team-superpower/commands/team-feature.md +0 -317
- package/plugins/team-superpower/hooks/hooks.json +0 -25
- package/plugins/team-superpower/hooks/task-completed.sh +0 -254
- package/plugins/team-superpower/hooks/task-created.sh +0 -174
- package/plugins/team-superpower/hooks/teammate-idle.sh +0 -149
- package/plugins/team-superpower/scripts/assess-complexity.sh +0 -194
- package/plugins/team-superpower/scripts/detect-stack.sh +0 -473
- package/plugins/team-superpower/scripts/parse-claudemd.sh +0 -194
- package/plugins/team-superpower/scripts/team-state.sh +0 -313
- package/plugins/team-superpower/scripts/wave-collision-check.sh +0 -60
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
# Escalation template (team-superpower v5)
|
|
2
|
-
|
|
3
|
-
v5 replaces v4's peer mailbox + multi-class escalation gauntlet with a single routing point: **team-leader**. Implementers SendMessage team-leader; team-leader routes by `class` per spec §6.4. The only owner-facing path is `RESTART_REQUEST` (team-leader → lead → owner recovery touchpoint).
|
|
4
|
-
|
|
5
|
-
## Where escalations go in v5
|
|
6
|
-
|
|
7
|
-
| From | Channel | Trigger |
|
|
8
|
-
| ----------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
9
|
-
| backend-developer / frontend-developer | SendMessage **team-leader** | Any task-level question that is not pure tactical (style/naming). |
|
|
10
|
-
| security-engineer (phase A) | SendMessage **lead** | SEC_BLOCKED finding, or `CLAUDE.md` `security.*: # CONFIRM:` blocks threat-modelling. |
|
|
11
|
-
| solution-architect / feature-planner (phase A) | SendMessage **lead** | Touchpoint output is owner-facing; lead presents to owner. |
|
|
12
|
-
| qc-engineer (phase G) | SendMessage **lead** | `QC_REWORK_NEEDED <n>` or `QC_PASS <slug>`. Lead re-spawns team-leader for rework dispatch. |
|
|
13
|
-
| team-leader (phase B–F coordinator) | SendMessage **lead** (`SPAWN_REQUEST` / `RESTART_REQUEST`) | Wave dispatch needs implementers; architectural escalation can't be resolved without owner touchpoint. |
|
|
14
|
-
| lead (orchestrator) | Owner touchpoint | Touchpoints 1–4 per spec §3.5 plus recovery touchpoints triggered by RESTART_REQUEST or 3+ QC rounds. |
|
|
15
|
-
|
|
16
|
-
## Implementer → team-leader template (spec §6.4)
|
|
17
|
-
|
|
18
|
-
Use this when a backend-developer or frontend-developer can't resolve a question alone.
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
ESCALATE <task-id>
|
|
22
|
-
class: tactical | cross-role | architectural
|
|
23
|
-
question: <one line>
|
|
24
|
-
context: <2-4 sentences — what we tried, what we considered, why we are stuck>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
team-leader routes by `class`:
|
|
28
|
-
|
|
29
|
-
- **tactical** (style, naming, local design) → team-leader answers from arch-map + AGENTS.md. SendMessage back to originator.
|
|
30
|
-
- **cross-role** (affects another implementer) → team-leader SendMessages the affected peer with the context and a proposed coordination point.
|
|
31
|
-
- **architectural** (changes arch-map, requires planner judgment, invalidates wave plan) → team-leader posts `RESTART_REQUEST <reason+task-id>` to lead. Do NOT re-answer. Do NOT downgrade legitimate architectural questions to tactical.
|
|
32
|
-
|
|
33
|
-
team-leader MAY downgrade an over-eager `class=architectural` to tactical when the question is genuinely style/naming dressed up as architecture. team-leader explains the downgrade in its reply.
|
|
34
|
-
|
|
35
|
-
## team-leader → lead protocols
|
|
36
|
-
|
|
37
|
-
### SPAWN_REQUEST (wave dispatch)
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
SPAWN_REQUEST wave=<plan-phase>.<wave>
|
|
41
|
-
roles_needed:
|
|
42
|
-
backend-developer: <count>
|
|
43
|
-
frontend-developer: <count>
|
|
44
|
-
brief_path: .team-superpower/spawn-briefs/wave-<plan-phase>.<wave>.md
|
|
45
|
-
expected_tasks: [<task-id-1>, <task-id-2>, ...]
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Lead reads the brief, TaskCreates per task block, spawns implementers, replies `SPAWN_DONE wave=<...> agent_ids=<...>`.
|
|
49
|
-
|
|
50
|
-
### RESTART_REQUEST (architectural unblock)
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
RESTART_REQUEST <reason>
|
|
54
|
-
trigger: <task-id | wave-id | qc-issue>
|
|
55
|
-
context: <2-4 sentences — what arch decision broke, what implementers reported>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Lead:
|
|
59
|
-
1. Shuts down all phase B–F teammates (team-leader + active implementers).
|
|
60
|
-
2. Presents owner recovery touchpoint with summary of partial commits + reason.
|
|
61
|
-
3. On owner approval, re-runs phase A (fresh solution-architect + feature-planner + security-engineer if applicable) with the prior spec/plan/arch-map + partial commits as input.
|
|
62
|
-
4. Increments `cycle_restart_count`. Cap is `limits.max_cycle_restarts` (default 2). Third restart triggers owner escalation: "this feature is not tractable, please refactor scope."
|
|
63
|
-
|
|
64
|
-
## Decision classes (v5 reference)
|
|
65
|
-
|
|
66
|
-
| Class | Examples | Routing |
|
|
67
|
-
| --------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
68
|
-
| tactical | naming, error wording, log field choice, fixture data, threshold inside a stated range | Originator decides. Logs to commit body `## Assumptions` line. No escalation. |
|
|
69
|
-
| cross-role | API contract shape across roles, error-handling contract, ambiguous acceptance criterion | `ESCALATE class=cross-role` to team-leader. team-leader routes to affected peer. |
|
|
70
|
-
| architectural | new runtime dependency, persistence-model change, public-interface shape change, contract drift | `ESCALATE class=architectural` to team-leader. team-leader posts `RESTART_REQUEST` to lead. |
|
|
71
|
-
|
|
72
|
-
Classification rule of thumb: if the answer changes a test the implementer would write, AND the existing arch-map / plan does not pin it, AND the change does not alter scope / architecture / external policy, the question is tactical or cross-role. Otherwise it is architectural.
|
|
73
|
-
|
|
74
|
-
## Worked example 1 — backend-developer tactical (NOT escalated, logged as assumption)
|
|
75
|
-
|
|
76
|
-
backend-developer chose error message `"user_id required"` over `"missing user_id"` for consistency with existing 422 responses on /v1/users. They log it in the commit body:
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
feat(users): validate user_id on POST /v1/users
|
|
80
|
-
|
|
81
|
-
Files: src/routes/users.ts, tests/routes/users.test.ts
|
|
82
|
-
Wave: 2.1
|
|
83
|
-
Test-status: green
|
|
84
|
-
|
|
85
|
-
## Assumptions
|
|
86
|
-
- error string "user_id required" matches existing 422 wording on /v1/users (peer: none, class=tactical)
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
No `ESCALATE` is sent. team-leader's phase-end review will spot-check assumption lines.
|
|
90
|
-
|
|
91
|
-
## Worked example 2 — cross-role (frontend asks backend via team-leader)
|
|
92
|
-
|
|
93
|
-
frontend-developer hits an ambiguous request shape on a paginated endpoint.
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
ESCALATE impl:fe-list-orders
|
|
97
|
-
class: cross-role
|
|
98
|
-
question: Should the paginated /v1/orders response use `nextCursor: string | null` or `nextCursor?: string`?
|
|
99
|
-
context: arch-map §4 pins cursor-based pagination but does not pick the null-vs-omitted shape. AGENTS.md has no precedent. backend-developer published the contract last wave; I need to align before I write the RED test for `useOrdersQuery`.
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
team-leader inspects the contract artefact, sees the BE published `nextCursor: string | null`, SendMessages frontend-developer with the decision and a one-line rationale, no further action.
|
|
103
|
-
|
|
104
|
-
## Worked example 3 — architectural → RESTART_REQUEST
|
|
105
|
-
|
|
106
|
-
backend-developer discovers mid-implementation that the planned `payments.transactions` table cannot enforce idempotency because the chosen primary key is auto-increment; the arch-map specified idempotency at the application layer but the plan ended up moving it to the DB.
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
ESCALATE impl:be-2.3-add-charge-endpoint
|
|
110
|
-
class: architectural
|
|
111
|
-
question: Idempotency on POST /v1/charges requires a stable key the client supplies. The plan task uses the DB auto-id, which won't dedupe retries. Should I add an `idempotency_key` column + unique index, or revert idempotency to the app layer as arch-map originally stated?
|
|
112
|
-
context: arch-map §3.2 said "app-layer idempotency via redis SETNX." Plan task 2.3 dropped redis and pushed dedup to DB without a key column. Either fix changes the migration and the route handler. I held RED before writing code.
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
team-leader confirms this contradicts arch-map, posts to lead:
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
RESTART_REQUEST arch-vs-plan-mismatch on impl:be-2.3
|
|
119
|
-
trigger: impl:be-2.3-add-charge-endpoint
|
|
120
|
-
context: Plan dropped redis layer arch-map specified; resulting migration cannot enforce idempotency. Implementer held RED. Two valid fixes (DB column + index, OR restore redis); both change the plan. Needs solution-architect adjudication, not team-leader.
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Lead shuts down team-leader + implementers, presents owner touchpoint summarising partial commits, runs phase A again on owner approval.
|
|
124
|
-
|
|
125
|
-
## Hook validation
|
|
126
|
-
|
|
127
|
-
`task-completed.sh` does NOT gate on the escalation template (escalations are SendMessages, not commits). It DOES validate:
|
|
128
|
-
|
|
129
|
-
- `Files:`, `Wave:`, `Test-status:` lines on every commit (`INVALID_WAVE_REFERENCE` if missing).
|
|
130
|
-
- `Reworks:` line on every commit for an `impl:rework-*` task (`MISSING_REWORK_REFERENCE`).
|
|
131
|
-
- Static-check log present and exit=0 (`MISSING_STATIC_CHECKS`).
|
|
132
|
-
- No agent-attributed commit touches `docs/superpowers/AGENTS.md` (`AGENT_WROTE_AGENTS_MD`).
|
|
133
|
-
|
|
134
|
-
The escalation template is policy, not hook-enforced. team-leader bounces ill-formed `ESCALATE` messages with a one-line reformat request.
|
|
135
|
-
|
|
136
|
-
## v4 → v5 changes (delta reference)
|
|
137
|
-
|
|
138
|
-
- Removed: 4-class table including `owner-only`. v5 routes owner touchpoints only via `RESTART_REQUEST`.
|
|
139
|
-
- Removed: `Peer attempts:` field. v5 implementers do not peer-mailbox; team-leader is the single router.
|
|
140
|
-
- Removed: `BLOCKED:` template with `Phase / Context / Options / Recommendation / Need from you / Peer attempts`. Replaced by terse `ESCALATE / class / question / context`.
|
|
141
|
-
- Removed: `FINISH_BLOCKED` 5-option menu. v5 finish-branch is a lead-only flow; failures are surfaced as a regular touchpoint to owner.
|
|
142
|
-
- Removed: software-architect / planner / reviewer references. Routing collapses to team-leader + lead.
|
|
@@ -1,338 +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
|
-
| `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 |
|
|
310
|
-
|
|
311
|
-
## Emergency bypass
|
|
312
|
-
|
|
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.
|
|
316
|
-
|
|
317
|
-
## Where the methodology lives
|
|
318
|
-
|
|
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.
|
|
324
|
-
|
|
325
|
-
## Session checkpoint § Assumptions
|
|
326
|
-
|
|
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:
|
|
332
|
-
|
|
333
|
-
```
|
|
334
|
-
- <ISO ts> <role> [class=<tactical|cross-role|architectural>]: <one-line decision> (peer: <role|none>, evidence: <link to mailbox msg | n/a>)
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
The owner sees the assumptions log at every phase boundary as part of the
|
|
338
|
-
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.
|