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 , then read
SPEC=$(python3 shared/scripts/artifact_path.py specs <slug>). If you're on a host that only exposes the packaged helper,"$SPEC"is the fallback. The resolver anchors specs at the per-project durable corpus (seepython3 ${CLAUDE_SKILL_DIR}/scripts/cook.pyz artifact-path specs <slug>§ Corpus location); this is the form../cheese/references/formatting.mduses when chaining./ultracook - 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:
- — autonomous mode: skip every handoff gate and chain
--auto(see/press → /age → /curebelow; full selection/cap rules in## Auto mode).references/auto-mode.md - — propagate through
--hard;/press → /age → /cure → /platefires/plateafter its final artifact-writing gate./hard-cheese - — propagate to terminal
--open-pr, which follows its explicit-choice and review-shape policy for a new PR./plate - — resume a crashed fan run from its manifest (full mechanics:
--resume <slug>§ --resume).references/fan-pathway.md
接受以下任一输入:
- 规范路径。若为明确路径,直接读取其指向的内容。
- 纯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,后者会遵循其针对新PR的明确选择和审核流程策略。/plate - ——从其清单恢复崩溃的fan运行(完整机制见
--resume <slug>§ --resume)。references/fan-pathway.md
Standalone fast-path
独立快速路径
/cook/mold- Inputs/outputs are clear. "Tail returns wrong byte count when file ends without newline" ✓; "make tail better" ✗.
- Scope is bounded. A named function, a single failing test, a specific call site, or a small region of one or two files.
- 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. ), treat Contract as a one-sentence restatement of the request, and proceed directly to Cut without a spec round-trip. Route to only when one of the three checks fails — silent ambiguity is the cardinal sin.
tail-trailing-newline/mold当任务明确时,无需即可运行。当以下三点全部满足或可轻松推导时,视为任务明确:
/cook/mold- 输入/输出清晰。例如“当文件末尾无换行符时,tail返回错误的字节数” ✓;“优化tail工具” ✗。
- 范围有限。涉及某个命名函数、单个失败测试、特定调用点,或一两个文件中的小范围区域。
- 验证方式明确。存在可修复的失败测试,或可运行的命令,其输出应按指定方式改变。
当快速路径适用时,从任务中生成slug(例如),将「契约」视为对请求的一句重述,直接进入「编码实现」环节,无需往返确认规范。仅当上述三项检查中有一项不满足时,才转向——隐性歧义是大忌。
tail-trailing-newline/moldFlow
流程
- 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 exists, read it before implementation so naming follows the resolved canonical terms.
.cheese/glossary/<slug>.md - Cut — write failing tests for the changed behaviour. See .
references/tdd-loop.md - Implement — make the cut tests pass with the smallest production change.
- Taste-test — check spec drift, readability, scope, plus three fresh-context lenses (production path, wired callers, locked-decision). Dispatch the fresh-context 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
reviewer.references/tdd-loop.md - Hand off — produce the package-ready report (), write the handoff slug (
references/package-report.mdbelow), and prompt the next step via the shared handoff gate (see## Handoff slugbelow). The default chain is## Handoff→/press→/age./cure
- 契约——确认行为、非目标、可能的范围、质量关卡。对于独立快速路径任务,契约就是对用户请求的一句重述。若存在,在实现前先读取,确保命名符合已解析的规范术语。
.cheese/glossary/<slug>.md - 编码准备(Cut)——为变更后的行为编写失败测试。详见。
references/tdd-loop.md - 实现——以最小的生产代码变更让准备阶段的测试通过。
- 尝试验证(Taste-test)——检查规范偏差、可读性、范围,同时从三个新视角(生产路径、关联调用方、已锁定决策)进行验证。若涉及多文件或公共接口变更,分派「审核者(reviewer)」进行新视角检查;否则进行内联检查。最多两轮验证。成本关卡、审核者模型固定、以及编码嵌套降级规则见。
references/tdd-loop.md - 交接——生成可打包的报告(详见),写入交接slug(见下文「交接slug」),并通过共享交接节点提示下一步(见下文「交接」)。默认链式流程为
references/package-report.md→/press→/age。/cure
Fan pathway
Fan路径
/cook(a) Curded spec. If the spec already carries an embedded / block (produced by '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.
curds:waves:/mold(b) Un-curded, small. Ordinary single-coder Cut → Implement → Taste-test, unchanged from today's ( above). Sizing signal: '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".
/cook## Flow/mold(c) Un-curded, big. Dispatch the decomposer per (the locked curd-block schema — do not use , which produces the incompatible legacy manifest schema) against the spec text to produce a -schema block (, , ), then validate it with . 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 is set. The count is an upper bound, , excluding wiring; the derivation lives in § Phase-chain topology.
../cheese/references/decomposer.md../ultracook/references/decomposer-prompt.mdcurd_blockcurds[]waves[]decomposer{}src/fanout/curd_block.py::validate_curd_block--auto5 + 5 x curdsreferences/fan-pathway.mdWave cap. Waves are capped at curds, enforced by in — cited, not reimplemented here.
<=4MAX_WAVE_SIZEsrc/fanout/curd_block.pyRead 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, , and resolution provenance.
references/fan-pathway.md--resume <slug>A terminal age is publishable only with ; or a missing halts — this applies to both fan-pathway tables () and the single-coder chain's terminal age ( below).
next: donenext: curenextreferences/fan-pathway.md--auto## Auto mode/cook(a) 含凝块(curd)的规范。若规范已包含嵌入的/块(由的凝块生成步骤或同级凝块的先前分解产生),直接跳至下文的wave分支——分解已锁定,无需重新执行分解步骤。
curds:waves:/mold(b) 未凝块的小型任务。采用普通的单人编码流程:编码准备→实现→尝试验证,与当前的流程一致(见上文「流程」)。规模判断依据:的凝块数量提示仅作参考;否则使用验收标准数量和编辑位点估算。根据规范的cook关卡行:“未凝块(有curd块则用,否则用验收标准数量和编辑位点估算) | 单人/分支/先分解;wave计划;传输方式”。
/cook/mold(c) 未凝块的大型任务。根据(已锁定的curd块 schema——请勿使用,其生成的是不兼容的旧版清单schema)分派分解器处理规范文本,生成-schema块(, , ),然后通过进行验证。向用户展示wave计划及预估的Agent调用次数,确认是否继续——表述为:“12项验收标准 → 5个curd,2个wave,最多30次Agent调用。是否开始?”——除非设置了。次数为上限值,计算公式为,不含关联操作;推导方式见 § 阶段链拓扑。
../cheese/references/decomposer.md../ultracook/references/decomposer-prompt.mdcurd_blockcurds[]waves[]decomposer{}src/fanout/curd_block.py::validate_curd_block--auto5 + 5 x curdsreferences/fan-pathway.mdWave上限。每个wave最多包含个curd,由中的强制限制——此处仅作引用,不重复实现。
<=4src/fanout/curd_block.pyMAX_WAVE_SIZE在编排wave分支运行前,请阅读——该文档涵盖现有交接防护、模式选择、发布拓扑预检、milknado衔接、阶段链拓扑、确定性阶段循环、Worker耗尽/聚合关卡恢复、工作区获取与清理、以及解析来源。
references/fan-pathway.md--resume <slug>仅当时,最终的age环节才是可发布状态;若为或缺失则停止——此规则适用于fan路径表()和单人编码链的最终age环节(见下文「自动模式」)。
next: donenext: curenextreferences/fan-pathway.md--autoBaseline capture
基线捕获
Before any curd cooks, 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: .
/cookreferences/quality-gates.mdFor source changes, call the selected backend directly and follow , including search → fresh bounded read → stale-safe write.
code-intelligence-routing.mdPortability reference: . It covers helper resolution, sub-agent dispatch, GitHub operations, and handoff transitions; prefer the bundled or repo-local helper first, and treat as optional host-provided fallback.
The handoff blocks below are the portable contract; slash commands are host renderings, not the control model.
../cheese/references/harness-portability.md${CLAUDE_SKILL_DIR}在任何curd开始处理前,会在编排器自身的工作树中,于模式选择完成后一次性捕获运行的宽基线。完整的捕获步骤、分类、传递及修复路径见:。
/cookreferences/quality-gates.md对于源代码变更,直接调用选定的后端,并遵循,包括搜索→新范围读取→防过时写入。
code-intelligence-routing.md可移植性参考:。该文档涵盖辅助工具解析、子Agent分派、GitHub操作及交接转换;优先使用打包或仓库本地的辅助工具,将视为可选的主机提供备选方案。
下文的交接块是可移植契约;斜杠命令是主机渲染形式,而非控制模型。
../cheese/references/harness-portability.md${CLAUDE_SKILL_DIR}Preferred tools and fallbacks
首选工具与备选方案
| Need | Prefer | Fallback |
|---|---|---|
| Diffs | | plain |
| GitHub context | | local git history or user-provided links |
| Merge assistance | mergiraf | manual conflict resolution with tests |
| Task commands | | direct documented commands |
| Code navigation | semantic symbol search, then caller search | LSP or bounded native search; report precision loss |
| Read before edit | fresh bounded read from the write backend family | another snapshot-capable bounded read; re-read if anchors are incompatible |
Falling back, mention any loss of precision that affects risk.
| 需求 | 首选工具 | 备选方案 |
|---|---|---|
| 差异对比 | | 原生 |
| GitHub上下文 | | 本地git历史或用户提供的链接 |
| 合并辅助 | mergiraf | 结合测试手动解决冲突 |
| 任务命令 | | 直接使用文档化命令 |
| 代码导航 | 语义符号搜索,然后调用方搜索 | 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 block shape are the shared reference ; every downstream phase links there instead of restating it.
baseline:references/quality-gates.md仅运行现有项目命令——针对受影响区域的最相关测试,加上已定义的lint/类型检查/构建命令。绝不能为了让变更通过而移除、跳过或弱化无关测试。
关卡失败会考虑基线情况。策略、分类体系及块格式见共享参考文档;所有下游阶段均链接至该文档,不再重复说明。
baseline:references/quality-gates.mdOutput
输出
House style and citations: . Authoritative report shape: ; the bullets below sketch it:
../cheese/references/formatting.mdreferences/package-report.md- Files changed and why.
- Tests or checks run.
- Remaining risks or skipped checks.
- Suggested next skill: usually →
/press→/age./cure
格式风格与引用规范:。权威报告格式:;以下要点为概述:
../cheese/references/formatting.mdreferences/package-report.md- 变更的文件及原因。
- 运行的测试或检查。
- 剩余风险或跳过的检查。
- 建议的下一步Skill:通常为→
/press→/age。/cure
Handoff slug
交接slug
Write a minimum-shape handoff slug at the top of — 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:
.cheese/cook/<slug>.mdmarkdown
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:pressagecookmolddonehalt:taste_test:durable_flags:none<what changed> -> <target wiki page>nonebaseline:## Quality gatesreferences/quality-gates.md在顶部写入最简格式的交接slug——与报告同文件,无需单独文件——以便下游阶段(以及cook自身编排wave时的fan路径)无需重新读取即可恢复或链式调用。Schema如下:
.cheese/cook/<slug>.mdmarkdown
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:pressagecookmolddonedonehalt:taste_test:durable_flags:none<变更内容> -> <目标wiki页面>none仅当上述「质量关卡」捕获规则运行并记录至少一处与基线相同的失败时,才写入;否则省略。块格式见: § 基线块格式。
baseline:references/quality-gates.mdHandoff
交接
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 (its Standard forward-step menu): lead each option with the verb, backed by the skill command (with any in-scope ):
../cheese/references/handoff-gate.md--hard- Harden tests before review (recommended) — .
/press <slug> - Plate it — : run the remaining review chain, then
/press <slug> --auto --open-prresolves topology and publishes./plate - Checkpoint & stop — : write a resumable handoff and pause.
/wheypoint - 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 ; manual chaining works via each step's own gate. Never dispatch before selection; run the selected command immediately.
other: /age <slug>When invoked with , skip this gate entirely and proceed straight into the auto-mode chain (see below).
--auto## Auto mode流水线: culture → mold → [cook] → press → age → cure → plate
当可打包报告和交接slug写入磁盘后,通过中的共享交接节点询问(其标准前进步骤菜单):每个选项以动词开头,后跟Skill命令(含适用的):
../cheese/references/handoff-gate.md--hard- 审核前强化测试(推荐)——。
/press <slug> - 提交PR——:运行剩余的审核链,然后
/press <slug> --auto --open-pr解析拓扑并发布。/plate - 检查点并停止——:写入可恢复的交接并暂停。
/wheypoint - 停止——不分派任何命令;后续强化工作留待以后进行。
当变更添加了新行为或涉及未测试的衔接点时,默认选中审核前强化测试。若要直接跳至审核,回复;可通过每个步骤的节点手动链式调用。绝不能在用户选择前分派命令;选定后立即运行对应命令。
other: /age <slug>若调用时使用了,则完全跳过此节点,直接进入自动模式链(见下文「自动模式」)。
--autoAuto mode
自动模式
--auto/press --auto → /age --auto → /cure --auto --stake medium+/cook/plate/cure--open-prAuto 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; returns ; 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.
/pressblockedRead 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.
references/auto-mode.md--auto/press --auto → /age --auto → /cure --auto --stake medium+/cook/plate/cure/plate--open-pr自动模式会提前停止的情况包括:质量关卡检测到新变更或变更内容与基线对比失败且修复次数耗尽、无进度检查触发、修复涉及设计层面变更;返回;cure迭代无法应用任何修复;或完成两轮cure迭代(成功路径)。每次提前停止都会展示失败Skill的报告,并说明已达到限制或遇到阻塞——绝不能静默降级。
/pressblocked在运行或分派自动模式前,请阅读——该文档涵盖完整的每步流程、限制执行机制、fan路径的无链隔离指令(生成的阶段子Agent绝不会自行链式调用;由编排器驱动)、cure的单问题失败处理以及最终报告模板。
references/auto-mode.mdRules
规则
- 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 (): lead the report with the answer, name loaded assumptions in the contract, flag residual risk as
../age/references/voice.md.certain | speculating | don't know - Verification before : identify the gate command, run it fresh this turn, read the full output, only then claim. Hedging words (
status: ok,should,probably) are banned — state what the gate output showed.I think
- 变更范围需符合已确认的契约。
- 优先使用现有依赖和模式。
- 不得发明已被规范否决的架构。
- 当实现过程中发现规范未明确的设计决策时,停止并询问。
- 若规范或快速路径请求基于错误前提,停止并指出该前提,再编写代码;不得为了字面满足请求而朝着错误方向工作。
- 应用共享语音内核():报告开头直接给出结果,在契约中说明隐含假设,将剩余风险标记为
../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.mdAgent resolution
Agent解析
Resolve implementation and taste-test dispatches through .
../cheese/references/agent-resolution.md| Work | Preferred types | Permissions/isolation | Minimum power | Effort | Fallback |
|---|---|---|---|---|---|
| Implement the contract | coder | write, isolated-worktree | default | high | compatible coder, then general |
| Fresh-context taste-test | reviewer | read-only, fresh-context | powerful | high | compatible reviewer, then general |
| Decompose the spec | planner, general | write (manifest only), fresh-context | powerful | high | compatible planner, then general |
| Harvest and plate | parent | parent-owned repository state | powerful | high | no fallback; halt |
The canonical cook handoff and package report carry the shared block.
agent_resolution通过解析实现和尝试验证的分派。
../cheese/references/agent-resolution.md| 工作内容 | 首选类型 | 权限/隔离 | 最低权限 | 工作量 | 备选方案 |
|---|---|---|---|---|---|
| 实现契约 | coder | 写入权限,隔离工作区 | 默认 | 高 | 兼容coder,通用型Agent |
| 新视角尝试验证 | reviewer | 只读权限,新上下文 | 高权限 | 高 | 兼容reviewer,通用型Agent |
| 分解规范 | planner, general | 写入权限(仅清单),新上下文 | 高权限 | 高 | 兼容planner,通用型Agent |
| 获取并提交 | parent | 父级拥有的仓库状态 | 高权限 | 高 | 无备选方案;停止运行 |
标准的cook交接和包报告需包含共享的块。
agent_resolution