cook

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/cook

/cook

Inputs

输入

Accept one of:
  • A spec path. When explicit, read it verbatim wherever it points.
  • A bare slug. Resolve it to the durable spec path with
    SPEC=$(python3 shared/scripts/artifact_path.py specs <slug>)
    , then read
    "$SPEC"
    . If you're on a host that only exposes the packaged helper,
    python3 ${CLAUDE_SKILL_DIR}/scripts/cook.pyz artifact-path specs <slug>
    is the fallback. The resolver anchors specs at the per-project durable corpus (see
    ../cheese/references/formatting.md
    § Corpus location); this is the form
    /ultracook
    uses when chaining.
  • A pasted spec or issue.
  • A focused implementation request with acceptance criteria.
  • A clear, unambiguous task — single-file fix, named bug, well-scoped tweak — even without a spec.
Optional flags:
  • --auto
    — autonomous mode: skip every handoff gate and chain
    /press → /age → /cure
    (see
    ## Auto mode
    below; full selection/cap rules in
    references/auto-mode.md
    ).
  • --hard
    — propagate through
    /press → /age → /cure → /plate
    ;
    /plate
    fires
    /hard-cheese
    after its final artifact-writing gate.
  • --open-pr
    — propagate to terminal
    /plate
    , which follows its explicit-choice and review-shape policy for a new PR.
  • --resume <slug>
    — resume a crashed fan run from its manifest (full mechanics:
    references/fan-pathway.md
    § --resume).
接受以下任一输入:
  • 规范路径。若为明确路径,直接读取其指向的内容。
  • 纯slug。通过
    SPEC=$(python3 shared/scripts/artifact_path.py specs <slug>)
    解析为持久规范路径,然后读取
    "$SPEC"
    。若所在主机仅暴露打包后的辅助工具,可使用备选命令
    python3 ${CLAUDE_SKILL_DIR}/scripts/cook.pyz artifact-path specs <slug>
    。解析器会将规范锚定在每个项目的持久语料库中(详见
    ../cheese/references/formatting.md
    § 语料库位置);这是
    /ultracook
    在链式调用时使用的格式。
  • 粘贴的规范或问题描述。
  • 带验收标准的聚焦型实现请求。
  • 明确无歧义的任务——单文件修复、已知bug、范围清晰的调整——即使没有规范也可。
可选标志:
  • --auto
    ——自主模式:跳过所有交接节点,链式调用
    /press → /age → /cure
    (详见下文「自动模式」;完整的选择/限制规则见
    references/auto-mode.md
    )。
  • --hard
    ——链式调用
    /press → /age → /cure → /plate
    /plate
    在其最终的工件写入节点后触发
    /hard-cheese
  • --open-pr
    ——链式调用至终端环节
    /plate
    ,后者会遵循其针对新PR的明确选择和审核流程策略。
  • --resume <slug>
    ——从其清单恢复崩溃的fan运行(完整机制见
    references/fan-pathway.md
    § --resume)。

Standalone fast-path

独立快速路径

/cook
runs without
/mold
when the task is unambiguous. Treat a request as unambiguous when all three are present or trivially derivable:
  1. Inputs/outputs are clear. "Tail returns wrong byte count when file ends without newline" ✓; "make tail better" ✗.
  2. Scope is bounded. A named function, a single failing test, a specific call site, or a small region of one or two files.
  3. Verification is obvious. A failing test that can be made to pass, or a runnable command whose output should change in a stated way.
When the fast-path applies, derive a slug from the task (e.g.
tail-trailing-newline
), treat Contract as a one-sentence restatement of the request, and proceed directly to Cut without a spec round-trip. Route to
/mold
only when one of the three checks fails — silent ambiguity is the cardinal sin.
当任务明确时,
/cook
无需
/mold
即可运行。当以下三点全部满足或可轻松推导时,视为任务明确:
  1. 输入/输出清晰。例如“当文件末尾无换行符时,tail返回错误的字节数” ✓;“优化tail工具” ✗。
  2. 范围有限。涉及某个命名函数、单个失败测试、特定调用点,或一两个文件中的小范围区域。
  3. 验证方式明确。存在可修复的失败测试,或可运行的命令,其输出应按指定方式改变。
当快速路径适用时,从任务中生成slug(例如
tail-trailing-newline
),将「契约」视为对请求的一句重述,直接进入「编码实现」环节,无需往返确认规范。仅当上述三项检查中有一项不满足时,才转向
/mold
——隐性歧义是大忌。

Flow

流程

  1. Contract — confirm behaviour, non-goals, likely scope, quality gates. For standalone fast-path tasks, the contract is the user's request restated in one sentence. If
    .cheese/glossary/<slug>.md
    exists, read it before implementation so naming follows the resolved canonical terms.
  2. Cut — write failing tests for the changed behaviour. See
    references/tdd-loop.md
    .
  3. Implement — make the cut tests pass with the smallest production change.
  4. Taste-test — check spec drift, readability, scope, plus three fresh-context lenses (production path, wired callers, locked-decision). Dispatch the fresh-context
    reviewer
    for multi-file or public-surface diffs; keep the inline check otherwise. Two-round cap. Cost gate, reviewer-model pin, and the coder-nested degrade live in
    references/tdd-loop.md
    .
  5. Hand off — produce the package-ready report (
    references/package-report.md
    ), write the handoff slug (
    ## Handoff slug
    below), and prompt the next step via the shared handoff gate (see
    ## Handoff
    below). The default chain is
    /press
    /age
    /cure
    .
  1. 契约——确认行为、非目标、可能的范围、质量关卡。对于独立快速路径任务,契约就是对用户请求的一句重述。若
    .cheese/glossary/<slug>.md
    存在,在实现前先读取,确保命名符合已解析的规范术语。
  2. 编码准备(Cut)——为变更后的行为编写失败测试。详见
    references/tdd-loop.md
  3. 实现——以最小的生产代码变更让准备阶段的测试通过。
  4. 尝试验证(Taste-test)——检查规范偏差、可读性、范围,同时从三个新视角(生产路径、关联调用方、已锁定决策)进行验证。若涉及多文件或公共接口变更,分派「审核者(reviewer)」进行新视角检查;否则进行内联检查。最多两轮验证。成本关卡、审核者模型固定、以及编码嵌套降级规则见
    references/tdd-loop.md
  5. 交接——生成可打包的报告(详见
    references/package-report.md
    ),写入交接slug(见下文「交接slug」),并通过共享交接节点提示下一步(见下文「交接」)。默认链式流程为
    /press
    /age
    /cure

Fan pathway

Fan路径

/cook
's single pathway routes a spec through one of three shapes, gated on whether the spec already carries a decomposition.
(a) Curded spec. If the spec already carries an embedded
curds:
/
waves:
block (produced by
/mold
's curdle step, or a sibling curd's prior decomposition), skip straight to wave fan-out below — the decomposition is already locked, no fresh decompose pass runs.
(b) Un-curded, small. Ordinary single-coder Cut → Implement → Taste-test, unchanged from today's
/cook
(
## Flow
above). Sizing signal:
/mold
's curd-count hint is advisory; otherwise use AC count and edit-site estimate. Per the spec's cook-gate row: "un-curded (curd block, else AC count and edit-site estimate) | single vs fan vs decompose-first; wave plan; transport".
(c) Un-curded, big. Dispatch the decomposer per
../cheese/references/decomposer.md
(the locked curd-block schema — do not use
../ultracook/references/decomposer-prompt.md
, which produces the incompatible legacy manifest schema) against the spec text to produce a
curd_block
-schema block (
curds[]
,
waves[]
,
decomposer{}
), then validate it with
src/fanout/curd_block.py::validate_curd_block
. Gate with the user by showing the wave plan plus a projected agent-dispatch count — exact phrasing: "12 ACs -> 5 curds, 2 waves, up to 30 agent dispatches. Go?" — unless
--auto
is set. The count is an upper bound,
5 + 5 x curds
, excluding wiring; the derivation lives in
references/fan-pathway.md
§ Phase-chain topology.
Wave cap. Waves are capped at
<=4
curds, enforced by
MAX_WAVE_SIZE
in
src/fanout/curd_block.py
— cited, not reimplemented here.
Read
references/fan-pathway.md
before orchestrating a wave-fan run — it owns the existing-handoffs guard, mode selection, the publication-topology preflight, the milknado seam, phase-chain topology, the deterministic phase loop, worker-exhaustion/aggregate-gate recovery, worktree harvest and teardown,
--resume <slug>
, and resolution provenance.
A terminal age is publishable only with
next: done
;
next: cure
or a missing
next
halts — this applies to both fan-pathway tables (
references/fan-pathway.md
) and the single-coder
--auto
chain's terminal age (
## Auto mode
below).
/cook
的单一路径会根据规范是否已完成分解,将其路由至三种流程之一。
(a) 含凝块(curd)的规范。若规范已包含嵌入的
curds:
/
waves:
块(由
/mold
的凝块生成步骤或同级凝块的先前分解产生),直接跳至下文的wave分支——分解已锁定,无需重新执行分解步骤。
(b) 未凝块的小型任务。采用普通的单人编码流程:编码准备→实现→尝试验证,与当前
/cook
的流程一致(见上文「流程」)。规模判断依据:
/mold
的凝块数量提示仅作参考;否则使用验收标准数量和编辑位点估算。根据规范的cook关卡行:“未凝块(有curd块则用,否则用验收标准数量和编辑位点估算) | 单人/分支/先分解;wave计划;传输方式”。
(c) 未凝块的大型任务。根据
../cheese/references/decomposer.md
(已锁定的curd块 schema——请勿使用
../ultracook/references/decomposer-prompt.md
,其生成的是不兼容的旧版清单schema)分派分解器处理规范文本,生成
curd_block
-schema块(
curds[]
,
waves[]
,
decomposer{}
),然后通过
src/fanout/curd_block.py::validate_curd_block
进行验证。向用户展示wave计划及预估的Agent调用次数,确认是否继续——表述为:“12项验收标准 → 5个curd,2个wave,最多30次Agent调用。是否开始?”——除非设置了
--auto
。次数为上限值,计算公式为
5 + 5 x curds
,不含关联操作;推导方式见
references/fan-pathway.md
§ 阶段链拓扑。
Wave上限。每个wave最多包含
<=4
个curd,由
src/fanout/curd_block.py
中的
MAX_WAVE_SIZE
强制限制——此处仅作引用,不重复实现。
在编排wave分支运行前,请阅读
references/fan-pathway.md
——该文档涵盖现有交接防护、模式选择、发布拓扑预检、milknado衔接、阶段链拓扑、确定性阶段循环、Worker耗尽/聚合关卡恢复、工作区获取与清理、
--resume <slug>
以及解析来源。
仅当
next: done
时,最终的age环节才是可发布状态;若为
next: cure
或缺失
next
则停止——此规则适用于fan路径表(
references/fan-pathway.md
)和单人编码
--auto
链的最终age环节(见下文「自动模式」)。

Baseline capture

基线捕获

Before any curd cooks,
/cook
captures the run's broad-gate baseline once, in the orchestrator's own tree, right after mode selection. Full capture steps, classification, hand-down, and the repair pathway:
references/quality-gates.md
.
For source changes, call the selected backend directly and follow
code-intelligence-routing.md
, including search → fresh bounded read → stale-safe write.
Portability reference:
../cheese/references/harness-portability.md
. It covers helper resolution, sub-agent dispatch, GitHub operations, and handoff transitions; prefer the bundled or repo-local helper first, and treat
${CLAUDE_SKILL_DIR}
as optional host-provided fallback. The handoff blocks below are the portable contract; slash commands are host renderings, not the control model.
在任何curd开始处理前,
/cook
会在编排器自身的工作树中,于模式选择完成后一次性捕获运行的宽基线。完整的捕获步骤、分类、传递及修复路径见:
references/quality-gates.md
对于源代码变更,直接调用选定的后端,并遵循
code-intelligence-routing.md
,包括搜索→新范围读取→防过时写入。
可移植性参考:
../cheese/references/harness-portability.md
。该文档涵盖辅助工具解析、子Agent分派、GitHub操作及交接转换;优先使用打包或仓库本地的辅助工具,将
${CLAUDE_SKILL_DIR}
视为可选的主机提供备选方案。 下文的交接块是可移植契约;斜杠命令是主机渲染形式,而非控制模型。

Preferred tools and fallbacks

首选工具与备选方案

NeedPreferFallback
Diffs
delta
plain
git diff
GitHub context
gh
local git history or user-provided links
Merge assistancemergirafmanual conflict resolution with tests
Task commands
just
, package scripts
direct documented commands
Code navigationsemantic symbol search, then caller searchLSP or bounded native search; report precision loss
Read before editfresh bounded read from the write backend familyanother snapshot-capable bounded read; re-read if anchors are incompatible
Falling back, mention any loss of precision that affects risk.
需求首选工具备选方案
差异对比
delta
原生
git diff
GitHub上下文
gh
本地git历史或用户提供的链接
合并辅助mergiraf结合测试手动解决冲突
任务命令
just
、包脚本
直接使用文档化命令
代码导航语义符号搜索,然后调用方搜索LSP或有限原生搜索;报告精度损失
编辑前读取写入后端家族提供的新范围读取其他支持快照的范围读取;若锚点不兼容则重新读取
使用备选方案时,需提及任何影响风险的精度损失。

Quality gates

质量关卡

Run existing project commands only — the most relevant tests for the touched area, plus lint/type/build if defined. Never remove, skip, or weaken unrelated tests to make the change pass.
Gate failures are baseline-aware. Policy, the classification taxonomy, and the
baseline:
block shape are the shared reference
references/quality-gates.md
; every downstream phase links there instead of restating it.
仅运行现有项目命令——针对受影响区域的最相关测试,加上已定义的lint/类型检查/构建命令。绝不能为了让变更通过而移除、跳过或弱化无关测试。
关卡失败会考虑基线情况。策略、分类体系及
baseline:
块格式见共享参考文档
references/quality-gates.md
;所有下游阶段均链接至该文档,不再重复说明。

Output

输出

House style and citations:
../cheese/references/formatting.md
. Authoritative report shape:
references/package-report.md
; the bullets below sketch it:
  • Files changed and why.
  • Tests or checks run.
  • Remaining risks or skipped checks.
  • Suggested next skill: usually
    /press
    /age
    /cure
    .
格式风格与引用规范:
../cheese/references/formatting.md
。权威报告格式:
references/package-report.md
;以下要点为概述:
  • 变更的文件及原因。
  • 运行的测试或检查。
  • 剩余风险或跳过的检查。
  • 建议的下一步Skill:通常为
    /press
    /age
    /cure

Handoff slug

交接slug

Write a minimum-shape handoff slug at the top of
.cheese/cook/<slug>.md
— same file as the report, no second file — so downstream phases (and cook's own fan pathway when orchestrating a wave) can resume or chain without re-reading it. Schema:
markdown
status: ok | halt: <one-line reason>
next: mold | cook | press | age | done
artifact: <path-to-richer-report-if-any>
taste_test: inline-pass | dispatched-pass | revised | deferred-to-orchestrator
durable_flags: none | <one line per flag: what durable knowledge changed -> target wiki page>
baseline: none | <block — shape in references/quality-gates.md § Baseline block shape>
<one-line orientation: what cook changed>
next:
names the next runnable phase —
press
(standard chain),
age
(press skipped),
cook
(rerun after a blocker),
mold
(spec needs another pass) — or
done
only for true terminal completion, never a blocked-but-resumable halt;
halt:
reasons follow the package-report stop conditions. The orientation line is one factual sentence. Omit
taste_test:
when the cost gate didn't warrant one.
durable_flags:
is a conservative gate, default
none
. Add one line per architecture/protocol/convention/rationale delta (
<what changed> -> <target wiki page>
); mechanical and test-only changes stay
none
. Cook records flags only — the publish-boundary writer (cure/plate/affinage) reads them as its write-back candidates.
baseline:
is written only when the
## Quality gates
capture rule above ran and recorded at least one identical-to-baseline failure; omit it otherwise. Block shape:
references/quality-gates.md
§ Baseline block shape.
.cheese/cook/<slug>.md
顶部写入最简格式的交接slug——与报告同文件,无需单独文件——以便下游阶段(以及cook自身编排wave时的fan路径)无需重新读取即可恢复或链式调用。Schema如下:
markdown
status: ok | halt: <单行原因>
next: mold | cook | press | age | done
artifact: <若有,指向更详细报告的路径>
taste_test: inline-pass | dispatched-pass | revised | deferred-to-orchestrator
durable_flags: none | <每行一个标志:变更的持久化知识 -> 目标wiki页面>
baseline: none | <块——格式见references/quality-gates.md § 基线块格式>
<单行说明:cook做了哪些变更>
next:
指定下一个可运行的阶段——
press
(标准流程)、
age
(跳过press)、
cook
(解决阻塞后重新运行)、
mold
(规范需再次调整)——或仅当真正完成时设为
done
,绝不能将可恢复的阻塞设为
done
halt:
原因需遵循包报告的停止条件。说明行应为一句事实陈述。若成本关卡无需尝试验证,则省略
taste_test:
durable_flags:
为保守型关卡,默认值为
none
。每发生一处架构/协议/惯例/原理变更,添加一行(
<变更内容> -> <目标wiki页面>
);仅涉及机械性或测试的变更保持
none
。Cook仅记录标志——发布边界的写入者(cure/plate/affinage)会读取这些标志作为写入候选。
仅当上述「质量关卡」捕获规则运行并记录至少一处与基线相同的失败时,才写入
baseline:
;否则省略。块格式见:
references/quality-gates.md
§ 基线块格式。

Handoff

交接

Pipeline: culture → mold → [cook] → press → age → cure → plate
After the package-ready report and handoff slug are on disk, ask via the shared handoff gate in
../cheese/references/handoff-gate.md
(its Standard forward-step menu): lead each option with the verb, backed by the skill command (with any in-scope
--hard
):
  • Harden tests before review (recommended)
    /press <slug>
    .
  • Plate it
    /press <slug> --auto --open-pr
    : run the remaining review chain, then
    /plate
    resolves topology and publishes.
  • Checkpoint & stop
    /wheypoint
    : write a resumable handoff and pause.
  • Stop — dispatch none; leave further hardening for later.
Pre-select Harden tests before review when the diff added new behaviour or touched untested seams. To skip straight to review, reply
other: /age <slug>
; manual chaining works via each step's own gate. Never dispatch before selection; run the selected command immediately.
When invoked with
--auto
, skip this gate entirely and proceed straight into the auto-mode chain (see
## Auto mode
below).
流水线: culture → mold → [cook] → press → age → cure → plate
当可打包报告和交接slug写入磁盘后,通过
../cheese/references/handoff-gate.md
中的共享交接节点询问(其标准前进步骤菜单):每个选项以动词开头,后跟Skill命令(含适用的
--hard
):
  • 审核前强化测试(推荐)——
    /press <slug>
  • 提交PR——
    /press <slug> --auto --open-pr
    :运行剩余的审核链,然后
    /plate
    解析拓扑并发布。
  • 检查点并停止——
    /wheypoint
    :写入可恢复的交接并暂停。
  • 停止——不分派任何命令;后续强化工作留待以后进行。
当变更添加了新行为或涉及未测试的衔接点时,默认选中审核前强化测试。若要直接跳至审核,回复
other: /age <slug>
;可通过每个步骤的节点手动链式调用。绝不能在用户选择前分派命令;选定后立即运行对应命令。
若调用时使用了
--auto
,则完全跳过此节点,直接进入自动模式链(见下文「自动模式」)。

Auto mode

自动模式

--auto
is the autonomous-pipeline switch: skip every gate and chain forward without asking between steps. It runs
/press --auto → /age --auto → /cure --auto --stake medium+
, capped at two cure passes total — pass 1 fixes the initial findings, pass 2 fixes anything the re-age surfaces, then the chain stops regardless of remaining findings.
/cook
itself never invokes
/plate
;
/cure
dispatches it at the chain terminal (existing PR always, new PR only with
--open-pr
).
Auto mode stops early when: a quality gate fails new or changed against baseline and the fix rounds exhaust, the no-progress check trips, or the fix is design-shaped;
/press
returns
blocked
; a cure pass cannot apply any finding; or two cure passes complete (success path). Every early stop surfaces the failing skill's report and states the cap reached or the blocker hit — never a silent downgrade.
Read
references/auto-mode.md
before running or dispatching auto mode — it owns the full per-step chain, cap-enforcement mechanics, the fan-pathway no-chain isolation directive (a spawned phase sub-agent never chains forward on its own; the orchestrator drives), cure's per-finding failure handling, and the final-report template.
--auto
是自主流水线开关:跳过所有节点,步骤间无需询问直接链式调用。会运行
/press --auto → /age --auto → /cure --auto --stake medium+
,最多两轮cure迭代——第一轮修复初始问题,第二轮修复重新age后发现的问题,之后无论是否还有剩余问题,流程都会停止。
/cook
自身绝不会调用
/plate
/cure
会在链的终端分派
/plate
(已有PR始终触发,新PR仅在设置
--open-pr
时触发)。
自动模式会提前停止的情况包括:质量关卡检测到新变更或变更内容与基线对比失败且修复次数耗尽、无进度检查触发、修复涉及设计层面变更;
/press
返回
blocked
;cure迭代无法应用任何修复;或完成两轮cure迭代(成功路径)。每次提前停止都会展示失败Skill的报告,并说明已达到限制或遇到阻塞——绝不能静默降级。
在运行或分派自动模式前,请阅读
references/auto-mode.md
——该文档涵盖完整的每步流程、限制执行机制、fan路径的无链隔离指令(生成的阶段子Agent绝不会自行链式调用;由编排器驱动)、cure的单问题失败处理以及最终报告模板。

Rules

规则

  • Keep changes scoped to the accepted contract.
  • Prefer existing dependencies and patterns.
  • Do not invent architecture already rejected by the spec.
  • Stop and ask when implementation reveals a design decision the spec did not answer.
  • If the spec or fast-path request rests on a false premise, stop and surface it before writing code; do not work the wrong angle to honour the request literally.
  • Apply the shared voice kernel (
    ../age/references/voice.md
    ): lead the report with the answer, name loaded assumptions in the contract, flag residual risk as
    certain | speculating | don't know
    .
  • Verification before
    status: ok
    :
    identify the gate command, run it fresh this turn, read the full output, only then claim. Hedging words (
    should
    ,
    probably
    ,
    I think
    ) are banned — state what the gate output showed.
  • 变更范围需符合已确认的契约。
  • 优先使用现有依赖和模式。
  • 不得发明已被规范否决的架构。
  • 当实现过程中发现规范未明确的设计决策时,停止并询问。
  • 若规范或快速路径请求基于错误前提,停止并指出该前提,再编写代码;不得为了字面满足请求而朝着错误方向工作。
  • 应用共享语音内核(
    ../age/references/voice.md
    ):报告开头直接给出结果,在契约中说明隐含假设,将剩余风险标记为
    certain | speculating | don't know
  • 标记
    status: ok
    前需验证
    :明确关卡命令,本次运行时重新执行,读取完整输出,之后再确认状态。禁止使用模糊词汇(
    should
    probably
    I think
    )——需明确说明关卡输出的结果。

Discipline

准则

Iron Law, Red Flags, and the TDD Rationalization table live in
references/cook-discipline.md
.
铁律、警示信号及TDD合理化表格见
references/cook-discipline.md

Agent resolution

Agent解析

Resolve implementation and taste-test dispatches through
../cheese/references/agent-resolution.md
.
WorkPreferred typesPermissions/isolationMinimum powerEffortFallback
Implement the contractcoderwrite, isolated-worktreedefaulthighcompatible coder, then general
Fresh-context taste-testreviewerread-only, fresh-contextpowerfulhighcompatible reviewer, then general
Decompose the specplanner, generalwrite (manifest only), fresh-contextpowerfulhighcompatible planner, then general
Harvest and plateparentparent-owned repository statepowerfulhighno fallback; halt
The canonical cook handoff and package report carry the shared
agent_resolution
block.
通过
../cheese/references/agent-resolution.md
解析实现和尝试验证的分派。
工作内容首选类型权限/隔离最低权限工作量备选方案
实现契约coder写入权限,隔离工作区默认兼容coder,通用型Agent
新视角尝试验证reviewer只读权限,新上下文高权限兼容reviewer,通用型Agent
分解规范planner, general写入权限(仅清单),新上下文高权限兼容planner,通用型Agent
获取并提交parent父级拥有的仓库状态高权限无备选方案;停止运行
标准的cook交接和包报告需包含共享的
agent_resolution
块。