@drunkcoding/agents-and-skills 0.0.18 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.claude-plugin/marketplace.json +5 -5
  2. package/README.md +23 -0
  3. package/package.json +1 -1
  4. package/plugins/auto-power/.claude-plugin/plugin.json +1 -1
  5. package/plugins/html-effectiveness/.claude-plugin/plugin.json +1 -1
  6. package/plugins/plugin-validator/.claude-plugin/plugin.json +1 -1
  7. package/plugins/team-superpower/.claude-plugin/plugin.json +1 -1
  8. package/plugins/team-superpower/README.md +186 -115
  9. package/plugins/team-superpower/agents/backend-developer.md +161 -39
  10. package/plugins/team-superpower/agents/feature-planner.md +66 -0
  11. package/plugins/team-superpower/agents/frontend-developer.md +163 -34
  12. package/plugins/team-superpower/agents/orchestrator.md +83 -0
  13. package/plugins/team-superpower/agents/qc-engineer.md +84 -0
  14. package/plugins/team-superpower/agents/security-engineer.md +90 -40
  15. package/plugins/team-superpower/agents/solution-architect.md +80 -0
  16. package/plugins/team-superpower/agents/team-leader.md +100 -0
  17. package/plugins/team-superpower/assets/AGENTS.md.template +23 -0
  18. package/plugins/team-superpower/assets/CLAUDE.md.template +25 -4
  19. package/plugins/team-superpower/assets/ESCALATION.md +114 -66
  20. package/plugins/team-superpower/assets/SESSION_README.md +233 -113
  21. package/plugins/team-superpower/commands/team-feature.md +195 -443
  22. package/plugins/team-superpower/hooks/task-completed.sh +180 -59
  23. package/plugins/team-superpower/hooks/task-created.sh +77 -19
  24. package/plugins/team-superpower/hooks/teammate-idle.sh +118 -13
  25. package/plugins/team-superpower/scripts/assess-complexity.sh +194 -0
  26. package/plugins/team-superpower/scripts/detect-stack.sh +39 -0
  27. package/plugins/team-superpower/scripts/team-state.sh +106 -37
  28. package/plugins/team-superpower/scripts/wave-collision-check.sh +60 -0
  29. package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
  30. package/plugins/html-effectiveness/tests/_tmp.test.js +0 -58
  31. package/plugins/html-effectiveness/tests/fixtures/01-exploration-code-approaches.data.json +0 -3
  32. package/plugins/html-effectiveness/tests/fixtures/02-exploration-visual-designs.data.json +0 -3
  33. package/plugins/html-effectiveness/tests/fixtures/03-code-review-pr.data.json +0 -3
  34. package/plugins/html-effectiveness/tests/fixtures/04-code-understanding.data.json +0 -3
  35. package/plugins/html-effectiveness/tests/fixtures/05-design-system.data.json +0 -3
  36. package/plugins/html-effectiveness/tests/fixtures/06-component-variants.data.json +0 -3
  37. package/plugins/html-effectiveness/tests/fixtures/07-prototype-animation.data.json +0 -3
  38. package/plugins/html-effectiveness/tests/fixtures/08-prototype-interaction.data.json +0 -3
  39. package/plugins/html-effectiveness/tests/fixtures/09-slide-deck.data.json +0 -3
  40. package/plugins/html-effectiveness/tests/fixtures/10-svg-illustrations.data.json +0 -3
  41. package/plugins/html-effectiveness/tests/fixtures/11-status-report.data.json +0 -37
  42. package/plugins/html-effectiveness/tests/fixtures/12-incident-report.data.json +0 -3
  43. package/plugins/html-effectiveness/tests/fixtures/13-flowchart-diagram.data.json +0 -3
  44. package/plugins/html-effectiveness/tests/fixtures/14-research-feature-explainer.data.json +0 -3
  45. package/plugins/html-effectiveness/tests/fixtures/15-research-concept-explainer.data.json +0 -3
  46. package/plugins/html-effectiveness/tests/fixtures/16-implementation-plan.data.json +0 -3
  47. package/plugins/html-effectiveness/tests/fixtures/17-pr-writeup.data.json +0 -3
  48. package/plugins/html-effectiveness/tests/fixtures/18-editor-triage-board.data.json +0 -3
  49. package/plugins/html-effectiveness/tests/fixtures/19-editor-feature-flags.data.json +0 -3
  50. package/plugins/html-effectiveness/tests/fixtures/20-editor-prompt-tuner.data.json +0 -3
  51. package/plugins/html-effectiveness/tests/fixtures/_canned.data.json +0 -7
  52. package/plugins/html-effectiveness/tests/fixtures/_canned.html.tmpl +0 -7
  53. package/plugins/html-effectiveness/tests/fixtures/_canned.manifest.json +0 -18
  54. package/plugins/html-effectiveness/tests/manifest.test.js +0 -61
  55. package/plugins/html-effectiveness/tests/mustache.test.js +0 -47
  56. package/plugins/html-effectiveness/tests/render.test.js +0 -118
  57. package/plugins/team-superpower/agents/designer.md +0 -50
  58. package/plugins/team-superpower/agents/planner.md +0 -186
  59. package/plugins/team-superpower/agents/qa-engineer.md +0 -47
  60. package/plugins/team-superpower/agents/reviewer.md +0 -110
  61. package/plugins/team-superpower/agents/software-architect.md +0 -45
  62. package/plugins/team-superpower/commands/team-feature-resume.md +0 -185
@@ -1,94 +1,142 @@
1
- # Escalation template (team-superpower)
1
+ # Escalation template (team-superpower v5)
2
2
 
3
- Every owner-facing question and every "I'm blocked" peer message MUST use this exact format. The `TaskCompleted` hook spot-checks for the field labels, and the lead refuses to forward escalations that don't match.
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
4
 
5
- ## Template
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)
6
51
 
7
52
  ```
8
- BLOCKED: <one-line question>
9
- Phase: <design | plan | pre_impl_review | implementation | qa | review | finish>
10
- Context: <2-4 sentences — what we tried, what we considered, why we are stuck>
11
- Options:
12
- A. <option> — <trade-off>
13
- B. <option> — <trade-off>
14
- C. <option> — <trade-off> (optional)
15
- Recommendation: <our pick + one-sentence why>
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>
53
+ RESTART_REQUEST <reason>
54
+ trigger: <task-id | wave-id | qc-issue>
55
+ context: <2-4 sentences — what arch decision broke, what implementers reported>
23
56
  ```
24
57
 
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.
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."
26
63
 
27
- ## Decision classes
64
+ ## Decision classes (v5 reference)
28
65
 
29
66
  | Class | Examples | Routing |
30
67
  | --------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
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>`. |
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.
35
73
 
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.
74
+ ## Worked example 1 backend-developer tactical (NOT escalated, logged as assumption)
37
75
 
38
- ## Worked example 1 peer-to-peer (planner designer)
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:
39
77
 
40
78
  ```
41
- BLOCKED: Acceptance criterion "fast" on req #4 is not measurable. What does "fast" mean here?
42
- Phase: plan
43
- Context: I am sizing tasks for the search endpoint. Design doc §4 says "results must come back fast." The plan needs a concrete number so the test the implementer writes can fail until the number is hit. I considered defaulting to "p95 < 200ms on a 10k-row fixture" but that's me guessing on the owner's behalf.
44
- Options:
45
- A. Adopt p95 < 200ms on the 10k-row fixture and proceed — designer can re-open if wrong.
46
- B. Pause planning; designer amends the design doc with a measurable number; owner re-approves the doc delta.
47
- C. Drop the criterion from the plan and tag it as a follow-up.
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.
49
- Need from you: choose A/B/C.
50
- Peer attempts:
51
- - 2026-05-12T14:02Z asked designer: "no reply within cadence (30min)"
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)
52
87
  ```
53
88
 
54
- ## Worked example 2 — lead-to-owner (plan-vs-design mismatch surfaced mid-implementation)
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.
55
94
 
56
95
  ```
57
- BLOCKED: backend-developer reports that task impl:be-add-user-endpoint specifies POST /users, but the approved design doc says PUT /users/{id}. Which is canonical?
58
- Phase: implementation
59
- Context: The plan was approved 2026-05-12T09:14Z. Task 4 reads "POST /users 201 Created with body". Design doc §3 (approved 2026-05-12T08:51Z) reads "idempotent PUT /users/{id}, 200 or 201". Both choices change the test the backend-developer writes in the RED step. We have not yet written code for this task — TDD held the line.
60
- Options:
61
- A. Owner confirms PUT /users/{id} is correct → planner amends task 4 → owner re-approves the plan delta → backend-developer proceeds.
62
- B. Owner confirms POST /users is correct → designer amends the design doc → owner re-approves the design delta → backend-developer proceeds.
63
- C. Owner reopens the design question entirely (the two APIs imply different semantics).
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.
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
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`.
68
100
  ```
69
101
 
70
- ## Worked example 3 lead-to-owner (`FINISH_BLOCKED` option E)
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.
71
107
 
72
108
  ```
73
- BLOCKED: Merge of feature/user-search into main failed: push rejected because origin/main advanced. Owner picked option E (escalate) from the 5-option menu rather than retrying inline.
74
- Phase: finish
75
- Context: Reviewer attempted `git push` after a clean local merge. Push was rejected: "Updates were rejected because the remote contains work that you do not have locally." The remote moved between phase 6 and phase 7. The lead's 5-option menu was presented; owner chose E because they want to coordinate the rebase manually rather than have the team retry blind.
76
- Options:
77
- A. Owner rebases the feature branch locally onto origin/main, signals "ready to retry"; lead instructs reviewer to retry merge (counts as 1/3 retries).
78
- B. Owner pulls latest origin/main into trunk first, then signals; lead retries.
79
- C. Owner switches the decision to pr_opened and merges via GitHub UI.
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.
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
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.
84
113
  ```
85
114
 
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.
115
+ team-leader confirms this contradicts arch-map, posts to lead:
89
116
 
90
117
  ```
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)
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.
92
121
  ```
93
122
 
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`).
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.