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.
Feature Description
#$ARGUMENTS
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-brainstormproduced 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 tomd/html, and ignore theoutput: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 valueOUTPUT_FORMATactually resolved to after the remaining precedence steps. Do not hardcodemdin 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/htmlcase-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 matchesmdorhtml(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: htmlto 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-invocationcontext, forceOUTPUT_FORMAT=mdregardless of steps 1-4.ce-workand 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, readreferences/markdown-rendering.mdfor format principles. - When
OUTPUT_FORMAT=html, readreferences/html-rendering.mdfor 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..htmlplan: short-circuit to Phase 5.3 (Confidence Check and Deepening) in interactive mode. Never route toreferences/universal-planning.mdbased on missing YAML..mdplan WITH YAML frontmatter: short-circuit to Phase 5.3 in interactive mode..mdplan WITHOUT YAML frontmatter (non-software plans use a simple# Titleheading withCreated:date instead): route toreferences/universal-planning.mdfor 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/v1andartifact_readiness: requirements-only, this run enriches that same file in place. If it is alreadyartifact_readiness: implementation-ready, treat it as a resume/deepening target. If it is a legacydocs/brainstorms/*-requirements.{md,html}file, use it as a legacy origin and write a new unified plan indocs/plans/. - Recent requirements-only unified plans. Search
docs/plans/*.{md,html}for visible/frontmatter metadata containingartifact_contract: ce-unified-plan/v1,artifact_readiness: requirements-only, andproduct_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 alreadyimplementation-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.mdor*-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-planwill enrich that same file toartifact_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.
- 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 (
- 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
- Reference important carried-forward decisions in the plan with
(see origin: <source-path>) - Do not silently omit source content — if the origin document discussed it, the plan must address it even if briefly. Before finalizing, scan each section of the origin document to verify nothing was dropped.
If no relevant Product Contract source exists, planning may proceed from the user's request directly and will create a complete unified plan with product_contract_source: ce-plan-bootstrap.
0.4 Planning Bootstrap (No Requirements Doc or Unclear Input)
If no relevant requirements document exists, or the input needs more structure:
- Assess whether the request is already clear enough for direct technical planning — if so, continue to Phase 0.5
- If the ambiguity is mainly product framing, user behavior, or scope definition, recommend
ce-brainstormas a suggestion — but always offer to continue planning here as well - If the user wants to continue here (or was already explicit about wanting a plan), run the planning bootstrap below
The planning bootstrap should establish:
- Problem frame
- Intended behavior
- Scope boundaries and obvious non-goals
- Success criteria
- Blocking questions or assumptions
Keep this bootstrap brief. It exists to preserve direct-entry convenience, not to replace a full brainstorm.
If the bootstrap uncovers major unresolved product questions:
- Recommend
ce-brainstormagain - If the user still wants to continue, require explicit assumptions before proceeding
If the bootstrap reveals that a different workflow would serve the user better:
Bug-shaped prompt (user describes broken behavior — "fix the bug where X", error message, regression, "doesn't work"). Surface
ce-debugas a route-out option alongside continuing withce-planwhenever the bug surface is reachable (in cwd OR named repo found at another local path). Stay ince-plansilently when the named code can't be found anywhere local — paper-planning is the only useful output for unreachable surfaces.When the bug is at another local path (not cwd):
- Announce the target explicitly before any cross-repo investigation: which path will be read AND where plan outputs will land (default: target repo's
docs/plans/, not cwd's). - Default: proceed from the target repo for both investigation and plan-write. The user can interrupt to redirect (switch context, paper-plan, abandon, etc.). No location menu — the announcement makes the cross-repo nature visible, and the user can speak up if they want something unusual.
- After announcing and proceeding, fire the standard ce-debug routing menu (continue with
ce-planvs switch toce-debug) — same shape as the in-cwd case. Cross-repo location and ce-debug skill routing are orthogonal decisions; do not merge them into a single question.
Reading code at another path is fine in principle — that's just file access. The harm to avoid is silent operation on the wrong repo, especially writing the plan doc somewhere it won't be discovered (a busyblock plan landing in
cli-printing-press/docs/plans/is a discoverability disaster). The announcement requirement makes the target visible; defaulting to the target repo for both investigation and outputs respects the user's stated intent (they named that repo); the orthogonal ce-debug menu keeps the skill-choice question clean.The accessibility classification is conservative and may under-suggest in monorepos, dependency bugs, or after renames. Users can always invoke
/ce-debugmanually.Headless mode: skip the ce-debug suggestion menu entirely; default to continuing with
/ce-plan(the user's explicit invocation). There is no synchronous user to resolve a route-out choice, and auto-routing to ce-debug would change the skill mid-flight without authorization.- Announce the target explicitly before any cross-repo investigation: which path will be read AND where plan outputs will land (default: target repo's
Clear task ready to execute (known root cause, obvious fix, no architectural decisions) — suggest
ce-workas a faster alternative alongside continuing with planning. The user decides.
0.5 Classify Outstanding Questions Before Planning
If the origin document contains Resolve Before Planning or similar blocking questions:
- Review each one before proceeding
- Reclassify it into planning-owned work only if it is actually a technical, architectural, or research question
- Keep it as a blocker if it would change product behavior, scope, or success criteria
If true product blockers remain:
- Surface them clearly
- Ask the user, using the platform's blocking question tool when available (see Interaction Method), whether to:
- Resume
ce-brainstormto resolve them - Convert them into explicit assumptions or decisions and continue
- Resume
- Do not continue planning while true blockers remain unresolved
0.6 Assess Plan Depth
Classify the work into one of these plan depths:
- Lightweight - small, well-bounded, low ambiguity
- Standard - normal feature or bounded refactor with some technical decisions to document
- Deep - cross-cutting, strategic, high-risk, or highly ambiguous implementation work
If depth is unclear, ask one targeted question and then continue.
0.7 Solo-Mode Scoping Synthesis
Surface call-outs to the user — the specific forks in scope or approach where user input materially changes the plan — so scope can be corrected before Phase 1 research is spent. Sub-agent dispatch (repo-research-analyst, learnings-researcher, etc.) is the expensive next step this phase guards against wasted effort on.
Fires only in solo invocation — when Phase 0.2 found no upstream Product Contract source (no requirements-only unified plan and no legacy *-requirements doc; product_contract_source: ce-plan-bootstrap) AND Phase 0.4 stayed in ce-plan (did not route to ce-debug, ce-work, or universal-planning) AND Phase 0.5 cleared (no unresolved blockers) AND not on Phase 0.1 fast paths (resume normal, deepen-intent). Each guard is an explicit conditional. Skip Phase 0.7 entirely when any guard fails — upstream-sourced invocations (unified-plan enrichment or legacy brainstorm) defer to Phase 5.1.5 instead.
Read references/synthesis-summary.md before composing the scoping synthesis. It carries the affirmability test, keep-test criteria, detail test, summary shape budgets, granularity rules, anti-patterns, revision-vs-confirmation discipline, doc-shape routing, soft-cut behavior, self-redirect support, the worked PII compression example, and full headless-mode routing — all required for a well-shaped synthesis.
Required gate output — do not skip; silent proceeding is not allowed. Compose an internal three-bucket scope draft (Stated / Inferred / Out of scope — internal thinking that feeds plan-body routing at Phase 5.2, not the chat output below). Derive call-outs (specific forks where user input materially changes the plan), then emit one of the two literal templates below in chat before continuing to Phase 1.
Synthesis is pre-plan-write. The agent does NOT yet know how plan-write will sequence the work. Do not claim PR count ("one PR"), commit/branch shape, effort or time estimates, Implementation Unit boundaries, or exact file paths in the synthesis. The synthesis surfaces decisions knowable at THIS point — for the solo variant, that's the user's request plus the Phase 0.4 bootstrap dialogue plus the agent's own internal three-bucket draft. Phase 1 research has not happened yet and there is no upstream brainstorm; do not claim grounding from either. Plan-write produces the rest. This rule holds even when the agent has formed plan-write opinions earlier in the session — those stay internal until plan-write.
Summary shape: the summary is a scope claim — what the plan will target, what it will not — at affirm-or-redirect level. NOT an enumeration of Implementation Units. Form is prose, bullets, or mix; tier budgets are ceilings, not targets (Lightweight 1-3 lines; Standard up to 3-5 lines or 2-4 bullets; Deep up to 4-6 lines or 3-6 bullets). 1-2 lines per bullet, conversational not documentary. Less is correct when there isn't more to say. See reference for keep test, detail test, and source-vocabulary discipline.
Do NOT enumerate the touch surface. Sentences like "The touch surface is...", "This plan touches...", "The implementation reaches into..." are plan-pitch leaks. File paths, module names, directory introductions, and per-file change descriptions belong in the plan body (Implementation Units at Phase 5.2), not the synthesis. The synthesis names what the plan targets, not where the code lives.
Pre-emit scans. Before emitting the synthesis, scan the output:
- Bare ID references (
AE\d+,R\d+,F\d+,A\d+,U\d+) → replace with plain names. - File paths (
path/like.md,path/like.py, etc.) → cut unless the path IS the topic of an explicit fork in the call-outs.
Tier guard on auto-proceed: the auto-proceed path (announce without waiting for confirmation) fires only when plan depth is Lightweight AND zero call-outs survive. Standard and Deep plans always fire the confirmation gate, even with zero call-outs — substance earns the checkpoint, not interaction history.
Confirmation template (Standard/Deep regardless of call-out count, or any tier with one or more call-outs surviving):
Based on your request and our brief discussion, here's the scope I'm proposing to plan against:
[scope claim — what the plan will target, what it will not; affirm-or-redirect level; NOT an enumeration of Implementation Units]
**Call outs:** (omit this header when zero forks survived the keep test)
- [decision-level fork in 1-2 lines: name the choice and optional one-clause trade-off in parens. NO multi-sentence rationale, NO "my default is X" pitch]
Confirm and I'll proceed to research, drawing on this scope. (You can also redirect to /ce-brainstorm if this is bigger than you initially thought — I'll stop here and load it for you.)
Wait for user confirmation before continuing to Phase 1.
Auto-proceed template (Lightweight with zero call-outs only):
Planning: [1-3 line scope claim]
No open decisions to weigh in on — proceeding to research. Interrupt if I have the scope wrong.
Then continue to Phase 1 without a blocking question.
Headless mode: internal draft is composed but stage 2 (chat-time call-outs) is skipped — no synchronous user to confirm to. Continue to Phase 1 research as normal. At plan-write time (Phase 5.2), Inferred bets from the internal draft route to a ## Assumptions section in the plan instead of Key Technical Decisions. See references/synthesis-summary.md Headless mode for the full routing.
Phase 1: Gather Context
All specialist research and deepening prompts used in this phase are skill-local prompt assets under references/agents/. When dispatching one, read the matching file and seed a generic subagent with that prompt content plus the task-specific context below. Do not dispatch standalone agents by type/name.
Model tiering lives in this caller, not in prompt assets. Local prompt files have no frontmatter. Use the platform's mid-tier model for external/organizational research prompts such as slack-researcher and web-researcher when the current harness exposes a known override; otherwise omit the override and inherit. Use inherited model for high-judgment architecture, migration, and planning-deepening prompts unless the harness has an established cheaper capable tier.
1.1 Local Research (Always Runs)
Prepare a concise planning context summary (a paragraph or two) to pass as input to the research agents:
- If an origin document exists, summarize the problem frame, requirements, and key decisions from that document
- Otherwise use the feature description directly
- If
STRATEGY.mdexists, read it and include the relevant pieces (target problem, approach, active tracks) in the summary so downstream research and planning decisions are anchored to product strategy - If
CONCEPTS.mdexists at repo root, read it — its definitions are the canonical names for domain entities, named processes, and status concepts. Plan with those terms rather than synonyms.
Run these agents in parallel:
references/agents/repo-research-analyst.md— scope: technology, architecture, patterns. Pass the planning context summary.references/agents/learnings-researcher.md— pass the planning context summary.
Agent-native planning triage (conditional) — consider broadly, dispatch selectively. Dispatch a generic subagent with references/agents/agent-native-planning-strategist.md in parallel with the local research agents when the request, origin document, or repo research indicates any of:
- agent, assistant, chat, workflow automation, MCP, plugin, skill, tool registry, prompt, or autonomous-loop work
- a codebase with an existing agent surface where this feature changes user-visible capabilities
- a primary domain action that is repetitive, high-volume, complex, naturally language-shaped, or likely to need automation access
- a risk that the plan will widen the gap between UI/API actions and agent-accessible tools or context
Do not dispatch for cosmetic, layout-only, animation-only, brand, low-value preference, or narrow work in a product with no agent surface. If the signal is borderline, do not dispatch; carry only a short future parity consideration when it affects a high-value domain action. Include any resulting findings in consolidation as planning inputs, not as a standalone advice appendix.
Collect:
- Technology stack and versions (used in section 1.2 to make sharper external research decisions)
- Architectural patterns and conventions to follow
- Implementation patterns, relevant files, modules, and tests
- AGENTS.md guidance that materially affects the plan, with CLAUDE.md used only as compatibility fallback when present
- Institutional learnings from
docs/solutions/ - Product strategy context when
STRATEGY.mdis present — flag any plan decisions that pull away from the active tracks or the stated approach - Agent-native planning findings when the conditional triage dispatched: action/context parity decisions, tool/workspace/execution-lifecycle choices, scope boundaries, and verification scenarios
Slack context (opt-in) — never auto-dispatch. Route by condition:
- Tools available + user asked: Dispatch a generic subagent with
references/agents/slack-researcher.mdand the planning context summary in parallel with other Phase 1.1 agents. If the origin document has a Slack context section, pass it verbatim so the researcher focuses on gaps. Include findings in consolidation. - Tools available + user didn't ask: Note in output: "Slack tools detected. Ask me to search Slack for organizational context at any point, or include it in your next prompt."
- No tools + user asked: Note in output: "Slack context was requested but no Slack tools are available. Install and authenticate the Slack plugin to enable organizational context search."
1.1b Detect Execution Posture Signals
Decide whether the plan should carry a lightweight execution posture signal.
Look for signals such as:
- The user explicitly asks for TDD, test-first, or characterization-first work
- The origin document calls for test-first implementation or exploratory hardening of legacy code
- Local research shows the target area is legacy, weakly tested, or historically fragile, suggesting characterization coverage before changing behavior
When the signal is clear, carry it forward silently in the relevant implementation units.
Ask the user only if the posture would materially change sequencing or risk and cannot be responsibly inferred.
1.2 Decide on External Research
Based on the origin document, user signals, and local findings, decide whether external research adds value and, if so, what kind. Resolve this in three stages: explicit-request priority, intent classification, then the implicit signals below.
Stage 1 — An explicit request takes precedence. If the user prompt or the origin requirements document explicitly asks for external input — a signal that the answer lives outside the repo, such as competitor/prior-art comparison, "what should we borrow", "from the web", "best practices", "official docs", "alternatives to", a market scan, or naming a specific external technology to consult — external research is required, regardless of how strong local patterns look. The list is illustrative; key on the signal, not the exact phrase — any wording that clearly points outside the repo qualifies. The skip conditions below do not apply to an explicit request. The only thing that overrides it is an explicit opt-out ("no web research", "skip external research"): honor that, skip, and note it. Improvement or quality verbs ("improve", "make better") carry no external signal on their own and never trigger research by themselves.
Stage 2 — Classify the research intent (whenever external research will run, from Stage 1 or the implicit signals below) so Phase 1.3 routes correctly. Use this mechanical test, not a fixed phrase list:
- Implementation-guidance — the approach or techn
…(truncated)