/dkitchen:build-runnerfrom dkitchen
Builds or modifies a resumable experiment runner for a dkitchen kitchen repo, providing a single entry point for item-by-item work like evaluations, batch inference, and data processing.
Ships in dkitchen. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Give the repo one runner for its item-by-item work, written by you in the repo's library and shaped to what the repo runs, plus docs/agents/runner.md from kitchen/runner/, its pointer line, and tests that keep the runner honest. Without a runner, every experiment carries its own loop with its parameters in code, and every fix to the loop is a copy; with one, an experiment is a spec and a task function.
You write the runner; this skill gives you a reference to read, not code to copy. reference/runner.py shows the hard parts working in one file; The core logic says what each must guarantee and where it goes wrong. The repo's runner keeps every guarantee and takes the shape the repo needs.
Follow Installing for the prerequisites, language, rendering, updating in place, pointer blocks, and approval. When /setup-dkitchen brought you here, the prerequisites and the language are already settled: skip them.
runner.py, the toy task function toy_task.py, and test_runner.py, the behaviours every runner must keep.docs/agents/code.md and [check] in .dkitchen.toml must exist, since the runner goes in the library area and its checks run under ding check. When they are missing, stop and offer build-repo first. The runner is Python only, as build-repo's checks are.docs/agents/runner.md, and any runner module already in the library, read in full when present.Done when you can name, with evidence, the work the runner would carry, the services it calls, and the config format.
Summarize the scripts that fit and those that do not, how each handles resuming and failures today, and where service names appear. When nothing in the repo runs item by item, say so and recommend not installing the runner.
Ask the sections as rounds, as Installing says. C and E wait for B, since the spec's fields decide which services and identity fields exist.
A. Scope. The runner carries new item-by-item runs. Recommend leaving existing scripts as they are: they move to the runner when a ticket changes them.
B. The spec. Propose the fields from the work found: items, arms with a task function and its arguments, passes, concurrency, output, inputs, and what the repo's runs add, such as models and generation settings. Recommend the repo's config format; with none, TOML.
C. Services. When runs call models or services, propose one registry module in the library that holds every name, address, and client setting, and one way in for task functions, such as ctx.client(name). Recommend the service-name check below. A repo that calls no services has neither.
D. Place and command. The runner's module in the library, and its command, such as python -m <package>.runner <spec>.
E. Identity. Recommend that only concurrency and the output folder stay outside the run identity. Anything else left out is the user's choice, with the reason.
Done when every section has an answer.
Show the user:
docs/agents/runner.md (a diff when updating), and the new pointer blocks;[check] commands, when there is a registry;code.md's reuse sentence naming the runner and the registry.Done when the user approves the draft.
Render with --templates runner, as Installing says, then fill and translate. Rewrite both pointer blocks from what render.py prints. Write the runner, the registry, the tests, and the check. In a kitchen kept in its own repo, these are the code repo's code: write them in a worktree of the code repo, on a ticket, and they land as a PR opened with ding pr. Adding to [check] commands is a guard change: the commit carries Guard-change: #<ticket> <reason>.
Done when every approved file exists with its approved content.
Run the checks in Installing, then:
ding check --base HEAD passes;ding launch --progress <output>/progress.json shows its progress on ding board.Done when every check passes, or the user has been told exactly which one fails and why.
Tell the user, briefly: new runs are a spec and a task function, started with the runner's command under ding launch; rerunning the command resumes; changing the spec or an input needs a new output folder, and changing code does not; summary.json says how every run ended; and what the runner leaves out (below) is theirs to add when a run needs it.
Each part below is one guarantee. Keep all six; shape the code to the repo.
The identity is a digest of the spec without its operational fields, plus a content digest of every input: the item source, the spec's input files, and each task module's INPUTS. run.json holds it, written when the run starts.
run.json (commit, and a digest of the task modules for uncommitted edits), warns in the log, and goes on. Each result records its segment. This is what lets code change in place: no copies to keep old runs reproducible.INPUTS misses files a task reads indirectly, such as a template included by another; excluding a field from identity is a decision, not a convenience.One job writes an output folder: an exclusive flock on a file in it, held for the whole job. The OS releases it when the process dies, even on SIGKILL, so no stale lock is left. Inside the job, only the main thread writes.
Each (item, arm, pass) is one file, written atomically: a temp file in the same folder, flushed and fsynced, then os.replace. The main thread keeps at most concurrency items in flight and commits each the moment it finishes.
os.replace a copy across filesystems.The original command resumes. After the identity check, load every committed result, skip the succeeded ones, and redo the rest. A result that does not parse stops the job: it is evidence of a bug, kept and investigated. A leftover temp file is a write that never committed, and is removed.
A failure of one item never stops the run. Retry the same input a bounded number of times (3 in the reference), then commit the item as failed, with its error kind, message, and traceback, and go on. A failed item counts as wrong and stays in the denominator; the next job retries it.
StopRun, such as on an authentication error.python -m pkg.runner, the module runs as __main__, and a task function's from pkg.runner import StopRun gets a second class that except StopRun never catches. Keep StopRun in a module that is never __main__, or have __main__ call into the imported module, as the reference does.progress.json uses the progress-v1 shape ding board reads: schema, state, stage, current with done, total, and failed, rate_per_hour, eta, updated. It is display only, never read back as state.summary.json is written however the job ends: SIGINT and SIGTERM become exceptions so the finally runs. It holds the state, the stop reason, counts from what is on disk, the failed items, and the segments. Exit 0 when every item succeeded, 1 when the run finished with failures, 2 when it stopped.With a registry, write a check script in the tools area and list it in [check] commands. It reads every model and service name from the registry, takes the lines git diff <base> adds under the experiments area (ding check passes --base <commit>), and fails, with file and line, on a string that equals a registered name. Lines already in the repo are left alone, so the check holds from the first PR with no exception list.
The reference leaves out spec schema checks beyond unknown keys, the service layer, checkpoint and canary rules, a cost ledger, pausing in place to recheck a service or disk, and GPU placement. Add one when a run needs it, keeping the six guarantees.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub 917dhj/dkitchen --plugin dkitchen11 skills in this plugin
/build-nightBuild or change how a dkitchen kitchen keeps working while the user is away — night orders, what the orchestrator moves forward on its own, and the orchestrator log. Use when the user asks for the kitchen to keep moving overnight or while they are away./build-repoBuild or change the code rules and checks of a dkitchen kitchen in this repo — the areas code goes in, changing modules in place, reuse, and the ding check gates in CI. Use when the user asks to set up repo rules, add or change a check, or stop the repo from filling up with copies./build-teamBuild or change the team of a dkitchen kitchen in this repo — its roles, design lines, tickets, PR review, watches, run budgets, and model-visible text rules. Use when the user asks to set up the kitchen's team, add or split a designer, or change how the roles work together./goodmorningWhen the user is back, close the night orders and report what needs their decision, how the orders were used, where work stalled, and what moved. Run in the orchestrator session./goodnightBefore the user goes offline, collect every decision the next hours will need, get the user's approvals and boundaries in one pass, and post them as night orders. Run in the orchestrator session./improve-kitchenPeriodic pass over a dkitchen kitchen's recent failures and friction. Turns each recurring one into a lesson, places it where it is hardest to ignore, retires the text that placement replaces, and brings proposals to the user for approval.Other plugins' skills for the same job