cold-start

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cold Start: Memory Bank + Agents bootstrap (greenfield & brownfield)

冷启动:Memory Bank + Agent 搭建(全新项目greenfield & 遗留系统brownfield)

Summary

概述

Note:
cold-start
is the package skill for all-in-one bootstrap. Do not confuse it with the generated project command
/cold-start
: that command is a lightweight router used after skeleton creation inside a target repo. For modular usage, prefer individual skills:
mb-init
(skeleton),
mb-from-prd
(greenfield),
mb-map-codebase
(brownfield),
mb-review
(review),
mb-execute
(implementation),
mb-verify
(UAT).
  • What it does: creates the Memory Bank skeleton, writes agent entry points, and routes the repo into the right workflow.
  • Use it when: you want one entry point for either a new project with a PRD or an existing codebase that needs mapping first.
  • Input: repository root plus either
    prd.md
    / requirements text or an existing codebase.
  • Output:
    .memory-bank/
    ,
    .tasks/
    ,
    .protocols/
    , agent entry files, and the next step for greenfield or brownfield work.
Supported scenarios:
  • Greenfield: repo has
    prd.md
    or requirements text, but no code yet.
  • Brownfield: repo already contains code and needs as-is documentation before change planning.

注意
cold-start
是一站式搭建的包技能。 请勿将其与生成的项目命令
/cold-start
混淆:该命令是目标仓库内骨架创建完成后使用的轻量级路由工具。 如需模块化使用,建议选用独立技能:
mb-init
(骨架搭建)、
mb-from-prd
(全新项目greenfield)、
mb-map-codebase
(遗留系统brownfield)、
mb-review
(评审)、
mb-execute
(实施)、
mb-verify
(用户验收测试UAT)。
  • 功能:创建Memory Bank骨架,编写Agent入口点,并将仓库接入对应的工作流。
  • 适用场景:你希望通过单一入口点处理两种情况——一是带有PRD的新项目,二是需要先进行映射的现有代码库。
  • 输入:仓库根目录,加上
    prd.md
    /需求文本,或现有代码库。
  • 输出
    .memory-bank/
    .tasks/
    .protocols/
    、Agent入口文件,以及全新项目或遗留系统工作的下一步指引。
支持的场景:
  • 全新项目(Greenfield):仓库包含
    prd.md
    或需求文本,但尚无代码。
  • 遗留系统(Brownfield):仓库已包含代码,在变更规划前需要如实完成文档记录。

Non-negotiable principles

不可妥协的原则

1) Orchestrator vs workers

1) 编排者 vs 执行者

  • You (main agent) are the orchestrator. You plan and coordinate.
  • Workers (subagents) do the heavy lifting (scanning many files, producing long reports).
  • Max depth = 2: orchestrator → subagent. No sub-sub-agents.
  • 你(主Agent)是编排者:负责规划与协调工作。
  • 执行者(子Agent)负责繁重工作(扫描大量文件、生成冗长报告)。
  • 最大层级=2:编排者 → 子Agent。不允许存在子子Agent。

2)
.tasks/
is runtime memory (НЕ Memory Bank)

2)
.tasks/
是运行时内存(而非Memory Bank)

  • Every agent process gets a unique task folder:
    .tasks/TASK-XXX/
    .
  • Subagents write detailed outputs there, and return only short summaries to the orchestrator.
  • 每个Agent进程都会获得唯一的任务文件夹:
    .tasks/TASK-XXX/
  • 子Agent在其中写入详细输出,仅向编排者返回简短摘要

3) Avoid conflicts by design

3) 从设计层面避免冲突

  • Split work by non-overlapping file sets.
  • If overlap is unavoidable, use git branches/worktrees per agent and merge later.
  • 无重叠的文件集拆分工作。
  • 若无法避免重叠,为每个Agent使用Git分支/工作区,后续再合并。

4) Parallelism limits

4) 并行性限制

  • Run up to 5–7 subagents in parallel.
  • If your runtime supports multi-tool calls: spawn parallel subagents in a single orchestrator turn.
  • 最多并行运行5–7个子Agent
  • 若运行时支持多工具调用:在单次编排者轮次中启动并行子Agent。

5) Docs First

5) 文档优先

After completing any meaningful unit of work:
  1. Update Memory Bank while context is fresh.
  2. Then change code / commit.

完成任何有意义的工作单元后:
  1. 在上下文清晰时更新Memory Bank。
  2. 再进行代码修改/提交。

Output you MUST create/maintain

你必须创建/维护的输出

Repo root

仓库根目录

  • AGENTS.md
    (canonical, short, ~100 lines)
  • CLAUDE.md
    → symlink (or copy) to
    AGENTS.md
  • (optional)
    GEMINI.md
    → symlink (or copy) to
    AGENTS.md
  • AGENTS.md
    (标准规范,简短,约100行)
  • CLAUDE.md
    → 符号链接(或副本)指向
    AGENTS.md
  • (可选)
    GEMINI.md
    → 符号链接(或副本)指向
    AGENTS.md

Repo folders

仓库文件夹

  • .memory-bank/
    — durable knowledge base
  • .tasks/
    — operational runtime memory
  • .protocols/
    — file-based protocols (plans / decision logs / resume)

  • .memory-bank/
    — 持久化知识库
  • .tasks/
    — 运行时操作内存
  • .protocols/
    — 基于文件的协议(计划/决策日志/进展记录)

Step 0 — Detect environment (don’t guess)

步骤0 — 检测环境(请勿猜测)

  1. Check what tools you have:
    • Codex available? (Codex CLI / MCP tool)
    • Claude Code available? (CLI
      claude
      , subagents)
    • Browser tools? (Playwright / agent-browser / CDP MCP)
  2. Decide primary engine:
    • If working inside Codex: use
      gpt-5.2-high
      for implementation and review (prefer fresh sessions for critical reviews).
    • If working inside Claude Code: use subagents for analysis + use Opus for synthesis; optionally call Codex via shell for second opinion or structured review.
    • If both Codex and Claude are available (dual-engine): use Claude for wide-context scanning and synthesis, Codex for structured review and implementation. Cross-validate critical outputs (MB compliance, architecture) by running the review step on the other engine. See Step 4 for the hybrid workflow.
If you don’t control Codex model selection via UI, create a project
.codex/config.toml
profile set (see Step 1.5).

  1. 检查可用工具:
    • 是否有Codex?(Codex CLI / MCP工具)
    • 是否有Claude Code?(CLI
      claude
      、子Agent)
    • 是否有浏览器工具?(Playwright / agent-browser / CDP MCP)
  2. 确定主引擎:
    • 若在Codex内工作:使用
      gpt-5.2-high
      进行实施与评审(关键评审建议使用全新会话)。
    • 若在Claude Code内工作:使用子Agent进行分析 + 使用Opus进行合成;可通过Shell调用Codex获取第二意见或结构化评审。
    • 若同时拥有Codex和Claude(双引擎):使用Claude进行宽上下文扫描与合成,使用Codex进行结构化评审与实施。通过在另一引擎上运行评审步骤,交叉验证关键输出(MB合规性、架构)。混合工作流详见步骤4。
若无法通过UI选择Codex模型,创建项目
.codex/config.toml
配置文件(见步骤1.5)。

Step 1 — Bootstrap the skeleton

步骤1 — 搭建骨架

1.1 Create directories

1.1 创建目录

Create (if missing):
  • .memory-bank/
    • mbb/
    • architecture/
    • guides/
    • adrs/
    • tech-specs/
    • domains/
      (optional but recommended)
    • contracts/
      (optional but recommended)
    • runbooks/
      (optional but recommended)
    • workflows/
      (optional; can keep
      wfs/
      if you already use it)
    • quality/
      (optional but recommended)
    • testing/
    • skills/
    • epics/
    • features/
    • tasks/
      (Memory Bank backlog & plans)
    • commands/
      (slash-command specs used by humans/agents)
    • agents/
      (subagent prompt library)
    • archive/
    • bugs/
  • .tasks/
  • .protocols/
创建(若不存在):
  • .memory-bank/
    • mbb/
    • architecture/
    • guides/
    • adrs/
    • tech-specs/
    • domains/
      (可选但推荐)
    • contracts/
      (可选但推荐)
    • runbooks/
      (可选但推荐)
    • workflows/
      (可选;若已使用
      wfs/
      可保留)
    • quality/
      (可选但推荐)
    • testing/
    • skills/
    • epics/
    • features/
    • tasks/
      (Memory Bank 待办事项与计划)
    • commands/
      (人类/Agent使用的斜杠命令规范)
    • agents/
      (子Agent提示词库)
    • archive/
    • bugs/
  • .tasks/
  • .protocols/

1.2 Create core files (use the templates)

1.2 创建核心文件(使用模板)

Use the templates in:
  • ./references/shared-structure-template.md
At minimum you must create:
  • AGENTS.md
  • CLAUDE.md
    symlink/copy
  • .memory-bank/index.md
  • .memory-bank/mbb/index.md
  • .memory-bank/product.md
  • .memory-bank/requirements.md
  • .memory-bank/testing/index.md
  • .memory-bank/tasks/backlog.md
Also create the command specs under
.memory-bank/commands/
(use
references/commands/*
).
使用以下路径中的模板:
  • ./references/shared-structure-template.md
至少必须创建:
  • AGENTS.md
  • CLAUDE.md
    符号链接/副本
  • .memory-bank/index.md
  • .memory-bank/mbb/index.md
  • .memory-bank/product.md
  • .memory-bank/requirements.md
  • .memory-bank/testing/index.md
  • .memory-bank/tasks/backlog.md
同时在
.memory-bank/commands/
下创建命令规范(使用
references/commands/*
)。

1.2.1 Create native skills (proxy commands)

1.2.1 创建原生技能(代理命令)

Create thin proxy skills so commands work natively in each runtime:
  • .claude/skills/<name>/SKILL.md
    → Claude Code + OpenCode
  • .agents/skills/<name>/SKILL.md
    → Codex CLI + OpenCode
Each proxy just says:
Read and follow the instructions in .memory-bank/commands/<name>.md
. This makes commands available natively (
/mb
,
/prd
,
/execute
, etc.) in all three tools.
The
init-mb.js
script creates both sets automatically.
创建轻量代理技能,使命令可在各运行时原生工作:
  • .claude/skills/<name>/SKILL.md
    → Claude Code + OpenCode
  • .agents/skills/<name>/SKILL.md
    → Codex CLI + OpenCode
每个代理仅需包含:
Read and follow the instructions in .memory-bank/commands/<name>.md
(读取并遵循
.memory-bank/commands/<name>.md
中的指令)。 这样可使命令在三个工具中原生可用(
/mb
/prd
/execute
等)。
init-mb.js
脚本会自动创建这两组文件。

1.3 Enforce frontmatter rule

1.3 强制实施前置元数据规则

Every markdown file inside
.memory-bank/
must include YAML frontmatter with at least:
  • description: ...
  • status: draft|active|deprecated|archived
.memory-bank/
内的每个Markdown文件必须包含YAML前置元数据,至少包括:
  • description: ...
  • status: draft|active|deprecated|archived

1.4 Create
.tasks/
protocol

1.4 创建
.tasks/
协议

Create a task folder for this run (pick a new id):
  • .tasks/TASK-MB-INIT/
Inside it, create:
  • TASK-MB-INIT-S-00-orchestrator-plan.md
    — what you will do + which subagents
为此运行创建任务文件夹(选择新ID):
  • .tasks/TASK-MB-INIT/
在其中创建:
  • TASK-MB-INIT-S-00-orchestrator-plan.md
    — 你的工作计划 + 子Agent分配

1.5 Optional: Codex profile presets

1.5 可选:Codex配置预设

If Codex is used, create
.codex/config.toml
with profiles:
  • default: coding (gpt-5.2, high)
  • profile
    deep-review
    : review (gpt-5.2, xhigh)
(If your repo is shared, consider keeping it local or documenting it in
.memory-bank/runbooks/
.)

若使用Codex,创建
.codex/config.toml
配置文件,包含以下配置:
  • default: coding (gpt-5.2, high)
  • profile
    deep-review
    : review (gpt-5.2, xhigh)
(若仓库为共享仓库,建议将其设为本地文件,或在
.memory-bank/runbooks/
中记录)。

Step 2 — Choose scenario

步骤2 — 选择场景

Decision rule

决策规则

  • If repo has substantial code (
    src/
    ,
    package.json
    ,
    go.mod
    ,
    Cargo.toml
    , etc.) → Brownfield (Step 3B).
  • If repo is mostly empty and you have
    prd.md
    Greenfield (Step 3A).
  • If both exist: treat as Brownfield + PRD delta (Step 3B).
  • If repo is empty/new and no
    prd.md
    Skeleton-only (Step 3C).
Record the scenario in:
  • .tasks/TASK-MB-INIT/TASK-MB-INIT-S-00-orchestrator-plan.md

  • 若仓库包含大量代码(
    src/
    package.json
    go.mod
    Cargo.toml
    等)→ 遗留系统(Brownfield)(步骤3B)。
  • 若仓库基本为空且包含
    prd.md
    全新项目(Greenfield)(步骤3A)。
  • 若两者都存在:按遗留系统 + PRD增量处理(步骤3B)。
  • 若仓库为新创建/空仓库且无
    prd.md
    仅骨架(步骤3C)。
将场景记录在:
  • .tasks/TASK-MB-INIT/TASK-MB-INIT-S-00-orchestrator-plan.md

Step 3A — Greenfield workflow (PRD → Memory Bank)

步骤3A — 全新项目工作流(PRD → Memory Bank)

3A.1 Read PRD and do Deep Questioning

3A.1 读取PRD并进行深度提问

  • Read
    prd.md
    .
  • If gaps exist, run deep questioning in rounds (3–5 questions each). Use
    ./references/shared-deep-questioning.md
    .
  • If PRD mentions “use skills/tools/CLIs” — run
    /find-skills
    first (project-installed → marketplace).
If user is temporarily unavailable (“запуск и ушёл”):
  • Record
    Open questions
    in
    .protocols/PRD-BOOTSTRAP/decision-log.md
    .
  • Stop and wait (do not invent facts; do not proceed to EP/FT/backlog generation without answers).
If the user explicitly wants autonomous mode:
  • record non-blocking gaps as
    Assumptions
  • halt only on blocking gaps (security/compliance/external contract/data-loss risks)
  • after L1–L3 + review gate, continue with
    /autonomous
  • 读取
    prd.md
  • 若存在信息缺口,分轮次进行深度提问(每轮3–5个问题)。使用
    ./references/shared-deep-questioning.md
  • 若PRD提及“使用技能/工具/CLI” — 先运行
    /find-skills
    (优先项目已安装技能 → 市场技能)。
若用户暂时不可用(“启动后离开”):
  • 未解决问题
    记录在
    .protocols/PRD-BOOTSTRAP/decision-log.md
    中。
  • 停止并等待(请勿编造信息;未得到答案前,请勿进行史诗/功能/待办事项生成)。
若用户明确要求自主模式
  • 将非阻塞缺口记录为
    假设
  • 仅在遇到阻塞缺口(安全/合规/外部合同/数据丢失风险)时暂停
  • 完成L1–L3 + 评审关卡后,使用
    /autonomous
    继续

3A.2 Write product brief (L1)

3A.2 编写产品简介(L1)

Update
.memory-bank/product.md
using user’s wording.
使用用户的表述更新
.memory-bank/product.md

3A.3 Requirements + RTM

3A.3 需求 + 需求跟踪矩阵(RTM)

Update
.memory-bank/requirements.md
:
  • REQ-IDs
  • RTM table mapping REQ → Epic → Feature → Test
更新
.memory-bank/requirements.md
  • 需求ID(REQ-IDs)
  • RTM表格,映射需求 → 史诗 → 功能 → 测试

3A.4 Create epics and features

3A.4 创建史诗与功能

Create:
  • .memory-bank/epics/EP-001-<slug>.md
  • .memory-bank/features/FT-001-<slug>.md
Each feature MUST include:
  • use cases
  • acceptance criteria
  • failure modes / edge cases
  • test strategy pointers
Status policy:
  • Default EP/FT frontmatter to
    status: draft
    until
    Open questions
    are resolved.
  • Promote to
    status: active
    only when acceptance criteria + verification plan are stable.
创建:
  • .memory-bank/epics/EP-001-<slug>.md
  • .memory-bank/features/FT-001-<slug>.md
每个功能必须包含:
  • 用例
  • 验收标准
  • 失败模式/边缘情况
  • 测试策略指引
状态规则:
  • 默认史诗/功能前置元数据为
    status: draft
    ,直至
    未解决问题
    得到解决。
  • 仅当验收标准 + 验证计划稳定后,才升级为
    status: active

3A.5 Tasks planning (per-feature, no “everything at once”)

3A.5 任务规划(按功能拆分,禁止“一次性全部生成”)

Do not generate a full task backlog for all features in one pass.
Instead:
  1. Create/refresh
    .memory-bank/tasks/backlog.md
    as a skeleton (waves + placeholders).
  2. For each selected feature, run
    /prd-to-tasks FT-<NNN>
    to produce:
    • .memory-bank/tasks/plans/IMPL-FT-<NNN>.md
    • atomic
      TASK-*
      items grouped by waves in
      backlog.md
请勿一次性为所有功能生成完整的任务待办事项。
而是:
  1. 创建/更新
    .memory-bank/tasks/backlog.md
    作为骨架(阶段 + 占位符)。
  2. 对每个选定的功能,运行
    /prd-to-tasks FT-<NNN>
    生成:
    • .memory-bank/tasks/plans/IMPL-FT-<NNN>.md
    • backlog.md
      中按阶段分组的原子化
      TASK-*

3A.6 Identify key concepts and create duo docs

3A.6 识别关键概念并创建配套文档

For every non-trivial concept, create a duo:
  • .memory-bank/architecture/<concept>.md
    (WHAT/WHY)
  • .memory-bank/guides/<concept>.md
    (HOW)
对于每个非平凡概念,创建一组配套文档:
  • .memory-bank/architecture/<concept>.md
    (是什么/为什么)
  • .memory-bank/guides/<concept>.md
    (怎么做)

3A.7 Update index

3A.7 更新索引

Update
.memory-bank/index.md
with annotated links to all created docs.

使用带注释的链接更新
.memory-bank/index.md
,指向所有已创建的文档。

Step 3B — Brownfield workflow (Repo → Memory Bank)

步骤3B — 遗留系统工作流(仓库 → Memory Bank)

3B.1 Spawn repo-scanning subagents (parallel)

3B.1 启动仓库扫描子Agent(并行)

Create a new task folder:
  • .tasks/TASK-MB-MAP/
Spawn up to 5 subagents in parallel with non-overlapping scopes:
  1. S-01
    : build/tooling (package managers, scripts, CI)
  2. S-02
    : backend/services
  3. S-03
    : frontend/UI
  4. S-04
    : data layer (DB, migrations, schema)
  5. S-05
    : tests + quality gates
Each subagent MUST:
  • verify its file glob targets exist ("smart calling")
  • write a detailed report into
    .tasks/TASK-MB-MAP/
    using naming:
    TASK-MB-MAP-S-0X-final-report-<code|docs>-YY.md
  • return a 5–10 line summary + file list
Use
./agents/shared-repo-scanner.md
as baseline prompt, but scope it.
创建新的任务文件夹:
  • .tasks/TASK-MB-MAP/
并行启动最多5个具有无重叠范围的子Agent:
  1. S-01
    :构建/工具链(包管理器、脚本、CI)
  2. S-02
    :后端/服务
  3. S-03
    :前端/UI
  4. S-04
    :数据层(数据库、迁移、 schema)
  5. S-05
    :测试 + 质量关卡
每个子Agent必须:
  • 验证其文件匹配目标是否存在(“智能调用”)
  • 将详细报告写入
    .tasks/TASK-MB-MAP/
    ,命名格式:
    TASK-MB-MAP-S-0X-final-report-<code|docs>-YY.md
  • 返回5–10行摘要 + 文件列表
使用
./agents/shared-repo-scanner.md
作为基础提示词,但需限定范围。

3B.2 Synthesize Memory Bank from reports

3B.2 从报告合成Memory Bank

Using the
.tasks/TASK-MB-MAP/
reports, fill:
  • .memory-bank/product.md
    — what the system is today
  • .memory-bank/architecture/
    — C4 L1–L3 overview + key invariants
  • .memory-bank/runbooks/
    — setup, dev, test, deploy
  • .memory-bank/contracts/
    — API/event contracts
  • .memory-bank/testing/index.md
    — canonical gates + verification notes
  • .memory-bank/index.md
    — annotated links
PRD-less rule (non-negotiable): if there is no
prd.md
, you MUST NOT create or populate:
  • .memory-bank/epics/*
  • .memory-bank/features/*
  • .memory-bank/tasks/backlog.md
    with waves/tasks
Empty skeleton files/folders are allowed if they were created by bootstrap.
Repo mapping is as-is documentation, not roadmap planning. If something cannot be derived from code/logs/tests, record it as a hypothesis or an open question.
使用
.tasks/TASK-MB-MAP/
中的报告,填充:
  • .memory-bank/product.md
    — 当前系统的实际情况
  • .memory-bank/architecture/
    — C4 L1–L3概览 + 关键不变量
  • .memory-bank/runbooks/
    — 搭建、开发、测试、部署指南
  • .memory-bank/contracts/
    — API/事件契约
  • .memory-bank/testing/index.md
    — 标准质量关卡 + 验证说明
  • .memory-bank/index.md
    — 带注释的链接
无PRD规则(不可妥协):若
prd.md
,禁止创建或填充:
  • .memory-bank/epics/*
  • .memory-bank/features/*
  • 包含阶段/任务的
    .memory-bank/tasks/backlog.md
允许保留由搭建过程创建的空骨架文件/文件夹。
仓库映射是如实记录文档,而非路线图规划。若无法从代码/日志/测试中推导信息,将其记录为假设或未解决问题。

3B.3 Ask user for PRD delta

3B.3 向用户请求PRD增量

After baseline MB exists:
  • ask the user for
    prd.md
    describing what to change/add
  • run
    /prd
    and
    /prd-to-tasks
    style decomposition against the existing baseline

基准Memory Bank创建完成后:
  • 向用户请求
    prd.md
    ,描述需要修改/添加的内容
  • 针对现有基准运行
    /prd
    /prd-to-tasks
    风格的分解流程

Step 3C — Skeleton-only workflow (no PRD, no code)

步骤3C — 仅骨架工作流(无PRD,无代码)

When the repo is new/empty and no
prd.md
is available:
当仓库为新创建/空仓库且无
prd.md
时:

3C.1 Create skeleton only

3C.1 仅创建骨架

Run Step 1 as usual — create all directories, core files from templates,
AGENTS.md
,
CLAUDE.md
symlink.
The skeleton provides a ready-to-fill structure:
product.md
,
requirements.md
,
backlog.md
, etc. remain as draft stubs.
按步骤1正常执行 — 创建所有目录、模板核心文件、
AGENTS.md
CLAUDE.md
符号链接。
骨架提供了可直接填充的结构:
product.md
requirements.md
backlog.md
等保留为草稿占位符。

3C.2 Ask for PRD

3C.2 请求PRD

After skeleton is created, ask the user to provide a PRD:
"Memory Bank skeleton created. To fill it with product details, epics, features, and a backlog, please provide a
prd.md
file (or paste requirements text). You can do this now or later — run
/prd
when ready."
骨架创建完成后,向用户请求提供PRD:
"Memory Bank骨架已创建。如需填充产品详情、史诗、功能与待办事项,请提供
prd.md
文件(或粘贴需求文本)。你可现在提供或稍后提供 — 准备就绪后运行
/prd
命令即可。"

3C.3 Wait or proceed

3C.3 等待或继续

  • If user provides PRD now → continue to Step 3A (Greenfield workflow).
  • If user defers → stop here. The skeleton is valid and usable. The user can invoke
    $mb-from-prd
    or
    /prd
    later to fill the Memory Bank.
  • If user provides partial info → run deep questioning (
    ./references/shared-deep-questioning.md
    ) to extract enough for product.md, then stop and wait for full PRD.
Note: The skeleton-only state is a valid stopping point.
AGENTS.md
+
.memory-bank/index.md
+ MBB rules are enough for agents to start navigating the repo.

  • 若用户现在提供PRD → 继续执行步骤3A(全新项目工作流)。
  • 若用户推迟提供 → 在此停止。骨架已可用,用户可稍后调用
    $mb-from-prd
    /prd
    填充Memory Bank。
  • 若用户提供部分信息 → 运行深度提问(
    ./references/shared-deep-questioning.md
    )以提取足够信息用于
    product.md
    ,然后停止并等待完整PRD。
注意:仅骨架状态是有效的停止点。
AGENTS.md
+
.memory-bank/index.md
+ MBB规则已足够Agent开始导航仓库。

Step 4 — Hybrid mode (Claude ↔ Codex)

步骤4 — 混合模式(Claude ↔ Codex)

If you’re in Claude Code but want Codex quality or long-horizon autonomy:
  1. Use Claude subagents to produce the scan reports into
    .tasks/TASK-MB-MAP/
    .
  2. Call Codex via shell to synthesize Memory Bank:
bash
codex exec --ephemeral --full-auto -m gpt-5.2-high \
  'Read .tasks/TASK-MB-MAP and build/refresh .memory-bank per MBB. Keep AGENTS.md short. Produce a summary and run a self-review.'
  1. Then run a Codex deep review profile (or a fresh Claude session) for 5-expert review.

若在Claude Code内工作,但希望获得Codex的质量或长周期自主性:
  1. 使用Claude子Agent将扫描报告生成到
    .tasks/TASK-MB-MAP/
  2. 通过Shell调用Codex合成Memory Bank:
bash
codex exec --ephemeral --full-auto -m gpt-5.2-high \
  'Read .tasks/TASK-MB-MAP and build/refresh .memory-bank per MBB. Keep AGENTS.md short. Produce a summary and run a self-review.'
  1. 然后运行Codex深度评审配置(或全新Claude会话)进行5专家评审。

Step 5 — Multi-expert review loop (fresh context)

步骤5 — 多专家评审循环(全新上下文)

Run fresh-context reviewers (do not reuse the writer context):
  • Architect (C4 + dependencies)
  • Scope analyst (REQ → Epic → Feature → Task coverage)
  • MBB compliance reviewer (frontmatter, links, atomics, duo)
  • Plan reviewer (backlog quality, waves, gates)
  • Security reviewer (auth, sensitive data, OWASP risks)
  • Code quality reviewer (conditional: if code exists — quality gates, conventions, hotspots)
Use prompts in
./agents/shared-review-*.md
and
./agents/shared-mb-reviewer.md
.
Rules:
  • If any reviewer returns REJECT → fix MB and repeat review.
  • Persist reviewer reports into
    .tasks/TASK-MB-REVIEW/
    .

运行全新上下文评审者(请勿复用编写者上下文):
  • 架构师(C4 + 依赖关系)
  • 范围分析师(需求 → 史诗 → 功能 → 任务覆盖)
  • MBB合规性评审者(前置元数据、链接、原子化、配套文档)
  • 计划评审者(待办事项质量、阶段、关卡)
  • 安全评审者(认证、敏感数据、OWASP风险)
  • 代码质量评审者(条件:若存在代码 — 质量关卡、规范、热点)
使用
./agents/shared-review-*.md
./agents/shared-mb-reviewer.md
中的提示词。
规则:
  • 若任何评审者返回REJECT → 修复Memory Bank并重复评审。
  • 将评审报告持久化到
    .tasks/TASK-MB-REVIEW/

Step 6 — Start executing tasks

步骤6 — 开始执行任务

After review gate passes (APPROVE):
  1. Pick the highest-priority task from
    .memory-bank/tasks/backlog.md
    .
  2. Run
    mb-execute
    for the task (plan → implement → quality gates → MB-SYNC).
  3. Run
    mb-verify
    to check acceptance criteria and record evidence.
  4. Repeat until the wave is complete or user stops.
If the intended mode is unattended end-to-end:
  • do not stay in manual loop here
  • switch to generated project command
    /autonomous
If
mb-execute
or
mb-verify
are not installed, follow their SKILL.md manually.

评审关卡通过(APPROVE)后:
  1. .memory-bank/tasks/backlog.md
    中选择最高优先级任务。
  2. 对该任务运行
    mb-execute
    (计划 → 实施 → 质量关卡 → MB同步)。
  3. 运行
    mb-verify
    检查验收标准并记录证据。
  4. 重复直至阶段完成或用户停止。
若目标模式为无人值守端到端执行:
  • 请勿停留在手动循环
  • 切换为生成的项目命令
    /autonomous
若未安装
mb-execute
mb-verify
,手动遵循其SKILL.md中的指引。

Definition of done

完成定义

You are done when:
  • AGENTS.md
    exists, short, points to
    .memory-bank/index.md
    .
  • CLAUDE.md
    is a symlink/copy of
    AGENTS.md
    .
  • .memory-bank/
    contains at minimum: index + MBB + product + testing (requirements/backlog can remain as stubs until PRD exists).
  • .tasks/
    contains scan/review artifacts with naming + stage ids.
  • Greenfield: epics/features/backlog created from PRD.
  • Brownfield: repo mapped as-is into MB and user asked for PRD delta (no roadmap entities invented without PRD).
  • Skeleton-only: skeleton created, user asked for PRD (valid stopping point).
  • Multi-expert review passes (APPROVE) — for Greenfield/Brownfield; skip for Skeleton-only.
  • Execution loop is available (mb-execute + mb-verify reachable or documented).
  • Autonomous loop is available (
    /autonomous
    +
    /autopilot
    documented).

满足以下条件即完成:
  • AGENTS.md
    已存在,内容简短,指向
    .memory-bank/index.md
  • CLAUDE.md
    AGENTS.md
    的符号链接/副本。
  • .memory-bank/
    至少包含:索引 + MBB + 产品 + 测试文档(需求/待办事项可保留为占位符,直至PRD存在)。
  • .tasks/
    包含符合命名规范 + 阶段ID的扫描/评审产物。
  • 全新项目场景:已从PRD创建史诗/功能/待办事项。
  • 遗留系统场景:仓库已如实映射到Memory Bank,且已向用户请求PRD增量(无PRD时禁止创建路线图实体)。
  • 仅骨架场景:骨架已创建,已向用户请求PRD(有效停止点)。
  • 多专家评审通过(APPROVE) — 适用于全新项目/遗留系统场景;仅骨架场景可跳过。
  • 执行循环可用(
    mb-execute
    +
    mb-verify
    可访问或已文档化)。
  • 自主循环可用(
    /autonomous
    +
    /autopilot
    已文档化)。

References in this skill

本技能中的参考文件

  • ./references/shared-structure-template.md
  • ./references/shared-deep-questioning.md
  • ./agents/shared-repo-scanner.md
  • ./agents/shared-mb-reviewer.md
  • ./agents/shared-review-architect.md
  • ./agents/shared-review-scope.md
  • ./agents/shared-review-code.md
  • ./agents/shared-review-plan.md
  • ./agents/shared-review-security.md
  • ./scripts/shared-init-mb.js
    (optional helper)
  • ./references/shared-structure-template.md
  • ./references/shared-deep-questioning.md
  • ./agents/shared-repo-scanner.md
  • ./agents/shared-mb-reviewer.md
  • ./agents/shared-review-architect.md
  • ./agents/shared-review-scope.md
  • ./agents/shared-review-code.md
  • ./agents/shared-review-plan.md
  • ./agents/shared-review-security.md
  • ./scripts/shared-init-mb.js
    (可选辅助工具)