/masterplan:masterplan runs instead · from masterplan
Entrypoint for Superpowers Masterplan on non-Claude Code hosts (Pi primary, Codex-compatible). Routes all masterplan verbs and adapts the canonical command prompt to the host runtime.
This skill never runs in Claude Code
It ships in masterplan at skills/, but /masterplan:masterplan (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
AUQ, Serena, Hindsight, context-mode, and agent policy is centralized in AGENTS.md (model-free C1 discovery uses MP_DISPATCH_MAP, else ~/.pi/workflows/dispatch-map.json; fleet policy at /srv/workflows/policy/dispatch.md). This skill must not duplicate or override dispatch rules. User-facing choices must use ask_user_question / AskUserQuestion, never prose questions.
This skill is the entrypoint for Superpowers Masterplan on hosts without the Claude Code plugin manager. Its job is to load the canonical command prompt and adapt it to the current host runtime.
Controller CLI scope repair follows commands §2a on every host: a
scope-amended-after-launch recording refusal preserves the work. Use the audited
mp reauthorize-scope --state=PATH --wave=N --reason=TEXT operation, or record
approved task files through mp amend-plan / mp amend-tasks (which re-authorize
in the same amendment event); never reset/clean work to clear that refusal.
These controller operations are not additional reserved entry verbs.
ask_user_question, parallel subagent fan-out) and runs
masterplan end-to-end — seeding, gates, waves, release. Pi skills are
installed by bin/install-pi.mjs (a copied release snapshot under
~/.local/share/masterplan/, symlinked into ~/.pi/agent/skills/ — never
a symlink into a dev tree)./masterplan).Masterplan packages neither map nor resolver. It reads phases, use cases, agents
and constraints from C1 only. Explicit missing paths refuse; Pi without a map
refuses; present unreadable/invalid maps (schema !== 1) and unknown phases/use
cases refuse on all hosts. Only non-Pi with no override and no default file may
be unconfigured (phase/agent only). Planning selects plan, review selects
challenge, execute tasks retain bounded-edit defaults. Pi receives model-free
use case/stakes/constraints and stable subject through its governed boundary;
critical panels are native and incomplete results are inconclusive, not success.
Requested effort is a minimum; served effort and observed model are receipt-derived.
Claude Code/Codex record model_source: host-native, never a model override.
Named agents preserve contracts where supported, not a fleet-model guarantee;
an unavailable review must not be replaced by narrated inline success. Codex
waves stay sequential in this session with no recursive spawning (adaptation below).
As of v8, commands/masterplan.md is a self-contained thin orchestrator
(~800 lines) that sequences the whole workflow inline — there are no
parts/ phase files to lazy-load. The deterministic decisions live in
lib/*.mjs behind bin/masterplan.mjs subcommands (invoked as mp), and
doctor is bin/doctor.mjs + the lib/doctor/*.mjs modules. Load the command
prompt once and follow its own §0 Boot → §1 Parse verb → §2 Resume sequencing;
do not look for per-phase files.
Resolve commands/masterplan.md in this order (its siblings bin/ and lib/
sit beside it at the plugin root):
../../commands/masterplan.md relative to this SKILL.md file (covers the
Pi install root and any symlinked skill dir).$PWD/commands/masterplan.md when running inside the plugin repo./path/to/masterplan/commands/masterplan.md.$HOME/.local/share/masterplan/current/commands/masterplan.md (Pi install root).$HOME/.codex/.tmp/marketplaces/rasatpetabit-masterplan/commands/masterplan.md.$HOME/.claude/plugins/marketplaces/rasatpetabit-masterplan/commands/masterplan.md.$HOME/.claude/commands/masterplan.md.If none exists, say the local masterplan command file is missing and stop before inventing behavior.
Run the deterministic core with the Node entrypoints that sit beside the command
file. The prompt writes them as node "${CLAUDE_PLUGIN_ROOT}/bin/masterplan.mjs"
and node "${CLAUDE_PLUGIN_ROOT}/bin/doctor.mjs"; ${CLAUDE_PLUGIN_ROOT} is a
Claude Code variable that may be unset on other hosts, so resolve bin/ as the
sibling of the located commands/masterplan.md:
mp <subcommand> → node <plugin-root>/bin/masterplan.mjs <subcommand> … —
the state reads/writes (decide, finish-status, gate verbs, set-status).
This is the sole state writer; the shell owns git (commit/checkout), the
bin is fs-only.doctor → node <plugin-root>/bin/doctor.mjs.Prefer summary-first inventory (rg --files docs/masterplan plus targeted
state.yml reads) before opening plan/spec artifacts. Avoid exploratory
full-file dumps of large prompt, plan, transcript, or event-log files.
Configuration resolves through a four-layer hierarchy (lib/config.mjs,
resolveRunConfig): CLI > repo (.masterplan.yaml) > user (~/.masterplan.yaml) >
default. A recognized key is validated against the schema enum and its source layer is
reported (config show prints resolved values + *_source). Unsupported keys warn and
are ignored; a malformed file or invalid enum is a hard error — a value never silently
falls through. done and context_watch support whole-object replacement with partial
context_watch defaults; auto_compact is a deprecated alias for context_watch.
Recognized keys: complexity (low|medium|high), autonomy (gated|loose, alias
full → loose), planning_mode (serial|parallel|auto), adversary_review
(on|off), render_images (on|off), fabric (on|off), context_watch
({threshold 1–99, focus}), adversary_review_fallback (off → noSubstitute: true; model arrays are retired, migrate to inference routing),
done (definition of done: version_from, fixed-order
release steps, ${version}, commit_paths).
Only complexity, autonomy, and planning_mode are resolved from the config
chain at seed and persisted into state.yml; adversary_review, render_images,
and fabric come from their seed flags/defaults only (never from a config file at
seed — mp set-review-config is the post-seed write for review). adversary_review_fallback
resolves from the chain at the finish gate: off adds noSubstitute: true to
model-free challenge intent; it does not authorize skipping unavailable reviews.
Pi's boundary owns recovery and critical panels, not an alternate reviewer loop.
fabric accepts
on|off at the flag (schema default on): off marks a bundle unexecutable —
fabric is the only wave path since the L2 legacy dispatch was deleted, so a bundle
without state.dispatch.fabric: true refuses dispatch (the legacy path is not restored).
Deploy groups run in a fixed order — release → install → user_only → live_check
(DEPLOY_GROUP_ORDER in lib/finish.mjs); group order is normative and within a group
steps run in list order. done: none deploys nothing. Deploy steps record via
mp finish-step --deploy-step-done=<group>[<index>] --exit=<code>.
mp seed): --autonomy, --complexity, --planning-mode,
--adversary-review=on|off (default on; alias --codex-review), --render-images,
--fabric=on, --overlap-review=<json> (required), --predecessor=<slug> — persisted
into state.yml at run creation. Every fresh bundle arms state.review.adversary: true
automatically; pass off for explicit opt-out. mp continue accepts --planning-mode
on the command line and resolves it through the same chain.mp set-review-config --review=true|false [--routing=auto|on|off];
alias mp set-codex-config): a CD-7 write that arms state.review.adversary. The
finish-step gate gates the optional review stage on state.review.adversary === true
(falling back to the legacy state.codex.review for in-flight bundles). New bundles
inherit true from the seed-time default; pass --review=false post-seed to opt out.
--routing is the legacy per-task dispatch default (state.codex.routing), still read
by prepare-wave for in-flight bundles.Host review-suppression (see the host adaptation sections) only forces the
effective review behavior off for the current invocation to avoid recursive
host-on-host dispatch; it does not rewrite the persisted state.yml values
(state.review.adversary, or legacy state.codex.{routing,review}), which
still apply to future runs on other hosts.
Treat these user inputs as this skill:
Use masterplan <args> as a normal chat message (any host)masterplan <args> when it appears as natural-language chat, not shell input$masterplan$masterplan <args> when it appears as normal chat (Codex caveat below —
its TUI shell-command mode sends this to Bash)/masterplan/masterplan <args>/masterplan:masterplan/masterplan:masterplan <args>No per-verb skills (v8). masterplan ships exactly two skill dirs — this one
and masterplan-detect. There are no /masterplan:<verb> per-verb skills:
every verb (brainstorm, full, execute, finish, retro, import,
doctor, status, validate, stats, clean, next, verbs, render, publish, follow, and plan) is dispatched
by the bare /masterplan <verb> command through bin/masterplan.mjs (verb
routing in commands/masterplan.md §1/§3). The per-verb namespace was removed
because it added nothing over bare-command routing and the reserved words
plan/status/doctor actively shadowed Claude Code built-ins (/plan
plan-mode, /status, /doctor). The namespace-collision guard (lib/hygiene.mjs
→ findNamespaceCollisions, driven by test/publish-hygiene.test.mjs) keeps it
that way: only masterplan + masterplan-detect are allowed under skills/.
The arguments are the text after the command name. If there are no arguments,
follow the command's bare invocation flow: resume active state.yml first,
re-render pending gates, poll background continuations, and treat status: blocked as critical-error recovery rather than an ordinary pause. When a host
renders a manual resume hint or close-out instruction, use an explicit normal
chat instruction suited to that host (see its adaptation section); never surface
a shell-looking form as the primary resume command.
Every host must recognize runs created by any other host. Before starting a new plan, inspect the current repo/worktree for:
docs/masterplan/*/state.ymldocs/masterplan/*/{spec.md,plan.md,retro.md,events.jsonl}docs/superpowers/plans/*-status.mddocs/superpowers/{plans,specs,retros,archived-plans,archived-specs}/*.mdDo not assume there is no active work because this host did not create the run
bundle. state.yml is the durable source of truth.
Two observability verbs help here: mp resume-brief --repo-root <dir>
resolves zero, one, or several active bundles into a compact resume brief
(the resume-brief-hook doctor check verifies the hook wiring — reads the
policy and reports PASS/WARN/SKIP, installs nothing), and
mp context-status --repo-root <dir> reports the measured context usage at
gates where the harness exposes it (and an explicit unknown state where it
does not) — watch it at gates and compact when it recommends the threshold.
read/bash/edit/write
for file work (no translation layer), ask_user_question for every
user-facing choice (never prose questions), todo for task tracking.PI_CODING_AGENT=true are forced onto the serial planning path
(planning_mode: serial in the resume-phase op) — this is automatic; the
parallel plan fan-out is CC-only.dispatch_fabric ops come back on Pi like every host.
Launch op.tasks from op.cwd with Pi's parallel subagent API — one
bounded, self-contained brief per task (its files scope, its verifies, its
digest contract), fan out the independent ones concurrently, honor each
task's files scope as its write boundary, then assemble the standard
per-task digest array and feed it to mp record-result exactly as the §2 op
table describes. Sequential single-task execution is fine for one-task waves
or when tasks share mutable state.Use masterplan execute docs/masterplan/<slug>/state.yml — there is no
slash-command form on Pi.~/.pi/agent/agents/
(bare-only) by bin/register-pi-agents.mjs during install; subagent
dispatches reference them by bare name.Use masterplan ... is the primary Codex chat/skill trigger for user-facing
resume hints. $masterplan ... can work only when the host records it as normal
chat; Codex TUI shell-command mode sends it to Bash. Never pass
$masterplan ..., masterplan ..., or /masterplan ... to exec_command;
Bash will either expand $masterplan as an environment variable or look for a
nonexistent executable. Resume hints use an explicit normal chat instruction,
e.g. send a normal Codex chat message: Use masterplan execute docs/masterplan/<slug>/state.yml.
When the command prompt names Claude Code tools, use the local Codex equivalents:
sed, ls, rg, or rg --files.apply_patch.exec_command.request_user_input when available; otherwise
fail closed — defer that decision, never a prose question.update_plan.dispatch_fabric op on every host (suppressed or not) — run op.tasks one
at a time in this session from op.cwd (track with update_plan), honor
each task's files scope, then assemble the standard per-task digest array
and feed it to mp record-result exactly as the §2 op table describes. Host
suppression does NOT suppress dispatch_fabric — it only forces PLANNING
onto the SERIAL path (planning_mode: serial in the resume-phase op;
the parallel plan fan-out is CC-only). Never run
either workflow inline — the foreground-sequential op IS the Codex
execution path.SKILL.md and follow it.multi_tool_use.parallel only for independent tool calls.Follow the command prompt's Codex-hosted suppression rules: do not recursively
dispatch to Codex from inside a Codex-hosted masterplan run. Codex host
review-suppression is only about recursive dispatch and review. When a Codex
request_user_input gate returns an answer label, treat that as explicit
interactive selection evidence even when it is the first/recommended option and
no free-form note is present. Follow the command prompt's
codex_host_gate_continuation rule for continuation answers and keep moving for
full / execute flows until a true halt gate, sensitive live-auth blocker, or
actual Codex host budget stop fires.
Codex native goal support is a pursuit wrapper for Masterplan plans, not a
Masterplan verb. After a plan exists, follow the command prompt's Codex native
goal pursuit contract: use get_goal to inspect the active thread goal, create
one with create_goal when an in-progress state.yml has no matching goal, and
call update_goal(status="complete") only after Masterplan's own completion
finalizer proves the plan is complete. Do not run /goal, $goal, or goal in
shell-command mode; those are host UI inputs, not executables. state.yml
remains authoritative for task position and recovery.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub rasatpetabit/masterplan --plugin masterplan2 skills in this plugin
Other plugins' skills for the same job