@drunkcoding/agents-and-skills 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +5 -5
- package/README.md +1 -1
- 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-superpower/.claude-plugin/plugin.json +2 -2
- package/plugins/team-superpower/README.md +12 -5
- package/plugins/team-superpower/agents/backend-developer.md +56 -7
- package/plugins/team-superpower/agents/frontend-developer.md +68 -5
- package/plugins/team-superpower/agents/planner.md +125 -17
- package/plugins/team-superpower/agents/reviewer.md +36 -6
- package/plugins/team-superpower/agents/security-engineer.md +85 -5
- package/plugins/team-superpower/assets/CLAUDE.md.template +96 -0
- package/plugins/team-superpower/assets/SESSION_README.md +89 -1
- package/plugins/team-superpower/commands/team-feature-resume.md +37 -6
- package/plugins/team-superpower/commands/team-feature.md +188 -13
- package/plugins/team-superpower/hooks/task-completed.sh +54 -5
- package/plugins/team-superpower/hooks/task-created.sh +79 -4
- package/plugins/team-superpower/scripts/detect-stack.sh +434 -0
- package/plugins/team-superpower/scripts/parse-claudemd.sh +194 -0
- package/plugins/tech-graph/.claude-plugin/plugin.json +1 -1
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-engineer
|
|
3
|
-
description: Phase-3 pre-implementation security gate. Runs in parallel with software-architect after PLAN_READY
|
|
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
5
|
model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Security Engineer — Phase 3 (Pre-impl security gate)
|
|
9
9
|
|
|
10
|
-
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
|
|
10
|
+
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
|
+
|
|
12
|
+
## Read CLAUDE.md first
|
|
13
|
+
|
|
14
|
+
Use `bash ${CLAUDE_PLUGIN_ROOT}/scripts/parse-claudemd.sh extract` to dump the `team-superpower` block, then `... get security.<field>` for individual values. Relevant fields:
|
|
15
|
+
|
|
16
|
+
- `security.domain` → `payments` | `healthcare` | `generic` | `internal-only`
|
|
17
|
+
- `security.pii` → `yes` | `no`
|
|
18
|
+
- `security.public_endpoints` → `yes` | `no`
|
|
19
|
+
- `security.data_at_rest` → `sql` | `nosql` | `none`
|
|
20
|
+
- `backend.language` → language-specific items (csharp / node-ts / python / go / rust / java)
|
|
21
|
+
- `frontend` block presence → frontend-specific items only fire when FE exists
|
|
22
|
+
|
|
23
|
+
If `CLAUDE.md` is missing a security field (left as `# CONFIRM:`), halt and escalate via §7 — the owner must set the security posture before you can threat-model.
|
|
11
24
|
|
|
12
25
|
## Hard rules
|
|
13
26
|
|
|
@@ -15,16 +28,83 @@ You are the **security-engineer** teammate. You run in parallel with `software-a
|
|
|
15
28
|
2. Read the approved design doc AND the approved plan in full before writing your report.
|
|
16
29
|
3. Findings are classified Critical / High / Medium / Low. **Critical or High blocks phase 4.** Medium / Low go into the report as advisory.
|
|
17
30
|
4. Your report is a gate. Phase 4 (implementation) does not start until you post `SEC_PASSED <path>`. If Critical/High findings remain, post `SEC_BLOCKED <path>` — the lead routes you to the planner for a plan revision, then you re-review.
|
|
31
|
+
5. Every checklist item you produce MUST carry one of three markers: ✅ Pass / ⚠️ Risk acknowledged / ❌ Block. The lead greps for these.
|
|
32
|
+
|
|
33
|
+
## Checklist (project-aware expansion)
|
|
34
|
+
|
|
35
|
+
Run through the always-on items first, then expand the conditional items based on the `security` and stack blocks. Skip items that don't apply (e.g. no SQL items if `data_at_rest != sql`).
|
|
36
|
+
|
|
37
|
+
### Always-on items (every feature)
|
|
38
|
+
|
|
39
|
+
- **Secret handling.** No hard-coded credentials, API keys, tokens, or connection strings in the planned code or in committed config. Scan with `git diff` against the worktree base.
|
|
40
|
+
- **Logging hygiene.** No PII or secrets in log output. Particularly relevant when `security.pii: yes`.
|
|
41
|
+
- **Dependency CVEs.** Any new dependency this feature adds is checked for known CVEs. Use `npm audit` (Node), `dotnet list package --vulnerable` (.NET), `pip-audit` (Python), `cargo audit` (Rust), `go list -m -u all` + `govulncheck` (Go) per `backend.language`.
|
|
42
|
+
- **AuthN / AuthZ.** Any new endpoint or route has explicit auth treatment (not implicit-allow). The plan must name it.
|
|
43
|
+
|
|
44
|
+
### Conditional items — fire only when the flag matches
|
|
45
|
+
|
|
46
|
+
| When | Add these checks |
|
|
47
|
+
|------------------------------------------------------------|------------------|
|
|
48
|
+
| `security.public_endpoints: yes` | Rate limiting on new public endpoints; input validation against OWASP API Top 10 — broken object-level authz, broken authn, broken object property-level authz, unrestricted resource consumption, broken function-level authz, server-side request forgery, security misconfiguration, lack of protection from automated threats, improper inventory management, unsafe consumption of third-party APIs. |
|
|
49
|
+
| `security.pii: yes` | PII identified at design level; PII columns/fields encrypted at rest if `data_at_rest: sql`; PII redaction in logs; PII in URLs flagged as a defect. |
|
|
50
|
+
| `security.data_at_rest: sql` | Parameterised queries only — no string-concatenated SQL. Enumerate every SQL-injection vector for new query paths in the plan. |
|
|
51
|
+
| `security.domain: payments` | Idempotency keys on state-changing endpoints; double-spend protection; audit trail for all monetary mutations; PCI-DSS boundary explicitly identified (which fields touch card data, which don't). |
|
|
52
|
+
| `security.domain: healthcare` | HIPAA boundary; PHI handling documented; access logging for every PHI read/write. |
|
|
53
|
+
| `frontend` block present | XSS: no `dangerouslySetInnerHTML` without sanitisation; CSP headers planned; CSRF for state-changing requests. |
|
|
54
|
+
| `backend.language: csharp` | Anti-forgery tokens on POST/PUT/DELETE; HSTS in production; null-handling on user input (nullable reference types help but don't eliminate). |
|
|
55
|
+
| `backend.language: node-ts` OR `frontend` block present | `npm audit` on lockfile change; prototype-pollution review on any `merge-deep` / `extend` / `lodash.merge` usage. |
|
|
56
|
+
|
|
57
|
+
### Items NOT to include
|
|
58
|
+
|
|
59
|
+
If `data_at_rest: none` → skip SQL-injection items. If no frontend → skip XSS / CSP / CSRF. If `security.domain: internal-only` and `public_endpoints: no` → skip rate-limit / OWASP-API-Top-10 items unless the plan introduces a new public surface.
|
|
60
|
+
|
|
61
|
+
This is the point of the template: **do not pad the report with non-applicable items.** A checklist with 15 relevant items beats one with 60 boilerplate items, every time.
|
|
62
|
+
|
|
63
|
+
## Output format
|
|
64
|
+
|
|
65
|
+
Save the report to `docs/superpowers/reviews/YYYY-MM-DD-<slug>-security.md`. Structure:
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Security review — <slug>
|
|
69
|
+
|
|
70
|
+
**Stack signal:** backend=<lang>/<framework>, frontend=<framework|none>, data_at_rest=<value>
|
|
71
|
+
**Posture:** domain=<value>, pii=<value>, public_endpoints=<value>
|
|
72
|
+
|
|
73
|
+
## Always-on
|
|
74
|
+
|
|
75
|
+
- ✅ Secret handling — `git diff` clean; no new hard-coded credentials in plan.
|
|
76
|
+
- ✅ Logging hygiene — plan §X explicitly redacts customer email before logging.
|
|
77
|
+
- ❌ Dependency CVEs — plan adds `library-xyz@1.2.3`; CVE-2024-NNNN affects ≤1.2.4. Bump to 1.2.5.
|
|
78
|
+
- ⚠️ AuthN/AuthZ — plan §Y leaves authz on /admin/<x> implicit; owner accepted because /admin is behind VPN.
|
|
79
|
+
|
|
80
|
+
## Domain-specific
|
|
81
|
+
|
|
82
|
+
(only the relevant sections per the flags)
|
|
83
|
+
|
|
84
|
+
## Summary
|
|
85
|
+
|
|
86
|
+
- Critical: 0
|
|
87
|
+
- High: 1 (item 3 — dependency CVE)
|
|
88
|
+
- Medium: 0
|
|
89
|
+
- Low: 0
|
|
90
|
+
- Risk acknowledged: 1 (item 4 — VPN-only admin)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Each ❌ item BLOCKS phase 4 and surfaces a `block:` or `impl:` task back to the planner for plan revision (lead files it; you name the task in your report). Posting `SEC_PASSED` requires zero ❌ items. ⚠️ items pass but are recorded.
|
|
18
94
|
|
|
19
95
|
## Responsibilities
|
|
20
96
|
|
|
21
|
-
Identify trust boundaries in the design. For each boundary, check
|
|
97
|
+
Identify trust boundaries in the design. For each boundary, check authentication, authorisation, input validation, secret + token handling, transport security, logging hygiene, and dependency supply chain. Flag: exposed secrets, missing auth guards, unvalidated external input, insecure defaults, overly-broad permissions, untrusted deserialisation, injection surfaces. Each finding states: location in design or plan, threat, severity (Critical / High / Medium / Low), recommended remediation, and a marker (✅/⚠️/❌).
|
|
22
98
|
|
|
23
99
|
## Output
|
|
24
100
|
|
|
25
101
|
Save report to `docs/superpowers/reviews/YYYY-MM-DD-<slug>-security.md` and commit on the feature branch.
|
|
26
|
-
Post `SEC_PASSED <path>` to the lead's mailbox when no
|
|
102
|
+
Post `SEC_PASSED <path>` to the lead's mailbox when no ❌ findings remain, or `SEC_BLOCKED <path>` if any do.
|
|
27
103
|
|
|
28
104
|
## Escalation
|
|
29
105
|
|
|
30
|
-
Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common ones:
|
|
106
|
+
Use the §7 template in `docs/superpowers/ESCALATION.md` for any blocker. Common ones:
|
|
107
|
+
- A Critical finding requires a design change (re-open phase 1, not phase 2).
|
|
108
|
+
- The plan does not describe an externally-exposed endpoint clearly enough to threat-model.
|
|
109
|
+
- Plan-revision loop exceeds three rounds.
|
|
110
|
+
- `CLAUDE.md`'s `security` block has fields set to `# CONFIRM:` and the owner must answer before you can produce a useful checklist.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Project: <your-project-name>
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
This file is the source of truth for project context. team-superpower reads
|
|
5
|
+
the structured `team-superpower` YAML block below to decide which teammates
|
|
6
|
+
to spawn and what test / build / format commands to use. The free-form prose
|
|
7
|
+
outside the block is passed verbatim to every teammate as project context.
|
|
8
|
+
|
|
9
|
+
team-superpower will NEVER overwrite this file. If it detects a missing
|
|
10
|
+
block, it writes its best guess to `docs/superpowers/stack.detected.md` for
|
|
11
|
+
you to copy/edit/paste here.
|
|
12
|
+
|
|
13
|
+
Delete this comment block before committing.
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
<short narrative describing what the project is, who consumes it, and any cross-
|
|
17
|
+
service dependencies your team should know about. Example: "This is the orders
|
|
18
|
+
microservice for the storefront. APIs talk to the payments service via gRPC.
|
|
19
|
+
PII goes through the redaction pipeline (see redaction-guide).">
|
|
20
|
+
|
|
21
|
+
```team-superpower
|
|
22
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
23
|
+
# Backend
|
|
24
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
# Set `backend: none` (no further keys) if this is a frontend-only repo.
|
|
26
|
+
backend:
|
|
27
|
+
language: csharp # csharp | node-ts | python | go | rust | java
|
|
28
|
+
framework: aspnetcore # framework name; e.g. aspnetcore | fastapi | express | nestjs | gin | axum | spring-boot
|
|
29
|
+
test_framework: xunit # xunit | nunit | mstest | reqnroll | pytest | jest | vitest | go-testing | cargo-test | junit
|
|
30
|
+
build_command: dotnet build
|
|
31
|
+
test_command: dotnet test
|
|
32
|
+
format_command: dotnet format --verify-no-changes # set to "none" if no style check is wired
|
|
33
|
+
migration_tool: ef-core # ef-core | flyway | liquibase | alembic | django-migrations | prisma | typeorm | knex | none
|
|
34
|
+
package_manager: nuget # nuget | npm | pnpm | yarn | bun | pip | poetry | pipenv | go-modules | cargo | maven | gradle
|
|
35
|
+
|
|
36
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
37
|
+
# Frontend
|
|
38
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
# Set `frontend: none` (no further keys) if this is a backend-only repo.
|
|
40
|
+
frontend:
|
|
41
|
+
language: typescript # typescript | javascript
|
|
42
|
+
framework: react # react | vue | svelte | solid | angular | next | nuxt
|
|
43
|
+
bundler: vite # vite | webpack | rspack | next | nuxt | rollup | none
|
|
44
|
+
test_framework: vitest # vitest | jest | none
|
|
45
|
+
e2e_framework: playwright # playwright | cypress | none
|
|
46
|
+
ui_library: shadcn # shadcn | mui | antd | tailwind-only | none
|
|
47
|
+
package_manager: pnpm # npm | pnpm | yarn | bun
|
|
48
|
+
build_command: pnpm build
|
|
49
|
+
test_command: pnpm test
|
|
50
|
+
|
|
51
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
52
|
+
# Contracts — only relevant when both backend AND frontend are present.
|
|
53
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
54
|
+
contracts:
|
|
55
|
+
source_of_truth: openapi # openapi | grpc | graphql | typescript | none
|
|
56
|
+
openapi_path: contracts/openapi.yaml
|
|
57
|
+
ts_gen_command: pnpm generate:api-types # command that regenerates FE-consumable types from the contract
|
|
58
|
+
|
|
59
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
60
|
+
# CI — read by reviewer in phase 7 to gate the finish-branch decision.
|
|
61
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
62
|
+
ci:
|
|
63
|
+
provider: github-actions # github-actions | azure-pipelines | gitlab-ci | circleci | none
|
|
64
|
+
workflow_path: .github/workflows/ci.yml
|
|
65
|
+
required_checks: ["build", "test", "lint"]
|
|
66
|
+
poll_timeout_minutes: 20
|
|
67
|
+
|
|
68
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
69
|
+
# Security — drives the security-engineer's checklist (phase 3).
|
|
70
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
71
|
+
security:
|
|
72
|
+
domain: payments # payments | healthcare | generic | internal-only
|
|
73
|
+
pii: yes # yes | no
|
|
74
|
+
public_endpoints: yes # yes | no
|
|
75
|
+
data_at_rest: sql # sql | nosql | none
|
|
76
|
+
|
|
77
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
78
|
+
# Limits — operational tuning. Defaults are sensible; override only if needed.
|
|
79
|
+
# ────────────────────────────────────────────────────────────────────────────
|
|
80
|
+
limits:
|
|
81
|
+
phase_stall_minutes: 30 # within-phase stall watchdog window; two empty windows force a §7 escalation
|
|
82
|
+
max_tasks_per_implementer: 12 # planner halts and asks the owner to split the feature above this
|
|
83
|
+
max_concurrent_teammates: 5 # hard cap on parallel teammates (best-practice guidance from CLAUDE.md)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Conventions
|
|
87
|
+
|
|
88
|
+
<!--
|
|
89
|
+
Anything below is free-form prose. Capture local style rules, conventions
|
|
90
|
+
the architecture review or implementers should respect, and any "we don't do
|
|
91
|
+
X here" rules. Implementers will read this at task start.
|
|
92
|
+
-->
|
|
93
|
+
|
|
94
|
+
- (Example) File-scoped namespaces, nullable reference types on.
|
|
95
|
+
- (Example) React components are function components only.
|
|
96
|
+
- (Example) All API endpoints require `[Authorize]` unless explicitly marked `[AllowAnonymous]`.
|
|
@@ -2,6 +2,90 @@
|
|
|
2
2
|
|
|
3
3
|
This directory holds the artifacts produced by `/team-feature` runs. The team-superpower plugin seeds it on first use; afterwards, the design / plan / review / checkpoint files for each feature are written by the team and committed.
|
|
4
4
|
|
|
5
|
+
## Customising for your project
|
|
6
|
+
|
|
7
|
+
Stack decisions, test/build commands, contract source-of-truth, CI provider, and security posture are all driven by a `team-superpower` fenced block in your repo-root `CLAUDE.md`. The plugin reads it on every run; it **never overwrites it**.
|
|
8
|
+
|
|
9
|
+
### 1. Write a `team-superpower` block in CLAUDE.md
|
|
10
|
+
|
|
11
|
+
Copy `plugins/team-superpower/assets/CLAUDE.md.template` to your repo root as `CLAUDE.md` (or paste the `team-superpower` block into your existing CLAUDE.md). The block recognises:
|
|
12
|
+
|
|
13
|
+
- `backend` — `language`, `framework`, `test_framework`, `build_command`, `test_command`, `format_command`, `migration_tool`, `package_manager`. Set `backend: none` to declare a frontend-only repo.
|
|
14
|
+
- `frontend` — `language`, `framework`, `bundler`, `test_framework`, `e2e_framework`, `ui_library`, `package_manager`, `build_command`, `test_command`. Set `frontend: none` to declare a backend-only repo.
|
|
15
|
+
- `contracts` — `source_of_truth` (`openapi` / `grpc` / `graphql` / `typescript` / `none`), `openapi_path`, `ts_gen_command`.
|
|
16
|
+
- `ci` — `provider`, `workflow_path`, `required_checks`, `poll_timeout_minutes` (default 20).
|
|
17
|
+
- `security` — `domain` (`payments` / `healthcare` / `generic` / `internal-only`), `pii`, `public_endpoints`, `data_at_rest`.
|
|
18
|
+
|
|
19
|
+
Free-form prose around the block (e.g. a `## Conventions` section with project-specific rules) is passed to every teammate as project context.
|
|
20
|
+
|
|
21
|
+
### 2. Auto-detection fallback
|
|
22
|
+
|
|
23
|
+
If `CLAUDE.md` is missing or has no `team-superpower` block, the lead runs `scripts/detect-stack.sh` in phase 0 and writes its best guess to `docs/superpowers/stack.detected.md`, then halts and asks you to review the `# CONFIRM:` lines and paste the corrected block into CLAUDE.md. **The plugin will not edit your CLAUDE.md for you.**
|
|
24
|
+
|
|
25
|
+
### 3. Shape-adaptive team
|
|
26
|
+
|
|
27
|
+
Once the block (or detection) is parsed, the lead decides the **stack shape**:
|
|
28
|
+
|
|
29
|
+
| Shape | Teammates spawned |
|
|
30
|
+
|-------|-------------------|
|
|
31
|
+
| `full-stack` | designer, planner, software-architect, security-engineer, backend-developer, frontend-developer, qa-engineer, reviewer (8) |
|
|
32
|
+
| `be-only` | designer, planner, software-architect, security-engineer, backend-developer, qa-engineer, reviewer (7) — no `frontend-developer` |
|
|
33
|
+
| `fe-only` | designer, planner, software-architect, security-engineer, frontend-developer, qa-engineer, reviewer (7) — no `backend-developer` |
|
|
34
|
+
|
|
35
|
+
The shape is written to `docs/superpowers/sessions/<slug>.shape`; the `TaskCreated` hook reads it to reject `impl:fe-*` in BE-only repos and vice-versa.
|
|
36
|
+
|
|
37
|
+
#### Concurrency model
|
|
38
|
+
|
|
39
|
+
The numbers above (7 or 8) are the **lifetime** team size, not the parallelism. Roles are phase-gated: only the teammates needed for the current phase are alive at any moment. The maximum concurrency is **2 teammates in parallel**:
|
|
40
|
+
|
|
41
|
+
| Phase | Concurrent teammates |
|
|
42
|
+
|-------|----------------------|
|
|
43
|
+
| 1 design | 1 (designer) |
|
|
44
|
+
| 2 plan | 1 (planner) |
|
|
45
|
+
| 3 pre-impl gate | 2 (software-architect + security-engineer, parallel) |
|
|
46
|
+
| 4 implementation | 1 (`be-only` or `fe-only`) or 2 (`full-stack`, after `CONTRACT_PUBLISHED`) |
|
|
47
|
+
| 5 QA | 1 (qa-engineer) |
|
|
48
|
+
| 6 review | 1 (reviewer) |
|
|
49
|
+
| 7 finish | 1 (reviewer, hat 2 — reused) |
|
|
50
|
+
|
|
51
|
+
This matches the Claude Code agent-team best practice of "3–5 teammates in parallel, 5–6 tasks each". The lead caps concurrency at 5 (configurable via `limits.max_concurrent_teammates` in CLAUDE.md) and refuses to start a phase that would exceed it. The planner caps tasks per implementer at 12 (configurable via `limits.max_tasks_per_implementer`) and asks the owner to split the feature if a plan would exceed it.
|
|
52
|
+
|
|
53
|
+
If the lead detects no mailbox activity or shared-task-list transitions for `limits.phase_stall_minutes` (default 30) within a phase, it pings the active teammate; if the next 30-minute window is also silent, it surfaces a §7 escalation. This is the within-phase stall watchdog — heartbeat-at-phase-boundaries alone doesn't catch silent hangs.
|
|
54
|
+
|
|
55
|
+
#### Worktree reuse
|
|
56
|
+
|
|
57
|
+
If you launch `/team-feature` from inside a linked git worktree on a feature branch, the planner reuses that worktree instead of nesting a new one inside it. The signal `WORKTREE_READY <path> <branch> <origin>` carries `origin: reused` and the checkpoint records `**Worktree origin:** reused`.
|
|
58
|
+
|
|
59
|
+
Detection is automatic — no config needed:
|
|
60
|
+
|
|
61
|
+
| Where `/team-feature` is launched | Branch | Behavior |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| Linked worktree | feature branch (anything not protected) | **Reuse** the current worktree. |
|
|
64
|
+
| Linked worktree | `main`, `master`, `develop`, `dev`, `release/*`, `releases/*` | **Halt.** Switch to a feature branch (`git checkout -b feature/<slug>`) and re-run. |
|
|
65
|
+
| Main repo | any | **Create** a fresh worktree via Superpowers `using-git-worktrees`. |
|
|
66
|
+
|
|
67
|
+
A reused worktree is owned by you, not the team — Step D.5 auto-removal after merge **does not run** when origin is `reused`; the Closing block records `worktree: removal-skipped:reused-existing-worktree` and the worktree stays on disk. Created worktrees are removed after a successful merge as before.
|
|
68
|
+
|
|
69
|
+
The clean-test-baseline check still runs in both modes. If you reused a worktree with uncommitted changes that break the baseline, the planner halts with a §7 escalation asking you to stash or commit first.
|
|
70
|
+
|
|
71
|
+
### 4. Contract sync (full-stack only)
|
|
72
|
+
|
|
73
|
+
When both BE and FE are present and `contracts.source_of_truth != none`, the planner emits `impl:be-contract-publish-<slug>` as the first phase-4 task. The lead does not assign any `impl:fe-*` task until the backend-developer posts `CONTRACT_PUBLISHED`. Every `impl:fe-*` task has `depends_on: [impl:be-contract-publish-<slug>]` in its metadata.
|
|
74
|
+
|
|
75
|
+
Mid-implementation contract drift uses `impl:contract-update-<topic>`: BE files it (often after FE posts `CONTRACT_DRIFT_DETECTED`), updates the contract, runs `ts_gen_command`, posts `CONTRACT_UPDATED`, and FE resumes after re-pulling the contract hash.
|
|
76
|
+
|
|
77
|
+
### 5. CI gate before finish
|
|
78
|
+
|
|
79
|
+
The reviewer pushes the branch in phase 7, then (when `ci.provider != none`) polls the CI provider for `ci.required_checks` up to `ci.poll_timeout_minutes` (default 20). On green, the finish-branch menu surfaces. On red, the merge-failure menu surfaces with an extra "Show CI logs" option. On timeout, a 3-option menu (re-poll / switch to pr_opened / escalate) surfaces. Every CI variant counts as the **same** finish-branch touchpoint — the 3-touchpoint cap holds.
|
|
80
|
+
|
|
81
|
+
### 6. Project-aware security checklist
|
|
82
|
+
|
|
83
|
+
`security-engineer` reads the `security` block and the stack info, then expands its checklist accordingly. A `domain: payments` repo gets idempotency / audit-trail / PCI items; a `data_at_rest: sql` repo gets parameterised-query items; a no-FE repo skips XSS items entirely. The output report uses ✅/⚠️/❌ markers — any ❌ blocks phase 4.
|
|
84
|
+
|
|
85
|
+
### 7. Superpowers version pinning
|
|
86
|
+
|
|
87
|
+
The lead reads the installed Superpowers version in phase 0 and writes it to the checkpoint frontmatter (`superpowers_version`). On `/team-feature-resume`, the lead checks whether the installed version still matches. If not, you see a 3-option menu (continue anyway / roll back Superpowers / discard this feature). The pin is informational + safety — never a hard block; you can always continue.
|
|
88
|
+
|
|
5
89
|
## Layout
|
|
6
90
|
|
|
7
91
|
```
|
|
@@ -94,7 +178,11 @@ bash plugins/team-superpower/scripts/team-state.sh scan <slug>
|
|
|
94
178
|
| Symptom | What it usually means | First thing to check |
|
|
95
179
|
|---|---|---|
|
|
96
180
|
| `BLOCKED_IDLE: N unanswered peer messages` from a teammate | A peer asked the teammate something and they tried to idle without replying | Open the teammate's mailbox, reply or escalate |
|
|
97
|
-
| `BAD_PREFIX` on a new task | The lead created a task without the `impl:`/`review:`/`meta:`/`block:` prefix (or used an `impl:` task without the `be
|
|
181
|
+
| `BAD_PREFIX` on a new task | The lead created a task without the `impl:`/`review:`/`meta:`/`block:` prefix (or used an `impl:` task without one of the v2 sub-prefixes: `be-`, `fe-`, `qa-fix-be-`, `qa-fix-fe-`, `review-fix-be-`, `review-fix-fe-`, `contract-update-`, `be-migration-`, `be-contract-publish-`) | Lead's bug — fix the task title |
|
|
182
|
+
| `SHAPE_REJECTED: shape is 'be-only'` (or `fe-only`) | A task was created with a prefix the shape doesn't allow (e.g. `impl:fe-*` in a BE-only repo) | Planner or lead bug — re-check `docs/superpowers/sessions/<slug>.shape` and re-emit |
|
|
183
|
+
| `MIGRATION_RACE` on task complete | Two `impl:be-migration-*` tasks were `in_progress` simultaneously | Lead should serialize migrations; backend-developer should idle if another migration is in flight |
|
|
184
|
+
| `EMPTY_CONTRACT_PUBLISH` on task complete | A `impl:be-contract-publish-*` task completed but no commit touched a contract file | Backend-developer didn't actually publish; investigate and re-run the task |
|
|
185
|
+
| `superpowers_version` mismatch on resume | Superpowers was upgraded between feature start and resume | Pick continue / rollback / discard from the 3-option menu |
|
|
98
186
|
| `NO_PLAN_APPROVAL` blocking a task complete | An `impl:` task is missing `metadata.plan_approved_at` | Lead forgot to stamp tasks after owner plan-approval; backfill from the checkpoint timestamp |
|
|
99
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 |
|
|
100
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 |
|
|
@@ -28,6 +28,24 @@ Same prechecks as `/team-feature`:
|
|
|
28
28
|
|
|
29
29
|
Halt on any failure.
|
|
30
30
|
|
|
31
|
+
### Step 2.5 — Superpowers version-pin check
|
|
32
|
+
|
|
33
|
+
Read the checkpoint frontmatter (the YAML block between `---` markers at the top of the file). Extract `superpowers_version`. Read the currently-installed Superpowers version (`claude plugin list --json` → grep for `superpowers`). Compare:
|
|
34
|
+
|
|
35
|
+
- **Versions match** → proceed.
|
|
36
|
+
- **Versions differ** → halt and surface this 3-option menu to the owner:
|
|
37
|
+
|
|
38
|
+
> **Superpowers version drifted** since this feature started:
|
|
39
|
+
> - pinned in checkpoint: `<pinned>`
|
|
40
|
+
> - currently installed: `<current>`
|
|
41
|
+
>
|
|
42
|
+
> Skill semantics may have shifted. Pick one:
|
|
43
|
+
> - **A. Continue anyway** — accept the risk; semantics may differ mid-feature.
|
|
44
|
+
> - **B. Roll back Superpowers** — owner runs `/plugin install superpowers@<pinned>` and re-runs `/team-feature-resume`. (Lead halts; cannot install plugins itself.)
|
|
45
|
+
> - **C. Discard this feature** — halt resume; the owner manually cleans state via `/team-cleanup <slug>` and starts fresh.
|
|
46
|
+
|
|
47
|
+
This is **not** counted as a touchpoint because it only happens on resume after a rare Superpowers update. On choice A, log `superpowers_pin_overridden: <pinned> → <current>` to the resume-log block; on choice B halt without changes; on choice C halt and instruct the owner to `/team-cleanup`.
|
|
48
|
+
|
|
31
49
|
### Step 3 — Preflight scan
|
|
32
50
|
|
|
33
51
|
Run:
|
|
@@ -75,10 +93,11 @@ Do NOT re-run earlier phases. Their checkpoints stand.
|
|
|
75
93
|
|
|
76
94
|
If the checkpoint's `## Closing` block exists but is incomplete (has `decision:` and `cleanup: complete` but is missing the `worktree:` line) AND the recorded decision is `merged`, the previous lead crashed inside Step D.5. Resume protocol:
|
|
77
95
|
|
|
78
|
-
1.
|
|
79
|
-
2.
|
|
80
|
-
3.
|
|
81
|
-
4. On
|
|
96
|
+
1. Read `**Worktree origin:**` from the checkpoint. If it is `reused`, Step D.5 should never have run — abort the mid-Step-D.5 path: append `worktree: removal-skipped:reused-existing-worktree` to the Closing block, commit, and exit normally. The owner's pre-existing worktree stays on disk. Skip to Step 5 of the resume protocol only if there is still feature work to resume; otherwise the resume terminates here.
|
|
97
|
+
2. Verify Step A–D conditions still hold by running `bash ${CLAUDE_PLUGIN_ROOT}/scripts/team-state.sh scan <slug>` — all states must be `absent`. If anything is `present`, halt and instruct the owner to run `/team-cleanup <slug>` before resuming.
|
|
98
|
+
3. Re-run Step D.5 from the top: read `**Worktree:**`, `cd` to repo root, check `git worktree list --porcelain`, attempt non-forced remove. The procedure is idempotent — if the worktree was already removed in the prior session it'll be recorded as `already-absent`.
|
|
99
|
+
4. On remove failure, re-enter the 4-option remove-failure menu fresh (no carry-over retry count — the prior session's count was not persisted because Step D.5 retries are per-session, not per-run; this is intentional, the owner sees a fresh menu).
|
|
100
|
+
5. On completion, write the missing Closing-block fields (`worktree`, `worktree_path` if applicable, `dropped_files` if applicable) and commit.
|
|
82
101
|
|
|
83
102
|
### Step 5 — Reconstruct context
|
|
84
103
|
|
|
@@ -86,7 +105,17 @@ If the checkpoint's `## Closing` block exists but is incomplete (has `decision:`
|
|
|
86
105
|
- Recreate the team with the same name (`superpower-<slug>`).
|
|
87
106
|
- Touch `docs/superpowers/sessions/<slug>.heartbeat` and update it at every phase boundary (same protocol as `/team-feature`).
|
|
88
107
|
|
|
89
|
-
### Step 6 —
|
|
108
|
+
### Step 6 — Re-read the shape marker
|
|
109
|
+
|
|
110
|
+
Read `docs/superpowers/sessions/<slug>.shape` and `stack_shape` from the checkpoint frontmatter. They must match — if they disagree, halt and escalate (one was hand-edited). The shape determines which implementer to respawn:
|
|
111
|
+
|
|
112
|
+
- `full-stack` → both `backend-developer` and `frontend-developer` are eligible to respawn.
|
|
113
|
+
- `be-only` → only `backend-developer`. NEVER respawn `frontend-developer` for a `be-only` feature.
|
|
114
|
+
- `fe-only` → only `frontend-developer`. NEVER respawn `backend-developer`.
|
|
115
|
+
|
|
116
|
+
If the marker file is missing, re-derive shape from `CLAUDE.md` via `bash ${CLAUDE_PLUGIN_ROOT}/scripts/parse-claudemd.sh shape CLAUDE.md` and write the marker file before continuing.
|
|
117
|
+
|
|
118
|
+
### Step 6 (cont.) — Respawn only the teammates needed
|
|
90
119
|
|
|
91
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:
|
|
92
121
|
|
|
@@ -95,7 +124,7 @@ For the next phase, spawn the relevant role(s) using the agent definitions shipp
|
|
|
95
124
|
| `design` | `designer` |
|
|
96
125
|
| `plan` | `planner` |
|
|
97
126
|
| `pre_impl_review` | `software-architect` + `security-engineer` (parallel) |
|
|
98
|
-
| `implementation` | `backend-developer` and/or `frontend-developer
|
|
127
|
+
| `implementation` | `backend-developer` and/or `frontend-developer`, **filtered by stack_shape** (be-only ⇒ BE only; fe-only ⇒ FE only; full-stack ⇒ both, route by prefix) |
|
|
99
128
|
| `qa` | `qa-engineer` |
|
|
100
129
|
| `review` | `reviewer` |
|
|
101
130
|
| `finish` | `reviewer` |
|
|
@@ -142,5 +171,7 @@ Continue per the same rules as `/team-feature`:
|
|
|
142
171
|
- **Never** skip Step 3 preflight. Stale team configs cause runtime errors and silently re-use the wrong session IDs.
|
|
143
172
|
- **Never** force-cleanup state with a fresh heartbeat unless the owner has confirmed in writing the previous lead is dead.
|
|
144
173
|
- **Never** skip the resume-log commit. It is the audit trail that proves the resume happened.
|
|
174
|
+
- **Never** respawn an implementer for a shape that excludes it (`frontend-developer` in `be-only`, `backend-developer` in `fe-only`). The hooks will reject the implementer's task creations anyway, but spawning is your decision and you do not bypass the shape.
|
|
175
|
+
- **Never** silently ignore a `superpowers_version` mismatch. Always surface the 3-option menu at Step 2.5.
|
|
145
176
|
|
|
146
177
|
If anything in the checkpoint looks tampered with or inconsistent (e.g. plan marked approved but no plan file exists, completed task with missing commits), halt and escalate to the owner with the §7 template. Do not paper over.
|