ce-plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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.
ce-plan
defines HOW to build it.
ce-work
executes the plan. A prior brainstorm is useful context but never required —
ce-plan
works from any input: a 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.
注意:当前年份为2026年。 在为计划标注日期和搜索最新文档时请使用此年份。
ce-brainstorm
定义要构建什么
ce-plan
定义如何构建
ce-work
负责执行计划。过往的头脑风暴内容是有用的上下文,但并非必需——
ce-plan
可基于任何输入开展工作:需求文档、Bug报告、功能想法或粗略描述。
当被直接调用时,始终执行规划任务。 绝不能将直接调用归类为“非规划任务”并终止工作流。如果输入内容不清晰,可提出澄清问题或使用规划引导阶段(Phase 0.4)来建立足够的上下文——但始终要留在规划工作流中。
此工作流会生成一个可落地的实施计划。它不会编写代码、运行测试或从执行结果中学习。如果答案需要修改代码并观察结果,那属于
ce-work
的范畴,而非此工作流。

Interaction Method

交互方式

Use the platform's question tool when available. When asking the user a question, prefer the platform's blocking question tool if one exists (
AskUserQuestion
in Claude Code,
request_user_input
in Codex,
ask_user
in Gemini). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
Ask one question at a time. Prefer a concise single-select choice when natural options exist.
在可用时使用平台的提问工具。当向用户提问时,如果存在平台的阻塞式提问工具(如Claude Code中的
AskUserQuestion
、Codex中的
request_user_input
、Gemini中的
ask_user
),优先使用该工具。否则,在聊天中展示编号选项,等待用户回复后再继续。
一次只提一个问题。当存在自然选项时,优先使用简洁的单选选项。

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.
<feature_description> #$ARGUMENTS </feature_description>
如果上述功能描述为空,请向用户提问:“您想要规划什么?请描述您心中的任务、目标或项目。”然后等待用户回复后再继续。
如果输入内容存在但不清晰或不够具体,请勿终止工作流——可提出1-2个澄清问题,或进入Phase 0.4的规划引导阶段来建立足够的上下文。我们的目标始终是帮助用户完成规划,而非退出工作流。
重要提示:计划文档中的所有文件引用必须使用仓库相对路径(例如:
src/models/user.rb
),绝对不能使用绝对路径(例如:
/Users/name/Code/project/src/models/user.rb
)。这适用于所有场景——实施单元文件列表、模式引用、原始文档链接和文本提及。绝对路径会破坏跨机器、工作区和团队成员的可移植性。

Core Principles

核心原则

  1. Use requirements as the source of truth - If
    ce-brainstorm
    produced a requirements document, planning should build from it rather than re-inventing behavior.
  2. 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.
  3. Research before structuring - Explore the codebase, institutional learnings, and external guidance when warranted before finalizing the plan.
  4. Right-size the artifact - Small work gets a compact plan. Large work gets more structure. The philosophy stays the same at every depth.
  5. Separate planning from execution discovery - Resolve planning-time questions here. Explicitly defer execution-time unknowns to implementation.
  6. Keep the plan portable - The plan should work as a living document, review artifact, or issue body without embedding tool-specific executor instructions.
  7. 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.
  8. 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.
  1. 以需求为唯一依据 - 如果
    ce-brainstorm
    生成了需求文档,规划应基于该文档进行,而非重新定义功能。
  2. 聚焦决策,而非代码 - 记录实现方法、边界、文件、依赖项、风险和测试场景。不要预先编写实现代码或Shell命令编排。当伪代码草图或DSL语法有助于评审人员验证方向时,可使用它们来传达高层技术设计——但必须明确将其标注为方向性指导,而非实现规范。
  3. 先研究再结构化 - 在最终确定计划之前,如有必要,先探索代码库、机构经验和外部指导。
  4. 匹配需求的文档规模 - 小型工作使用紧凑的计划,大型工作使用更结构化的计划。无论规模大小,核心理念保持一致。
  5. 区分规划与执行探索 - 在此阶段解决规划层面的问题。将执行层面的未知问题明确推迟到实施阶段处理。
  6. 保持计划的可移植性 - 计划应可作为活文档、评审工件或议题内容使用,无需嵌入特定工具的执行器指令。
  7. 必要时兼顾执行姿态 - 如果请求、原始文档或仓库上下文明确暗示了测试优先、特征化优先或其他非默认执行姿态,可在计划中以轻量级信号体现。不要将计划转化为分步执行的编排指令。
  8. 尊重用户指定的资源 - 当用户指定了特定资源(CLI、MCP服务器、URL、文件、文档链接或过往工件)时,将其视为权威输入,而非建议。如果不了解该资源,先进行发现(
    command -v
    、获取、读取),再假设它不可用。用它替代通用方案。如果它失败或不存在,要明确说明,而非默默替换。

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

Phase 0:恢复、溯源与范围界定

0.1 Resume Existing Plan Work When Appropriate

0.1 适当时恢复现有规划工作

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, preserve completed checkboxes and revise only the still-relevant sections
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,
status: active
):
  • If the plan lacks YAML frontmatter (non-software plans use a simple
    # Title
    heading with
    Created:
    date instead of frontmatter), 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.
  • Otherwise, short-circuit to Phase 5.3 (Confidence Check and Deepening) in interactive mode. This 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.
如果用户引用了现有计划文件,或
docs/plans/
中存在明显匹配的近期计划:
  • 读取该计划
  • 确认是就地更新还是创建新计划
  • 如果是更新,保留已完成的复选框,仅修改仍相关的部分
深化意图: 提及计划时使用的“deepen”(或“deepening”)一词是触发深化快速路径的主要条件。当用户说“deepen the plan”、“deepen my plan”、“run a deepening pass”或类似表述时,目标文档是
docs/plans/
中的计划,而非需求文档。使用用户提供的任何路径、关键字或上下文来识别正确的计划。如果提供了路径,要验证它确实是计划文档。如果匹配不明确,在继续之前先与用户确认。
像“strengthen”、“confidence”、“gaps”和“rigor”这类词本身不足以触发深化。这些词会出现在常规编辑请求中(“strengthen that section about the diagram”、“there are gaps in the test scenarios”),不应触发整体深化流程。只有当请求明确针对整个计划且未指定要修改的具体章节或内容区域时,才将其视为深化意图——即便如此,在进入深化流程前也应优先与用户确认。
一旦计划被识别且看起来完整(包含所有主要章节、定义了实施单元、
status: active
):
  • 如果计划缺少YAML前置元数据(非软件计划使用简单的
    # Title
    标题和
    Created:
    日期,而非前置元数据),则转向
    references/universal-planning.md
    进行编辑或深化,而非进入Phase 5.3。非软件计划不使用软件信心检查。
  • 否则,直接进入Phase 5.3(信心检查与深化)的交互模式。这避免了重新运行完整的规划工作流,让用户可以控制要整合哪些发现结果。
常规编辑请求(例如:“update the test scenarios”、“add a new implementation unit”、“strengthen the risk section”)不应触发快速路径——它们应遵循标准的恢复流程。
如果计划已包含
deepened: YYYY-MM-DD
前置元数据字段,且用户未明确要求重新深化,快速路径仍会执行相同的信心差距评估——不会强制进行深化。

0.1b Classify Task Domain

0.1b 任务领域分类

If the task involves building, modifying, or architecting software (references code, repos, APIs, databases, or asks to build/modify/deploy), continue to Phase 0.2.
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.
如果任务涉及构建、修改或架构软件(提及代码、仓库、API、数据库,或要求构建/修改/部署),继续进入Phase 0.2。
如果领域确实模糊(例如:“plan a migration”且无其他上下文),在转向其他工作流前先询问用户。
否则,读取
references/universal-planning.md
并遵循该工作流。跳过后续所有阶段。指定的工具或源链接不会改变此路由——它们是输入,将根据核心原则8处理。

0.2 Find Upstream Requirements Document

0.2 查找上游需求文档

Before asking planning questions, search
docs/brainstorms/
for files matching
*-requirements.md
.
Relevance criteria: A requirements document 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.
在提出规划问题之前,搜索
docs/brainstorms/
中匹配
*-requirements.md
的文件。
相关性标准: 需求文档符合以下条件则视为相关:
  • 主题与功能描述语义匹配
  • 创建于过去30天内(如果文档明显仍相关或明显过时,可灵活判断)
  • 似乎覆盖了相同的用户问题或范围
如果有多个源文档匹配,在可用时使用平台的阻塞式提问工具询问用户要使用哪一个(见交互方式)。否则,在聊天中展示编号选项,等待用户回复后再继续。

0.3 Use the Source Document as Primary Input

0.3 将源文档作为主要输入

If a relevant requirements document exists:
  1. Read it thoroughly
  2. Announce that it will serve as the origin document for planning
  3. Carry forward all of the following:
    • Problem frame
    • Requirements and success criteria
    • Scope boundaries
    • Key decisions and rationale
    • Dependencies or assumptions
    • Outstanding questions, preserving whether they are blocking or deferred
  4. Use the source document as the primary input to planning and research
  5. Reference important carried-forward decisions in the plan with
    (see origin: <source-path>)
  6. 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 requirements document exists, planning may proceed from the user's request directly.
如果存在相关需求文档:
  1. 仔细阅读该文档
  2. 告知用户它将作为规划的原始文档
  3. 继承以下所有内容:
    • 问题框架
    • 需求和成功标准
    • 范围边界
    • 关键决策和依据
    • 依赖项或假设
    • 未解决的问题,保留其是否为阻塞问题的状态
  4. 将源文档作为规划和研究的主要输入
  5. 在计划中使用
    (see origin: <source-path>)
    引用继承的重要决策
  6. 不要默默省略源文档内容——如果原始文档讨论过某内容,计划必须提及,即便只是简要提及。最终确定计划前,扫描原始文档的每个章节,确保没有遗漏任何内容。
如果不存在相关需求文档,规划可直接基于用户请求进行。

0.4 Planning Bootstrap (No Requirements Doc or Unclear Input)

0.4 规划引导(无需求文档或输入不清晰时)

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-brainstorm
    as 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-brainstorm
    again
  • 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:
  • Symptom without a root cause (user describes broken behavior but hasn't identified why) — announce that investigation is needed before planning and load the
    ce-debug
    skill. A plan requires a known problem to solve; debugging identifies what that problem is. Announce the routing clearly: "This needs investigation before planning — switching to ce-debug to find the root cause."
  • Clear task ready to execute (known root cause, obvious fix, no architectural decisions) — suggest
    ce-work
    as a faster alternative alongside continuing with planning. The user decides.
如果不存在相关需求文档,或输入内容需要更结构化:
  • 评估请求是否已足够清晰,可直接进行技术规划——如果是,继续进入Phase 0.5
  • 如果模糊点主要在于产品框架、用户行为或范围定义,可建议使用
    ce-brainstorm
    ——但也要始终提供在此处继续规划的选项
  • 如果用户希望在此处继续(或已明确表示需要计划),运行以下规划引导流程
规划引导应明确:
  • 问题框架
  • 预期功能
  • 范围边界和明显的非目标
  • 成功标准
  • 阻塞问题或假设
保持引导流程简洁。它的存在是为了保留直接进入规划的便利性,而非替代完整的头脑风暴。
如果引导流程发现了重大未解决的产品问题:
  • 再次建议使用
    ce-brainstorm
  • 如果用户仍希望继续,要求明确假设后再进行
如果引导流程发现更适合用户的其他工作流:
  • 有症状但无根本原因(用户描述了故障行为但未确定原因)——告知用户需要先进行调查才能规划,并加载
    ce-debug
    技能。计划需要明确的待解决问题;调试用于确定该问题是什么。要清晰地告知路由:“需要先进行调查才能规划——切换到ce-debug以查找根本原因。”
  • 明确可执行的任务(已知根本原因、明显的修复方案、无架构决策)——建议使用
    ce-work
    作为更快的替代方案,同时提供继续规划的选项。由用户决定。

0.5 Classify Outstanding Questions Before Planning

0.5 规划前分类未解决的问题

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:
    1. Resume
      ce-brainstorm
      to resolve them
    2. Convert them into explicit assumptions or decisions and continue
  • Do not continue planning while true blockers remain unresolved
如果原始文档包含“Resolve Before Planning”或类似的阻塞问题:
  • 在继续前逐一审查这些问题
  • 只有当问题确实是技术、架构或研究问题时,才将其重新分类为规划层面的工作
  • 如果问题会改变产品行为、范围或成功标准,将其保留为阻塞问题
如果仍存在真正的产品阻塞问题:
  • 清晰地列出这些问题
  • 在可用时使用平台的阻塞式提问工具询问用户(见交互方式),选择:
    1. 恢复
      ce-brainstorm
      以解决这些问题
    2. 将其转化为明确的假设或决策并继续
  • 在真正的阻塞问题解决前,不要继续规划

0.6 Assess Plan Depth

0.6 评估计划深度

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.
将工作分为以下计划深度之一:
  • 轻量级 - 小型、边界清晰、低模糊度
  • 标准 - 常规功能或边界明确的重构,有一些技术决策需要记录
  • 深度 - 跨领域、战略性、高风险或高度模糊的实施工作
如果深度不明确,提出一个针对性问题后再继续。

Phase 1: Gather Context

Phase 1:收集上下文

1.1 Local Research (Always Runs)

1.1 本地研究(始终执行)

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
Run these agents in parallel:
  • Task research:ce-repo-research-analyst(Scope: technology, architecture, patterns. {planning context summary})
  • Task research:ce-learnings-researcher(planning context summary) 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/
Slack context (opt-in) — never auto-dispatch. Route by condition:
  • Tools available + user asked: Dispatch
    research:ce-slack-researcher
    with 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-2段),作为输入传递给研究Agent:
  • 如果存在原始文档,总结该文档中的问题框架、需求和关键决策
  • 否则直接使用功能描述
并行运行以下Agent:
  • Task research:ce-repo-research-analyst(Scope: technology, architecture, patterns. {planning context summary})
  • Task research:ce-learnings-researcher(planning context summary) 收集:
  • 技术栈和版本(用于在1.2节中做出更精准的外部研究决策)
  • 要遵循的架构模式和约定
  • 实现模式、相关文件、模块和测试
  • 对计划有重大影响的AGENTS.md指南,仅当存在CLAUDE.md且作为兼容性回退时才使用
  • 来自
    docs/solutions/
    的机构经验
Slack上下文(可选)——绝不自动调度。根据条件路由:
  • 工具可用且用户要求:并行调度
    research:ce-slack-researcher
    和其他Phase 1.1 Agent,传入规划上下文摘要。如果原始文档包含Slack上下文章节,直接传递该章节内容,以便研究人员聚焦于信息差距。将发现结果整合到总结中。
  • 工具可用但用户未要求:在输出中注明:“检测到Slack工具。您可以随时要求我搜索Slack以获取组织上下文,或在下一个提示中包含此需求。”
  • 无工具但用户要求:在输出中注明:“已请求Slack上下文,但Slack工具不可用。请安装并认证Slack插件以启用组织上下文搜索。”

1.1b Detect Execution Posture Signals

1.1b 检测执行姿态信号

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.
决定计划是否应携带轻量级执行姿态信号。
寻找以下信号:
  • 用户明确要求TDD、测试优先或特征化优先工作
  • 原始文档要求测试优先实施或对遗留代码进行探索性强化
  • 本地研究显示目标区域是遗留代码、测试薄弱或历史上易出故障,表明在修改行为前应先进行特征化覆盖
当信号明确时,在相关实施单元中默默继承该信号。
只有当姿态会对执行顺序或风险产生重大影响且无法合理推断时,才询问用户。

1.2 Decide on External Research

1.2 决定是否进行外部研究

Based on the origin document, user signals, and local findings, decide whether external research adds value.
Read between the lines. Pay attention to signals from the conversation so far:
  • User familiarity — Are they pointing to specific files or patterns? They likely know the codebase well.
  • User intent — Do they want speed or thoroughness? Exploration or execution?
  • Topic risk — Security, payments, external APIs warrant more caution regardless of user signals.
  • Uncertainty level — Is the approach clear or still open-ended?
Leverage ce-repo-research-analyst's technology context:
The ce-repo-research-analyst output includes a structured Technology & Infrastructure summary. Use it to make sharper external research decisions:
  • If specific frameworks and versions were detected (e.g., Rails 7.2, Next.js 14, Go 1.22), pass those exact identifiers to ce-framework-docs-researcher so it fetches version-specific documentation
  • If the feature touches a technology layer the scan found well-established in the repo (e.g., existing Sidekiq jobs when planning a new background job), lean toward skipping external research -- local patterns are likely sufficient
  • If the feature touches a technology layer the scan found absent or thin (e.g., no existing proto files when planning a new gRPC service), lean toward external research -- there are no local patterns to follow
  • If the scan detected deployment infrastructure (Docker, K8s, serverless), note it in the planning context passed to downstream agents so they can account for deployment constraints
  • If the scan detected a monorepo and scoped to a specific service, pass that service's tech context to downstream research agents -- not the aggregate of all services. If the scan surfaced the workspace map without scoping, use the feature description to identify the relevant service before proceeding with research
Always lean toward external research when:
  • The topic is high-risk: security, payments, privacy, external APIs, migrations, compliance
  • The codebase lacks relevant local patterns -- fewer than 3 direct examples of the pattern this plan needs
  • Local patterns exist for an adjacent domain but not the exact one -- e.g., the codebase has HTTP clients but not webhook receivers, or has background jobs but not event-driven pub/sub. Adjacent patterns suggest the team is comfortable with the technology layer but may not know domain-specific pitfalls. When this signal is present, frame the external research query around the domain gap specifically, not the general technology
  • The user is exploring unfamiliar territory
  • The technology scan found the relevant layer absent or thin in the codebase
Skip external research when:
  • The codebase already shows a strong local pattern -- multiple direct examples (not adjacent-domain), recently touched, following current conventions
  • The user already knows the intended shape
  • Additional external context would add little practical value
  • The technology scan found the relevant layer well-established with existing examples to follow
Announce the decision briefly before continuing. Examples:
  • "Your codebase has solid patterns for this. Proceeding without external research."
  • "This involves payment processing, so I'll research current best practices first."
基于原始文档、用户信号和本地发现,决定外部研究是否有价值。
读懂言外之意。 关注迄今为止对话中的信号:
  • 用户熟悉度 —— 用户是否指向了特定文件或模式?他们可能非常了解代码库。
  • 用户意图 —— 用户想要速度还是彻底性?探索还是执行?
  • 主题风险 —— 安全、支付、外部API无论用户信号如何,都需要更谨慎对待。
  • 模糊度 —— 实现方法是清晰的还是仍不明确?
利用ce-repo-research-analyst的技术上下文:
ce-repo-research-analyst的输出包含结构化的技术与基础设施摘要。利用它做出更精准的外部研究决策:
  • 如果检测到特定框架和版本(例如:Rails 7.2、Next.js 14、Go 1.22),将这些确切的标识符传递给ce-framework-docs-researcher,以便它获取特定版本的文档
  • 如果功能涉及代码库中已确立的技术层(例如:规划新的后台任务时已有现有的Sidekiq任务),倾向于跳过外部研究——本地模式可能已足够
  • 如果功能涉及代码库中缺失或薄弱的技术层(例如:规划新的gRPC服务时没有现有的proto文件),倾向于进行外部研究——没有本地模式可遵循
  • 如果检测到部署基础设施(Docker、K8s、无服务器),在传递给下游Agent的规划上下文中注明,以便他们考虑部署约束
  • 如果检测到单体仓库且范围限定于特定服务,将该服务的技术上下文传递给下游研究Agent——而非所有服务的汇总信息。如果扫描显示了工作区映射但未限定范围,先根据功能描述确定相关服务,再进行研究
以下情况始终倾向于进行外部研究:
  • 主题为高风险:安全、支付、隐私、外部API、迁移、合规
  • 代码库缺乏相关本地模式——该计划所需模式的直接示例少于3个
  • 存在相邻领域的本地模式但无完全匹配的模式——例如:代码库有HTTP客户端但无Webhook接收器,或有后台任务但无事件驱动的发布/订阅。相邻模式表明团队熟悉该技术层,但可能不了解领域特定的陷阱。当存在此信号时,将外部研究查询聚焦于领域差距,而非通用技术
  • 用户正在探索不熟悉的领域
  • 技术扫描发现代码库中相关层缺失或薄弱
以下情况跳过外部研究:
  • 代码库已显示强大的本地模式——多个直接示例(非相邻领域)、近期修改、遵循当前约定
  • 用户已明确了解预期的实现形态
  • 额外的外部上下文几乎无实用价值
  • 技术扫描发现相关层已确立且有现有示例可遵循
在继续前简要告知决策。示例:
  • “您的代码库对此有完善的模式。将不进行外部研究,直接继续。”
  • “这涉及支付处理,因此我将先研究当前最佳实践。”

1.3 External Research (Conditional)

1.3 外部研究(可选)

If Step 1.2 indicates external research is useful, run these agents in parallel:
  • Task research:ce-best-practices-researcher(planning context summary)
  • Task research:ce-framework-docs-researcher(planning context summary)
如果Step 1.2表明外部研究有用,并行运行以下Agent:
  • Task research:ce-best-practices-researcher(planning context summary)
  • Task research:ce-framework-docs-researcher(planning context summary)

1.4 Consolidate Research

1.4 整合研究结果

Summarize:
  • Relevant codebase patterns and file paths
  • Relevant institutional learnings
  • Organizational context from Slack conversations, if gathered (prior discussions, decisions, or domain knowledge relevant to the feature)
  • External references and best practices, if gathered
  • Related issues, PRs, or prior art
  • Any constraints that should materially shape the plan
总结:
  • 相关代码库模式和文件路径
  • 相关机构经验
  • 来自Slack对话的组织上下文(如果收集到):与功能相关的过往讨论、决策或领域知识
  • 外部参考资料和最佳实践(如果收集到)
  • 相关议题、PR或过往实践
  • 任何应显著影响计划的约束

1.4b Reclassify Depth When Research Reveals External Contract Surfaces

1.4b 当研究发现外部契约接口时重新分类深度

If the current classification is Lightweight and Phase 1 research found that the work touches any of these external contract surfaces, reclassify to Standard:
  • Environment variables consumed by external systems, CI, or other repositories
  • Exported public APIs, CLI flags, or command-line interface contracts
  • CI/CD configuration files (
    .github/workflows/
    ,
    Dockerfile
    , deployment scripts)
  • Shared types or interfaces imported by downstream consumers
  • Documentation referenced by external URLs or linked from other systems
This ensures flow analysis (Phase 1.5) runs and the confidence check (Phase 5.3) applies critical-section bonuses. Announce the reclassification briefly: "Reclassifying to Standard — this change touches [environment variables / exported APIs / CI config] with external consumers."
如果当前分类为轻量级,且Phase 1研究发现工作涉及以下任何外部契约接口,将其重新分类为标准
  • 被外部系统、CI或其他仓库使用的环境变量
  • 导出的公共API、CLI标志或命令行接口契约
  • CI/CD配置文件(
    .github/workflows/
    Dockerfile
    、部署脚本)
  • 被下游消费者导入的共享类型或接口
  • 被外部URL引用或从其他系统链接的文档
这确保了流分析(Phase 1.5)会运行,且信心检查(Phase 5.3)会应用关键区域的额外验证。简要告知重新分类:“重新分类为标准——此变更会触及[环境变量/导出的API/CI配置],存在外部消费者。”

1.5 Flow and Edge-Case Analysis (Conditional)

1.5 流程与边缘案例分析(可选)

For Standard or Deep plans, or when user flow completeness is still unclear, run:
  • Task workflow:ce-spec-flow-analyzer(planning context summary, research findings)
Use the output to:
  • Identify missing edge cases, state transitions, or handoff gaps
  • Tighten requirements trace or verification strategy
  • Add only the flow details that materially improve the plan
对于标准深度计划,或当用户流程完整性仍不清晰时,运行:
  • Task workflow:ce-spec-flow-analyzer(planning context summary, research findings)
使用输出结果:
  • 识别缺失的边缘案例、状态转换或交接差距
  • 收紧需求追溯或验证策略
  • 仅添加能显著改进计划的流程细节

Phase 2: Resolve Planning Questions

Phase 2:解决规划问题

Build a planning question list from:
  • Deferred questions in the origin document
  • Gaps discovered in repo or external research
  • Technical decisions required to produce a useful plan
For each question, decide whether it should be:
  • Resolved during planning - the answer is knowable from repo context, documentation, or user choice
  • Deferred to implementation - the answer depends on code changes, runtime behavior, or execution-time discovery
Ask the user only when the answer materially affects architecture, scope, sequencing, or risk and cannot be responsibly inferred. Use the platform's blocking question tool when available (see Interaction Method).
Do not run tests, build the app, or probe runtime behavior in this phase. The goal is a strong plan, not partial execution.
从以下来源构建规划问题列表:
  • 原始文档中的未解决问题
  • 仓库或外部研究中发现的差距
  • 生成有用计划所需的技术决策
对于每个问题,决定:
  • 在规划阶段解决 - 答案可从仓库上下文、文档或用户选择中获取
  • 推迟到实施阶段 - 答案取决于代码变更、运行时行为或执行阶段的探索
只有当答案会对架构、范围、执行顺序或风险产生重大影响且无法合理推断时,才询问用户。在可用时使用平台的阻塞式提问工具(见交互方式)。
请勿在此阶段运行测试、构建应用或探查运行时行为。我们的目标是制定完善的计划,而非部分执行。

Phase 3: Structure the Plan

Phase 3:构建计划结构

3.1 Title and File Naming

3.1 标题与文件命名

  • Draft a clear, searchable title using conventional format such as
    feat: Add user authentication
    or
    fix: Prevent checkout double-submit
  • Determine the plan type:
    feat
    ,
    fix
    , or
    refactor
  • Build the filename following the repository convention:
    docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md
    • Create
      docs/plans/
      if it does not exist
    • Check existing files for today's date to determine the next sequence number (zero-padded to 3 digits, starting at 001)
    • Keep the descriptive name concise (3-5 words) and kebab-cased
    • Examples:
      2026-01-15-001-feat-user-authentication-flow-plan.md
      ,
      2026-02-03-002-fix-checkout-race-condition-plan.md
    • Avoid: missing sequence numbers, vague names like "new-feature", invalid characters (colons, spaces)
  • 使用常规格式起草清晰、可搜索的标题,例如
    feat: Add user authentication
    fix: Prevent checkout double-submit
  • 确定计划类型:
    feat
    fix
    refactor
  • 遵循仓库约定构建文件名:
    docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md
    • 如果
      docs/plans/
      不存在则创建
    • 检查现有文件以确定今日日期的下一个序号(零填充为3位数字,从001开始)
    • 描述性名称保持简洁(3-5个单词)并使用短横线分隔
    • 示例:
      2026-01-15-001-feat-user-authentication-flow-plan.md
      2026-02-03-002-fix-checkout-race-condition-plan.md
    • 避免:缺失序号、模糊名称如"new-feature"、无效字符(冒号、空格)

3.2 Stakeholder and Impact Awareness

3.2 干系人与影响认知

For Standard or Deep plans, briefly consider who is affected by this change — end users, developers, operations, other teams — and how that should shape the plan. For cross-cutting work, note affected parties in the System-Wide Impact section.
对于标准深度计划,简要考虑此变更会影响谁——终端用户、开发人员、运维人员、其他团队——以及这应如何影响计划。对于跨领域工作,在系统级影响章节中注明受影响的各方。

3.3 Break Work into Implementation Units

3.3 将工作拆分为实施单元

Break the work into logical implementation units. Each unit should represent one meaningful change that an implementer could typically land as an atomic commit.
Good units are:
  • Focused on one component, behavior, or integration seam
  • Usually touching a small cluster of related files
  • Ordered by dependency
  • Concrete enough for execution without pre-writing code
  • Marked with checkbox syntax for progress tracking
Avoid:
  • 2-5 minute micro-steps
  • Units that span multiple unrelated concerns
  • Units that are so vague an implementer still has to invent the plan
将工作拆分为逻辑实施单元。每个单元应代表一个有意义的变更,实施人员通常可将其作为原子提交完成。
优质单元的特点:
  • 聚焦于一个组件、行为或集成边界
  • 通常涉及一组相关文件
  • 按依赖关系排序
  • 足够具体,无需预先编写代码即可执行
  • 使用复选框语法标记以跟踪进度
应避免:
  • 2-5分钟的微步骤
  • 跨越多个不相关关注点的单元
  • 过于模糊,实施人员仍需自行制定计划的单元

3.4 High-Level Technical Design (Optional)

3.4 高层技术设计(可选)

Before detailing implementation units, decide whether an overview would help a reviewer validate the intended approach. This section communicates the shape of the solution — how pieces fit together — without dictating implementation.
When to include it:
Work involves...Best overview form
DSL or API surface designPseudo-code grammar or contract sketch
Multi-component integrationMermaid sequence or component diagram
Data pipeline or transformationData flow sketch
State-heavy lifecycleState diagram
Complex branching logicFlowchart
Mode/flag combinations or multi-input behaviorDecision matrix (inputs -> outcomes)
Single-component with non-obvious shapePseudo-code sketch
When to skip it:
  • Well-patterned work where prose and file paths tell the whole story
  • Straightforward CRUD or convention-following changes
  • Lightweight plans where the approach is obvious
Choose the medium that fits the work. Do not default to pseudo-code when a diagram communicates better, and vice versa.
Frame every sketch with: "This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce."
Keep sketches concise — enough to validate direction, not enough to copy-paste into production.
在详细说明实施单元之前,决定概述是否有助于评审人员验证预期方法。此部分传达解决方案的形态——各部分如何配合——而非规定实现细节。
何时包含此部分:
工作涉及...最佳概述形式
DSL或API表面设计伪代码语法或契约草图
多组件集成Mermaid序列图或组件图
数据管道或转换数据流草图
状态密集型生命周期状态图
复杂分支逻辑流程图
模式/标志组合或多输入行为决策矩阵(输入 -> 结果)
形状不明显的单组件伪代码草图
何时跳过此部分:
  • 模式成熟的工作,文本和文件路径已能完整说明情况
  • 直接的CRUD或遵循约定的变更
  • 方法明显的轻量级计划
选择适合工作的媒介。当图表能更好地传达信息时,不要默认使用伪代码,反之亦然。
所有草图都应附带说明:"此示意图展示了预期方法,是用于评审的方向性指导,而非实现规范。实施Agent应将其视为上下文,而非要复制的代码。"
保持草图简洁——足够验证方向即可,无需详细到可直接复制粘贴到生产环境。

3.4b Output Structure (Optional)

3.4b 输出结构(可选)

For greenfield plans that create a new directory structure (new plugin, service, package, or module), include an
## Output Structure
section with a file tree showing the expected layout. This gives reviewers the overall shape before diving into per-unit details.
When to include it:
  • The plan creates 3+ new files in a new directory hierarchy
  • The directory layout itself is a meaningful design decision
When to skip it:
  • The plan only modifies existing files
  • The plan creates 1-2 files in an existing directory — the per-unit file lists are sufficient
The tree is a scope declaration showing the expected output shape. It is not a constraint — the implementer may adjust the structure if implementation reveals a better layout. The per-unit
**Files:**
sections remain authoritative for what each unit creates or modifies.
对于创建新目录结构的全新计划(新插件、服务、包或模块),包含
## 输出结构
章节,用文件树展示预期布局。这让评审人员在深入单元细节前先了解整体形态。
何时包含此部分:
  • 计划在新目录层级中创建3个以上新文件
  • 目录布局本身是有意义的设计决策
何时跳过此部分:
  • 计划仅修改现有文件
  • 计划在现有目录中创建1-2个文件——单元级文件列表已足够
文件树是范围声明,展示预期输出形态。它不是约束——实施人员如果在实施过程中发现更好的布局,可调整结构。各单元的
**Files:**
章节仍是每个单元创建或修改内容的权威来源。

3.5 Define Each Implementation Unit

3.5 定义每个实施单元

For each unit, include:
  • Goal - what this unit accomplishes
  • Requirements - which requirements or success criteria it advances
  • Dependencies - what must exist first
  • Files - repo-relative file paths to create, modify, or test (never absolute paths)
  • Approach - key decisions, data flow, component boundaries, or integration notes
  • Execution note - optional, only when the unit benefits from a non-default execution posture such as test-first or characterization-first
  • Technical design - optional pseudo-code or diagram when the unit's approach is non-obvious and prose alone would leave it ambiguous. Frame explicitly as directional guidance, not implementation specification
  • Patterns to follow - existing code or conventions to mirror
  • Test scenarios - enumerate the specific test cases the implementer should write, right-sized to the unit's complexity and risk. Consider each category below and include scenarios from every category that applies to this unit. A simple config change may need one scenario; a payment flow may need a dozen. The quality signal is specificity — each scenario should name the input, action, and expected outcome so the implementer doesn't have to invent coverage. For units with no behavioral change (pure config, scaffolding, styling), use
    Test expectation: none -- [reason]
    instead of leaving the field blank.
    • Happy path behaviors - core functionality with expected inputs and outputs
    • Edge cases (when the unit has meaningful boundaries) - boundary values, empty inputs, nil/null states, concurrent access
    • Error and failure paths (when the unit has failure modes) - invalid input, downstream service failures, timeout behavior, permission denials
    • Integration scenarios (when the unit crosses layers) - behaviors that mocks alone will not prove, e.g., "creating X triggers callback Y which persists Z". Include these for any unit touching callbacks, middleware, or multi-layer interactions
  • Verification - how an implementer should know the unit is complete, expressed as outcomes rather than shell command scripts
Every feature-bearing unit should include the test file path in
**Files:**
.
Use
Execution note
sparingly. Good uses include:
  • Execution note: Start with a failing integration test for the request/response contract.
  • Execution note: Add characterization coverage before modifying this legacy parser.
  • Execution note: Implement new domain behavior test-first.
Do not expand units into literal
RED/GREEN/REFACTOR
substeps.
每个单元应包含:
  • 目标 - 此单元要实现的内容
  • 需求 - 它推进了哪些需求或成功标准
  • 依赖项 - 必须先完成的工作
  • 文件 - 要创建、修改或测试的仓库相对文件路径(绝对不能使用绝对路径)
  • 方法 - 关键决策、数据流、组件边界或集成说明
  • 执行说明 - 可选,仅当单元从非默认执行姿态(如测试优先或特征化优先)中受益时使用
  • 技术设计 - 可选,当单元的方法不明显且仅用文本会模糊时,使用伪代码或图表。明确标注为方向性指导,而非实现规范
  • 要遵循的模式 - 要效仿的现有代码或约定
  • 测试场景 - 枚举实施人员应编写的具体测试用例,规模与单元的复杂度和风险匹配。考虑以下每个类别,包含适用于此单元的所有类别的场景。简单的配置变更可能只需1个场景;支付流程可能需要十几个。质量信号是具体性——每个场景应指定输入、操作和预期结果,以便实施人员无需自行设计覆盖范围。对于无行为变更的单元(纯配置、脚手架、样式),使用
    Test expectation: none -- [原因]
    替代空白。
    • 正常路径行为 - 具有预期输入和输出的核心功能
    • 边缘案例(当单元有明确边界时)- 边界值、空输入、nil/null状态、并发访问
    • 错误与故障路径(当单元有故障模式时)- 无效输入、下游服务故障、超时行为、权限拒绝
    • 集成场景(当单元跨层级时)- 仅靠模拟无法验证的行为,例如:"创建X会触发回调Y,后者会持久化Z"。对于涉及回调、中间件或多层交互的单元,包含这些场景
  • 验证 - 实施人员如何知道单元已完成,用结果而非Shell命令脚本表示
每个承载功能的单元应在
**Files:**
中包含测试文件路径。
sparingly使用
Execution note
。适用场景包括:
  • Execution note: 从针对请求/响应契约的失败集成测试开始。
  • Execution note: 在修改此遗留解析器前添加特征化覆盖。
  • Execution note: 测试优先实施新领域行为。
不要将单元扩展为字面意义上的
RED/GREEN/REFACTOR
子步骤。

3.6 Keep Planning-Time and Implementation-Time Unknowns Separate

3.6 区分规划阶段与实施阶段的未知问题

If something is important but not knowable yet, record it explicitly under deferred implementation notes rather than pretending to resolve it in the plan.
Examples:
  • Exact method or helper names
  • Final SQL or query details after touching real code
  • Runtime behavior that depends on seeing actual test failures
  • Refactors that may become unnecessary once implementation starts
如果某内容很重要但目前无法确定,将其明确记录在推迟实施的说明中,而非假装已解决。
示例:
  • 确切的方法或助手名称
  • 接触真实代码后的最终SQL或查询细节
  • 取决于实际测试失败的运行时行为
  • 实施开始后可能变得不必要的重构

Phase 4: Write the Plan

Phase 4:编写计划

Use one planning philosophy across all depths. Change the amount of detail, not the boundary between planning and execution.
所有深度的计划遵循相同的核心理念。调整细节的多少,而非规划与执行的边界。

4.1 Plan Depth Guidance

4.1 计划深度指南

Lightweight
  • Keep the plan compact
  • Usually 2-4 implementation units
  • Omit optional sections that add little value
Standard
  • Use the full core template, omitting optional sections (including High-Level Technical Design) that add no value for this particular work
  • Usually 3-6 implementation units
  • Include risks, deferred questions, and system-wide impact when relevant
Deep
  • Use the full core template plus optional analysis sections where warranted
  • Usually 4-8 implementation units
  • Group units into phases when that improves clarity
  • Include alternatives considered, documentation impacts, and deeper risk treatment when warranted
轻量级
  • 保持计划紧凑
  • 通常包含2-4个实施单元
  • 省略几乎无价值的可选章节
标准
  • 使用完整的核心模板,省略对特定工作无价值的可选章节(包括高层技术设计)
  • 通常包含3-6个实施单元
  • 相关时包含风险、未解决问题和系统级影响
深度
  • 使用完整的核心模板,并在必要时添加可选分析章节
  • 通常包含4-8个实施单元
  • 当有助于提高清晰度时,将单元分组为多个阶段
  • 相关时包含考虑过的替代方案、文档影响和更深入的风险处理

4.1b Optional Deep Plan Extensions

4.1b 深度计划的可选扩展

For sufficiently large, risky, or cross-cutting work, add the sections that genuinely help:
  • Alternative Approaches Considered
  • Success Metrics
  • Dependencies / Prerequisites
  • Risk Analysis & Mitigation
  • Phased Delivery
  • Documentation Plan
  • Operational / Rollout Notes
  • Future Considerations only when they materially affect current design
Do not add these as boilerplate. Include them only when they improve execution quality or stakeholder alignment.
对于足够大、高风险或跨领域的工作,添加真正有帮助的章节:
  • 考虑过的替代方法
  • 成功指标
  • 依赖项 / 先决条件
  • 风险分析与缓解
  • 分阶段交付
  • 文档计划
  • 运维 / 发布说明
  • 未来考虑 仅当它们会对当前设计产生重大影响时
不要将这些章节作为模板添加。仅当它们能提高执行质量或干系人一致性时才包含。

4.2 Core Plan Template

4.2 核心计划模板

Omit clearly inapplicable optional sections, especially for Lightweight plans.
markdown
---
title: [Plan Title]
type: [feat|fix|refactor]
status: active
date: YYYY-MM-DD
origin: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md  # include when planning from a requirements doc
deepened: YYYY-MM-DD  # optional, set when the confidence check substantively strengthens the plan
---
明显不适用的可选章节可省略,尤其是轻量级计划。
markdown
---
title: [计划标题]
type: [feat|fix|refactor]
status: active
date: YYYY-MM-DD
origin: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md  # 基于需求文档规划时包含此字段
deepened: YYYY-MM-DD  # 可选,当信心检查显著强化了计划时设置
---

[Plan Title]

[计划标题]

Overview

概述

[What is changing and why]
[要变更的内容及原因]

Problem Frame

问题框架

[Summarize the user/business problem and context. Reference the origin doc when present.]
[总结用户/业务问题和上下文。存在原始文档时引用。]

Requirements Trace

需求追溯

  • R1. [Requirement or success criterion this plan must satisfy]
  • R2. [Requirement or success criterion this plan must satisfy]
  • R1. [此计划必须满足的需求或成功标准]
  • R2. [此计划必须满足的需求或成功标准]

Scope Boundaries

范围边界

  • [Explicit non-goal or exclusion]
<!-- Optional: When some items are planned work that will happen in a separate PR, issue, or repo, use this sub-heading to distinguish them from true non-goals. -->
  • [明确的非目标或排除项]
<!-- 可选:当某些项是将在单独PR、议题或仓库中开展的计划工作时,使用此子标题将其与真正的非目标区分开。 -->

Deferred to Separate Tasks

推迟到单独任务

  • [Work that will be done separately]: [Where or when -- e.g., "separate PR in repo-x", "future iteration"]
  • [将单独开展的工作]: [开展地点或时间 -- 例如:"repo-x中的单独PR"、"未来迭代"]

Context & Research

上下文与研究

Relevant Code and Patterns

相关代码与模式

  • [Existing file, class, component, or pattern to follow]
  • [要遵循的现有文件、类、组件或模式]

Institutional Learnings

机构经验

  • [Relevant
    docs/solutions/
    insight]
  • [相关的
    docs/solutions/
    见解]

External References

外部参考资料

  • [Relevant external docs or best-practice source, if used]
  • [使用的相关外部文档或最佳实践来源]

Key Technical Decisions

关键技术决策

Open Questions

未解决问题

Resolved During Planning

规划阶段已解决

Deferred to Implementation

推迟到实施阶段

  • [Question or unknown]: [Why it is intentionally deferred]
<!-- Optional: Include when the plan creates a new directory structure (greenfield plugin, new service, new package). Shows the expected output shape at a glance. Omit for plans that only modify existing files. This is a scope declaration, not a constraint -- the implementer may adjust the structure if implementation reveals a better layout. -->
<!-- 可选:当计划创建新目录结构(全新插件、服务、包或模块)时包含此部分。在深入单元细节前展示预期输出形态。仅修改现有文件的计划可省略此部分。这是范围声明,而非约束——实施人员如果在实施过程中发现更好的布局,可调整结构。 -->

Output Structure

输出结构

[directory tree showing new directories and files]
<!-- Optional: Include this section only when the work involves DSL design, multi-component integration, complex data flow, state-heavy lifecycle, or other cases where prose alone would leave the approach shape ambiguous. Omit it entirely for well-patterned or straightforward work. -->
[显示新目录和文件的目录树]
<!-- 可选:仅当工作涉及DSL设计、多组件集成、复杂数据流、状态密集型生命周期,或其他仅用文本会让方法形态模糊的情况时,包含此章节。对于模式成熟或直接的变更,完全省略此章节。 -->

High-Level Technical Design

高层技术设计

This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce.
[Pseudo-code grammar, mermaid diagram, data flow sketch, or state diagram — choose the medium that best communicates the solution shape for this work.]
"此示意图展示了预期方法,是用于评审的方向性指导,而非实现规范。实施Agent应将其视为上下文,而非要复制的代码。"
[伪代码语法、Mermaid图、数据流草图或状态图——选择最适合此工作的媒介。]

Implementation Units

实施单元

  • Unit 1: [Name]
Goal: [What this unit accomplishes]
Requirements: [R1, R2]
Dependencies: [None / Unit 1 / external prerequisite]
Files:
  • Create:
    path/to/new_file
  • Modify:
    path/to/existing_file
  • Test:
    path/to/test_file
Approach:
  • [Key design or sequencing decision]
Execution note: [Optional test-first, characterization-first, or other execution posture signal]
Technical design: (optional -- pseudo-code or diagram when the unit's approach is non-obvious. Directional guidance, not implementation specification.)
Patterns to follow:
  • [Existing file, class, or pattern]
Test scenarios:
<!-- Include only categories that apply to this unit. Omit categories that don't. For units with no behavioral change, use "Test expectation: none -- [reason]" instead of leaving this section blank. -->
  • [Scenario: specific input/action -> expected outcome. Prefix with category — Happy path, Edge case, Error path, or Integration — to signal intent]
Verification:
  • [Outcome that should hold when this unit is complete]
  • 单元1: [名称]
目标: [此单元要实现的内容]
需求: [R1, R2]
依赖项: [无 / 单元1 / 外部先决条件]
文件:
  • 创建:
    path/to/new_file
  • 修改:
    path/to/existing_file
  • 测试:
    path/to/test_file
方法:
  • [关键设计或执行顺序决策]
执行说明: [可选的测试优先、特征化优先或其他执行姿态信号]
技术设计: (可选——当单元的方法不明显时使用伪代码或图表。方向性指导,而非实现规范。)
要遵循的模式:
  • [现有文件、类或模式]
测试场景:
<!-- 仅包含适用于此单元的类别。省略不适用的类别。对于无行为变更的单元,使用"Test expectation: none -- [原因]"替代空白。 -->
  • [场景:具体输入/操作 -> 预期结果。使用类别前缀——正常路径、边缘案例、错误路径或集成——以表明意图]
验证:
  • [此单元完成时应满足的结果]

System-Wide Impact

系统级影响

  • Interaction graph: [What callbacks, middleware, observers, or entry points may be affected]
  • Error propagation: [How failures should travel across layers]
  • State lifecycle risks: [Partial-write, cache, duplicate, or cleanup concerns]
  • API surface parity: [Other interfaces that may require the same change]
  • Integration coverage: [Cross-layer scenarios unit tests alone will not prove]
  • Unchanged invariants: [Existing APIs, interfaces, or behaviors that this plan explicitly does not change — and how the new work relates to them. Include when the change touches shared surfaces and reviewers need blast-radius assurance]
  • 交互图: [可能受影响的回调、中间件、观察者或入口点]
  • 错误传播: [故障应如何跨层级传递]
  • 状态生命周期风险: [部分写入、缓存、重复或清理问题]
  • API表面一致性: [可能需要相同变更的其他接口]
  • 集成覆盖: [仅靠单元测试无法验证的跨层级场景]
  • 未变更的不变量: [此计划明确不会变更的现有API、接口或行为——以及新工作与它们的关系。当变更涉及共享表面且评审人员需要了解影响范围时包含此部分]

Risks & Dependencies

风险与依赖项

RiskMitigation
[Meaningful risk][How it is addressed or accepted]
风险缓解措施
[重大风险][如何解决或接受]

Documentation / Operational Notes

文档 / 运维说明

  • [Docs, rollout, monitoring, or support impacts when relevant]
  • [相关的文档、发布、监控或支持影响]

Sources & References

来源与参考资料

  • Origin document: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md
  • Related code: [path or symbol]
  • Related PRs/issues: #[number]
  • External docs: [url]

For larger `Deep` plans, extend the core template only when useful with sections such as:

```markdown
  • 原始文档: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md
  • 相关代码: [路径或符号]
  • 相关PR/议题: #[编号]
  • 外部文档: [url]

对于较大的`深度`计划,仅当有用时才使用以下章节扩展核心模板:

```markdown

Alternative Approaches Considered

考虑过的替代方法

  • [Approach]: [Why rejected or not chosen]

Success Metrics

成功指标

  • [How we will know this solved the intended problem]
  • [如何判断是否解决了预期问题]

Dependencies / Prerequisites

依赖项 / 先决条件

  • [Technical, organizational, or rollout dependency]
  • [技术、组织或发布依赖项]

Risk Analysis & Mitigation

风险分析与缓解

RiskLikelihoodImpactMitigation
[Risk][Low/Med/High][Low/Med/High][How addressed]
风险可能性影响缓解措施
[风险][低/中/高][低/中/高][如何解决]

Phased Delivery

分阶段交付

Phase 1

阶段1

  • [What lands first and why]
  • [先交付的内容及原因]

Phase 2

阶段2

  • [What follows and why]
  • [后续交付的内容及原因]

Documentation Plan

文档计划

  • [Docs or runbooks to update]
  • [要更新的文档或运行手册]

Operational / Rollout Notes

运维 / 发布说明

  • [Monitoring, migration, feature flag, or rollout considerations]
undefined
  • [监控、迁移、功能标志或发布考虑]
undefined

4.3 Planning Rules

4.3 规划规则

  • All file paths must be repo-relative — never use absolute paths like
    /Users/name/Code/project/src/file.ts
    . Use
    src/file.ts
    instead. Absolute paths make plans non-portable across machines, worktrees, and teammates. When a plan targets a different repo than the document's home, state the target repo once at the top of the plan (e.g.,
    **Target repo:** my-other-project
    ) and use repo-relative paths throughout
  • Prefer path plus class/component/pattern references over brittle line numbers
  • Keep implementation units checkable with
    - [ ]
    syntax for progress tracking
  • Do not include implementation code — no imports, exact method signatures, or framework-specific syntax
  • Pseudo-code sketches and DSL grammars are allowed in the High-Level Technical Design section and per-unit technical design fields when they communicate design direction. Frame them explicitly as directional guidance, not implementation specification
  • Mermaid diagrams are encouraged when they clarify relationships or flows that prose alone would make hard to follow — ERDs for data model changes, sequence diagrams for multi-service interactions, state diagrams for lifecycle transitions, flowcharts for complex branching logic
  • Do not include git commands, commit messages, or exact test command recipes
  • Do not expand implementation units into micro-step
    RED/GREEN/REFACTOR
    instructions
  • Do not pretend an execution-time question is settled just to make the plan look complete
  • 所有文件路径必须是仓库相对路径 —— 绝对不能使用
    /Users/name/Code/project/src/file.ts
    这样的绝对路径。应使用
    src/file.ts
    替代。绝对路径会破坏跨机器、工作区和团队成员的可移植性。当计划针对的仓库与文档所在仓库不同时,在计划顶部声明目标仓库(例如:
    **Target repo:** my-other-project
    ),并始终使用仓库相对路径
  • 优先使用路径加类/组件/模式引用,而非脆弱的行号
  • 使用
    - [ ]
    语法标记实施单元以跟踪进度
  • 不要包含实现代码——无导入、确切方法签名或框架特定语法
  • 高层技术设计章节和单元级技术设计字段中允许使用伪代码草图和DSL语法,用于传达设计方向。明确标注为方向性指导,而非实现规范
  • 当Mermaid图有助于澄清关系或流程(仅靠文本难以说明)时,鼓励使用——数据模型变更的ERD、多服务交互的序列图、生命周期的状态图、复杂分支逻辑的流程图
  • 不要包含Git命令、提交消息或确切的测试命令配方
  • 不要将实施单元扩展为微步骤的
    RED/GREEN/REFACTOR
    指令
  • 不要假装解决了执行阶段的问题,以使计划看起来完整

4.4 Visual Communication in Plan Documents

4.4 计划文档中的视觉传达

When the plan contains 4+ implementation units with non-linear dependencies, 3+ interacting surfaces in System-Wide Impact, 3+ behavioral modes/variants in Overview or Problem Frame, or 3+ interacting decisions in Key Technical Decisions or alternatives in Alternative Approaches, read
references/visual-communication.md
for diagram and table guidance. This covers plan-structure visuals (dependency graphs, interaction diagrams, comparison tables) — not solution-design diagrams, which are covered in Section 3.4.
当计划包含4个以上有非线性依赖的实施单元、系统级影响中有3个以上交互表面、概述或问题框架中有3个以上行为模式/变体,或关键技术决策中有3个以上交互决策或替代方法中的替代方案时,读取
references/visual-communication.md
获取图表和表格指导。这涵盖计划结构视觉元素(依赖图、交互图、对比表)——而非解决方案设计图,后者在3.4节中已覆盖。

Phase 5: Final Review, Write File, and Handoff

Phase 5:最终评审、写入文件与交接

5.1 Review Before Writing

5.1 写入前评审

Before finalizing, check:
  • The plan does not invent product behavior that should have been defined in
    ce-brainstorm
  • If there was no origin document, the bounded planning bootstrap established enough product clarity to plan responsibly
  • Every major decision is grounded in the origin document or research
  • Each implementation unit is concrete, dependency-ordered, and implementation-ready
  • If test-first or characterization-first posture was explicit or strongly implied, the relevant units carry it forward with a lightweight
    Execution note
  • Each feature-bearing unit has test scenarios from every applicable category (happy path, edge cases, error paths, integration) — right-sized to the unit's complexity, not padded or skimped
  • Test scenarios name specific inputs, actions, and expected outcomes without becoming test code
  • Feature-bearing units with blank or missing test scenarios are flagged as incomplete — feature-bearing units must have actual test scenarios, not just an annotation. The
    Test expectation: none -- [reason]
    annotation is only valid for non-feature-bearing units (pure config, scaffolding, styling)
  • Deferred items are explicit and not hidden as fake certainty
  • If a High-Level Technical Design section is included, it uses the right medium for the work, carries the non-prescriptive framing, and does not contain implementation code (no imports, exact signatures, or framework-specific syntax)
  • Per-unit technical design fields, if present, are concise and directional rather than copy-paste-ready
  • If the plan creates a new directory structure, would an Output Structure tree help reviewers see the overall shape?
  • If Scope Boundaries lists items that are planned work for a separate PR or task, are they under
    ### Deferred to Separate Tasks
    rather than mixed with true non-goals?
  • Would a visual aid (dependency graph, interaction diagram, comparison table) help a reader grasp the plan structure faster than scanning prose alone?
If the plan originated from a requirements document, re-read that document and verify:
  • The chosen approach still matches the product intent
  • Scope boundaries and success criteria are preserved
  • Blocking questions were either resolved, explicitly assumed, or sent back to
    ce-brainstorm
  • Every section of the origin document is addressed in the plan — scan each section to confirm nothing was silently dropped
最终确定前,检查:
  • 计划未定义应在
    ce-brainstorm
    中定义的产品行为
  • 如果无原始文档,有限的规划引导已建立足够的产品清晰度,可负责任地进行规划
  • 每个重大决策都基于原始文档或研究
  • 每个实施单元都是具体的、按依赖关系排序的、可实施的
  • 如果测试优先或特征化优先姿态明确或强烈暗示,相关单元通过轻量级
    Execution note
    继承了该姿态
  • 每个承载功能的单元都包含所有适用类别的测试场景(正常路径、边缘案例、错误路径、集成)——规模与单元的复杂度匹配,既不冗余也不缺失
  • 测试场景指定了具体的输入、操作和预期结果,而非测试代码
  • 承载功能的单元如果测试场景空白或缺失,标记为不完整——承载功能的单元必须有实际的测试场景,而非仅注释。
    Test expectation: none -- [原因]
    注释仅对非承载功能的单元(纯配置、脚手架、样式)有效
  • 推迟的项是明确的,未被隐藏为已解决
  • 如果包含高层技术设计章节,使用了适合工作的媒介、带有非规范性说明,且不包含实现代码(无导入、确切签名或框架特定语法)
  • 单元级技术设计字段(如果存在)是简洁且方向性的,而非可直接复制粘贴的
  • 如果计划创建了新目录结构,输出结构树是否有助于评审人员了解整体形态?
  • 如果范围边界列出了将在单独PR或任务中开展的计划工作,是否将其放在
    ### 推迟到单独任务
    下,而非与真正的非目标混合?
  • 视觉辅助(依赖图、交互图、对比表)是否比仅扫描文本更有助于读者快速理解计划结构?
如果计划源自需求文档,重新阅读该文档并验证:
  • 选择的方法仍与产品意图匹配
  • 范围边界和成功标准得以保留
  • 阻塞问题已解决、明确假设或送回
    ce-brainstorm
  • 原始文档的每个章节都在计划中得到了处理——扫描每个章节以确认没有被默默遗漏

5.2 Write Plan File

5.2 写入计划文件

REQUIRED: Write the plan file to disk before presenting any options.
Use the Write tool to save the complete plan to:
text
docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md
Confirm:
text
Plan written to docs/plans/[filename]
Pipeline mode: If invoked from an automated workflow such as LFG, SLFG, or any
disable-model-invocation
context, skip interactive questions. Make the needed choices automatically and proceed to writing the plan.
必需:在展示任何选项前,将计划文件写入磁盘。
使用写入工具将完整计划保存到:
text
docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md
确认:
text
Plan written to docs/plans/[filename]
管道模式: 如果从自动化工作流(如LFG、SLFG或任何
disable-model-invocation
上下文)调用,跳过交互式问题。自动做出必要的选择并继续写入计划。

5.3 Confidence Check and Deepening

5.3 信心检查与深化

After writing the plan file, automatically evaluate whether the plan needs strengthening.
Two deepening modes:
  • Auto mode (default during plan generation): Runs without asking the user for approval. The user sees what is being strengthened but does not need to make a decision. Sub-agent findings are synthesized directly into the plan.
  • Interactive mode (activated by the re-deepen fast path in Phase 0.1): The user explicitly asked to deepen an existing plan. Sub-agent findings are presented individually for review before integration. The user can accept, reject, or discuss each agent's findings. Only accepted findings are synthesized into the plan.
Interactive mode exists because on-demand deepening is a different user posture — the user already has a plan they are invested in and wants to be surgical about what changes. This applies whether the plan was generated by this skill, written by hand, or produced by another tool.
ce-doc-review
and this confidence check are different:
  • Use the
    ce-doc-review
    skill when the document needs clarity, simplification, completeness, or scope control
  • This confidence check strengthens rationale, sequencing, risk treatment, and system-wide thinking when the plan is structurally sound but still needs stronger grounding
Pipeline mode: This phase always runs in auto mode in pipeline/disable-model-invocation contexts. No user interaction needed.
写入计划文件后,自动评估计划是否需要强化。
两种深化模式:
  • 自动模式(计划生成期间默认):无需征得用户同意即可运行。用户会看到正在强化的内容,但无需做出决策。子Agent的发现结果直接整合到计划中。
  • 交互模式(由Phase 0.1中的重新深化快速路径激活):用户明确要求深化现有计划。子Agent的发现结果会单独展示供评审,再进行整合。用户可接受、拒绝或讨论每个Agent的发现结果。仅接受的发现结果会整合到计划中。
交互模式的存在是因为按需深化是不同的用户姿态——用户已有一个他们投入的计划,希望精确控制变更内容。无论计划是由此技能生成、手动编写还是由其他工具生成,这都适用。
ce-doc-review
与此次信心检查不同:
  • 当文档需要提高清晰度、简化、完整性或范围控制时,使用
    ce-doc-review
    技能
  • 当计划结构合理但仍需要更强的依据、执行顺序、风险处理和系统级思考时,此次信心检查会强化这些内容
管道模式: 在管道/禁用模型调用上下文中,此阶段始终以自动模式运行。无需用户交互。
5.3.1 Classify Plan Depth and Topic Risk
5.3.1 分类计划深度与主题风险
Determine the plan depth from the document:
  • Lightweight - small, bounded, low ambiguity, usually 2-4 implementation units
  • Standard - moderate complexity, some technical decisions, usually 3-6 units
  • Deep - cross-cutting, high-risk, or strategically important work, usually 4-8 units or phased delivery
Build a risk profile. Treat these as high-risk signals:
  • Authentication, authorization, or security-sensitive behavior
  • Payments, billing, or financial flows
  • Data migrations, backfills, or persistent data changes
  • External APIs or third-party integrations
  • Privacy, compliance, or user data handling
  • Cross-interface parity or multi-surface behavior
  • Significant rollout, monitoring, or operational concerns
从文档中确定计划深度:
  • 轻量级 - 小型、边界清晰、低模糊度,通常包含2-4个实施单元
  • 标准 - 中等复杂度,有一些技术决策,通常包含3-6个单元
  • 深度 - 跨领域、高风险或战略性重要工作,通常包含4-8个单元或分阶段交付
构建风险概况。以下视为高风险信号:
  • 认证、授权或安全敏感行为
  • 支付、计费或财务流程
  • 数据迁移、回填或持久数据变更
  • 外部API或第三方集成
  • 隐私、合规或用户数据处理
  • 跨接口一致性或多表面行为
  • 重大发布、监控或运维问题
5.3.2 Gate: Decide Whether to Deepen
5.3.2 网关:决定是否深化
  • Lightweight plans usually do not need deepening unless they are high-risk
  • Standard plans often benefit when one or more important sections still look thin
  • Deep or high-risk plans often benefit from a targeted second pass
  • Thin local grounding override: If Phase 1.2 triggered external research because local patterns were thin (fewer than 3 direct examples or adjacent-domain match), always proceed to scoring regardless of how grounded the plan appears. When the plan was built on unfamiliar territory, claims about system behavior are more likely to be assumptions than verified facts. The scoring pass is cheap — if the plan is genuinely solid, scoring finds nothing and exits quickly
If the plan already appears sufficiently grounded and the thin-grounding override does not apply, report "Confidence check passed — no sections need strengthening" and skip to Phase 5.3.8 (Document Review). Document-review always runs regardless of whether deepening was needed — the two tools catch different classes of issues.
  • 轻量级计划通常无需深化,除非是高风险
  • 标准计划当一个或多个重要章节仍看起来薄弱时,通常会从深化中受益
  • 深度或高风险计划通常会从针对性的第二轮审查中受益
  • 本地依据薄弱覆盖:如果Phase 1.2因本地模式薄弱(直接示例少于3个或仅匹配相邻领域)而触发外部研究,无论计划看起来依据多充分,始终进入评分阶段。当计划基于不熟悉的领域时,关于系统行为的主张更可能是假设而非已验证的事实。评分阶段成本低——如果计划确实完善,评分会快速结束且无发现结果
如果计划已看起来依据充分且本地依据薄弱覆盖不适用,报告“信心检查通过——无章节需要强化”并跳过到Phase 5.3.8(文档评审)。无论是否需要深化,文档评审始终会运行——这两个工具处理不同类型的问题。
5.3.3–5.3.7 Deepening Execution
5.3.3–5.3.7 深化执行
When deepening is warranted, read
references/deepening-workflow.md
for confidence scoring checklists, section-to-agent dispatch mapping, execution mode selection, research execution, interactive finding review, and plan synthesis instructions. Execute steps 5.3.3 through 5.3.7 from that file, then return here for 5.3.8.
当需要深化时,读取
references/deepening-workflow.md
获取信心评分清单、章节到Agent的调度映射、执行模式选择、研究执行、交互式发现结果评审和计划合成说明。执行该文件中的5.3.3至5.3.7步骤,然后返回此处进入5.3.8。
5.3.8–5.4 Document Review, Final Checks, and Post-Generation Options
5.3.8–5.4 文档评审、最终检查与生成后选项
When reaching this phase, read
references/plan-handoff.md
for document review instructions (5.3.8), final checks and cleanup (5.3.9), post-generation options menu (5.4), and issue creation. Do not load this file earlier. Document review is mandatory — do not skip it even if the confidence check already ran.
NEVER CODE! Research, decide, and write the plan.
进入此阶段时,读取
references/plan-handoff.md
获取文档评审说明(5.3.8)、最终检查与清理(5.3.9)、生成后选项菜单(5.4)和议题创建说明。不要提前加载此文件。文档评审是必需的——即便信心检查已运行,也不能跳过。
绝对不要编写代码!仅进行研究、决策和编写计划。