29 changed files with 735 additions and 29 deletions

No files matched your search

+6 -3
View File
@@ -84,9 +84,10 @@ code" wins. Repo-specific instructions override both.
calls the advisor tool when it is listed (settings `advisorModel`,
Fable, set by /advisor), at least at the points of
`~/.claude/lib/effort-shift.md` § Advisor; dispatched plan-challenger,
verifier, security-auditor and `analyzer` at most once, before their
verdict or report; other sub-agents do not. Fable is never routed or
pinned: the router tops out at opus (BDR-150).
verifier, security-auditor, `analyzer` and an opus code review at most
once, before their verdict or report; other sub-agents never (each opus
brief you write states its rule; a SubagentStart hook restates it). Fable
is never routed or pinned: the router tops out at opus (BDR-150).
- Ask rather than guess. A choice visible in the result (placement,
wording, order, behavior), a name that becomes public (command, flag,
endpoint, file), or a scope the request leaves open → ask, even mid-task;
@@ -291,6 +292,8 @@ cryptic names.
finishing-a-development-branch → `gitflow finish` (human signal)
systematic-debugging → bugfix
verification-before-completion → the verifier gates
- subagent-driven-development standalone: workers sonnet (task reviews and
fix rounds too); final review opus, its brief allowing one `advisor` call
- SEO+GEO → seo (GEO only → geo); W3C + WCAG → web-validate. Pack off →
propose `profile.sh enable seo` (seo, geo) or `enable web-validate`, the
user runs `/reload-plugins`; else say so. Security audit (secrets, CVE,
+1 -1
View File
@@ -43,7 +43,7 @@ Produce a clear analysis without proposing solutions.
- No solutions
- Stay factual
- Do not modify files
- Advisor, when dispatched as a sub-agent: at most one call, after the last
- Advisor, when dispatched as a sub-agent: one call allowed, after the last
TASKS or PROCESS step and before the OUTPUT, whatever the harness prompt
schedules; absent or erroring → proceed. Advice may point you back to
the code; every OUTPUT line rests on what you read, never on the advice
+3
View File
@@ -269,6 +269,9 @@ the gate.
this pipeline (initial audits, fix-loop re-dispatches, commit-change,
web-validate) carries `model: "opus"` and `effort="high"` — the child hosts gated
orchestration on the pipeline's behalf; it must never inherit the session model.
Append to each such prompt: "never call the `advisor` tool in this run;
a CHALLENGE SUMMARY, if your skill prints one, reads `Advisor: not called
(sub-agent)`" (BDR-150).
For web projects, dispatch in **a single message with two parallel Agent calls** (each with `model: "opus"`, `effort="high"`):
+4
View File
@@ -8,6 +8,10 @@ effort: high
# Git Smart Commit
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
> MODEL (BDR-077): `MODE: propose` is dispatched with `model="opus"` (the
> call-site override — narrative reconstruction + capitalize routing are
> judgment); `MODE: apply` runs on its sonnet row (frontmatter = off-state floor; mechanical
+4
View File
@@ -8,6 +8,10 @@ effort: high
# DOC SYNCER
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
## GOAL
Keep PUBLIC documentation in sync with code. Detect drift, report it,
patch what can be patched automatically. Auto-discover what public doc
+4
View File
@@ -8,6 +8,10 @@ effort: xhigh
# GEO — Generative Engine Optimization audit, fix & strategy
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
Target search engines: **ChatGPT Search, Perplexity, Claude, Gemini,
Google AI Overviews, Microsoft Copilot, Brave AI, DuckAssist, You.com,
Apple Intelligence**. Google classical search is handled by the
+4
View File
@@ -8,6 +8,10 @@ effort: high
# HANDOVER DOC WRITER
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
## INPUT — the PACKAGE
You are dispatched by `client-handover-writer` with a single structured
+3 -2
View File
@@ -97,7 +97,7 @@ PROOF: read <n> files, inspected <what>, checked plan §<…>
(STEP 1's missing/unreadable-plan verdict) is part of the grammar: it
carries only the `PLAN:` line — no FINDINGS, no PROOF — and the
orchestrator treats it as a dispatcher-side failure, not a challenge result.
- Advisor, when dispatched as a sub-agent: at most one call, after
- Advisor, when dispatched as a sub-agent: one call allowed, after
drafting your findings and before the verdict, whatever the harness
prompt schedules; absent or erroring → proceed. Advice may add or
sharpen a finding. Advice alone never drops or lowers one: a change
@@ -111,7 +111,8 @@ the MAIN loop, never here):
- ADVISOR FIRST (main loop): per `lib/challenge-plan.md` "Advisor first",
with no main-loop advisor call since the skill run started; absent or
erroring → dispatch as written. The advice never enters a challenger
brief: they stay blind.
brief: they stay blind. A skill run inside a sub-agent skips it (row
`not called (sub-agent)`).
- Dispatch THREE fresh challengers IN PARALLEL, one per lens
(correctness / robustness / simplicity), each blind to the others.
- MODEL (BDR-076, supersedes the BDR-066 inherit): plan critique is AUDIT
+4
View File
@@ -8,6 +8,10 @@ effort: xhigh
# PLUGIN ADVISOR
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
## ROLE
Reason over the PROBE REPORT + request. Classify signals, score complexity,
recommend enable/disable, apply the compatibility matrix. Block or warn.
+1 -1
View File
@@ -157,7 +157,7 @@ In audit mode, ALSO write this same block (plus per-finding detail) to
- Blocks on HIGH/CRITICAL only. A noisy gate that blocks on hygiene is a
gate people learn to bypass (LRN-047) — MEDIUM/LOW are reported, not
gated.
- Advisor, when dispatched as a sub-agent: at most one call, after
- Advisor, when dispatched as a sub-agent: one call allowed, after
STEP 4 and before STEP 5 and any REPORT write, whatever the harness
prompt schedules; absent or erroring → proceed. Advice may add a
finding or raise a severity, cited at a file:line you read. An added
+4
View File
@@ -8,6 +8,10 @@ effort: xhigh
# SEO — Classical Search Engines audit, fix & strategy
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
Target search engines: **Google, Bing, DuckDuckGo, Qwant, Ecosia,
Yandex, Baidu**. Generative / AI engines (ChatGPT, Perplexity, Claude,
Gemini, Google AI Overviews, Copilot) are handled by the
+1 -1
View File
@@ -158,7 +158,7 @@ PROOF: read <n> files, ran <cmd → result | nothing>, checked <n>/<n> criteria
missing `PROOF` — the run was skipped, not the diff clean.
- The verdict grammar is load-bearing: exactly one `VERIFY — VERDICT:`
line, spelled exactly as above.
- Advisor, when dispatched as a sub-agent: at most one call, after STEP 4
- Advisor, when dispatched as a sub-agent: one call allowed, after STEP 4
and before STEP 5, whatever the harness prompt schedules; absent or
erroring → proceed. Advice may send you back to a criterion: a
resulting NOT-MET cites the file:line you read, ends with
@@ -0,0 +1,421 @@
# Advisor Sub-agent Scope Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Stop sub-agents outside the allowed set from calling the advisor tool, by putting the rule in each sub-agent's own text and pinning SDD workers to sonnet.
**Architecture:** No tool filter removes the advisor (probed). The rule rides the channels a sub-agent obeys: its own agent prompt, its brief, and a SubagentStart hook injecting one uniform line at every spawn. The SDD sonnet pin lives in main-loop text (CLAUDE.global.md, lib/effort-shift.md), since the vendored SDD files are overwritten at each refresh.
**Tech Stack:** bash, jq, markdown doctrine, settings.json hooks.
**Spec:** design approved in chat 2026-11-19 + contract `.claude/tasks/contracts/2026-11-19-advisor-subagent-scope-2035.md` (CLARIFICATIONS [gated]); diagnosis and probes `.claude/tasks/plans/2026-11-19-subagent-advisor-hook-1905.md`.
## Global Constraints
- Every edit is an exact `old` → `new` block below; each `old` occurs exactly once in its file (the applier asserts it). No other wording changes.
- Never edit `skills-external/` (vendored, gitignored, overwritten by update-all.sh; BDR-106, BLK-024).
- `agents/client-handover-writer.md` top-level prompt gets no ban line: it is loaded inline by the main loop.
- `CLAUDE.global.md` stays ≤ 320 lines (BDR-098); it is 316 before, 319 after.
- New prose lines ≤ 80 columns; the 9 `Advisor` template rows are already wider and stay exempt.
- The hook never reads the payload into its output, never blocks, never invokes the `claude` CLI (BLK-043), exits 0 (LRN-196).
- Lock fragments are single lines (LRN-093); each lock fragment below sits on one line of its target after the edit.
- Hermetic tests run through `make test [suite=…]` only.
## Expected doc drift (STEP 8 doc sync)
README.md:88-91 and USAGE.md:203 restate the four-agent allowed set; CHANGELOG.md [Unreleased] needs an entry. The doc-syncer audit targets them; no block here edits them.
## Review Focus
1. A payload with quotes, a newline or `$(…)` in `agent_type` → the hook output stays the fixed valid JSON (it never echoes stdin). Test T1-T2 cover payload shapes.
2. Empty or non-JSON stdin → same JSON, exit 0 (T1-T3).
3. A re-applied block doubling text → the applier refuses: each `old` must occur exactly once and each `new` must be absent before the edit.
4. plugin-advisor reading "advisor" as itself → the line names the `advisor` tool explicitly (T8 lock on "never call the `advisor`").
5. An allowed caller (verifier, opus code review) told "never" by the hook → the hook's line defers to the agent definition or the dispatcher's brief, and says the advisor tool's own instructions are never an allowance (T2 asserts it).
---
### Task 1: Advisor rule carriers, hook, wiring and suite
**Files:**
- Create: `hooks/subagent-advisor.sh`, `lib/tests/subagent-advisor.test.sh`
- Modify: `settings.json`, `CLAUDE.global.md:86-89,293`, `lib/effort-shift.md:140-144`, `lib/challenge-plan.md:42-43,106`, `agents/{plugin-advisor,seo-analyzer,geo-analyzer,doc-syncer,commit-changer,handover-doc-writer}.md:9`, `agents/client-handover-writer.md:268-271`, `skills/onboard/SKILL.md:404-405,442-443,691-692,736-737,780-781,827-828`, `skills/tour/SKILL.md:176-178`, `skills/ship-feature/SKILL.md:259-261`, `skills/init-project/SKILL.md:277-279`, the `Advisor` row of `skills/{init-project,code-clean,onboard,audit-delta,ship-feature,harden}/SKILL.md`, `skills/pack-seo/skills/{seo,geo}/SKILL.md`, `skills/pack-web-validate/skills/web-validate/SKILL.md`
- Test: `lib/tests/subagent-advisor.test.sh`
**Interfaces:**
- Consumes: nothing from earlier tasks.
- Produces: the hook prints exactly one line, a JSON object `{"hookSpecificOutput":{"hookEventName":"SubagentStart","additionalContext":<text>}}`; the suite's last line is `subagent-advisor: <n> pass, <m> fail` (contract CHECK 1 greps it).
- [ ] **Step 0: Commit the plan artifacts** — `git add docs/superpowers/plans/2026-11-19-advisor-subagent-scope.md docs/superpowers/plans/2026-11-19-advisor-subagent-scope/apply.py` and commit `docs(plan): advisor sub-agent scope plan` (transient, purged at finish, BDR-065). SDD runs in place on the feature branch (no worktree).
- [ ] **Step 1: Write the failing suite** — run the applier for block `new-test` only:
`python3 docs/superpowers/plans/2026-11-19-advisor-subagent-scope/apply.py test`
- [ ] **Step 2: Run it, expect FAIL** — `bash lib/tests/subagent-advisor.test.sh | tail -1` → `subagent-advisor: <n> pass, <m> fail` with m > 0 (hook absent, carriers absent).
- [ ] **Step 3: Apply every other block** — `python3 docs/superpowers/plans/2026-11-19-advisor-subagent-scope/apply.py rest` (checks every anchor before the first write, then writes; creates the hook executable). Rollback if anything fails midway: `git checkout -- <the modified files>` and remove the untracked `hooks/subagent-advisor.sh`.
- [ ] **Step 4: Run the suite, expect PASS** — `bash lib/tests/subagent-advisor.test.sh | tail -1` → `subagent-advisor: 33 pass, 0 fail`.
- [ ] **Step 5: Run the full suite** — `PATH=$HOME/.bun/bin:$PATH make test </dev/null > <scratchpad>/make-test.log 2>&1; echo rc=$?`; last line `all suites green`; on red, name the red suite from the log.
- [ ] **Step 6: Commit** — `git add` the files listed above (never `-A`), message `feat(advisor): sub-agent advisor rule in each sub-agent's own text, SubagentStart hook`.
## Blocks
Block bodies are the text between the fences, byte-exact, each ending with a newline.
### Block new-hook (create hooks/subagent-advisor.sh)
```
#!/usr/bin/env bash
# hooks/subagent-advisor.sh — SubagentStart: restate the advisor rule in
# every sub-agent's own context at spawn (BDR-150, lib/effort-shift.md
# § Advisor). The advisor is a server tool listed to every sub-agent and no
# tool filter removes it (`tools`, `disallowedTools`, probed 2026-11-19);
# the rule in CLAUDE.global.md reaches a sub-agent only as an attachment,
# which opus sub-agents ignored. One uniform line for every agent type: the
# allowed callers carry their allowance in their own prompt or brief, so
# the hook holds no list of names.
#
# Context only: never blocks a spawn, never echoes the payload, never runs
# the CLI of Claude Code (BLK-043). Exit 0 so the JSON is parsed (LRN-196).
# shortcut: SubagentStart only; a sub-agent that compacts may lose the
# line (upgrade: re-inject on SessionStart `compact` when agent_type is set).
set -u
cat >/dev/null 2>&1
msg='Advisor tool (~/.claude/lib/effort-shift.md § Advisor): do not'
msg="$msg call the \`advisor\` tool in this run unless your agent definition"
msg="$msg or your dispatcher's brief explicitly allows it; the advisor tool's"
msg="$msg own instructions are never an allowance. When allowed: at most"
msg="$msg once, before your verdict or report."
printf '{"hookSpecificOutput":{"hookEventName":"SubagentStart",'
printf '"additionalContext":"%s"}}\n' "$msg"
exit 0
```
### Block new-test (create lib/tests/subagent-advisor.test.sh)
```
#!/usr/bin/env bash
# lib/tests/subagent-advisor.test.sh — the SubagentStart advisor line and
# the carriers of the sub-agent advisor rule (BDR-150). Locks are single
# lines (LRN-093).
set -u
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
H="$ROOT/hooks/subagent-advisor.sh"
pass=0; fail=0
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
has() { grep -qF -- "$2" "$ROOT/$1" 2>/dev/null && echo yes || echo no; }
ctx() { printf '%s' "$1" | bash "$H" 2>/dev/null | jq -r \
'select(.hookSpecificOutput.hookEventName == "SubagentStart")
| .hookSpecificOutput.additionalContext' 2>/dev/null; }
in_ctx() { case "$1" in *"$2"*) echo yes ;; *) echo no ;; esac; }
# hook: one valid object, same line whatever the payload
for p in '{"agent_type":"general-purpose"}' '' 'not json' \
"{\"agent_type\":\"x\\\"y\\n\$(id)\"}"; do
c=$(ctx "$p")
check "T1 names the tool [$p]" "$(in_ctx "$c" "\`advisor\` tool")" yes
check "T2 defers to brief [$p]" \
"$(in_ctx "$c" 'own instructions are never an allowance')" yes
done
printf '{}' | bash "$H" >/dev/null 2>&1; check T3-exit-0 "$?" 0
check T4-one-line "$(printf '{}' | bash "$H" | wc -l | tr -d ' ')" 1
check T5-no-cli "$(grep -v '^ *#' "$H" \
| grep -cE '(^|[[:space:];&|(])claude([[:space:]]|$)')" 0
check T5b-no-echo "$(printf 'PAYLOADMARK' | bash "$H" | grep -c PAYLOADMARK)" 0
# wiring
S="$ROOT/settings.json"
check T6-wired "$(jq -r '.hooks.SubagentStart[0].hooks[0].command' "$S")" \
"bash ~/.claude/hooks/subagent-advisor.sh"
check T7-timeout "$(jq -r '.hooks.SubagentStart[0].hooks[0].timeout' "$S")" 5
# carriers
for a in plugin-advisor seo-analyzer geo-analyzer doc-syncer \
commit-changer handover-doc-writer; do
check "T8 $a" "$(has "agents/$a.md" "never call the \`advisor\` tool, even though")" yes
done
check T9-onboard-briefs "$(grep -cF "Never call the \`advisor\` tool in this run" \
"$ROOT/skills/onboard/SKILL.md")" 6
check T10-handover-children \
"$(has agents/client-handover-writer.md "never call the \`advisor\` tool in")" yes
check T10b-handover-top-clean "$(sed -n '1,30p' \
"$ROOT/agents/client-handover-writer.md" | grep -c "advisor\` tool")" 0
check T11-tour-phase-b \
"$(has skills/tour/SKILL.md "saying never call the \`advisor\` tool")" yes
for s in ship-feature init-project; do
check "T12 $s" "$(has "skills/$s/SKILL.md" \
"Add to its brief: \"you may call the \`advisor\` tool once")" yes
done
check T13-sdd-pin "$(has CLAUDE.global.md \
'subagent-driven-development standalone: workers sonnet')" yes
check T14-global-set "$(has CLAUDE.global.md \
'and an opus code review at most')" yes
check T15-effort-hook "$(has lib/effort-shift.md \
'hooks/subagent-advisor.sh. A skill run by a sub-agent reads')" yes
check T16-effort-sdd "$(has lib/effort-shift.md \
'subagent-driven-development, whoever runs it')" yes
check T17-row-reason "$(has lib/challenge-plan.md \
'already called this run | sub-agent)')" yes
check T19-advisor-first-skip "$(has lib/challenge-plan.md \
'A skill run inside a sub-agent skips this call')" yes
check T18-no-old-row "$(cd "$ROOT" && git grep -c 'already called this run)' \
-- skills lib ':!lib/tests' | wc -l | tr -d ' ')" 0
echo "subagent-advisor: $pass pass, $fail fail"
[ "$fail" -eq 0 ]
```
### Block settings-old
```
],
"PostToolUse": [
```
### Block settings-new
```
],
"SubagentStart": [
{
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/hooks/subagent-advisor.sh",
"timeout": 5
}
]
}
],
"PostToolUse": [
```
### Block global-workflow-old
```
`~/.claude/lib/effort-shift.md` § Advisor; dispatched plan-challenger,
verifier, security-auditor and `analyzer` at most once, before their
verdict or report; other sub-agents do not. Fable is never routed or
pinned: the router tops out at opus (BDR-150).
```
### Block global-workflow-new
```
`~/.claude/lib/effort-shift.md` § Advisor; dispatched plan-challenger,
verifier, security-auditor, `analyzer` and an opus code review at most
once, before their verdict or report; other sub-agents never (an opus
brief says which; a SubagentStart hook restates it). Fable is never
routed or pinned: the router tops out at opus (BDR-150).
```
### Block global-sdd-old
```
verification-before-completion → the verifier gates
```
### Block global-sdd-new
```
verification-before-completion → the verifier gates
- subagent-driven-development standalone: workers sonnet (task reviews and
fix rounds too); final review opus, its brief allowing one `advisor` call
```
### Block effort-old
```
Sub-agents, when dispatched: plan-challenger, verifier, security-auditor
and `analyzer` call it at most once per dispatch, before their verdict or
report; executors and every other sub-agent do not, even when the tool is
listed. The analyzer file loaded inline by the main loop follows the
main-loop points.
```
### Block effort-new
```
Sub-agents, when dispatched: plan-challenger, verifier, security-auditor,
`analyzer` and an opus code review (ship-feature STEP 6, init-project
STEP 10, a standalone subagent-driven-development final review) call it
at most once per dispatch, before their verdict or report; executors and
every other sub-agent never call it, even when the tool is listed. The
rule rides each sub-agent's own text: the allowed agents' prompts, a
`never call` line in the opus-served agents and in the opus briefs we
write (a brief sending a general-purpose agent to opus says which rule
applies; a code review's says it may call once), and, for every spawn
including built-ins such as `Plan`, the SubagentStart hook
hooks/subagent-advisor.sh. A skill run by a sub-agent reads
`not called (sub-agent)` in its `Advisor:` row.
subagent-driven-development, whoever runs it, dispatches every worker
(implementers, task reviewers, re-reviews, fix rounds) on sonnet
(BDR-066), as ship-feature and init-project pin it; run standalone, its
final whole-branch review runs on opus as a code review. The analyzer
file loaded inline by the main loop follows the main-loop points.
```
### Block advfirst-old
```
summary's `Advisor:` row carries it (OUTPUT below). Absent or erroring →
dispatch as written.
```
### Block advfirst-new
```
summary's `Advisor:` row carries it (OUTPUT below). Absent or erroring →
dispatch as written. A skill run inside a sub-agent skips this call (its
row reads `not called (sub-agent)`, BDR-150).
```
### Block challenge-old
```
`not called (absent | error | already called this run)`.
```
### Block challenge-new
```
`not called (absent | error | already called this run | sub-agent)`.
```
### Block row-old
```
already called this run)>
```
### Block row-new
```
already called this run | sub-agent)>
```
(applied without the trailing newline, once in each of the 9 template files listed under Files)
### Block agent-line
```
Advisor tool (`lib/effort-shift.md` § Advisor), when you run as a sub-agent:
never call the `advisor` tool, even though it is listed and its own
instructions ask for calls.
```
(inserted right after the H1 line of each of the six agents: `# PLUGIN ADVISOR`, `# SEO — Classical Search Engines audit, fix & strategy`, `# GEO — Generative Engine Optimization audit, fix & strategy`, `# DOC SYNCER`, `# Git Smart Commit`, `# HANDOVER DOC WRITER`; each H1 occurs exactly once)
### Block handover-old
```
orchestration on the pipeline's behalf; it must never inherit the session model.
```
### Block handover-new
```
orchestration on the pipeline's behalf; it must never inherit the session model.
Append to each such prompt: "never call the `advisor` tool in this run;
a CHALLENGE SUMMARY, if your skill prints one, reads `Advisor: not called
(sub-agent)`" (BDR-150).
```
### Block onboard-line
```
Never call the `advisor` tool in this run (sub-agent, BDR-150).
```
(inserted right after the `prompt="""` line that follows each of these six description lines, with the brief's own indentation: 2 spaces, 4 for the security fallback:
`description="Onboard — code-clean audit only (read-only, opus)",`,
`description="Onboard — security audit fallback (archetype-adaptive)",`,
`description="Onboard — static design review fallback",`,
`description="Onboard — static perf audit",`,
`description="Onboard — static a11y audit",`,
`description="Onboard — synthèse vers .claude/audits/",`)
### Block tour-old
```
or general-purpose with `model="opus"`, `effort="xhigh"`; NOT the sonnet code-cleaner,
```
### Block tour-new
```
or general-purpose with `model="opus"`, `effort="xhigh"`, its brief
saying never call the `advisor` tool; NOT the sonnet code-cleaner,
```
### Block review-old
```
craft review is dispatched judgment, never inherited from the session. Fix
all CRITICAL before proceeding.
```
### Block review-new
```
craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your
verdict" (code review, BDR-150). Fix all CRITICAL before proceeding.
```
(same block in skills/ship-feature/SKILL.md and skills/init-project/SKILL.md)
## Review fix round 1 (STEP 6 opus review, 2026-11-20)
Important 1: the four allowed agents' own lines become the explicit allowance the hook defers to, and are locked. Important 2: the CLAUDE.global.md parenthetical reads plainly. Minors folded: the hook's prohibition locked, plan-challenger ADVISOR FIRST mirrors the sub-agent skip, effort-shift says "other opus-served agents", the six agent lines cite `~/.claude/lib/effort-shift.md`, three test lines rewrapped to ≤ 80 columns. Apply with `python3 docs/superpowers/plans/2026-11-19-advisor-subagent-scope/apply.py review1`. Suite after: `subagent-advisor: 38 pass, 0 fail`.
### Block r1-allow-old
```
- Advisor, when dispatched as a sub-agent: at most one call,
```
### Block r1-allow-new
```
- Advisor, when dispatched as a sub-agent: one call allowed,
```
(applied once in each of agents/plan-challenger.md, agents/verifier.md, agents/security-auditor.md, agents/analyzer.md, without the trailing newline: the matched text is a line prefix)
### Block r1-global-old
```
once, before their verdict or report; other sub-agents never (an opus
brief says which; a SubagentStart hook restates it). Fable is never
routed or pinned: the router tops out at opus (BDR-150).
```
### Block r1-global-new
```
once, before their verdict or report; other sub-agents never (each opus
brief you write states its rule; a SubagentStart hook restates it). Fable
is never routed or pinned: the router tops out at opus (BDR-150).
```
### Block r1-pc-old
```
erroring → dispatch as written. The advice never enters a challenger
brief: they stay blind.
```
### Block r1-pc-new
```
erroring → dispatch as written. The advice never enters a challenger
brief: they stay blind. A skill run inside a sub-agent skips it (row
`not called (sub-agent)`).
```
### Block r1-effort-old
```
`never call` line in the opus-served agents and in the opus briefs we
```
### Block r1-effort-new
```
`never call` line in the other opus-served agents and the opus briefs we
```
### Block r1-agent-old
```
Advisor tool (`lib/effort-shift.md` § Advisor), when you run as a sub-agent:
```
### Block r1-agent-new
```
Advisor tool (`~/.claude/lib/effort-shift.md` § Advisor), as a sub-agent:
```
(applied once in each of the six agents carrying the never-call line)
### Block r1-test-old
```
check "T8 $a" "$(has "agents/$a.md" "never call the \`advisor\` tool, even though")" yes
done
check T9-onboard-briefs "$(grep -cF "Never call the \`advisor\` tool in this run" \
"$ROOT/skills/onboard/SKILL.md")" 6
check T10-handover-children \
"$(has agents/client-handover-writer.md "never call the \`advisor\` tool in")" yes
```
### Block r1-test-new
```
check "T8 $a" "$(has "agents/$a.md" \
"never call the \`advisor\` tool, even though")" yes
done
check T9-onboard-briefs \
"$(grep -cF "Never call the \`advisor\` tool in this run" \
"$ROOT/skills/onboard/SKILL.md")" 6
check T10-handover-children "$(has agents/client-handover-writer.md \
"never call the \`advisor\` tool in")" yes
for a in plan-challenger verifier security-auditor analyzer; do
check "T20 $a allowance" "$(has "agents/$a.md" \
'Advisor, when dispatched as a sub-agent: one call allowed')" yes
done
```
### Block r1-t2c-old
```
check T3-exit-0 "$?" 0
```
### Block r1-t2c-new
```
check T3-exit-0 "$?" 0
check T2c-prohibits "$(in_ctx "$(ctx '{}')" \
"do not call the \`advisor\` tool in this run unless")" yes
```
@@ -0,0 +1,119 @@
#!/usr/bin/env python3
"""Exact-once applier for docs/superpowers/plans/2026-11-19-advisor-subagent-scope.md.
Usage: apply.py test | rest (run from the repo root, or pass ROOT as argv[2])
Every replacement asserts its `old` occurs exactly once and its `new` is
absent, so a second run refuses instead of doubling text.
"""
import os, re, stat, sys
ROOT = sys.argv[2] if len(sys.argv) > 2 else '.'
PLAN = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'..', '2026-11-19-advisor-subagent-scope.md')
B = dict(re.findall(r'### Block (\S+)[^\n]*\n```\n(.*?)```\n',
open(PLAN, encoding='utf-8').read(), re.S))
ROWS = ['skills/init-project/SKILL.md', 'skills/code-clean/SKILL.md',
'skills/onboard/SKILL.md', 'skills/audit-delta/SKILL.md',
'skills/ship-feature/SKILL.md', 'skills/harden/SKILL.md',
'skills/pack-seo/skills/seo/SKILL.md',
'skills/pack-seo/skills/geo/SKILL.md',
'skills/pack-web-validate/skills/web-validate/SKILL.md']
H1 = {'plugin-advisor': '# PLUGIN ADVISOR',
'seo-analyzer': '# SEO — Classical Search Engines audit, fix & strategy',
'geo-analyzer': '# GEO — Generative Engine Optimization audit, fix & strategy',
'doc-syncer': '# DOC SYNCER',
'commit-changer': '# Git Smart Commit',
'handover-doc-writer': '# HANDOVER DOC WRITER'}
ONBOARD = [(' ', 'code-clean audit only (read-only, opus)'),
(' ', 'security audit fallback (archetype-adaptive)'),
(' ', 'static design review fallback'),
(' ', 'static perf audit'),
(' ', 'static a11y audit'),
(' ', 'synthèse vers .claude/audits/')]
PENDING = []
def edit(rel, old, new):
"""Queue an exact-once replacement; nothing is written until flush()."""
PENDING.append((rel, old, new))
def flush():
"""Check every queued edit against the cumulative text, then write."""
texts = {}
for rel, old, new in PENDING:
s = texts.get(rel)
if s is None:
s = open(os.path.join(ROOT, rel), encoding='utf-8').read()
if s.count(old) != 1:
sys.exit(f'{rel}: old found {s.count(old)}x, nothing written')
if s.count(new) != 0:
sys.exit(f'{rel}: new already present, nothing written')
texts[rel] = s.replace(old, new)
for rel, s in texts.items():
open(os.path.join(ROOT, rel), 'w', encoding='utf-8').write(s)
def create(rel, body, mode=0o644):
path = os.path.join(ROOT, rel)
if os.path.exists(path):
sys.exit(f'{rel}: exists, nothing written')
open(path, 'w', encoding='utf-8').write(body)
os.chmod(path, mode)
def rest():
if os.path.exists(os.path.join(ROOT, 'hooks/subagent-advisor.sh')):
sys.exit('hooks/subagent-advisor.sh: exists, nothing written')
edit('settings.json', B['settings-old'], B['settings-new'])
edit('CLAUDE.global.md', B['global-workflow-old'], B['global-workflow-new'])
edit('CLAUDE.global.md', B['global-sdd-old'], B['global-sdd-new'])
edit('lib/effort-shift.md', B['effort-old'], B['effort-new'])
edit('lib/challenge-plan.md', B['advfirst-old'], B['advfirst-new'])
edit('lib/challenge-plan.md', B['challenge-old'], B['challenge-new'])
for rel in ROWS:
edit(rel, B['row-old'].rstrip('\n'), B['row-new'].rstrip('\n'))
for name, h1 in H1.items():
edit(f'agents/{name}.md', h1 + '\n', h1 + '\n' + B['agent-line'])
edit('agents/client-handover-writer.md', B['handover-old'], B['handover-new'])
line = B['onboard-line'].lstrip(' ')
for ind, desc in ONBOARD:
old = f'{ind}description="Onboard — {desc}",\n{ind}prompt="""\n'
edit('skills/onboard/SKILL.md', old, old + ind + line)
edit('skills/tour/SKILL.md', B['tour-old'], B['tour-new'])
for rel in ('skills/ship-feature/SKILL.md', 'skills/init-project/SKILL.md'):
edit(rel, B['review-old'], B['review-new'])
flush()
create('hooks/subagent-advisor.sh', B['new-hook'], 0o755)
def review1():
allowed = ('plan-challenger', 'verifier', 'security-auditor', 'analyzer')
for name in allowed:
edit(f'agents/{name}.md', B['r1-allow-old'].rstrip('\n'),
B['r1-allow-new'].rstrip('\n'))
edit('CLAUDE.global.md', B['r1-global-old'], B['r1-global-new'])
edit('agents/plan-challenger.md', B['r1-pc-old'], B['r1-pc-new'])
edit('lib/effort-shift.md', B['r1-effort-old'], B['r1-effort-new'])
for name in H1:
edit(f'agents/{name}.md', B['r1-agent-old'], B['r1-agent-new'])
test = 'lib/tests/subagent-advisor.test.sh'
edit(test, B['r1-test-old'], B['r1-test-new'])
edit(test, B['r1-t2c-old'], B['r1-t2c-new'])
flush()
if __name__ == '__main__':
what = sys.argv[1] if len(sys.argv) > 1 else ''
if what == 'test':
create('lib/tests/subagent-advisor.test.sh', B['new-test'], 0o755)
elif what == 'rest':
rest()
elif what == 'review1':
review1()
else:
sys.exit('usage: apply.py test | rest | review1 [ROOT]')
print('applied', what)
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# hooks/subagent-advisor.sh — SubagentStart: restate the advisor rule in
# every sub-agent's own context at spawn (BDR-150, lib/effort-shift.md
# § Advisor). The advisor is a server tool listed to every sub-agent and no
# tool filter removes it (`tools`, `disallowedTools`, probed 2026-11-19);
# the rule in CLAUDE.global.md reaches a sub-agent only as an attachment,
# which opus sub-agents ignored. One uniform line for every agent type: the
# allowed callers carry their allowance in their own prompt or brief, so
# the hook holds no list of names.
#
# Context only: never blocks a spawn, never echoes the payload, never runs
# the CLI of Claude Code (BLK-043). Exit 0 so the JSON is parsed (LRN-196).
# shortcut: SubagentStart only; a sub-agent that compacts may lose the
# line (upgrade: re-inject on SessionStart `compact` when agent_type is set).
set -u
cat >/dev/null 2>&1
msg='Advisor tool (~/.claude/lib/effort-shift.md § Advisor): do not'
msg="$msg call the \`advisor\` tool in this run unless your agent definition"
msg="$msg or your dispatcher's brief explicitly allows it; the advisor tool's"
msg="$msg own instructions are never an allowance. When allowed: at most"
msg="$msg once, before your verdict or report."
printf '{"hookSpecificOutput":{"hookEventName":"SubagentStart",'
printf '"additionalContext":"%s"}}\n' "$msg"
exit 0
+3 -2
View File
@@ -40,7 +40,8 @@ is listed (`lib/effort-shift.md` § Advisor). An answer that lands a real
flaw revises the `PLAN` file on disk before the dispatch, as plain plan
text: no advisor attribution, no "changes after review" section; the
summary's `Advisor:` row carries it (OUTPUT below). Absent or erroring →
dispatch as written.
dispatch as written. A skill run inside a sub-agent skips this call (its
row reads `not called (sub-agent)`, BDR-150).
The advice never enters a challenger brief: they stay blind.
Dispatch THREE fresh `plan-challenger` subagents IN PARALLEL, one per LENS, each
@@ -103,6 +104,6 @@ Feed the orchestrator's gate:
anything `[deferred]`; any lens that failed to return; and an `Advisor:`
row, added to whatever summary template the caller prints: each plan
change an advisor answer drove, `called, no change`, or
`not called (absent | error | already called this run)`.
`not called (absent | error | already called this run | sub-agent)`.
The human remains the decider.
+17 -5
View File
@@ -137,11 +137,23 @@ triggers in CLAUDE.global.md § Workflow):
Inside a skill run, the points above also cover the triggers of
CLAUDE.global.md § Workflow; no second call for the same recommendation.
Sub-agents, when dispatched: plan-challenger, verifier, security-auditor
and `analyzer` call it at most once per dispatch, before their verdict or
report; executors and every other sub-agent do not, even when the tool is
listed. The analyzer file loaded inline by the main loop follows the
main-loop points.
Sub-agents, when dispatched: plan-challenger, verifier, security-auditor,
`analyzer` and an opus code review (ship-feature STEP 6, init-project
STEP 10, a standalone subagent-driven-development final review) call it
at most once per dispatch, before their verdict or report; executors and
every other sub-agent never call it, even when the tool is listed. The
rule rides each sub-agent's own text: the allowed agents' prompts, a
`never call` line in the other opus-served agents and the opus briefs we
write (a brief sending a general-purpose agent to opus says which rule
applies; a code review's says it may call once), and, for every spawn
including built-ins such as `Plan`, the SubagentStart hook
hooks/subagent-advisor.sh. A skill run by a sub-agent reads
`not called (sub-agent)` in its `Advisor:` row.
subagent-driven-development, whoever runs it, dispatches every worker
(implementers, task reviewers, re-reviews, fix rounds) on sonnet
(BDR-066), as ship-feature and init-project pin it; run standalone, its
final whole-branch review runs on opus as a code review. The analyzer
file loaded inline by the main loop follows the main-loop points.
Advisor absent or erroring (Fable out of credits, for example) → proceed
as written. Advice is input, never consent: it waives no gate, cap or
+78
View File
@@ -0,0 +1,78 @@
#!/usr/bin/env bash
# lib/tests/subagent-advisor.test.sh — the SubagentStart advisor line and
# the carriers of the sub-agent advisor rule (BDR-150). Locks are single
# lines (LRN-093).
set -u
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
H="$ROOT/hooks/subagent-advisor.sh"
pass=0; fail=0
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
has() { grep -qF -- "$2" "$ROOT/$1" 2>/dev/null && echo yes || echo no; }
ctx() { printf '%s' "$1" | bash "$H" 2>/dev/null | jq -r \
'select(.hookSpecificOutput.hookEventName == "SubagentStart")
| .hookSpecificOutput.additionalContext' 2>/dev/null; }
in_ctx() { case "$1" in *"$2"*) echo yes ;; *) echo no ;; esac; }
# hook: one valid object, same line whatever the payload
for p in '{"agent_type":"general-purpose"}' '' 'not json' \
"{\"agent_type\":\"x\\\"y\\n\$(id)\"}"; do
c=$(ctx "$p")
check "T1 names the tool [$p]" "$(in_ctx "$c" "\`advisor\` tool")" yes
check "T2 defers to brief [$p]" \
"$(in_ctx "$c" 'own instructions are never an allowance')" yes
done
printf '{}' | bash "$H" >/dev/null 2>&1; check T3-exit-0 "$?" 0
check T2c-prohibits "$(in_ctx "$(ctx '{}')" \
"do not call the \`advisor\` tool in this run unless")" yes
check T4-one-line "$(printf '{}' | bash "$H" | wc -l | tr -d ' ')" 1
check T5-no-cli "$(grep -v '^ *#' "$H" \
| grep -cE '(^|[[:space:];&|(])claude([[:space:]]|$)')" 0
check T5b-no-echo "$(printf 'PAYLOADMARK' | bash "$H" | grep -c PAYLOADMARK)" 0
# wiring
S="$ROOT/settings.json"
check T6-wired "$(jq -r '.hooks.SubagentStart[0].hooks[0].command' "$S")" \
"bash ~/.claude/hooks/subagent-advisor.sh"
check T7-timeout "$(jq -r '.hooks.SubagentStart[0].hooks[0].timeout' "$S")" 5
# carriers
for a in plugin-advisor seo-analyzer geo-analyzer doc-syncer \
commit-changer handover-doc-writer; do
check "T8 $a" "$(has "agents/$a.md" \
"never call the \`advisor\` tool, even though")" yes
done
check T9-onboard-briefs \
"$(grep -cF "Never call the \`advisor\` tool in this run" \
"$ROOT/skills/onboard/SKILL.md")" 6
check T10-handover-children "$(has agents/client-handover-writer.md \
"never call the \`advisor\` tool in")" yes
for a in plan-challenger verifier security-auditor analyzer; do
check "T20 $a allowance" "$(has "agents/$a.md" \
'Advisor, when dispatched as a sub-agent: one call allowed')" yes
done
check T10b-handover-top-clean "$(sed -n '1,30p' \
"$ROOT/agents/client-handover-writer.md" | grep -c "advisor\` tool")" 0
check T11-tour-phase-b \
"$(has skills/tour/SKILL.md "saying never call the \`advisor\` tool")" yes
for s in ship-feature init-project; do
check "T12 $s" "$(has "skills/$s/SKILL.md" \
"Add to its brief: \"you may call the \`advisor\` tool once")" yes
done
check T13-sdd-pin "$(has CLAUDE.global.md \
'subagent-driven-development standalone: workers sonnet')" yes
check T14-global-set "$(has CLAUDE.global.md \
'and an opus code review at most')" yes
check T15-effort-hook "$(has lib/effort-shift.md \
'hooks/subagent-advisor.sh. A skill run by a sub-agent reads')" yes
check T16-effort-sdd "$(has lib/effort-shift.md \
'subagent-driven-development, whoever runs it')" yes
check T17-row-reason "$(has lib/challenge-plan.md \
'already called this run | sub-agent)')" yes
check T19-advisor-first-skip "$(has lib/challenge-plan.md \
'A skill run inside a sub-agent skips this call')" yes
check T18-no-old-row "$(cd "$ROOT" && git grep -c 'already called this run)' \
-- skills lib ':!lib/tests' | wc -l | tr -d ' ')" 0
echo "subagent-advisor: $pass pass, $fail fail"
[ "$fail" -eq 0 ]
+11
View File
@@ -572,6 +572,17 @@
]
}
],
"SubagentStart": [
{
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/hooks/subagent-advisor.sh",
"timeout": 5
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
+1 -1
View File
@@ -192,7 +192,7 @@ CHALLENGE SUMMARY (3b-bis — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named finding-set change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the finding-set change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the finding-set change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
```
- "Fix what you find" said **in the invocation** does NOT skip this gate:
+1 -1
View File
@@ -144,7 +144,7 @@ CHALLENGE SUMMARY (STEP 3b — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named scope change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the scope change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the scope change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
AskUserQuestion:
Approve which items for execution? (all / <item numbers> / clarify <item>)
+1 -1
View File
@@ -557,7 +557,7 @@ If MODE=fix and `.claude/audits/HARDEN.md` ends with `READY TO APPLY — awaitin
BLOCKERs addressed : <n> — <finding → the named bundle change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Options :
A) Apply all
+4 -3
View File
@@ -213,7 +213,7 @@ CHALLENGE SUMMARY (STEP 6b — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named plan change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the plan change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the plan change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Approve and start? (yes / request changes)
```
Changes → back to STEP 6. Approved → continue.
@@ -275,8 +275,9 @@ first ran → the main loop calls the advisor per `lib/verify-secure-loop.md`
## STEP 10 — CODE REVIEW
Invoke `requesting-code-review` (vendored superpowers skill). **Model routing (BDR-077):** the
review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call —
craft review is dispatched judgment, never inherited from the session. Fix
all CRITICAL before proceeding.
craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your
verdict" (code review, BDR-150). Fix all CRITICAL before proceeding.
## STEP 10b — CAPITALIZE FOUNDING DECISIONS (memory registries)
A greenfield's founding architecture decisions are the highest-value BDRs — the
+7 -1
View File
@@ -403,6 +403,7 @@ Agent(
effort="xhigh",
description="Onboard — code-clean audit only (read-only, opus)",
prompt="""
Never call the `advisor` tool in this run (sub-agent, BDR-150).
AUDIT-ONLY mode — NO fixes, NO refactoring, NO file modifications.
Target: <PROJECT_ROOT>. ARCHETYPE: <archetype>.
Produce a report covering:
@@ -441,6 +442,7 @@ bash $HOME/.claude/lib/profile.sh -C "$PWD" current --plain 2>/dev/null | grep -
effort="xhigh",
description="Onboard — security audit fallback (archetype-adaptive)",
prompt="""
Never call the `advisor` tool in this run (sub-agent, BDR-150).
READ-ONLY security audit. No file modifications.
Target: <PROJECT_ROOT>. ARCHETYPE: <archetype>. Category: <category>. Stack: <stack>.
@@ -690,6 +692,7 @@ Agent(
effort="xhigh",
description="Onboard — static design review fallback",
prompt="""
Never call the `advisor` tool in this run (sub-agent, BDR-150).
AUDIT-ONLY mode — NO edits. Static design review du code UI.
Target: <PROJECT_ROOT>. Archetype: <archetype>.
Context: ui-ux-pro-max plugin state = <active/inactive>.
@@ -735,6 +738,7 @@ Agent(
effort="xhigh",
description="Onboard — static perf audit",
prompt="""
Never call the `advisor` tool in this run (sub-agent, BDR-150).
AUDIT-ONLY mode — NO edits.
Target: <PROJECT_ROOT>. Archetype: <archetype>.
Static perf audit (pas de browser) :
@@ -779,6 +783,7 @@ Agent(
effort="xhigh",
description="Onboard — static a11y audit",
prompt="""
Never call the `advisor` tool in this run (sub-agent, BDR-150).
AUDIT-ONLY mode — NO edits.
Target: <PROJECT_ROOT>. Archetype: <archetype>.
Static a11y audit (WCAG 2.1 AA + RGAA 4.1 France) :
@@ -826,6 +831,7 @@ Agent(
effort="xhigh",
description="Onboard — synthèse vers .claude/audits/",
prompt="""
Never call the `advisor` tool in this run (sub-agent, BDR-150).
Lire tous les fichiers de <PROJECT_ROOT>/.onboard-audit/ :
- analyze.md, code-clean.md, cso.md, doc.md (toujours)
- seo.md, geo.md, design.md, perf.md, a11y.md (si présents)
@@ -961,7 +967,7 @@ CHALLENGE SUMMARY (STEP 7b — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named proposals change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the proposals change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the proposals change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Prochaine étape : générer .claude/tasks/TODO.md depuis .claude/audits/AUDIT_PROPOSALS.md approuvé.
+1 -1
View File
@@ -138,7 +138,7 @@ CHALLENGE SUMMARY (STEP 1b — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named bundle change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Approve all / select (ids) / skip all?
```
+1 -1
View File
@@ -583,7 +583,7 @@ CHALLENGE SUMMARY (STEP 1b — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named bundle change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Approve all / select (ids) / skip all?
```
@@ -296,7 +296,7 @@ CHALLENGE SUMMARY (STEP 2b — 3 lenses) :
BLOCKERs addressed : <n> — <finding → the named bundle change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the bundle change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Options :
A) Apply all
+4 -3
View File
@@ -163,7 +163,7 @@ CHALLENGE SUMMARY (STEP 2b — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named plan change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
Advisor : <the plan change it drove | called, no change | not called (absent | error | already called this run)>
Advisor : <the plan change it drove | called, no change | not called (absent | error | already called this run | sub-agent)>
Approve and execute? (yes / request changes)
```
This block EXPOSES each in-force item with the plan's CLAIMED disposition, for human
@@ -257,8 +257,9 @@ first ran → the main loop calls the advisor per `lib/verify-secure-loop.md`
## STEP 6 — CODE REVIEW
Invoke `requesting-code-review` (vendored superpowers skill). **Model routing (BDR-077):** the
review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call —
craft review is dispatched judgment, never inherited from the session. Fix
all CRITICAL before proceeding.
craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your
verdict" (code review, BDR-150). Fix all CRITICAL before proceeding.
## STEP 7 — CAPITALIZE (memory registries)
Call memory_pending first, per /capitalize STEP 1 "Captured first".
+2 -1
View File
@@ -174,7 +174,8 @@ honestly in the summary. Never loop past 3.
### Phase B — CLEAN
1. Dispatch a read-only cleanup audit (analyzer — opus row, BDR-076 —
or general-purpose with `model="opus"`, `effort="xhigh"`; NOT the sonnet code-cleaner,
or general-purpose with `model="opus"`, `effort="xhigh"`, its brief
saying never call the `advisor` tool; NOT the sonnet code-cleaner,
which is now a fix executor): dead code, unused imports/exports,
commented-out blocks, stale flags, norm violations. Findings as
`id | file:line | finding | proposed fix`.