| name | ce-plan |
| description | Create structured plans for multi-step work, including software and non-software tasks. Use when asked to plan, break down implementation, plan from requirements, or deepen an existing plan; prefer ce-brainstorm for exploratory framing. |
| argument-hint | [optional: feature description, requirements doc path, plan path to deepen, or any task to plan] [output:html] |
Create Technical Plan
Note: The current year is 2026. Use this when dating plans and searching for recent documentation.
ce-brainstorm defines WHAT to build by creating a requirements-only unified plan. ce-plan enriches that same artifact with HOW to build it. ce-work executes implementation-ready plans. A prior brainstorm is useful context but never required — ce-plan works from any input: a requirements-only unified plan, a legacy requirements doc, a bug report, a feature idea, or a rough description.
When directly invoked, always plan. Never classify a direct invocation as "not a planning task" and abandon the workflow. If the input is unclear, ask clarifying questions or use the planning bootstrap (Phase 0.4) to establish enough context — but always stay in the planning workflow.
This workflow produces a durable implementation plan. It does not implement code, run tests, or learn from execution-time results. If the answer depends on changing code and seeing what happens, that belongs in ce-work, not here.
Interaction Method
When asking the user a question, use the platform's blocking question tool: AskUserQuestion in Claude Code (call ToolSearch with select:AskUserQuestion first if its schema isn't loaded), request_user_input in Codex, ask_question in Antigravity CLI (agy), ask_user in Pi (requires the pi-ask-user extension). Fall back to numbered options in chat only when no blocking tool exists in the harness or the call errors (e.g., Codex edit modes) — not because a schema load is required. Never silently skip the question.
Ask one question at a time. Prefer a concise single-select choice when natural options exist.
Running inside Fusion (autonomous workflow step)
When the environment variable FUSION_WORKFLOW_STEP is set, you are running as a Fusion workflow step, not an interactive session. There is no synchronous blocking-question tool — AskUserQuestion has no listener here and must NOT be called. Adapt as follows:
-
Asking the user a question: emit a single await-input block in your output and stop. Fusion parses it, pauses the task (awaiting-user-input), and surfaces it to a human via the task card; when they answer, this step re-runs with their reply available as the latest steering comment. Emit at most one question per run, exactly in this form:
===FUSION_AWAIT_INPUT===
<your single clear question, including any options as a short list>
===END_FUSION_AWAIT_INPUT===
On the re-run, read the most recent steering comment as the answer and continue. Only emit the block for questions that genuinely block planning (per Phase 0.5 / Phase 2). If FUSION_HEADLESS is also set, do not emit questions at all — take the headless path (record assumptions in a ## Assumptions section and proceed).
-
Spawning sub-agents (research / reviewer personas): Fusion's spawn primitive is fn_spawn_agent, not Task. To run a named ce-* persona, read its definition from the directory in FUSION_CE_AGENTS_DIR (e.g. ${FUSION_CE_AGENTS_DIR}/ce-repo-research-analyst.md), strip the YAML frontmatter, and pass the remaining body as fn_spawn_agent's systemPromptOverride (with role: "reviewer" for review personas, role: "executor" otherwise) and the task scope as task. If FUSION_CE_AGENTS_DIR is unset or the def is missing, fall back to running the analysis inline yourself (single-agent) rather than failing.
Feature Description
<feature_description> #$ARGUMENTS </feature_description>
If the feature description above is empty, ask the user: "What would you like to plan? Describe the task, goal, or project you have in mind." Then wait for their response before continuing.
If the input is present but unclear or underspecified, do not abandon — ask one or two clarifying questions, or proceed to Phase 0.4's planning bootstrap to establish enough context. The goal is always to help the user plan, never to exit the workflow.
IMPORTANT: All file references in the plan document must use repo-relative paths (e.g., src/models/user.rb), never absolute paths (e.g., /Users/name/Code/project/src/models/user.rb). This applies everywhere — implementation unit file lists, pattern references, origin document links, and prose mentions. Absolute paths break portability across machines, worktrees, and teammates.
Core Principles
- Use the Product Contract as the source of truth - If
ce-brainstorm produced a requirements-only unified plan, planning should enrich it in place rather than re-inventing behavior or creating a second artifact.
- Decisions, not code - Capture approach, boundaries, files, dependencies, risks, and test scenarios. Do not pre-write implementation code or shell command choreography. Pseudo-code sketches or DSL grammars that communicate high-level technical design are welcome when they help a reviewer validate direction — but they must be explicitly framed as directional guidance, not implementation specification.
- Research before structuring - Explore the codebase, institutional learnings, and external guidance when warranted before finalizing the plan.
- Right-size the artifact - Small work gets a compact plan. Large work gets more structure. The philosophy stays the same at every depth.
- Separate planning from execution discovery - Resolve planning-time questions here. Explicitly defer execution-time unknowns to implementation.
- Keep the plan portable - The plan should work as a living document, review artifact, or issue body without embedding tool-specific executor instructions.
- Carry execution posture lightly when it matters - If the request, origin document, or repo context clearly implies test-first, characterization-first, or another non-default execution posture, reflect that in the plan as a lightweight signal. Do not turn the plan into step-by-step execution choreography.
- Honor user-named resources - When the user names a specific resource — a CLI, MCP server, URL, file, doc link, or prior artifact — treat it as authoritative input, not a suggestion. Discover it if unknown (
command -v, fetch, read) before assuming it's unavailable. Use it in place of generic alternatives. If it fails or doesn't exist, say so explicitly rather than silently substituting.
Plan Quality Bar
Every plan should contain:
- A clear problem frame and scope boundary
- Concrete requirements traceability back to the request or origin document
- Repo-relative file paths for the work being proposed (never absolute paths — see Planning Rules)
- Explicit test file paths for feature-bearing implementation units
- Decisions with rationale, not just tasks
- Existing patterns or code references to follow
- Enumerated test scenarios for each feature-bearing unit, specific enough that an implementer knows exactly what to test without inventing coverage themselves
- Clear dependencies and sequencing
A plan is ready when an implementer can start confidently without needing the plan to write the code for them.
Workflow
Phase 0: Resume, Source, and Scope
0.0 Resolve Output Mode
Determine OUTPUT_FORMAT before any other phase fires. Output mode is exclusive — the plan is written as either markdown (.md) OR HTML (.html), never both. Precedence: in-prompt request > user-stated preference > config > default (md), with a hard pipeline-mode override.
Read config. The repo root is pre-resolved at skill load:
!git rev-parse --show-toplevel 2>/dev/null || true
If the line above is an absolute path, use it as <repo-root>. If it is empty or still shows a backtick command string (a non-Claude harness that did not run the pre-resolution), resolve <repo-root> at runtime by running git rev-parse --show-toplevel with the shell tool. Then read <repo-root>/.compound-engineering/config.local.yaml with the native file-read tool. If the root cannot be resolved (not a git repo) or the file does not exist, fall through to the defaults below.
Resolution steps:
- In-prompt request. Reason over the user's prompt for this run for a request about this document's output format, expressed either as the
output: shorthand or in plain language ("make the plan a webpage", "I want this in HTML"). On an explicit format, match it case-insensitively to md/html, and ignore the output: shorthand token when reading the rest of the prompt as the feature description. Distinguish a request about the document's format from a format named as subject matter: "add an HTML export feature" or "plan the CSV importer" is the work, not a doc-format request — do not switch on it.
output: alone (no value) → no-op, fall through to step 2.
output:<unknown> (e.g., output:pdf) → drop the token, fall through to step 2, and remember to emit a one-line note above the post-generation menu after final resolution: Ignored unknown output: value '<value>' — using <resolved_format> instead. where <resolved_format> is the value OUTPUT_FORMAT actually resolved to after the remaining precedence steps. Do not hardcode md in the note — that misleads users when config has set HTML.
- User-stated preference. If this prompt holds no format request, honor an output-format preference (markdown vs HTML) the user established earlier — earlier in this session, in your memory, or written into their active instructions — that is already in your context (match
md/html case-insensitively). A remembered preference is more current than the rarely-edited config, so it overrides the config in step 3. Do not open or search instruction files to find it — act only on a preference already present in your context; if none is, fall through to the config.
- Config. If steps 1-2 did not resolve and the config file read above has an active (non-commented)
plan_output: key whose value matches md or html (case-insensitive), use it. Missing, invalid, or commented values fall through silently. Critical: lines starting with # are YAML comments and must be ignored — the shipped config template includes commented examples like # plan_output: html to document the option, and matching those as active settings would silently force HTML mode on every run without the user having opted in.
- Default. Otherwise
OUTPUT_FORMAT=md.
- Pipeline override. When invoked from LFG or any
disable-model-invocation context, force OUTPUT_FORMAT=md regardless of steps 1-4. ce-work and other automated downstream consumers parse markdown reliably; HTML in pipeline runs is unnecessary friction.
Token-parsing convention: only literal-prefix flag tokens (output:, mode:, delegate: where applicable) are consumed and stripped. Other <word>:<word> tokens — including conventional commit prefixes like feat:, fix:, chore: that may appear inside a feature description — pass through verbatim.
Load the format-rendering reference based on the resolved value. Section content is the same in either format; presentation differs. Both references are paired with references/plan-sections.md, which describes what the plan contains regardless of format.
- When
OUTPUT_FORMAT=md, read references/markdown-rendering.md for format principles.
- When
OUTPUT_FORMAT=html, read references/html-rendering.md for format principles.
0.1 Resume Existing Plan Work When Appropriate
If the user references an existing plan file or there is an obvious recent matching plan in docs/plans/:
- Read it
- Confirm whether to update it in place or create a new plan
- If updating, revise only the still-relevant sections. Plans do not carry per-unit progress state — progress is derived from git by
ce-work, so there is no progress to preserve across edits
A requirements-only unified plan is not a resume target. A docs/plans/ file with artifact_readiness: requirements-only is an enrichment input, not an existing plan to resume — do not fire the update-or-create confirm for it. Fall through to Phase 0.2, which enriches it in place to implementation-ready. This matters most for the hands-off ce-brainstorm -> lfg flow: lfg hands ce-plan the requirements-only path in disable-model-invocation pipeline mode, where no user is present to answer a resume prompt. More generally, in pipeline mode the resume choice is made automatically (default to in-place update of the referenced plan) and never prompted.
Deepen intent: The word "deepen" (or "deepening") in reference to a plan is the primary trigger for the deepening fast path. When the user says "deepen the plan", "deepen my plan", "run a deepening pass", or similar, the target document is a plan in docs/plans/, not a requirements document. Use any path, keyword, or context the user provides to identify the right plan. If a path is provided, verify it is actually a plan document. If the match is not obvious, confirm with the user before proceeding.
Words like "strengthen", "confidence", "gaps", and "rigor" are NOT sufficient on their own to trigger deepening. These words appear in normal editing requests ("strengthen that section about the diagram", "there are gaps in the test scenarios") and should not cause a holistic deepening pass. Only treat them as deepening intent when the request clearly targets the plan as a whole and does not name a specific section or content area to change — and even then, prefer to confirm with the user before entering the deepening flow.
Once the plan is identified and appears complete (all major sections present, implementation units defined):
- Routing is keyed on file extension first, then frontmatter. HTML plans (
.html) are always software plans — the html-rendering invariant forbids YAML frontmatter, so frontmatter absence is not a non-software signal for HTML. Treat the visible-header metadata (title, date) as the frontmatter equivalent.
.html plan: short-circuit to Phase 5.3 (Confidence Check and Deepening) in interactive mode. Never route to references/universal-planning.md based on missing YAML.
.md plan WITH YAML frontmatter: short-circuit to Phase 5.3 in interactive mode.
.md plan WITHOUT YAML frontmatter (non-software plans use a simple # Title heading with Created: date instead): route to references/universal-planning.md for editing or deepening instead of Phase 5.3. Non-software plans do not use the software confidence check.
The Phase 5.3 short-circuit avoids re-running the full planning workflow and gives the user control over which findings are integrated.
Normal editing requests (e.g., "update the test scenarios", "add a new implementation unit", "strengthen the risk section") should NOT trigger the fast path — they follow the standard resume flow.
If the plan already has a deepened: YYYY-MM-DD frontmatter field and there is no explicit user request to re-deepen, the fast path still applies the same confidence-gap evaluation — it does not force deepening.
Resume preserves the existing artifact's format, except pipeline mode. When resuming an existing plan, the resume run writes back in whatever format the existing artifact uses — markdown if the existing file is .md, HTML if it is .html — so a resume doesn't silently change the artifact shape. Explicit output: arguments on this run override (e.g., resuming an .html plan with output:md switches the artifact to markdown). Pipeline mode (LFG, any disable-model-invocation context) always wins per Phase 0.0: even when resuming an existing .html plan, pipeline runs force OUTPUT_FORMAT=md so downstream automation receives the markdown shape it expects. The resume rewrites the markdown file at the parallel path (<plan-basename>.md) and the original .html is left in place untouched.
0.1a Recognize Approach-Altitude Requests
Some requests are better answered one level up: produce a grounded approach-plan — a plan for how the deliverable will be made — and hold there, rather than zero-shotting the deliverable. This runs after Phase 0.1's resume and deepen fast paths (so "deepen the plan" and resume short-circuit first) and before Phase 0.1b's domain split (so the capability is domain-general — it applies to software and knowledge-work alike).
Two entries, with very different gating:
Explicit (always honored, ungated). When the user asks for the approach itself — "plan for a plan", "plan the approach", "plan how you'll do X", "don't do it yet -- just plan how you'd approach it" — enter approach altitude and hold at the approach. Do NOT begin the deliverable. Key on language that asks for the approach to producing something, not the something. This is a distinct signal from "deepen"/"strengthen" (the Phase 0.1 deepening fast path) and from a normal plan request.
Proactive (rare, conservative). When the user gives a plain request with no approach-language, offer an approach-plan only when both of these are clearly high:
- Method uncertainty — the core approach is genuinely unsettled: competing methodologies that would yield different deliverables, unclear how disparate sources or constraints combine, or an outcome stated only at the value level ("something I can actually use"). This is not satisfied by a task whose core method is obvious but whose rollout, sequencing, scope, or ordering has routine variants (big-bang vs. incremental, batch order, phased vs. one-shot) — those are ordinary plan decisions the Phase 0.7 scoping synthesis already surfaces as call-outs, not method-uncertainty. A large or mechanical change (a 40-endpoint migration, a wide rename, a framework bump) is typically costly but method-obvious; cost alone never fires the offer.
- Cost of getting it wrong — the deliverable is expensive or slow to produce and a wrong approach wastes real effort (heavy inputs to process, a long synthesis, a large or risky change).
If either is low, stay silent and plan/do normally. When borderline, stay silent. Assess this from request shape and input metadata only — do not read the inputs yet (recon happens after the offer is accepted). When the offer does fire, it is a single dismissible line naming the specific signal (e.g., "Three heavy sources are about to get synthesized and you might want them weighted differently -- want my approach first, or should I just go?") — never a blocking question, never a ceremony. Because the explicit path above is always available, a missed offer is cheap; the failure mode to avoid is the new-hammer nag — opening turns with "want me to plan the approach first?" when the method is obvious.
Stay disjoint from the other approach surfaces (R16). An investigative or analytical request with no approach-language and not-both-signals-high is NOT an approach-altitude request — it must pass through this gate untouched to Phase 0.1b, where answer-seeking's plan-of-attack handles it; the gate's earlier position must not intercept it. "Deepen the plan" and resume are already short-circuited by Phase 0.1. The Phase 0.7 / 5.1.5 scoping synthesis and the Phase 5.3 deepening pass operate on a deliverable already committed to; approach altitude operates before that commitment. Full distinctions: references/approach-altitude.md.
On entry (explicit, or an accepted offer), read references/approach-altitude.md and follow it. Otherwise continue to Phase 0.1b unchanged.
0.1b Classify Task Domain
If the task asks to build, modify, refactor, deploy, or architect software (code, schemas, infrastructure), continue to Phase 0.2.
Classify by task-type, not topic. A request that merely references code, a repo, an API, or a database is not automatically software work: building or modifying code is software; investigating or analyzing it is an answer-seeking question. "How often does X star repos — is it a big deal?" or "how does our approach compare to Y?" route to references/universal-planning.md (answer-seeking), not the implementation-plan path.
If the domain is genuinely ambiguous (e.g., "plan a migration" with no other context), ask the user before routing.
Otherwise, read references/universal-planning.md and follow that workflow instead. Skip all subsequent phases. Named tools or source links don't change this routing — they're inputs, handled per Core Principle 8.
0.2 Find Upstream Product Contract
Before asking planning questions, resolve the upstream product source in this order:
- Explicit path from the user. If it points to a unified plan with
artifact_contract: ce-unified-plan/v1 and artifact_readiness: requirements-only, this run enriches that same file in place. If it is already artifact_readiness: implementation-ready, treat it as a resume/deepening target. If it is a legacy docs/brainstorms/*-requirements.{md,html} file, use it as a legacy origin and write a new unified plan in docs/plans/.
- Recent requirements-only unified plans. Search
docs/plans/*.{md,html} for visible/frontmatter metadata containing artifact_contract: ce-unified-plan/v1, artifact_readiness: requirements-only, and product_contract_source: ce-brainstorm. Skip a superseded sibling: if a requirements-only candidate has a same-basename file in the other format (<basename>.md / <basename>.html) that is already implementation-ready, a format conversion superseded it — the implementation-ready sibling is canonical; do not re-enrich the stale requirements-only copy.
- Legacy requirements docs. Search
docs/brainstorms/ for files matching *-requirements.md or *-requirements.html. These remain readable historical inputs; do not migrate or rewrite them.
Relevance criteria: A Product Contract source is relevant if:
- The topic semantically matches the feature description
- It was created within the last 30 days (use judgment to override if the document is clearly still relevant or clearly stale)
- It appears to cover the same user problem or scope
If multiple source documents match, ask which one to use using the platform's blocking question tool when available (see Interaction Method). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
0.3 Use the Product Contract as Primary Input
If a relevant requirements-only unified plan exists:
- Read metadata, Goal Capsule, Product Contract, Open Questions, and Sources (scan headings to locate them; don't read long appendices unless referenced).
- Announce that
ce-plan will enrich that same file to artifact_readiness: implementation-ready.
- Preserve the existing Product Contract text and stable R/A/F/AE IDs unless planning discovers a direct conflict. Conflicts become explicit assumptions or questions; do not silently rewrite product scope.
- Because enrichment edits the same file that holds the user's product decisions, record a one-line Product Contract preservation note in the enriched plan: either "Product Contract unchanged" or "changed: <R-IDs> — <why>". This keeps the WHAT/HOW review boundary visible to reviewers (
ce-doc-review, PR review) when there is no separate brainstorm file to diff against. For a substantive product-scope change (not a clarification), pause and confirm with the user before writing implementation units.
- Carry forward all applicable Product Contract sections listed below.
- Use the Product Contract as the primary input to planning and research.
- Do not create a duplicate plan unless an explicit
output: conversion or pipeline override requires a new canonical path; when conversion happens, report old path and new canonical path.
If a relevant legacy requirements document exists:
- Read it thoroughly
- Announce that it will serve as the origin document for planning
- Carry forward all of the following:
- Problem frame
- Actors (A-IDs), Key Flows (F-IDs), and Acceptance Examples (AE-IDs) when present — preserve these as constraints that implementation units must honor
- Requirements and success criteria
- Scope boundaries (including "Deferred for later" and "Outside this product's identity" subsections when present)
- Key decisions and rationale
- Dependencies or assumptions
- Outstanding questions, preserving whether they are blocking or deferred
- Use the source document as the primary input to planning and research