/dkitchen:improve-kitchenfrom dkitchen
Periodically reviews a dkitchen kitchen's recent failures and friction, turns recurring issues into lessons placed at the highest effective rung (remove cause, check, tool, text), and proposes changes for approval.
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, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Rules that live only as text get skipped under pressure. This pass reads what went wrong or cost too much since the last pass, and moves each lesson up the ladder until the failure is hard to repeat.
The repo keeps two files for this skill, both under docs/agents/: improve-kitchen.md for what is specific to this repo (extra evidence sources, where each rung lands, conventions), and improve-kitchen-history.md for past passes. The first pass drafts them in step 0.
The scope is how people and agents work: tickets, reviews, merges, launches, code layout, tools. Lessons about the work's content (design, model-visible text, experiment protocol, results) go to the designers as one line each, outside this pass.
Place each lesson on the highest rung that can hold it.
A rule that already exists and was skipped goes up a rung. Restating it louder is the rung it already failed on.
Read docs/agents/improve-kitchen.md and docs/agents/improve-kitchen-history.md. When either is missing, this is the first pass: draft the missing file in the scratchpad from the templates below, and propose it in step 8 with the rest. Nothing is written to the repo before then.
improve-kitchen.md: a heading per section of This repo's file, filled from the repo: evidence sources the kitchen has beyond the general ones, or "none"; the rule files and checks for step 6; the target of each rung; the repo's conventions, such as the language to report in.improve-kitchen-history.md: one line, "Pass history: newest last. Each pass records its window, adopted changes with their PR or ticket links and the failure each targets, and rejected items with the reason."Done when both files are read, or drafted in the scratchpad.
Read the last entry of the history. The window starts at its date; with no entry, use the last 14 days. List that entry's adopted changes for step 4.
A problem the user names gets searched back to its origin, past the window's start.
Done when the window's start date and the list of changes to re-check are written down.
Work through every evidence source and every extra source in improve-kitchen.md, across the whole window. An incident is one concrete event where work was wrong, redone, stalled, or corrected, recorded with its link, copied from what the tool returned.
Friction counts too: work that finished right at a cost nobody reported, such as repeated reads, failed commands, or a long search. Session records hold it, and they are too large to read. Scan them with a script in the scratchpad, bring only the totals into context, and search the one spot behind a number that stands out. A friction incident is that spot, recorded with its session file and command.
Save the raw list in the scratchpad. It stays out of the repo.
Done when every source is either read for the whole window or named as unread with the reason.
Merge incidents with one cause into a lesson. Name the cause, which is usually earlier than the symptom: why the wrong path was the easy one.
Keep a lesson when one of these holds:
The rest are one-offs. Report only how many there were.
A count is a lead. Keep a friction lesson once its cause is confirmed at the spots behind the count.
Done when each kept lesson has a cause and links to every incident behind it, and every incident is in a lesson or counted as a one-off.
For each change from step 1, search this window's incidents for the failure it targeted, and give one verdict:
Done when each change has a verdict with evidence.
Pick the highest rung that holds, and name the exact file, check, or ticket it lands in, from the rung targets in improve-kitchen.md. Before proposing, read the current target, including open PRs and open tickets that may already cover it, so the proposal fits what is there. A check that already exists but runs too late, only warns, or is broken is the finding: propose wiring it.
A check or tool any kitchen could use belongs in ding. Propose it as a draft issue for the dkitchen repository, which the user files or drops; this pass writes nothing to another repository.
Done when each lesson has one rung, one target, and, for rung 4, a line saying why rungs 1–3 cannot hold it.
Go through the rule files and checks named in improve-kitchen.md, and list:
Pair each lesson's addition with what it retires whenever one exists.
Done when the list is written, with file and line for each item. An empty list states which files were read.
Note which sources gave nothing, which steps took effort without changing a proposal, and which rung labels or thresholds misled you. Turn each into a proposed edit to improve-kitchen.md, or, for this file, a draft issue for the dkitchen repository, with the same evidence standard as any lesson.
Done when there are proposed edits, or a line saying this pass found none.
Send the user the report in the repo's language, in the shape below, with proposals ordered by what the failure cost: spend, lost results, and stalled lines rank above how often or how loudly it came up. Then stop and wait. Everything up to here changes nothing in the repository.
Approval covers exactly the numbered items the user names.
Window: <start date> to <today>; N incidents, M one-offs; unread sources: <none, or the list>
Earlier changes
- <change>: <gone / recurred / not exercised>, <links>
Proposals
1. <the lesson in one sentence>
Evidence: <links…>
Lands in: <rung>, <file, check, or ticket>
Retires: <the text it replaces, or "none">
Subtract only
N. <file:line>: <why it can go>
This skill
N. <what to change>, <evidence>
First pass only
N. docs/agents/improve-kitchen.md and docs/agents/improve-kitchen-history.md, as drafted
write-ticket, with the incidents as its background. Implementation follows the kitchen's normal route.Done when each approved item has a PR or ticket link in the history.
Run from the repo root. SINCE is the window's start, as YYYY-MM-DDT00:00:00Z. In a kitchen kept in its own repo (ding kitchen names both), read each source where it lives: tickets, rulings, and the log in the kitchen repo; PRs, CI runs, Guard-change: commits, and the executors' transcripts in the code repo and its worktrees; the standing roles' transcripts in the kitchen's checkout. The role names, signatures, status words, review lines, and the log ticket come from the repo's .dkitchen.toml, or ding's defaults where it sets none.
gh api "repos/<owner>/<repo>/issues/comments?since=$SINCE&per_page=100" --paginate --slurp. since filters on the update time, so older comments come back too; compare created_at with the window. Every role posts under one GitHub account, so tell authors apart by signature. Look for reviews that did not pass, blocked statuses, reruns, reverted decisions, and repeated requests.[log] issue is set: the same comments, filtered to that ticket. Look for missed waits, wrong releases, and stalled cards.~/.claude/projects/<the path with every / replaced by ->/*.jsonl, in files changed since the window's start. Take records with type: user and a string message.content. Skip content that is not the user's own words: text starting with < (command wrapping), Another Claude session sent a message: (a relay from another role), or This session is being continued from a previous conversation (a compaction summary). Keep the relays in a separate list. They are not corrections, but a relay that widened or changed what the user decided is an incident of its own. Deduplicate by text, since the same message recurs across forked transcripts.type: feedback files in that project's memory/ folder changed since the window's start. Each one is a correction somebody chose to keep.ding waits --minutes 60. It reads every open ticket and can take minutes; give it a long timeout or run it in the background.mergedAt. Long gaps are stalled merges; check the log before counting one, since some are deliberate holds.ding check: failed runs of its CI workflow in the window (gh run list --workflow <file> --status failure --created ">=<date>" --json headBranch,url,createdAt), and git log --since=<date> --grep 'Guard-change:'. Look for failures on correct code, and for checks that were loosened.~/.codex/sessions/**/*.jsonl whose working directory is the repo or one of its worktrees. A payload.type of custom_tool_call holds the commands; custom_tool_call_output holds their exit codes and output sizes, in the same order, and says when output was truncated. Pair the n-th exit code with the n-th command of the same call.tool_use items, and user tool_result items with is_error. Leave out errors the host app produced rather than the repo, such as hook timeouts.blocked in the window. For each Waiting on category (review, merge, the user, design, a job or run), report the count, the median, and the longest time from the blocked comment to the executor's next status change, or to now for a wait still open. Long review-or-merge waits point at work stalled on PRs. A high count of short waits does not: some are gates the rules set on purpose, such as heavy runs waiting for the verifier to sample first.docs/agents/improve-kitchen.md holds these sections:
Extra evidence sources: anything else that records what went wrong in this repo, with the command that reads it, such as run summaries or a cost ledger.
Rule files and checks for step 6: AGENTS.md, CLAUDE.md, the files in docs/agents/, and the checks in [check] of .dkitchen.toml, plus any guards in the repo's own code that stop runs.
Where each rung lands:
| Rung | Target |
|---|---|
| Check | a script in the tools area, listed in [check] commands; a merge gate in [merge] |
| Tool | a command in the tools area; ding, through a dkitchen issue, when any kitchen could use it |
| Text | judgement on code: docs/agents/reviewing.md; a recurring situation: a row of known situations in docs/agents/roles.md; otherwise the docs/agents/ file that owns the topic; AGENTS.md and CLAUDE.md take pointers only |
Conventions: the language to report in, who approves merging rule files, and anything else the user set for these passes.
What SKILL.md sets; muted values are Claude Code's defaults
11 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-runnerBuild or change the experiment runner of a dkitchen kitchen in this repo — one resumable entry point for work done item by item (evaluations, batch inference, data processing), with run identity and per-item commits. Use when the user asks to set up a runner, make runs resumable, or stop writing one script per experiment.npx claudepluginhub 917dhj/dkitchen --plugin dkitchenOther plugins' skills for the same job