Skip to content

Commit 120baf5

Browse files
Copilotintel352
andauthored
scope-lock: prevent agent rescoping, PR collapse, and demo-rush on locked plans (#24)
* feat: adversarial design/plan review + holistic lifecycle improvements (v5.4.0) Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/00b94a42-65c9-443f-a930-36d72c87dd30 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * feat: ship deferred roadmap items as functionality (v5.5.0) Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/1e87f44a-1b33-4b41-a3fc-f111acd5069e Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * fix: address code-review feedback (mktemp guard, marker-based help, sort guidance, audit dedup note) Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/1e87f44a-1b33-4b41-a3fc-f111acd5069e Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * feat: scope-lock + strict-interpretation gates against agent rescoping (v5.6.0) Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/1e9d2946-d531-4ae1-a466-1a9a285d6230 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * feat: add 5 scope-enforcement hooks (PreToolUse, UserPromptSubmit, Stop, SubagentStop, PreCompact) Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/eb1c005b-4d4e-4c5d-9f2f-07785768e3f7 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * fix: block agent self-bypass via SUPERPOWERS_* env var assignment in Bash commands Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/333dd4a3-c249-43c5-911a-56193578cb9c Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * fix: address all 9 PR review feedback items Agent-Logs-Url: https://github.com/GoCodeAlone/claude-superpowers/sessions/333f45fb-54f9-4471-a162-9d3bdd01cb0e Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
1 parent 8beba50 commit 120baf5

30 files changed

Lines changed: 2657 additions & 59 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "superpowers",
1111
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
12-
"version": "5.3.0",
12+
"version": "5.6.0",
1313
"source": "./",
1414
"author": {
1515
"name": "Jesse Vincent",

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "superpowers",
33
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
4-
"version": "5.3.0",
4+
"version": "5.6.0",
55
"author": {
66
"name": "Jesse Vincent",
77
"email": "jesse@fsck.com"

.cursor-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "superpowers",
33
"displayName": "Superpowers",
44
"description": "Core skills library: TDD, debugging, collaboration patterns, and proven techniques",
5-
"version": "5.3.0",
5+
"version": "5.6.0",
66
"author": {
77
"name": "Jesse Vincent",
88
"email": "jesse@fsck.com"

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,48 @@ Per-skill host-conditional audit: [tests/cross-llm-coverage.md](tests/cross-llm-
101101

102102
## The Basic Workflow
103103

104-
1. **brainstorming** - Activates before writing code. Refines rough ideas through questions, explores alternatives, presents design in sections for validation. Saves design document.
104+
1. **brainstorming** - Activates before writing code. Refines rough ideas through questions, explores alternatives, lists load-bearing assumptions, runs a self-challenge round, presents design in sections for validation. Soft cap of 5 question-batches; on exceed, agent presents best-current-approximation and asks user to approve / refine / extend the budget. Saves design document.
105105

106-
2. **using-git-worktrees** - Activates after design approval. Creates isolated workspace on new branch, runs project setup, verifies clean test baseline.
106+
2. **adversarial-design-review (design phase)** - Activates after design doc is committed. Adversarially attacks the *ideas* in the design (not just structure): unstated assumptions, repo-precedent conflicts, YAGNI violations, missing failure modes, security gaps, rollback story, simpler alternatives, user-intent drift. PASS/FAIL with max 2 revision cycles.
107107

108-
3. **writing-plans** - Activates with approved design. Breaks work into bite-sized tasks (2-5 minutes each). Every task has exact file paths, complete code, verification steps.
108+
3. **recording-decisions** - Activates inside brainstorming and writing-plans whenever a non-trivial choice is made (divergence from precedent, trade-off between ≥2 plausible approaches, adversarial-review override, cross-skill structural change). Adds a numbered ADR in `decisions/` so the *why* survives renames and refactors.
109109

110-
4. **subagent-driven-development** or **executing-plans** - Activates with plan. Dispatches fresh subagent per task with two-stage review (spec compliance, then code quality), or executes in batches with human checkpoints.
110+
4. **using-git-worktrees** - Activates after design approval. Creates isolated workspace on new branch, runs project setup, verifies clean test baseline.
111111

112-
5. **test-driven-development** - Activates during implementation. Enforces RED-GREEN-REFACTOR: write failing test, watch it fail, write minimal code, watch it pass, commit. Deletes code written before tests.
112+
5. **writing-plans** - Activates with approved design. Breaks work into bite-sized tasks (2-5 minutes each). Every task has exact file paths, complete code, verification steps. Runtime-affecting tasks include rollback notes. Plan MUST contain a `## Scope Manifest` block declaring PR Count, Tasks, Out-of-scope items, and a per-PR grouping table — this is the contract `scope-lock` enforces.
113113

114-
6. **requesting-code-review** - Activates between tasks. Reviews against plan, reports issues by severity. Critical issues block progress.
114+
6. **adversarial-design-review (plan phase)** - Activates after plan doc is committed. Inherits the design checklist plus plan-specific scans: task granularity, verification-class match, hidden serial dependencies, rollback wiring.
115115

116-
7. **finishing-a-development-branch** - Activates when tasks complete. Verifies tests, presents options (merge/PR/keep/discard), cleans up worktree.
116+
7. **alignment-check** - Activates after adversarial review of plan passes. Narrowly structural: every design requirement maps to a plan task; every plan task traces to a design requirement; the Scope Manifest is well-formed (forward + reverse + manifest trace via `tests/plan-scope-check.sh`).
117+
118+
8. **scope-lock** - Activates immediately after `alignment-check` PASS. Stamps the plan with `Locked <timestamp>`, computes the manifest's sha256 into `<plan>.scope-lock`, commits both. From this point until completion (or an explicit user-approved unlock), the task list, PR count, and feature scope are immutable. `subagent-driven-development` re-checks the lock between tasks; `finishing-a-development-branch` re-checks before any PR is created.
119+
120+
9. **subagent-driven-development** or **executing-plans** - Activates with a locked plan. Dispatches fresh subagent per task with two-stage review (spec compliance, then code quality). Between tasks, re-runs the scope-lock check; on lock drift, stops the line and surfaces the discrepancy.
121+
122+
10. **test-driven-development** - Activates during implementation. Enforces RED-GREEN-REFACTOR: write failing test, watch it fail, write minimal code, watch it pass, commit. Deletes code written before tests.
123+
124+
11. **requesting-code-review** - Activates between tasks. Reviews against plan, reports issues by severity. Critical issues block progress.
125+
126+
12. **finishing-a-development-branch** - Activates when tasks complete. Step 1d (Scope Completeness Check) verifies every manifest task has implementing commits and that the autonomous run produces the planned number of PRs (no silent collapse). Verifies tests, presents options (merge/PR/keep/discard), cleans up worktree.
127+
128+
13. **pr-monitoring** - Activates after autonomous PR creation (one monitor per PR in the manifest). Watches CI and review comments; fixes failures and responds to feedback until green.
129+
130+
14. **post-merge-retrospective** - Activates after `pr-monitoring` exits successfully on a merged PR with green CI. Reads the design, plan, adversarial-review reports, code-review threads, and CI history; produces a short retro in `docs/retros/` scoring each adversarial finding (Prescient / Resolved upfront / False positive / Inconclusive), naming gate misses, and surfacing plugin-level follow-ups when patterns emerge across retros.
117131

118132
**The agent checks for relevant skills before any task.** Mandatory workflows, not suggestions.
119133

134+
## Auditing skill activations
135+
136+
`tests/skill-activation-audit.sh` reads `.claude/superpowers-state/in-progress.jsonl` (the activity log written by the `record-activity` hook) and reports which pipeline gates fired during a session. Use it post-hoc when you want to confirm whether the autonomous pipeline ran end-to-end or stopped earlier than expected. Strictly local — never transmits anything.
137+
138+
`tests/skill-cross-refs.sh` verifies that cross-skill references inside `skills/` and `agents/` markdown resolve (skill names, `Step N` references, `superpowers:<name>` mentions). Run it before committing any skill edit that renames a skill or renumbers a step.
139+
140+
`tests/plan-scope-check.sh` verifies the Scope Manifest invariant. Three modes: `--plan <path>` (well-formedness — PR Count matches the grouping table; every task in the body appears in the table; etc.), `--verify-lock <path>` (manifest sha256 matches the `.scope-lock` file written at alignment time), and `--against-branch <plan>` (planned branches in the manifest exist locally or on origin). The autonomous pipeline runs all three at the appropriate gates; CI can run `--plan` against every plan in `docs/plans/`.
141+
142+
## Strict-interpretation invariant
143+
144+
Once a plan is locked, ambiguous user phrases — "reorder as needed", "create a PR", "test locally", "ship a demo", "be quick" — do NOT authorize rescoping, PR collapse, or partial-scope shipping. The agent picks the most-faithful-to-the-locked-manifest interpretation; if multiple strict readings remain plausible, it stops and asks. See the table in `skills/using-superpowers/SKILL.md` § "Strict-interpretation invariant" for the full mapping and the unlock path.
145+
120146
## What's Inside
121147

122148
### Skills Library
@@ -129,14 +155,20 @@ Per-skill host-conditional audit: [tests/cross-llm-coverage.md](tests/cross-llm-
129155
- **verification-before-completion** - Ensure it's actually fixed
130156

131157
**Collaboration**
132-
- **brainstorming** - Socratic design refinement
133-
- **writing-plans** - Detailed implementation plans
158+
- **brainstorming** - Socratic design refinement (with assumption-listing, self-challenge round, and a 5-batch question budget)
159+
- **adversarial-design-review** - Adversarial attack on design and plan ideas before execution (two phases: design, plan)
160+
- **recording-decisions** - ADRs in `decisions/` for non-trivial trade-offs, rejected alternatives, and user-approved scope reductions
161+
- **writing-plans** - Detailed implementation plans (with mandatory Scope Manifest)
134162
- **executing-plans** - Batch execution with checkpoints
163+
- **alignment-check** - Structural design ↔ plan trace (forward + reverse + manifest)
164+
- **scope-lock** - Once a plan passes alignment, the task list, PR count, and feature scope are immutable until completion or explicit user-approved reduction
135165
- **dispatching-parallel-agents** - Concurrent subagent workflows
136166
- **requesting-code-review** - Pre-review checklist
137167
- **receiving-code-review** - Responding to feedback
138168
- **using-git-worktrees** - Parallel development branches
139-
- **finishing-a-development-branch** - Merge/PR decision workflow
169+
- **finishing-a-development-branch** - Merge/PR decision workflow (with Step 1d Scope Completeness Check)
170+
- **pr-monitoring** - Watches CI and reviews after autonomous PR creation
171+
- **post-merge-retrospective** - Closes the loop on merged PRs; scores each adversarial finding and surfaces gate misses
140172
- **subagent-driven-development** - Fast iteration with two-stage review (spec compliance, then code quality)
141173

142174
**Meta**

0 commit comments

Comments
 (0)