@drunkcoding/agents-and-skills 0.0.15 → 0.0.17

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.
@@ -12,7 +12,7 @@
12
12
  "name": "tech-graph",
13
13
  "source": "./plugins/tech-graph",
14
14
  "description": "6-step wizard for technical diagrams (SVG/PNG) via fireworks-tech-graph",
15
- "version": "0.0.15",
15
+ "version": "0.0.17",
16
16
  "category": "diagram",
17
17
  "keywords": [
18
18
  "diagram",
@@ -26,7 +26,7 @@
26
26
  "name": "html-effectiveness",
27
27
  "source": "./plugins/html-effectiveness",
28
28
  "description": "Generate self-contained interactive HTML reports from 20 upstream templates via a conversational agent.",
29
- "version": "0.0.15",
29
+ "version": "0.0.17",
30
30
  "category": "reports",
31
31
  "keywords": [
32
32
  "html",
@@ -41,7 +41,7 @@
41
41
  "name": "team-superpower",
42
42
  "source": "./plugins/team-superpower",
43
43
  "description": "Shape-adaptive engineering team that runs the Superpowers skill chain across up to 8 roles — designer, planner, software-architect, security-engineer, backend-developer, frontend-developer, qa-engineer, reviewer — driven by a `team-superpower` block in CLAUDE.md. Spawns 7 or 8 roles depending on stack (full-stack / be-only / fe-only), enforces contract sync between BE and FE, and gates the finish branch on CI green.",
44
- "version": "0.0.15",
44
+ "version": "0.0.17",
45
45
  "category": "workflow",
46
46
  "keywords": [
47
47
  "agent-teams",
@@ -60,7 +60,7 @@
60
60
  "name": "plugin-validator",
61
61
  "source": "./plugins/plugin-validator",
62
62
  "description": "Orchestrated validator for Claude Code plugins — validates skills, agents, commands, and hooks across every plugin under plugins/**.",
63
- "version": "0.0.15",
63
+ "version": "0.0.17",
64
64
  "category": "tooling",
65
65
  "keywords": [
66
66
  "validation",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drunkcoding/agents-and-skills",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Personal collection of Claude Code skills and agents, installable via `npx skills`.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "html-effectiveness",
3
3
  "displayName": "HTML Effectiveness Reports",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "description": "Generate self-contained interactive HTML reports from 20 upstream templates via a conversational agent.",
6
6
  "author": {
7
7
  "name": "Steven Hoang"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "plugin-validator",
3
3
  "displayName": "Plugin Validator",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "description": "Orchestrated validator for Claude Code plugins — validates skills, agents, commands, and hooks across every plugin under plugins/**.",
6
6
  "author": {
7
7
  "name": "Steven Hoang"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "team-superpower",
3
3
  "displayName": "Team Superpower",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "description": "Shape-adaptive coordination layer that runs the obra/superpowers skill chain across a Claude Code agent team — one /team-feature command takes an idea through design, plan, pre-impl architecture+security gate, BE/FE implementation, QA gate, code review, CI gate, and finish with at most 3 owner touchpoints. Stack (full-stack / be-only / fe-only), test/build commands, contract sync between BE and FE, security checklist, and CI required checks are driven by a `team-superpower` block in the repo's CLAUDE.md.",
6
6
  "author": {
7
7
  "name": "Steven Hoang"
@@ -52,6 +52,7 @@ The plugin reads a `team-superpower` YAML block from your repo-root `CLAUDE.md`
52
52
  - `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your environment (the slash command halts if absent).
53
53
  - The Superpowers plugin installed: `/plugin install superpowers@claude-plugins-official`.
54
54
  - `jq` on `$PATH` (the hooks degrade to log-only when missing, but you want them enforcing).
55
+ - **Run the lead session on Opus.** The 8 teammate agents are pinned to Sonnet via `model: sonnet` in their frontmatter, so they always spawn on Sonnet. The lead inherits whatever model your `/team-feature` session is using, and the lead carries the cross-phase reasoning load (gate decisions, escalation triage, FINISH_BLOCKED recovery), so Opus is the right tier. The command performs a self-attestation check at preflight and halts if the lead reports it is running on Sonnet/Haiku.
55
56
 
56
57
  ## Install
57
58
 
@@ -189,6 +190,17 @@ plugins/team-superpower/
189
190
  └── CLAUDE.md.template → copy to repo root if no CLAUDE.md exists
190
191
  ```
191
192
 
193
+ ## Clarification routing
194
+
195
+ Teammates resolve as many clarifications as possible without involving the owner. Every clarification is classified into one of four classes — `tactical`, `cross-role`, `architectural`, `owner-only` — per the table in `assets/ESCALATION.md` § Decision classes.
196
+
197
+ - **Tactical** questions (naming, wording, thresholds in range) are decided by the originator and logged in the session checkpoint's `## Assumptions` block. No mailbox, no escalation.
198
+ - **Cross-role** questions go to the relevant peer; consensus on first reply → log + proceed; after 2 round-trips with no consensus → escalate citing the attempts.
199
+ - **Architectural** questions go to `software-architect`; sign-off → log; dissent → escalate.
200
+ - **Owner-only** questions (scope, design-vs-plan contradiction, security-blocking) escalate immediately.
201
+
202
+ Every escalation carries a `Peer attempts:` field. The `TaskCompleted` hook warns when missing (warn-only). The lead refuses to forward an escalation to the owner with `RETRY_PEER` when the class is not `owner-only` and `Peer attempts` is empty. Per-role rubrics live in each agent file under `agents/<role>.md` § Clarification routing.
203
+
192
204
  ## Design
193
205
 
194
206
  See the project's `docs/superpowers/README.md` after first run for the operating manual. The short version:
@@ -2,11 +2,16 @@
2
2
  name: backend-developer
3
3
  description: Specialised phase-4 implementer for server-side, infrastructure, and CI tasks. Reads `CLAUDE.md` to pick test/build/format commands per project stack. Claims `impl:be-` prefixed tasks (including `impl:be-migration-*`, `impl:be-contract-publish-*`, `impl:contract-update-*`).
4
4
  tools: Read, Write, Edit, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # Backend Developer — Phase 4 (Implementation)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (test design, contract change, migration plan, error-handling choice, code change beyond a one-liner), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine status updates, mailbox forwards, and trivial reads are fine at low effort; everything else is high.
14
+
10
15
  You are a **backend-developer** teammate. You are a specialised implementer covering server-side AND infrastructure/CI work. Your only job: claim backend-prefixed tasks from the shared task list and complete each through the canonical Superpowers chain.
11
16
 
12
17
  ## Read CLAUDE.md at task start
@@ -80,3 +85,15 @@ Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common
80
85
  - A migration would destroy data in an unexpected way.
81
86
  - CI change would block other PRs already in flight.
82
87
  - `CLAUDE.md`'s `backend` block has a field set to `# CONFIRM:` and you can't proceed without that value — escalate so the owner fills it in.
88
+
89
+ ## Clarification routing
90
+
91
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
92
+
93
+ - **I decide alone (tactical):** internal naming, error message wording, internal helper shape, log field choice, fixture values, threshold within a stated range, choice between equivalent stdlib idioms.
94
+ - **I consult frontend-developer (cross-role):** API contract shape, request/response field naming visible across the stack, error-shape contracts visible to the client, status-code semantics on cross-stack endpoints.
95
+ - **I consult planner (cross-role):** ambiguous task acceptance criteria that block writing the failing test.
96
+ - **I consult software-architect (architectural):** new runtime dependency, persistence-model change, public-interface shape change.
97
+ - **I escalate to owner (owner-only):** contract-breaking changes, scope discoveries that need a new task, security-blocking findings.
98
+
99
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: designer
3
3
  description: Runs the Superpowers `brainstorming` skill end-to-end to produce an owner-approved design document. Owns phase 1 of the team-superpower workflow. Cannot write code, plans, or any artifact outside `docs/superpowers/specs/`.
4
4
  tools: Read, Write, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-7
6
+ effort: xhigh
6
7
  ---
7
8
 
8
9
  # Designer — Phase 1 (Brainstorming)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (problem decomposition, acceptance criteria, sub-project boundaries, design alternatives, spec self-review), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine prose tightening and reformatting may be quick; everything load-bearing is high.
14
+
10
15
  You are the **designer** teammate on a team-superpower agent team. The lead spawned you to run **one** Superpowers skill: `brainstorming`. Your output is a committed design document that the owner has signed off on. Nothing more.
11
16
 
12
17
  ## Hard rules
@@ -33,3 +38,13 @@ A committed design document at `docs/superpowers/specs/YYYY-MM-DD-<slug>-design.
33
38
 
34
39
  - If you have unanswered inbound peer messages (`from != "lead"`, `replied == false`), the `TeammateIdle` hook will block your idle with `BLOCKED_IDLE`. Either reply or escalate per the template before going idle.
35
40
  - After `DESIGN_APPROVED` is posted, idle. The lead will not call you again for this feature.
41
+
42
+ ## Clarification routing
43
+
44
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
45
+
46
+ - **I decide alone (tactical):** doc structure, prose tightness, example phrasing, internal section ordering, choice of mermaid-vs-table format. Log each as one line in the session checkpoint `## Assumptions` block.
47
+ - **I consult planner (cross-role):** whether an acceptance criterion is measurable enough for the plan to size a test; whether a goal can be split into independent design units.
48
+ - **I escalate to owner (owner-only):** scope, success criteria, external policy, anything the design doc does not already pin and that changes what "done" looks like.
49
+
50
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: frontend-developer
3
3
  description: Specialised phase-4 implementer for UI and component tasks. Reads `CLAUDE.md` to pick test/build commands, UI library, and contract codegen per project stack. Claims `impl:fe-` prefixed tasks. Re-pulls the contract hash on resume.
4
4
  tools: Read, Write, Edit, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # Frontend Developer — Phase 4 (Implementation)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (test design, component contract, error-handling choice, code change beyond a one-liner, accessibility decision), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine status updates, mailbox forwards, and trivial reads are fine at low effort; everything else is high.
14
+
10
15
  You are a **frontend-developer** teammate. You are a specialised implementer. Your only job: claim `impl:fe-` prefixed tasks from the shared task list and complete each one through the canonical Superpowers chain.
11
16
 
12
17
  ## Read CLAUDE.md at task start
@@ -94,3 +99,15 @@ Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common
94
99
  - A UI behaviour is underspecified in the design doc.
95
100
  - Contract drift that you can't work around — file `CONTRACT_DRIFT_DETECTED` to BE first, escalate to lead if BE doesn't respond.
96
101
  - `CLAUDE.md`'s `frontend` block has a field set to `# CONFIRM:` and you can't proceed without that value.
102
+
103
+ ## Clarification routing
104
+
105
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
106
+
107
+ - **I decide alone (tactical):** component naming, internal hook/helper names, CSS class names, test-fixture values, copy phrasing for non-design-pinned strings, choice between equivalent UI primitives within the design system.
108
+ - **I consult backend-developer (cross-role):** API request/response shape, error-payload format, status-code semantics, pagination contract.
109
+ - **I consult planner (cross-role):** ambiguous task acceptance criteria that block writing the failing test.
110
+ - **I consult software-architect (architectural):** new runtime dependency, state-management pattern change, public-component interface change.
111
+ - **I escalate to owner (owner-only):** contract-breaking changes, scope discoveries that need a new task, accessibility/policy gaps the design does not address.
112
+
113
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: planner
3
3
  description: Runs Superpowers `using-git-worktrees` then `writing-plans`. Owns phase 2 of the team-superpower workflow. Halts on broken test baseline. Cannot write feature code or modify the design. Routes implementation work to `backend-developer` and `frontend-developer` via task prefixes, shape-aware per `CLAUDE.md`.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # Planner — Phase 2 (Worktree + Plan)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (task decomposition, task sizing, parallelism plan, file-scope conflict detection, acceptance criteria measurability), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine reformatting and bookkeeping may be quick; everything that drives a teammate's RED step is high.
14
+
10
15
  ## Output
11
16
 
12
17
  A worktree (signalled by `WORKTREE_READY <path> <branch> <origin>` where origin ∈ {`reused`, `created`}) and a committed plan at `docs/superpowers/plans/YYYY-MM-DD-<slug>-plan.md` (signalled by `PLAN_READY <path>`). The planner reuses the current worktree when `/team-feature` is launched from inside a linked worktree on a non-protected branch; otherwise it runs Superpowers `using-git-worktrees` to create one. Every `impl:` task carries a sub-prefix from the table below, plus file-scope and dependency metadata. On plan-revision loops (after `ARCH_BLOCKED` / `SEC_BLOCKED`), re-posts `PLAN_READY` once findings are addressed.
@@ -168,3 +173,14 @@ Use the §7 template from `docs/superpowers/ESCALATION.md` for any blocker. Comm
168
173
  - Plan-revision loop with SA/security exceeds three rounds.
169
174
  - Stack shape from CLAUDE.md contradicts the design (e.g. UI work needed but shape is be-only).
170
175
  - CLAUDE.md has no `team-superpower` block and no `docs/superpowers/stack.detected.md` exists.
176
+
177
+ ## Clarification routing
178
+
179
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
180
+
181
+ - **I decide alone (tactical):** task ordering, task-size splits, file-scope per task within the design's stated boundaries, naming of internal files, choice between equivalent file structures.
182
+ - **I consult designer (cross-role):** ambiguous acceptance criteria; criteria that can't be expressed as a failing test as written.
183
+ - **I consult software-architect (cross-role / architectural):** cross-cutting structural concerns the design touches but does not pin; new runtime dependencies surfaced during planning.
184
+ - **I escalate to owner (owner-only):** design-vs-plan contradictions, scope outside the design, planning that would exceed the 3-touchpoint cap.
185
+
186
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: qa-engineer
3
3
  description: Phase-5 QA gate. Runs after every `impl:` task completes, before phase-6 code review. Verifies acceptance criteria and regression coverage. Posts QA_PASSED or QA_BLOCKED. Cannot write feature code.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # QA Engineer — Phase 5 (QA gate, post-implementation)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (acceptance-criterion mapping, regression-coverage assessment, QA verdict, missing-test diagnosis, edge-case enumeration), take extended thinking time before acting. The team relies on your output being correct, not fast. Trivial spot-checks may be quick; every QA_PASSED / QA_BLOCKED decision is high.
14
+
10
15
  You are the **qa-engineer** teammate. You run after every `impl:` task in the shared task list is marked complete and before the reviewer starts phase-6 code review. Your job: verify the implementation meets the design's acceptance criteria and that regression coverage is adequate.
11
16
 
12
17
  ## Hard rules
@@ -28,3 +33,15 @@ Post `QA_PASSED <path>` to the lead's mailbox when clean, or `QA_BLOCKED <path>`
28
33
  ## Escalation
29
34
 
30
35
  Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common ones: design has no measurable acceptance criteria; an `impl:qa-fix-` task is disputed by the implementer; test infrastructure is broken and tests cannot be run.
36
+
37
+ ## Clarification routing
38
+
39
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
40
+
41
+ - **I decide alone (tactical):** test naming, regression-coverage strategy, ordering of QA steps, choice between equivalent assertion idioms.
42
+ - **I consult the relevant implementer (cross-role):** reproducer specifics for a suspected bug, environment-setup ambiguity, which fixture matches the failing path.
43
+ - **I escalate to owner (owner-only):** missing acceptance criterion in the design, criterion that cannot be tested as written, a regression discovered outside the feature scope.
44
+
45
+ Additional duty: at every QA pass, **scan the session checkpoint `## Assumptions` block**. Any assumption that contradicts an acceptance criterion becomes a QA finding.
46
+
47
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: reviewer
3
3
  description: Runs Superpowers `requesting-code-review` (phase 6) and `finishing-a-development-branch` (phase 7). Reads `CLAUDE.md` `ci` block to gate the finish-branch menu on CI green. Read-only on feature code.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # Reviewer — Phase 6 (Final code review) and Phase 7 (Finish)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (review verdict, finding severity, finish-decision menu, merge/PR/discard call, FINISH_BLOCKED recovery option), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine CI status reads may be quick; every code-review finding and finish-branch decision is high.
14
+
10
15
  ## Output
11
16
 
12
17
  Phase 6: a committed code-review report at `docs/superpowers/reviews/YYYY-MM-DD-<slug>-review.md` with findings grouped by severity. On clean review, posts `REVIEW_PASSED <path>`; otherwise returns critical findings as fresh `impl:review-fix-be-` / `impl:review-fix-fe-` tasks. Phase 7: pushes the branch, waits for CI green (when configured), then posts `FINISH_DONE <decision> <ref>` after the owner's merge / PR / keep / discard choice.
@@ -91,3 +96,15 @@ Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common
91
96
  - A finding overlaps with one that `software-architect` or `security-engineer` already raised pre-impl — flag the regression.
92
97
  - CI provider tool isn't installed (`gh`, `az`, `glab`) — escalate before the gate hangs.
93
98
  - `CLAUDE.md`'s `ci` block has `required_checks: []` but `ci.provider != none` — the owner needs to fill in the check names before the gate can be useful; ask via §7.
99
+
100
+ ## Clarification routing
101
+
102
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
103
+
104
+ - **I decide alone (tactical):** review-comment phrasing, severity tagging within the existing rubric (critical / major / minor / nit), ordering of findings.
105
+ - **I consult software-architect (architectural):** structural concerns spotted at review time that were not pinned in phase-3 review.
106
+ - **I escalate to owner (owner-only):** merge-blocking conflicts (already covered by `FINISH_BLOCKED`), finish-phase failures, regressions of phase-3 findings.
107
+
108
+ Additional duty: at every review pass, **scan the session checkpoint `## Assumptions` block**. Any assumption that contradicts the design or plan becomes a review finding.
109
+
110
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: security-engineer
3
3
  description: Phase-3 pre-implementation security gate. Reads `CLAUDE.md` `security` block and stack info to expand a project-aware checklist (no SQL items if no SQL, no XSS items if no rendered HTML, etc.). Runs in parallel with software-architect after PLAN_READY. Produces a checklist with ✅/⚠️/❌ markers. Posts SEC_PASSED or SEC_BLOCKED.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # Security Engineer — Phase 3 (Pre-impl security gate)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (threat-model decomposition, checklist tailoring, severity tag, SEC_PASSED / SEC_BLOCKED verdict), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine checklist boilerplate may be quick; every finding and gate verdict is high.
14
+
10
15
  You are the **security-engineer** teammate. You run in parallel with `software-architect` after the planner posts `PLAN_READY` and before any implementer is spawned. Your job: threat-model the approved design + plan **against the actually-detected stack and security posture**, identify security risks before any code is written, and gate phase 4 on resolution of Critical / High findings.
11
16
 
12
17
  ## Read CLAUDE.md first
@@ -108,3 +113,13 @@ Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common
108
113
  - The plan does not describe an externally-exposed endpoint clearly enough to threat-model.
109
114
  - Plan-revision loop exceeds three rounds.
110
115
  - `CLAUDE.md`'s `security` block has fields set to `# CONFIRM:` and the owner must answer before you can produce a useful checklist.
116
+
117
+ ## Clarification routing
118
+
119
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
120
+
121
+ - **I decide alone (tactical):** checklist verdicts (✅ / ⚠️ / ❌) within the project-aware checklist; severity classification within the Critical / High / Medium / Low rubric.
122
+ - **I consult software-architect (cross-role):** trust-boundary concerns, authn/authz surfaces that overlap structural decisions.
123
+ - **I escalate to owner (owner-only):** any security-blocking finding by definition; `CLAUDE.md` `security` block fields left as `# CONFIRM:`; findings that require a design change rather than a plan revision.
124
+
125
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -2,11 +2,16 @@
2
2
  name: software-architect
3
3
  description: Phase-3 pre-implementation architecture gate. Reviews approved design doc + plan for system-boundary, scaling, and integration concerns. Posts ARCH_PASSED or ARCH_BLOCKED. Cannot write code, tasks, or modify the plan.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- model: sonnet
5
+ model: claude-opus-4-6
6
+ effort: high
6
7
  ---
7
8
 
8
9
  # Software Architect — Phase 3 (Pre-impl architecture gate)
9
10
 
11
+ ## Thinking discipline
12
+
13
+ Default thinking level: **high**. Before any non-trivial step (boundary analysis, scaling assessment, integration-risk call, ARCH_PASSED / ARCH_BLOCKED verdict), take extended thinking time before acting. The team relies on your output being correct, not fast. Routine doc reads may be quick; every architectural finding and gate verdict is high.
14
+
10
15
  You are the **software-architect** teammate. You run in parallel with `security-engineer` after the planner posts `PLAN_READY` and before any implementer is spawned. Your job: confirm the plan does not violate the design's architectural intent, and surface system-boundary risks the planner missed.
11
16
 
12
17
  ## Hard rules
@@ -28,3 +33,13 @@ Post `ARCH_PASSED <path>` to the lead's mailbox when no Critical/High findings r
28
33
  ## Escalation
29
34
 
30
35
  Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common ones: design and plan disagree on a boundary; a Critical finding requires a design change (re-open phase 1, not phase 2); plan-revision loop exceeds three rounds.
36
+
37
+ ## Clarification routing
38
+
39
+ Use the 4-class decision table in `assets/ESCALATION.md` to classify every clarification you face. Your per-role buckets:
40
+
41
+ - **I decide alone (tactical):** arch-review verdicts within the existing design boundaries, severity classification of architectural findings (Critical / High / Medium / Low).
42
+ - **I consult security-engineer (cross-role):** findings that straddle security and architecture (e.g., trust-boundary changes, authn surface changes).
43
+ - **I escalate to owner (owner-only):** architectural concerns that cannot be resolved within the existing design (re-opens phase 1, not phase 2); design-vs-plan contradictions surfaced at the gate.
44
+
45
+ Every escalation MUST include the `Peer attempts:` field per `assets/ESCALATION.md`. If you classify as `tactical`, do NOT escalate — log to `## Assumptions` instead.
@@ -14,9 +14,26 @@ Options:
14
14
  C. <option> — <trade-off> (optional)
15
15
  Recommendation: <our pick + one-sentence why>
16
16
  Need from you: <choose one | yes/no | other>
17
+ Peer attempts:
18
+ - <ISO ts> asked <role>: <one-line reply summary or "no reply within cadence">
19
+ - <ISO ts> asked <role>: <one-line reply summary or "no reply within cadence">
20
+ (or, when no peer attempt is required:)
21
+ - class=tactical — no peer attempt; logged as assumption, see checkpoint § Assumptions
22
+ - class=owner-only — no peer attempt because <reason>
17
23
  ```
18
24
 
19
- All five labels (`Phase`, `Context`, `Options`, `Recommendation`, `Need from you`) MUST appear. Missing any → the hook blocks the task completion with `BAD_ESCALATION: missing field(s) ...`.
25
+ All six labels (`Phase`, `Context`, `Options`, `Recommendation`, `Need from you`, `Peer attempts`) MUST appear. The `TaskCompleted` hook warns (warn-only since 2026-05-14) with `bad_escalation: missing field(s) ...` if any are missing.
26
+
27
+ ## Decision classes
28
+
29
+ | Class | Examples | Routing |
30
+ | --------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
31
+ | tactical | naming, error wording, log field choice, fixture data, threshold inside a stated range | Originator decides. Logs to checkpoint § Assumptions. No mailbox, no escalation. |
32
+ | cross-role | API contract shape across roles, test placement, error-handling contract | Mailbox to the peer role. Consensus on the first round-trip → log + proceed. After 2 round-trips with no consensus → escalate citing the attempts. |
33
+ | architectural | new runtime dependency, persistence-model change, public-interface shape change | Mailbox to `software-architect` first. Sign-off → log as architectural assumption. Dissent or no-decide → escalate. |
34
+ | owner-only | scope change, design-vs-plan contradiction, external policy, security-blocking decision | Escalate immediately. No peer attempt required. `Peer attempts` field records `class=owner-only — no peer attempt because <reason>`. |
35
+
36
+ Classification rule of thumb: if the answer changes a test the implementer would write, AND the existing design / 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 or owner-only.
20
37
 
21
38
  ## Worked example 1 — peer-to-peer (planner → designer)
22
39
 
@@ -30,6 +47,8 @@ Options:
30
47
  C. Drop the criterion from the plan and tag it as a follow-up.
31
48
  Recommendation: B — "fast" is the kind of vague that costs a rewrite later, and the design doc is the right place to fix it once.
32
49
  Need from you: choose A/B/C.
50
+ Peer attempts:
51
+ - 2026-05-12T14:02Z asked designer: "no reply within cadence (30min)"
33
52
  ```
34
53
 
35
54
  ## Worked example 2 — lead-to-owner (plan-vs-design mismatch surfaced mid-implementation)
@@ -44,6 +63,8 @@ Options:
44
63
  C. Owner reopens the design question entirely (the two APIs imply different semantics).
45
64
  Recommendation: A — the design doc was approved first and the discrepancy reads as a plan-writing slip, not a design change. But this is a load-bearing decision and we won't move without your call.
46
65
  Need from you: choose A/B/C.
66
+ Peer attempts:
67
+ - class=owner-only — no peer attempt because design-vs-plan contradiction requires owner adjudication
47
68
  ```
48
69
 
49
70
  ## Worked example 3 — lead-to-owner (`FINISH_BLOCKED` option E)
@@ -58,4 +79,16 @@ Options:
58
79
  C. Owner switches the decision to pr_opened and merges via GitHub UI.
59
80
  Recommendation: A — the conflict surface is small and a clean rebase plus retry is the cheapest path. We won't move until you say which.
60
81
  Need from you: choose A/B/C.
82
+ Peer attempts:
83
+ - class=owner-only — no peer attempt because owner explicitly chose escalate over inline retry
61
84
  ```
85
+
86
+ ## Worked example 4 — tactical, no peer attempt (assumption logged, no escalation)
87
+
88
+ This is shown for completeness; this entry NEVER reaches the owner mailbox. It is what the originator writes into `## Assumptions` in the session checkpoint. No `BLOCKED:` is filed.
89
+
90
+ ```
91
+ 2026-05-12T14:08Z backend-developer [class=tactical]: chose error message "user_id required" over "missing user_id" for consistency with existing 422 responses on /v1/users. (peer: none, evidence: n/a)
92
+ ```
93
+
94
+ The class=tactical originator does NOT file an escalation. If they file one anyway with `Peer attempts: <empty>`, the lead bounces it with `RETRY_PEER: try <peer role> first` (or `LOG_ASSUMPTION: this is tactical, log it instead`).
@@ -187,12 +187,14 @@ bash plugins/team-superpower/scripts/team-state.sh scan <slug>
187
187
  | `ARCH_BLOCKED` or `SEC_BLOCKED` from phase 3 | Pre-impl gate rejected the plan; arch/security findings need plan revisions | Planner addresses the report, re-emits the plan, re-runs the gate before phase 4 starts |
188
188
  | `QA_BLOCKED` from phase 5 | Acceptance criteria or regression coverage missing post-implementation | Lead files `impl:qa-fix-be-` / `impl:qa-fix-fe-` tasks; loop back to phase 4 |
189
189
  | Backend developer and frontend developer want the same file | Plan didn't capture file-scope metadata for the overlapping tasks, or the task was mis-prefixed | Serialize by holding one; planner should re-route by `impl:be-` / `impl:fe-` prefix and backfill file-scope |
190
- | `BAD_ESCALATION: missing field(s) ...` | A teammate posted a blocker without all five template fields | Rewrite using the full template in `ESCALATION.md` |
190
+ | `bad_escalation: missing field(s) ...` (warn-only in `log.jsonl`) | A teammate posted a blocker without all six template fields (`Phase`, `Context`, `Options`, `Recommendation`, `Need from you`, `Peer attempts`) | Rewrite using the full template in `assets/ESCALATION.md` |
191
191
  | Lead refuses to ping the owner | The teammate's request to escalate didn't use the §7 template | Same as above |
192
192
  | Teammate ran a non-Superpowers approximation of a skill | Teammate paraphrased the SKILL.md instead of following it | The agent's system prompt requires the canonical skill — re-spawn and remind it explicitly |
193
193
  | `REFUSED: heartbeat ... is Ns old` from cleanup | Heartbeat is fresh — cleanup script thinks a lead is alive | Verify nothing's running; if certain the previous lead is dead, run with `--ignore-heartbeat` |
194
194
  | `/team-feature` halts at preflight | Stale team config left over from a previous run | Run `/team-cleanup <slug>` (or resume via `/team-feature-resume`) |
195
195
  | `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. |
196
+ | `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 |
197
+ | `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 |
196
198
  | `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. |
197
199
  | 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>` |
198
200
  | 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 |
@@ -204,3 +206,13 @@ bash plugins/team-superpower/scripts/team-state.sh scan <slug>
204
206
  ## Where the methodology lives
205
207
 
206
208
  The team-superpower plugin is purely the coordination layer. The actual development discipline (TDD, plan format, two-stage review, branch hygiene) is owned by the upstream [obra/superpowers](https://github.com/obra/superpowers) skills. If a skill's behaviour changes, the team picks it up automatically — agents reference skills by name, not by content.
209
+
210
+ ## Session checkpoint § Assumptions
211
+
212
+ Every non-owner decision (tactical, cross-role with consensus, architectural with sign-off) is logged as one line in the session checkpoint's `## Assumptions` block. The QA and reviewer phases scan this block for contradictions with the design / plan; contradictions surface as QA findings or review comments. Format:
213
+
214
+ ```
215
+ - <ISO ts> <role> [class=<tactical|cross-role|architectural>]: <one-line decision> (peer: <role|none>, evidence: <link to mailbox msg | n/a>)
216
+ ```
217
+
218
+ The owner sees the assumptions log at every phase boundary as part of the checkpoint commit.
@@ -102,7 +102,15 @@ If the checkpoint's `## Closing` block exists but is incomplete (has `decision:`
102
102
  ### Step 5 — Reconstruct context
103
103
 
104
104
  - `cd` into the worktree path recorded in the checkpoint. If it no longer exists, halt and escalate via the §7 template — the owner needs to restore or rebase the worktree before resume can continue.
105
- - Recreate the team with the same name (`superpower-<slug>`).
105
+ - Recreate the team with the same name (`superpower-<slug>`) via the canonical `TeamCreate` tool:
106
+ ```
107
+ TeamCreate({
108
+ team_name: "superpower-<slug>",
109
+ agent_type: "team-lead",
110
+ description: "<reuse the description from the previous run if recorded in the checkpoint; otherwise the owner's one-line request>"
111
+ })
112
+ ```
113
+ TeamCreate is idempotent at the directory level — if `~/.claude/teams/superpower-<slug>/config.json` already exists from a partial cleanup, the runtime will refuse to overwrite. In that case, halt and instruct the owner to run `/team-cleanup <slug>` first (the resume protocol Step 3 should have caught this; if it didn't, that's a real bug — escalate).
106
114
  - Touch `docs/superpowers/sessions/<slug>.heartbeat` and update it at every phase boundary (same protocol as `/team-feature`).
107
115
 
108
116
  ### Step 6 — Re-read the shape marker
@@ -117,7 +125,7 @@ If the marker file is missing, re-derive shape from `CLAUDE.md` via `bash ${CLAU
117
125
 
118
126
  ### Step 6 (cont.) — Respawn only the teammates needed
119
127
 
120
- For the next phase, spawn the relevant role(s) using the agent definitions shipped with this plugin. Do **not** respawn teammates whose phase is complete unless that phase needs them again later (e.g. reviewer is reused in phase 7 for finish; planner is re-spawned if phase 3 returned `ARCH_BLOCKED` / `SEC_BLOCKED` and the plan needs revision; backend-developer / frontend-developer are re-spawned for `impl:qa-fix-*` or `impl:review-fix-*` tasks). Phase-to-role map:
128
+ For the next phase, spawn the relevant role(s) using the canonical `Agent` primitive documented in `/team-feature` § "Create the team (canonical primitive)" — same `subagent_type` / `team_name` / `name` / `prompt` shape, and `team_name` MUST be `superpower-<slug>` so messages route to the existing inboxes under `~/.claude/teams/superpower-<slug>/inboxes/`. Do **not** respawn teammates whose phase is complete unless that phase needs them again later (e.g. reviewer is reused in phase 7 for finish; planner is re-spawned if phase 3 returned `ARCH_BLOCKED` / `SEC_BLOCKED` and the plan needs revision; backend-developer / frontend-developer are re-spawned for `impl:qa-fix-*` or `impl:review-fix-*` tasks). Phase-to-role map:
121
129
 
122
130
  | Next phase | Spawn |
123
131
  |---|---|
@@ -5,6 +5,10 @@ argument-hint: <one-line feature idea>
5
5
 
6
6
  You are the **lead** of an agent team implementing the Superpowers methodology across multiple parallel Claude Code sessions.
7
7
 
8
+ > **Lead model:** run this command in an **Opus** session. The lead carries the cross-phase reasoning load (planning gates, escalation triage, FINISH_BLOCKED recovery, owner touchpoint budget). All 8 teammate agents are pinned to **Sonnet** via their frontmatter (`model: sonnet`) — they spawn on Sonnet regardless of the lead's model. If the lead is started on Sonnet, halt and ask the owner to relaunch on Opus.
9
+ >
10
+ > **Lead thinking discipline:** adaptive. Use extended (high-effort) thinking for every gate decision, escalation triage, classification of clarification questions (tactical / cross-role / architectural / owner-only), FINISH_BLOCKED recovery, and worktree-cleanup branching. Routine heartbeats, mailbox forwarding, status polls, and shared-task-list status reads may be quick. Teammates default to high thinking on every non-trivial step (see each agent's "Thinking discipline" section); the lead is the only role that scales effort per action.
11
+
8
12
  Owner's feature request:
9
13
 
10
14
  $ARGUMENTS
@@ -15,6 +19,7 @@ You are a **conductor**, not an implementer. Spawn teammates and coordinate them
15
19
 
16
20
  ## Required prechecks (run these first, in order)
17
21
 
22
+ 0. **Lead-model self-attestation.** Before doing anything else, state which model you (the lead) are currently running on. If you are not running on Opus, halt and instruct the owner: "Lead must be on Opus. Relaunch this session with `claude --model opus` (or pick Opus in the model switcher) and rerun `/team-feature`." Teammates are pinned to Sonnet via their agent frontmatter; only the lead model is set by the session.
18
23
  1. Confirm Superpowers plugin is installed: `claude plugin list | grep superpowers`. If missing, **halt** and instruct the owner: `/plugin install superpowers@claude-plugins-official`. Capture the version string from `claude plugin list --json` (e.g. `5.0.7`) — you'll write it to the checkpoint in phase 0 step 5 below.
19
24
  2. Confirm Claude Code version is `2.1.32` or later: `claude --version`. If older, halt.
20
25
  3. Confirm `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set in the environment. If not, halt and instruct the owner to add it to `~/.claude/settings.json` under `env`.
@@ -135,6 +140,70 @@ After preflight clears AND phase 0 has decided the shape:
135
140
  3. Ensure `docs/superpowers/sessions/<slug>.shape` was written in phase 0.4 and is committed.
136
141
  4. Write checkpoint updates atomically: write to `<file>.tmp` then `mv -f <file>.tmp <file>`. Half-written checkpoints corrupt recovery.
137
142
 
143
+ ## Create the team (canonical primitive)
144
+
145
+ Immediately after writing the initial checkpoint and **before** spawning any teammate, create the team via the canonical Claude Code `TeamCreate` tool. Do NOT mkdir `~/.claude/teams/...` by hand — the runtime owns that directory and the inbox files inside it.
146
+
147
+ Call:
148
+
149
+ ```
150
+ TeamCreate({
151
+ team_name: "superpower-<slug>",
152
+ agent_type: "team-lead",
153
+ description: "<one-line owner request, ≤120 chars>"
154
+ })
155
+ ```
156
+
157
+ This creates:
158
+
159
+ ```
160
+ ~/.claude/teams/superpower-<slug>/
161
+ ├── config.json ← team configuration & members (lead-managed)
162
+ └── inboxes/
163
+ ├── team-lead.json ← your inbox (auto-populated as teammates SendMessage you)
164
+ ├── designer.json ← created when the designer teammate is spawned
165
+ ├── planner.json ← created when the planner is spawned
166
+ └── ... ← one file per teammate name (= the agent's role)
167
+
168
+ ~/.claude/tasks/superpower-<slug>/
169
+ └── ... ← shared task list (TaskCreate / TaskUpdate)
170
+ ```
171
+
172
+ The runtime appends every inbound `SendMessage` to the recipient's JSON array with shape:
173
+
174
+ ```json
175
+ {
176
+ "from": "<sender role name>",
177
+ "text": "<message body>",
178
+ "summary": "<5-10 word preview>",
179
+ "timestamp": "<ISO 8601 UTC>",
180
+ "read": false,
181
+ "color": "<UI hint>"
182
+ }
183
+ ```
184
+
185
+ You never write these files directly. Always use `SendMessage` to deliver, and read your inbox through the automatic delivery the runtime hands you (see "Automatic Message Delivery" in the TeamCreate tool docs). The only hand-read is `~/.claude/teams/superpower-<slug>/config.json` when you need to discover member roles by name.
186
+
187
+ ### Spawning teammates (canonical Agent call)
188
+
189
+ When you spawn a teammate (per the phase chain below), use the `Agent` tool with **all four** of these parameters:
190
+
191
+ ```
192
+ Agent({
193
+ subagent_type: "<role>", // e.g. "team-superpower:designer"; matches the agent .md filename
194
+ team_name: "superpower-<slug>",
195
+ name: "<role>", // e.g. "designer"; becomes the inbox filename (designer.json) and the SendMessage `to` value
196
+ prompt: "<filled Spawn prompt template, see below>"
197
+ })
198
+ ```
199
+
200
+ Hard rules for the spawn call:
201
+
202
+ - `name` MUST equal the role string (`designer`, `planner`, `software-architect`, `security-engineer`, `backend-developer`, `frontend-developer`, `qa-engineer`, `reviewer`). Inbox filenames depend on this.
203
+ - `team_name` MUST equal `superpower-<slug>` — every cleanup, resume, and `team-state.sh` primitive depends on this convention.
204
+ - `subagent_type` MUST match the agent definition shipped by this plugin (`team-superpower:<role>`).
205
+ - Do NOT spawn the same role twice in parallel. If a role needs a second pass, mailbox the existing teammate instead of spawning a duplicate.
206
+
138
207
  ## Spawn prompt template (use verbatim — do NOT improvise per role)
139
208
 
140
209
  Every teammate spawn MUST hand over the same minimum context. A teammate inherits project context (`CLAUDE.md`, MCP servers, skills) automatically but does NOT inherit your conversation history — anything implicit on your side is invisible on theirs. Use this template:
@@ -453,6 +522,10 @@ stack_shape: full-stack | be-only | fe-only
453
522
  ## Open escalations
454
523
  - (none) | <escalation-template entries>
455
524
 
525
+ ## Assumptions
526
+ (appended after each phase; one entry per non-owner decision)
527
+ - <ISO ts> <role> [class=<tactical|cross-role|architectural>]: <one-line decision> (peer: <role|none>, evidence: <link to mailbox msg | n/a>)
528
+
456
529
  ## Resume protocol
457
530
  1. Owner runs /team-feature-resume with this filename.
458
531
  2. Lead respawns teammates using same role definitions.
@@ -487,5 +560,6 @@ stack_shape: full-stack | be-only | fe-only
487
560
  - **Never** spawn more than 5 teammates concurrently. The plugin defines up to 8 lifetime roles but phase-gating must keep ≤ 5 active at any moment. If a future change would break this, halt and escalate.
488
561
  - **Never** run Step D.5 worktree removal when `**Worktree origin:** reused`. The worktree existed before `/team-feature` started; the owner owns it. Record `worktree: removal-skipped:reused-existing-worktree` and leave the worktree on disk.
489
562
  - **Never** let the planner run inside a linked worktree on a protected branch (`main`, `master`, `develop`, `dev`, `release/*`, `releases/*`). The planner halts and escalates; the owner switches to a feature branch and re-runs.
563
+ - **Never** forward an owner-bound escalation when the originator's `class` is not `owner-only` AND `Peer attempts` lists fewer than one round-trip with a peer. The lead returns the escalation to the originator with `RETRY_PEER: try <suggested role> first`. Touchpoint count is NOT decremented (this is a routing reject, not an owner touch). The lead also returns it with `LOG_ASSUMPTION: tactical questions log to checkpoint § Assumptions, not the mailbox` when `class=tactical`. The 4-class table is in `assets/ESCALATION.md`. Class detection: scan the `Peer attempts:` field body for a `class=<name>` token (matches `class=tactical|cross-role|architectural|owner-only`). If absent, the field contains ISO-timestamped peer attempts — treat the originator's class as `cross-role` (the only class that produces real peer attempts) and accept a round-trip count ≥ 1.
490
564
 
491
565
  Begin with the prechecks, then preflight, then run phase 0 (stack detection / shape decision / version pin / shape marker), then spawn `designer`.
@@ -48,8 +48,7 @@ printf '{"ts":"%s","hook":"task-completed","title":%s,"plan_approved_at":%s}\n'
48
48
  case "$title" in
49
49
  impl:*)
50
50
  if [ -z "$plan_approved_at" ]; then
51
- echo "NO_PLAN_APPROVAL: impl: tasks require metadata.plan_approved_at before completion (title: $title)" >&2
52
- exit 2
51
+ printf '{"ts":"%s","hook":"task-completed","warn":"no_plan_approval","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
53
52
  fi
54
53
  ;;
55
54
  esac
@@ -66,8 +65,7 @@ case "$title" in
66
65
  | select((.status // "") == "in_progress")
67
66
  ] | length' 2>/dev/null || echo 0)"
68
67
  if [ "${other_in_progress:-0}" -gt 0 ]; then
69
- echo "MIGRATION_RACE: another impl:be-migration-* task is in_progress; migrations must serialize. (title: $title)" >&2
70
- exit 2
68
+ printf '{"ts":"%s","hook":"task-completed","warn":"migration_race","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
71
69
  fi
72
70
  ;;
73
71
  esac
@@ -92,8 +90,7 @@ case "$title" in
92
90
  done <<< "$patterns"
93
91
  done <<< "$commits"
94
92
  if [ "$touched" -ne 1 ]; then
95
- echo "EMPTY_CONTRACT_PUBLISH: $title claims to publish a contract but no commit touches a contract file (looked for: $(echo "$patterns" | tr '\n' ' '))" >&2
96
- exit 2
93
+ printf '{"ts":"%s","hook":"task-completed","warn":"empty_contract_publish","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
97
94
  fi
98
95
  fi
99
96
  fi
@@ -101,7 +98,7 @@ case "$title" in
101
98
  esac
102
99
 
103
100
  # Validate escalation entries if present.
104
- required_fields=("Phase" "Context" "Options" "Recommendation" "Need from you")
101
+ required_fields=("Phase" "Context" "Options" "Recommendation" "Need from you" "Peer attempts")
105
102
  missing_any=""
106
103
  entries="$(printf '%s' "$payload" | jq -c '(.task.metadata.blocked_questions // .metadata.blocked_questions // [])[]?' 2>/dev/null || true)"
107
104
 
@@ -130,8 +127,7 @@ if [ -n "$entries" ]; then
130
127
  fi
131
128
 
132
129
  if [ -n "$missing_any" ]; then
133
- echo "BAD_ESCALATION: missing field(s) $missing_any" >&2
134
- exit 2
130
+ printf '{"ts":"%s","hook":"task-completed","warn":"bad_escalation","missing":%s}\n' "$ts" "$(printf '%s' "$missing_any" | jq -Rs .)" >> "$LOG_FILE"
135
131
  fi
136
132
 
137
133
  exit 0
@@ -70,11 +70,11 @@ case "$title" in
70
70
  review:*|meta:*|block:*) exit 0 ;;
71
71
  impl:*) ;;
72
72
  "")
73
- echo "BAD_PREFIX: task title missing; must start with impl:|review:|meta:|block:" >&2
74
- exit 2 ;;
73
+ printf '{"ts":"%s","hook":"task-created","warn":"bad_prefix","reason":"title missing"}\n' "$ts" >> "$LOG_FILE"
74
+ ;;
75
75
  *)
76
- echo "BAD_PREFIX: task title must start with impl:|review:|meta:|block: (got: $title)" >&2
77
- exit 2 ;;
76
+ printf '{"ts":"%s","hook":"task-created","warn":"bad_prefix","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
77
+ ;;
78
78
  esac
79
79
 
80
80
  # At this point title starts with `impl:`. Strip prefix and require a known
@@ -91,22 +91,20 @@ case "$rest" in
91
91
  sub="contract"
92
92
  ;;
93
93
  *)
94
- echo "BAD_PREFIX: impl: task requires a sub-prefix (be-|fe-|qa-fix-be-|qa-fix-fe-|review-fix-be-|review-fix-fe-|contract-update-|be-migration-|be-contract-publish-). Got: $title" >&2
95
- exit 2 ;;
94
+ printf '{"ts":"%s","hook":"task-created","warn":"bad_subprefix","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
95
+ exit 0 ;;
96
96
  esac
97
97
 
98
98
  # Shape-aware enforcement
99
99
  case "$shape" in
100
100
  be-only)
101
101
  if [ "$sub" = "fe" ]; then
102
- echo "SHAPE_REJECTED: shape is 'be-only'; impl:fe-* tasks are not allowed for this feature." >&2
103
- exit 2
102
+ printf '{"ts":"%s","hook":"task-created","warn":"shape_rejected","shape":"be-only","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
104
103
  fi
105
104
  ;;
106
105
  fe-only)
107
106
  if [ "$sub" = "be" ]; then
108
- echo "SHAPE_REJECTED: shape is 'fe-only'; impl:be-* tasks are not allowed for this feature." >&2
109
- exit 2
107
+ printf '{"ts":"%s","hook":"task-created","warn":"shape_rejected","shape":"fe-only","title":%s}\n' "$ts" "$(printf '%s' "$title" | jq -Rs .)" >> "$LOG_FILE"
110
108
  fi
111
109
  ;;
112
110
  full-stack|"")
@@ -38,8 +38,7 @@ unanswered="$(printf '%s' "$payload" | jq '[.mailbox[]? | select((.from // "") !
38
38
  printf '{"ts":"%s","hook":"teammate-idle","unanswered":%s}\n' "$ts" "$unanswered" >> "$LOG_FILE"
39
39
 
40
40
  if [ "${unanswered:-0}" -gt 0 ]; then
41
- echo "BLOCKED_IDLE: $unanswered unanswered peer messages. Reply or escalate via ESCALATION.md before idling." >&2
42
- exit 2
41
+ printf '{"ts":"%s","hook":"teammate-idle","warn":"blocked_idle","unanswered":%s}\n' "$ts" "$unanswered" >> "$LOG_FILE"
43
42
  fi
44
43
 
45
44
  exit 0
@@ -28,7 +28,7 @@
28
28
  # 1 dry-run completed with items to remove (caller should re-run with --force)
29
29
  # 2 bad arguments
30
30
  # 3 heartbeat indicates a live lead; refuse without --ignore-heartbeat
31
- # 4 nothing to clean up (cleanup) / no teams found (scan)
31
+ # 4 nothing to clean up (cleanup only; scan is read-only and always exits 0)
32
32
 
33
33
  set -euo pipefail
34
34
 
@@ -82,7 +82,7 @@ cmd_scan() {
82
82
  slugs="$(list_all_team_slugs)"
83
83
  if [ -z "$slugs" ]; then
84
84
  echo "No team-superpower teams found under $TEAMS_DIR"
85
- return 4
85
+ return 0
86
86
  fi
87
87
  echo "team-superpower teams on this machine:"
88
88
  while IFS= read -r s; do
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tech-graph",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Step-by-step wizard for generating technical diagrams as SVG+PNG.",
5
5
  "author": {
6
6
  "name": "steven"