plan
Purpose
Turn confirmed Scope into the smallest sufficient aligned draft and user-facing handoff. spectre-plan-route alone classifies; the primary owns synthesis, routing, and draft finalization. Scope remains the immutable user contract; the draft is not a reviewed execution source.
Inputs
$ARGUMENTS: confirmed Scope—thread or managed root/descendant. Ordinary repository-changing work without confirmed Scope returns tospectre-scope; reported bugs normally usespectre-fix. Read-only diagnosis/review, release, and execution of approved artifacts remain direct.- Existing
concepts/scope.md,specs/prd.md,ux.md(preferred) or legacyspecs/ux.md,task_context.md, and prior plan artifacts.
Working Set
- Reuse a managed
FEATURE_ROOTonly when explicit/current-thread evidence ties it to this work (physical directory wins; never branch/recency/lifecycle/scans); distinct work ignores ambient roots. Otherwise, including on collision, standalone MUST first load and followSkill(spectre-feature-root)through DONE; orchestrated calls escalate. Keep writes beneath it and pass it unchanged. - Immutable canonical Scope:
concepts/scope.mdwhen present, else confirmed thread; never narrow, expand, or reinterpret it without explicit scope-change approval. - Read
references/estimation-guidance.mdonly at an applicable gate; each estimate excludes user waits and never delays or blocks the gate.
Outputs + DONE
Every route produces the aligned specs/plan.md and existing task_context.md evidence; it produces no review, task/index, or task-review artifact. The plan's response is the alignment surface, not a second durable specification.
DONE when initial and observed routing decisions are recorded; the draft and protected inputs validate; Scope is unchanged; plan.completed records the draft; the response gives the required concise alignment brief and one marked Execute handoff; telemetry is complete|degraded; or unavailable authority/scope change stopped before handoff.
Method / guardrails
- Check product readiness: unresolved journeys/states/copy/accessibility route to
spectre-ux; load-bearing interaction/layout validation routes tospectre-prototype. - Make one cheap local scan, then invoke
Skill(spectre-plan-route)ininitialmode. Runnode "${PLUGIN_ROOT}/hooks/scripts/workflow-cli.mjs" plan startwith the root/scope hash plus the returned semantic record, size/route, reason codes, design flag, probe flags, and protected boundaries; retainPLAN_RUN_IDforplan.started. Show size/rationale without asking approval of the label. - Gather proportional evidence: XS/S stay local except the route's bounded probe; M uses at most two relevant
@spectre_finder,@spectre_analyst, or@spectre_patterns; L/XL cover necessary dimensions.@spectre_web_researchis only for an external dependency/API/framework decision. Persist accepted evidence intask_context.md. - Draft once with the route-mapped depth and no review: XS →
Skill(spectre-create_plan) --depth light --no-review --execution structured; S →Skill(spectre-create_plan) --depth light --no-review --execution structured; M/L →Skill(spectre-create_plan) --depth standard --no-review --execution structured; XL →Skill(spectre-create_plan) --depth comprehensive --no-review --execution structured. Never run a review, task/index, or task-review pipeline here. XS must uselight, notxs, so its draft never receivesExecution Mode: direct. - Validate the draft, invoke
Skill(spectre-plan-route)inobservedmode withRouting Observations, and emitplan.reclassifiedwith plan hash, initial/observed records, and regret. Surface KEEP/RERUN_SMALLER/RERUN_LARGER and wait when changed; never silently rerun paid work. Emitplan.completedfor this draft with raw-file artifact hashes, counts, and planning elapsed time excluding waits. Any telemetry failure is degraded observation only and never blocks the handoff. - Derive the response from
specs/plan.md: requested outcome, proposed architecture/approach, material decisions, Scope/anti-scope boundaries, credible risks, verification intent, and genuine ordering/shared-contract constraints. Keep it concise. If drafting exposes a Scope change, contradiction with an explicit selected design, missing irreversible decision, or unavailable user authority, withhold the handoff and use the existing authority escalation. Otherwise return exactly one copy-ready fenced command:spectre-execute <repo-relative plan.md> --origin plan --preflight-plan <xs|light|standard|comprehensive>. Marker mapping is XS → xs; S → light; M/L → standard; XL → comprehensive. Launching that command is the user's alignment signal. Never pass--orchestratedor wait for delivery insurance.
Handoff
The marked handoff gives Execute the editable aligned draft and its task depth. Execute owns scope-safe delivery insurance, safe-parallelism assessment, derivative task/index creation, and all later structured delivery gates. Never generate a goal prompt; autonomous goal mode is an explicit opt-in utility outside this route.
Escalate-If
- Scope/root is absent or conflicts; drafting reveals a Scope change, explicit-design contradiction, missing irreversible decision, or unavailable authority; or deterministic draft artifacts do not validate.
- Telemetry or a missing estimate never blocks planning; report degraded observation and continue.