/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 . 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 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:
- — autonomous mode: skip every handoff gate and chain (see below; full selection/cap rules in ).
- — propagate through
/press → /age → /cure → /plate
; fires after its final artifact-writing gate.
- — propagate to terminal , which follows its explicit-choice and review-shape policy for a new PR.
- — resume a crashed fan run from its manifest (full mechanics:
references/fan-pathway.md
§ --resume).
Standalone fast-path
runs without
when the task is unambiguous. Treat a request as unambiguous when
all three are present or trivially derivable:
- 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.
Flow
- 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.
- Cut — write failing tests for the changed behaviour. See .
- 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 .
- Hand off — produce the package-ready report (
references/package-report.md
), write the handoff slug ( below), and prompt the next step via the shared handoff gate (see below). The default chain is → → .
Fan pathway
'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
/
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.
(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".
(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
-schema block (
,
,
), 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
is set. The count is an upper bound,
, excluding wiring; the derivation lives in
references/fan-pathway.md
§ Phase-chain topology.
Wave cap. Waves are capped at
curds, enforced by
in
— 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,
, and resolution provenance.
A terminal age is
publishable only with ;
or a missing
halts — this applies to both fan-pathway tables (
references/fan-pathway.md
) and the single-coder
chain's terminal age (
below).
Baseline 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:
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
as optional host-provided fallback.
The handoff blocks below are the portable contract; slash commands are host renderings, not the control model.
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 | , package scripts | 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.
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
references/quality-gates.md
; every downstream phase links there instead of restating it.
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 → → .
Handoff 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:
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>
names the next runnable phase —
(standard chain),
(press skipped),
(rerun after a blocker),
(spec needs another pass) — or
only for true terminal completion, never a blocked-but-resumable halt;
reasons follow the package-report stop conditions. The orientation line is one factual sentence. Omit
when the cost gate didn't warrant one.
is a conservative gate, default
. Add one line per architecture/protocol/convention/rationale delta (
<what changed> -> <target wiki page>
); mechanical and test-only changes stay
. Cook records flags only — the publish-boundary writer (cure/plate/affinage) reads them as its write-back candidates.
is written only when the
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.
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
):
- Harden tests before review (recommended) — .
- Plate it —
/press <slug> --auto --open-pr
: run the remaining review chain, then resolves topology and publishes.
- Checkpoint & stop — : 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
; manual chaining works via each step's own gate. Never dispatch before selection; run the selected command immediately.
When invoked with
, skip this gate entirely and proceed straight into the auto-mode chain (see
below).
Auto mode
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.
itself never invokes
;
dispatches it at the chain terminal (existing PR always, new PR only with
).
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;
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.
Read
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.
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 : identify the gate command, run it fresh this turn, read the full output, only then claim. Hedging words (, , ) are banned — state what the gate output showed.
Discipline
Iron Law, Red Flags, and the TDD Rationalization table live in
references/cook-discipline.md
.
Agent resolution
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.