agentleFS
gurinderugurinderu/craft/AGENTS.md

craft

AGENTS.md1 starsChanged 39 days agoMITView on GitHub

  • Deletes or force-pushes
  • Commits and pushes

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Retrieve state, do not recall it: No source for "we decided…" — read the realm or the repo before acting.

    line 27
  2. Very specific:

    No hook guards this order — a hook's context reaches the model only after the command has run (realm @nick/craft, #289), so the post-push …

    line 71
  3. Very specific:

    Always a fresh agent: every review, a delta check after a fix included, is a new agent with a clean context — never SendMessage to a prior …

    line 214

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

craft

The craft plugin ships engineering skills, review agents, and a review workflow engine to other repositories.

Project

  • Nature: production; one relaxation — the gate always runs whole, no affected-only mode (realm @nick/craft, #118; agreed: owner).
  • Cost of breakage: external and silent — craft runs in repositories it never sees, and none of its failures fail loudly: a degraded check reads as a clean one (agreed: owner).
  • Consumers: anyone who installs craft — the Claude Code marketplace (.claude-plugin/marketplace.json), the OpenCode delivery, the Codex plugin, the pi package; they learn of breakage only by its effects — a skill that never triggers, a review that silently drops a check, an agent advising on code it never read (agreed: owner).
  • Stack: Node.js 22 (CI pin), ESM JavaScript with JSDoc types, no runtime dependencies; the OpenCode plugin in TypeScript; the craft CLI in Rust (toolchain pinned in cli/rust-toolchain.toml); the gate is a root justfile (just 1.51.0, pinned in CI) whose runner and completeness check are the cli/xtask crate; skills and agents are Markdown with YAML frontmatter.
  • Gate: just gate (npm run gate its alias for one release); the Rust CLI — CI's rust job, "Commands".
  • Layout: code map — "Project structure" below and MAP.md; gotchas — realm rule nodes on the steps they constrain.
  • Feedback reflection: yes — template default.
  • Workflow-suite interop: none — no coercive suite installed.

Persistence rules

State lives in the repo or in the realm — nowhere else. The harness's built-in memory (memory directory, conversation summaries, /tmp, machine-local files) is forbidden entirely, not by category; the temporary directory is only the session's scratch, and the session cleans it up.

  • Repo: code, configs, rituals (how to act here), branch state.
  • Realm: decisions, substantive questions (vimarshas), plans (the transformation map), lessons; gotchas — per the "Layout" slot. Do not restate the realm in the repo — link it.
  • Case (a conversation on a realm node): a one-off brief, question, agreement, acceptance; the progress and outcome of work — as lines of its summary ("Work runs in the realm" below); the state of what the work changes — in the realm.
  • Retrieve state, do not recall it. No source for "we decided…" — read the realm or the repo before acting.
  • A node is not recorded until the thing pulling it is named — which kriya breaks if it disappears? Hiding places and the form of a write — the writing skill.
  • Whose fact is this? — ask always, over the harness's memory instruction; before finishing, place every durable fact of the conversation: a code property, ritual, command or procedure of this repo → this file; a gotcha → its home by "Layout"; the meaning of code (decisions, grounds, links) and knowledge that outlives a refactor → the @nick/craft realm, a decision as a node at once; a substantive question or obligation → a vimarsha; a one-off → a word in a case; work progress → node modes; about another project → that project's realm. A rule or method of this project itself — here, by authority. The user's own is not written here: where it lives — the iskron door.
  • Project instructions are held by committed working-tree files (AGENTS.md, the hooks file) and the project realm — never a global instructions file, harness memory, or user hooks; personal preferences are not copied into the project; installing a delivery (bridge, plugin) is delivery, not configuration.
  • craft's review memory is the realm. A decision on a review finding — a rejection with its why, a deferral, a stance on a class of findings — is recorded with craft:memory (record-decision, record-question, record-rule) into the @nick/craft realm, by the realm's writing rules (writing) and with the record's kind in the node's craft_kind attribute and its date (YYYY-MM-DD) in craft_date beside it: a later review recalls by that attribute, so a why left only in a PR thread or a case line is not recalled, and the next round raises the finding again. A record here carries no commit (no SHA enters the realm); a record of a finding raised on a pull request links that pull request's URL (https://github.com/gurinderu/craft/pull/<N>) — the one pull-request reference a node carries: a Links: <url> line at the end of the record's text, as skills/memory/backends.md writes links in a store whose relations hold no URL — never in its name or attributes. The review checks a record's scope against that pull request's merge on the trunk (realm @nick/craft, #682), so a rejection of a finding in code the pull request itself adds sets the finding aside once it is merged, until that code changes; before the merge, or with no such link, against its date (#676) — the trunk's last commit before that day is the base, so a decision recorded the same UTC day as the change it judges does not set its finding aside: that day's commits count as after it, as do the commits of a change under review that edits its scope. The setting craft reads is the line below, on its own; it pins the store, so with the realm unreachable there is no memory, never the harness's.

craft-memory: mcp iskron @nick/craft

  • The memory directory is evacuated and frozen: the PreToolUse memory guard in .claude/settings.json blocks writes into ~/.claude/projects/*/memory/ (exit 2); no stub is created (an existing one stays as it is); it does not read the rituals: field — switching guard off means removing it. Evacuate before freezing; delete nothing unread. Two arms: Write|Edit|MultiEdit|NotebookEdit tests file_path (or notebook_path) as a resolved path — Windows separators normalised, symlinks followed, .. applied, case-insensitive; Bash tests the command for a write shape aimed at that path (>/>>, heredoc, tee/cp/mv/rm/touch/install/mkdir). Reads are not blocked, nor is a write the regex cannot see (an editor, a path built at runtime) — the guard catches the reflex; it is not a sandbox.

Session lifecycle

One line per rule; the full norm is the cross-cutting norms of the iskron skill.

  • The realm is the work, git is how we got here. SHAs, branches, PR numbers, "merged" never enter the realm (bodies, names, attributes); provenance goes in a write's reasoning. The one exception: a craft:memory record's link to the pull request its finding was raised on — its Links: line at the end of its text, per skills/memory/backends.md ("Persistence rules"). In a case they are written freely.
  • Session start — the "Start" section of the iskron door before acting and until readiness, not only before reading. Addresses — from the cover; entry by a start line, the receipt and a subagent's own bridge — by the door's start.md reference.
  • Cleanup — with each finished piece ("Cleanup" in the cross-cutting norms of the iskron skill): scratch and your own development caches — in the same move, the tree and the branch — "Branch discipline"; leave cases where your move is no longer awaited, closing your lines with their outcome, then leave (the lead — propose_close or a handover of the lead). Sit only where you await an answer or lead something unclosed.
  • Realm craft — with whoever decides: reading for a decision, the decision, weaving, integration and acceptance ("Realm craft" in the cross-cutting norms of the iskron skill). To subagents on their own satellite bridge — the bulky work on a decision already made: code, gate, review, verification, editing the many nodes it touches with references to the decision and the neighbourhood; a search along the recall ladder — recaller (the decider opens the find), the intake of a complex story — ingester; the launcher checks the result.
  • Starting work: realm, then project, then code. (1) realm reconnaissance (entry): what is recorded about the site of the change, open vimarshas, what was decided and rejected; (2) the integration field (integrity, section below); (3) design (design), then code. Skip only on an explicit "just work" or another named protocol — the reconnaissance debt goes to reconcile; human silence is not permission.
  • A decision goes into the realm the moment it is made, wherever it came from (chat, socket, agents agreeing) — into the repo's holon as an edit of what it touches and its links, the thesis as a node of its own, modes by writing; what counts as execution — in the node; who decided — in reasoning and the case, not in the node. A changed situation — the same, at once.
  • Describe work before it begins — as what it is. One-off work — in one case: the brief and agreement as words, progress and outcome as lines by the door's cases.md; arrived without a case — open one (open_room on the subject's node or iskron_case(action="talk", about=<subject>)) before the first external change. Into the realm — the transitions it changes, and decisions. A vimarsha is only a substantive question or obligation; a kriya is a repeatable transition. Telling a task from a legitimate one-sided edge kriya — reconcile, pass 2.
  • Work runs in the realm — the cross-cutting norms of the iskron door; before a move in a case read its cases.md reference, leading a case — leading.md too. The realm/case distinction, addressing, the form of progress and outcome and the handover of the lead live there; the method is not copied here.
  • Iteration — only the affected: while you edit, run the probes of the affected modules and what depends on them; the full gate — once, on the merge candidate; what passed on the same tree is not repeated — CI either. Here the merge candidate is the batch's head before the cold review and the push (realm @nick/craft, #118, #127): the gate runs whole there, never on a subset.
  • Merge → realm. A push that opened or updated a PR shipped nothing; the sequence hangs on the merge event, not on a lull. Every act is mandatory — except for work by reference from an agent (a brief by references, a report in a case): there weaving, closing along the axis and reconciling are the setter's, and the doer's are the transformation seed and the delivery modes (vahta skill):
    • Weave (weaving): what shipped — into the target system as nodes and edges, not a paragraph; repo mechanics stay in git. Zero nodes and arrows after a substantive wave — say plainly why.
    • Advance the map: open work — anga to the transformation; one genre=hint seed per transformation — only what cannot be recovered by reading the realm and the cases; live cases — a pointer to reading them (iskron_case(action="at"), read), a number only where an essential choice cannot be recovered otherwise.
    • Switch modes by evidence on the carrier (REALITY.md, reality-audit), not by the merge: the merge moves the nodes of what the code carries; a practice (anagata→vartamana) — a rollout or run seen on the carrier (anumita), observed — pratyakshita.
    • Close along the axis (inquiry): addressed_by to the carrying node; visarjana when the answer stands as a node, the repo shows it and reality shows it as far as reachable (where not — the user's word); otherwise put it to the owner. In the same move — the posed_to inbox (a change at the anchor wakes them, not age), propose_close with evidence.
    • Reconcile (reconcile): nodes against code, code against the realm, discarded options recorded and referenceable; the remainder as vimarshas.
    • Feedback reflection — at the merge and at a session close without one: experience about the method (a skill, rule or surface failed or surprised) — as a case, not an opinion, after checking it was not said already, into the work realm anchored on the tool's node and addressed to its steward; about the method in general — by the feedback skill's route. Zero records is a valid outcome.
    • Vocabulary pass: borrowed words (the list — principle 8) in the text and nodes you land — name each to the human and ask what it is called in this project; never substitute on your own.
  • A design is not ready until its decisions, risks and lifecycle are in the realm, whatever skill elicited it; an external design/spec file is a draft for intake in the same session — the realm holds the decisions. Without the owner: decisions and risks — now, the transformation — with its telos awaiting confirmation.
  • Execution suites lead execution (planning, TDD, debugging, review); the realm carries memory and design: decisions and risks born in execution go into the realm before the session ends.
  • A claim you made is not a claim you accept. A behavioural claim is closed by a cold verifier: the brief is the claim, the carrier and the falsifier from REALITY.md; wait for the verdict. No role available — observe the carrier yourself, never the source.
  • Hook merge: entries from different suites coexist in the hooks file — add alongside, never overwrite someone else's.
  • The start, push and merge rituals are carried by the delivery by the cover; the memory guard — Claude Code: in the repo (.claude/settings.json), OpenCode: carried by the delivery. This repo still holds its own push and merge hooks in .claude/settings.json until a Claude Code service session observes the delivery's replacement (alignment case №147, its remainder carried into №75); they stay until then. Its own start hook is gone: a Claude Code service session heard the delivery's start word by the cover. Craft's own entries beside them stay regardless: the pre-push branch-freshness probe (PreToolUse Bash) and the local pull arm of the merge hook — it wakes on a pull whose target copy is on main/master (git pull, git -C <dir> pull, cd <dir> && git pull and chains of such cds, git -c <k=v> pull, with or without rtk) unless the pull reports "Already up to date" (realm @nick/craft, node #235); an iskronify re-projection of the hooks must carry both over. A visible refusal (git's fatal:/error:/! [rejected]; the forge's error:, GraphQL:, X , "not mergeable") wakes neither the push nor the merge hook, nor does a tags-only push.
  • Keep this file honest. The contract is the number after КОНТРАКТ AGENTS.md: at the start of the iskronify skill description: compare it with the cover's contract without loading anything. Higher than contract, or the sources moved after stamp (git log -1 --format=%cd -- .github/workflows/ci.yml .claude-plugin/marketplace.json integrations/claude-code/.claude-plugin/ integrations/shared/ package.json cli/Cargo.toml) — run iskronify as the first move, in a clean tree and a work branch, by its "Who executes the run" rule; the run does not wait for the human, the order of slots — Step 1 of iskronify. Lower than contract — the file is ahead of the delivery: do not lower it and do not call the run; update the shadowing copy of iskronify and re-read the description. A line of this file diverges from the skill — say so aloud (in a case to the setter, otherwise to the human): contract lower — the skill is right; higher — the file is right; equal — a template defect, feedback to the skill delivery's steward (feedback skill).
  • Keep the toolchain fresh: updates are on by default — take them as the channel delivers them. A channel without auto-update (an unpacked copy) — check the version before the session, or move.

Stage self-check

The affected probes green and a coherent stage finished (a branch about to go to the cold review and the push, or you are about to touch nodes beyond the initial ones) — re-read the branch diff against trunk: bugs, fragile spots, weak error handling, DRY/SOLID violations, missing or useless tests, files over 150 lines, god-units. Fix in the same branch, or say plainly that nothing surfaced; do not invent findings. Per stage, not only at the end.

Cold review of the batch

  • Self-check always, the cold review after it — where due below: you see your own work as you intended it.
  • Two stages, not a round on every PR (realm @nick/craft, #254). A finished batch's branch — one light independent review of its diff by the reviewer role; an unfinished feature or an intermediate PR is not put through a full review. The full review — once, on release-please's release PR before it merges: the reviewer role over the whole diff since the previous tag, with its integration report; Medium and above are fixed in their own branch before the release merges, Low — counted in the release PR body (#220). After a fix — a check of the changed delta and the findings it touched; a pull of main, a rebase or a new SHA with no change of content is not a new round. A second model family — only on the human's word, with names. CI, tests and a targeted check of a security or data-loss threat stay on every batch.
  • The cold review comes before the push and before the PR, not after (realm @nick/craft, #127): after the self-check, the reviewer reads the local branch at its commit, not origin/<branch>; blocking findings are closed before the push; git push and gh pr create follow the verdict. An open PR is an invitation to merge, and a review that lands after the merge has lost. A deliberate divergence from the iskronify template, which opens the PR in the same move as the push: an iskronify re-projection must carry this order over.
  • No hook guards this order — a hook's context reaches the model only after the command has run (realm @nick/craft, #289), so the post-push line can only catch a push that came first; the order is yours to hold.
  • The review — by the reviewer role, in a separate worktree: where the spawning tool gives isolation (Claude Code — isolation) — through it; where it does not (OpenCode) — the lead lays a detached tree (git worktree add --detach .worktrees/<name> <head>), the path goes into the brief as "work only there", the no-edit rule as the second line; the report says "manual isolation". Neither — say that there was no cold review.
  • craft reviews itself beside the reviewer (realm @nick/craft, #609): in the same move as launching the reviewer agent, the main session launches the craft:review workflow on the same range — first check of a branch { repo: <the branch's worktree>, base: origin/main, fresh: true, fullEvery: 0, depth: 'light', extraLenses: [] }, a check of fix commits { …, base: <the commit the last review was made on>, delta: true }; that worktree is clean first — craft:review reads uncommitted edits, the reviewer reads the commit. Both run in the background; a Medium-or-higher finding from either holds the branch until closed; the PR body names how many Lows both left (#636). The reviewer-dispatch hook's suggested { base, fresh: true, fullEvery: 0 } at full depth is for consumers; this repo overrides it to light (#417). The release PR's full review stays the reviewer role over the whole diff, with craft:review at full depth beside it, run with pr=<n> and allLenses: true on the PR's head, so the lenses a reviewer's profile turns off are checked once a release (realm @nick/craft, #644). An iskronify re-projection must carry this over.
  • Under a provider's limit the two checks are ordered by the kind of limit (realm @nick/craft, #681, #609). Without a limit — one move, as above. A request-rate limit (the 1302 refusal): the reviewer first, craft:review after its verdict — after its findings are closed, when the verdict holds the branch. Both checks draw on one counter: an engine task that was refused gets another round, a reviewer session gets no second turn, and the engine's first run then reads the diff that will go to the push. A usage limit until its reset (the 1310 refusal) is not cured by order: no check starts while the account is closed; a craft:review run the limit stopped is resumed after the reset (run=), a reviewer session is started anew; another model — only on the human's word. An iskronify re-projection must carry this over.
  • The release review also works the unverified findings that recur (realm @nick/craft, #636, #256): in the detached tree laid for the release review at the release PR's head, the lead runs the candidate's own build over the run store — cargo run -q --locked --manifest-path cli/Cargo.toml -p craft -- runs recurring --unverified --project . (cargo is in the dev shell: nix develop -c …) — and first sets aside each group whose file and title a craft:memory record already answers (recalled by the group's file as scope). The first five groups left, in the reader's order, go to the release reviewer in its brief as findings to verify on that head, each with its file, titles, severities and runs and the reader's store to open those runs, naming how many groups were left beyond the five (the rest of unverified.groups plus unverified.groupsCut) and the reader's note; no group — one line in the brief saying so. The lead records each verified title, since one group can hold different findings: a refuted one — record-decision (scope its file, the title as the group lists it); a confirmed one is the reviewer's own finding (Medium and above fixed before the release merges), and a confirmed Low left unfixed — record-question with deferred: true; the next release's recall then sets them aside instead of handing them over again. An iskronify re-projection must carry this over.
  • The reviewer's brief: the launch line start <realm> <role> <case №N> of its child case, the whole diff of the local branch against trunk (origin/main...<branch>, at the commit the brief names), the focus holon with its steward role and references to the realm nodes the diff touches, not a retelling; the integration field and report — by the reviewer role. NEEDS_CONTEXT is a realm defect: design further, weave, pose vimarshas, review again. A finding you disagree with is rejected with a recorded "why" — a craft:memory decision in the realm ("Persistence rules"), which the next review recalls; the PR or the node may carry it too, never alone.
  • Only Low findings left — no further round: the PR is opened and merged as it stands; the Low findings are dropped, the PR body naming how many (realm @nick/craft, #220, #636). A follow-up branch only for a Low that visibly hurts the plugin's consumer, named in the PR body with that reason (realm @nick/craft, #220).

Role file tails

reviewer

  • Read the diff and files by the local branch the brief names — the review comes before the push, so origin/<branch> may be missing or stale (realm @nick/craft, #127): git fetch origin, then git diff origin/main...<branch> and git show <branch>:<path>, and check that git rev-parse <branch> is the commit the brief names. A branch with no local ref (release-please's release PR) — read origin/<branch>.

Branch discipline

One branch and one PR per batch, until it merges: its items, follow-ups and subagents' work go into it locally. A branch lives in its own worktree inside the repo (git worktree add .worktrees/<branch> -b <branch> origin/main; .worktrees/ is in .gitignore), not in the main copy and not beside the repo: sessions share the main copy, and a checkout there wipes someone else's work. After a merge: git worktree remove your tree, git branch -d the merged branch and others already in main, your development caches; git pull in the main copy (it stays on main); weave what shipped into the realm; the next branch from a fresh origin/main; confirm the cleanup before the next task. An abandoned tree (its branch in main or deleted on the forge, the copy clean) may be removed by any agent of the repo (git worktree remove, prune, git branch -d); uncommitted or unmerged work is not touched — name it to its holder or the human. The orchestrator's tree .worktrees/orchestra-<operation> is never abandoned and never yours, even if you worked in it: it holds the terminal of a launched agent, and the orchestrator is what releases it; unlock, move, remove --force and rm -rf on it are forbidden.

Working principles

  1. Think before code. Name your assumptions; when unsure, ask what exactly is unclear. A question to a human is asked in words, not with a picker tool: in text — only to whoever is answering now; one that outlives the turn — an ask card in the case ("A question to the human" in the iskron door; no case — take one; no seat — their standing bridge); never use OpenCode question or Claude Code AskUserQuestion. Object when you see a simpler move or a false premise. Touch the live system before trusting a type, a name, a doc.
  2. Simplicity first. The minimum for the task; no speculative features, abstractions for one-offs, handling of the impossible. Validate at boundaries.
  3. Stay inside the repo boundary. Edits only in the working directory; outside it — reading carriers, the session's scratch and the delivery's home. Another holon — a vimarsha on its node (anga to the transformation) and a word to its steward in a case (iskron_case(action="talk", about=<subject>)). Do not take someone else's code into context — no reading, no clone, no subagent reconnaissance: what is needed comes from the realm (that repo's holon, its phenomena, relays, vimarshas) or a word to its steward; what is in neither — a posed_to vimarsha to them.
  4. A second implementation is an event to report. Derive both places through integrity, name them to the human, propose reunification or a named fork; a new consumer gets its edges in the same move.
  5. Surgical changes. Touch what the task needs; do not reformat or refactor neighbouring code; keep the style; the linter is authoritative; delete only what your change made dead — flag the rest, do not delete it.
  6. Goal-driven execution. A bug — a failing test before the patch. Multi-step — step → check pairs. Runtime — in the real environment. The falsifier before you look; observe the carrier (REALITY.md), not the source. An implementation brief asks for the test plan first (each promised behaviour, its test, the breakage it must fail on) and for mutants on the diff before hand-back (cargo mutants --in-diff for Rust, each guard broken by hand elsewhere; never in the gate); the hand-back names which test fails without which fix (realm @nick/craft, #622); an iskronify re-projection must carry this over.
  7. Read before answering an open question — from what is recorded, not from training data (recall skill). A search hit is a lead, not data: structure and links through iskron_look, iskron_orient; to a subagent — reconnaissance of code and files (reader), a realm search (recaller); reading the find for a decision is yours.
  8. Think in the realm, speak the project's language. The realm's vocabulary (kriya, phenomenon, holon, role, vimarsha, modes) is for reasoning; to the human — the project's words (skill, agent, workflow, lens, gate, finding, verdict) until they use it first. Borrowed words about the work — ticket, task, sprint, backlog, epic, story, done, blocker, committed — never substitute on your own: name them and ask what they are called here ("Vocabulary pass"); say: the question, the change, what is open, what this resolves.

Integration field — from the realm only

  • The root of the walk is the focus holon #1 and the steward role #3 from the cover. Do not keep a list of shared surfaces or consumers here and do not ask the human for one — someone else's thing the realm does not model belongs under "External surfaces".
  • For each change name the nodes whose embodiment is in the diff and run integrity: a phenomenon — iskron_orient(lens="trace") both ways; a kriya — the next thread and the ahara/utpatti/upadhi relays; crossing into another holon — to its steward role.
  • A dependency the walk did not find is a model defect: design (design), weave (weaving), waiting — a posed_to vimarsha and a word in the case. A public handle with no trace in the realm is either unneeded or a realm debt. A new consumer is in when the code and the edges appeared in one move.

External surfaces — what you use and do not own

Someone else's API, SDK, CLI, protocol, schema — here above all the Claude Code harness contracts (skill and agent frontmatter, plugin and marketplace manifest schemas, the Workflow tool API, MCP tool names) and the host CLIs the craft binary drives (claude, codex, pi, opencode, and codebase-memory-mcp for the consumers list, realm #530): memory of them is indistinguishable from knowledge, and a wrong name diverges on a live call.

  • Before the work, pin the part of the surface you touch as a realm node, with the version.
  • Pratyaksha before shabda: observation by your own hand (a call, --help, claude plugin validate . --strict, the installed package's types) outranks docs, docs outrank memory, memory is not a source. pratyakshita only for what you observed.
  • Thread the link: the surface node is an upadhi (or ahara/utpatti) on the kriya that acts through it.
  • Keep it in step: a divergence or a new version — fix the node in the same move; lower the epistemics if you did not observe it.
  • Source that works with a surface carries (realm @nick/craft, node #N) — and you read that node before the work.

Reality — what a claim is checked against

The carrier table is REALITY.md at the root, read on occasion: before saying a behaviour "works", switching a mode, or closing a question on an execution claim — read the row of your claim class and observe its carrier; the row goes whole into the verifier and reviewer brief. The first row — "the released plugin behaves this way for a consumer": the installed plugin in a consuming repo, observed by the user. The Ceiling ("this skill triggers", "the engine produces good findings") is there too. A gate attests to form, not to behaviour (realm @nick/craft, #126). Learned a carrier the table lacks — write the row there at once.

Realm ↔ repo: what lives where

ConcernRepoRealm
Code, configs, lockfiles✓
Commands, conventions, stack✓ (AGENTS.md)
Reality carriers✓ (REALITY.md)
Gotchas✓ rule nodes; this file and code reference them
Branch state, what is in flightgit + PR (the case number in its body)✓ (the transformation's genre=hint seed)
Methodology, ontology✓
Decisions✓ (a node, at once)
Substantive questions, obligations✓ (vimarshas)
Plans✓ (the transformation map)
One-off task, conversation, shift handover✓ (the case + the transformation seed)
Commit history, PRs, SHAsgit(never in the realm)

No HANDOVER.md is created: branch state already has homes — git branch/log, the open PR and the case by the number in its body, node modes, the transformation seed; a hand-written file is the only one of them that goes stale silently. Forge unreachable — progress is read from modes and the seed.

Commands

The gate is one call: just gate (the justfile at the root; its runner is cargo xtask gate, cli/xtask/src/gate.rs; needs just, cargo, npm ci and npm ci --prefix integrations/opencode/plugin — the dev shell has just and cargo) runs every recipe of the justfile's gate group in order, the offline rows below — each step runs even after one fails, each prints its result, the exit is non-zero when any failed; just gate --base <ref> names the mutation floor's base (default origin/main when it resolves). npm run gate is an alias of just gate for one release, so existing callers keep working, and is dropped after it. CI's test job calls the same command; the gate-steps step fails when a check named in package.json, integrations/shared/check-*.mjs, CI's test job, this table or the justfile is neither a step nor excluded with its reason. A step standing for a package.json script is exactly that script's command, and a gate step's line is exactly one of two forms — npm run --silent <package.json script> or cd cli && cargo xtask <check> for xtask's own checks, the one that takes the base (check-mutation-floor) as cd cli && cargo xtask <check> ${1:+--base "$1"}, required on the recipe that takes base and refused on any other — while gate is exactly cd cli && cargo xtask gate "$@" (cli/xtask/src/allowlist.rs); a gate recipe is one line with no dependency, no attribute but [group('gate')] and [doc(…)] and parameters only a bare name, *name/+name or a literal default, and besides its recipes the justfile holds only set positional-arguments. gate-steps counts a step by the script or check its form names and nothing else, and fails, naming what it found, on anything outside these forms; a base that no gate recipe takes (a parameter named base) turns the gate red. What a package.json script itself runs is outside the check, as it was when the gate ran its steps through npm; a check of the repository's own is an xtask check (cli/xtask/src/checks.rs) with a step in the second form, a wrapper of a JavaScript tool a script with a step in the first. This holds the gate's lines to a small form so an edit that could hide a failure fails loudly; it is not a sandbox — an author set on bypassing it can edit the scripts or the xtask itself. CI's rust job also runs cargo xtask gate-steps directly, so a justfile edit cannot silence the checker that judges it. The rows are what it runs, for running one alone.

WhatCommand
Unit testsjust test (vitest run; files in integrations/shared/config/vitest.config.mjs)
The gate is complete: every check package.json, integrations/shared/check-*.mjs, CI's test job, this table or the justfile names is a gate step or excluded with its reason (cli/xtask/src/exclusions.rs), every exclusion names a check that exists, and each step covers a named check no other step doesjust gate-steps (cargo xtask gate-steps, run in cli/; needs just on the path; CI's rust job runs it directly too)
Format (Prettier, pinned exact; options in .prettierrc.json, scope in .prettierignore: JS, TS and JSON/YAML config — never Markdown, the generated engines, lockfiles, content/ or cli/)just check-format; npm run format rewrites the files (needs npm ci)
Lint (zero-warning, identical to CI; typescript-eslint's strict-type-checked over the integrations/shared/ and integrations/opencode/plugin/ programs, each rule eased in integrations/shared/config/eslint.config.mjs with its reason; each function is held to fixed bars in integrations/shared/complexity-rules.mjs, the engines too — cognitive 15 (the same number as Rust's) and cyclomatic 10 — with no exception: a function over a bar is rebuilt)just lint — read the raw exit code (needs npm ci and npm ci --prefix integrations/opencode/plugin)
Typecheck the OpenCode plugin — *.ts and every *.mjs, tests included, at integrations/shared/'s maximum strictness (checkJs, JSDoc types, the plugin's own Node typings)just check-types (needs npm ci and npm ci --prefix integrations/opencode/plugin: the plugin's tests import vitest from the root)
Typecheck integrations/shared/*.mjs at maximum strictness (checkJs, JSDoc types, Node 22 typings; tests included)just check-types-lib (needs npm ci and npm ci --prefix integrations/opencode/plugin)
The shipped engines integrations/claude-code/workflows/*.js are a fresh build of their sources integrations/claude-code/src/*.js, a bundled engine's integrations/claude-code/workflows/<engine>.js.map included (integrations/shared/build-engines.mjs: an engine imports from integrations/shared/, then export const meta, then export async function __run, and is built by esbuild with meta and the stamp lifted verbatim; refused when not in that form, on a non-literal meta, a surviving import and a name no source spells)just check-engines (needs npm ci for esbuild and npm ci --prefix integrations/opencode/plugin for tsc); after any edit in integrations/claude-code/src/, npm run build:engines regenerates integrations/claude-code/workflows/ — never edit it by hand
Typecheck the engines' own code integrations/claude-code/src/*.js at the same strictness (sandbox globals in integrations/shared/workflow-sandbox.d.ts), plus typescript-eslint's no-unsafe-* rules at zero on the same program and each engine's any count (spelled and implicit) held to integrations/shared/engine-any-ceiling.jsonjust check-types-workflows (same prerequisites)
Syntax-check the shipped workflow scripts (integrations/claude-code/workflows/), their CRAFT_VERSION stamps, sandbox names and launch names; the integrations/shared/ modules the engines bundle are strictly typedjust check-workflows (needs npm ci --prefix integrations/opencode/plugin for tsc)
Every workflow script is at most 500 KiB (512000 bytes), under the 512 KiB the harness registers (cli/xtask/src/workflow_size.rs)just check-workflow-size (cargo xtask check-workflow-size, run in cli/)
Tracked JavaScript/TypeScript stays under integrations/ (git's index, a deleted file still tracked until its deletion is staged; cli/xtask/src/js_boundary.rs)just check-js-boundary (cargo xtask check-js-boundary, run in cli/)
Skills and agents (frontmatter + craft:<slug> refs, prefixed launch names in prose, an agent's reach to the skills it names; cli/xtask/src/skills.rs)just check-skills (cargo xtask check-skills, run in cli/)
Delivery parity of review agentsjust check-delivery-parity
OpenCode agent/command frontmatterjust check-opencode-frontmatter
Eval corpus shape (cli/xtask/src/evals.rs)just check-evals (cargo xtask check-evals, run in cli/)
Unused files, exports, dependencies (config integrations/shared/config/knip.config.js; the engines in integrations/claude-code/src/ are entries, read with their imports as written)just check-dead-production (tests excluded: an export only a test uses is dead) and just check-dead (tests included: devDependencies, packages tests import); both need npm ci and npm ci --prefix integrations/opencode/plugin
Copied code (integrations/shared/check-dup.mjs running jscpd on .jscpd.json; tests excluded; accepted copies in .jscpd-baseline.json, their count held to integrations/shared/dup-ceiling.json, which may only fall)just check-dup (needs npm ci); an edit in or beside a baselined copy changes its fingerprint — npm run check:dup:baseline regenerates it, the count unchanged; raising the ceiling is an edit with its reason in the PR
The mutation floor only rises and what it is measured over only widens (integrations/shared/mutation-floor.json: break and mutate, which integrations/shared/config/stryker.config.mjs must take as its thresholds.break and mutate, the config imported by Node as Stryker imports it; CI's test job compares the file with the PR's base; cli/xtask/src/mutation_floor.rs)just check-mutation-floor origin/main (after git fetch origin main; cargo xtask check-mutation-floor --base origin/main, run in cli/, needs Node); without a base it checks only the file's form and that the config applies it. To raise it after a better weekly run: read the score in that run's mutation-report artifact and set break a little under it (room for run-to-run noise, such as timeouts) in its own PR — never above the score, or the next run is red
What the shipped Node entries and the engines reach (config integrations/shared/config/.dependency-cruiser.mjs: no test file, no npm package beyond the plugin's @opencode-ai/*; from integrations/claude-code/src/, no npm package, no Node built-in and no test at all)just check-deps (needs npm ci and npm ci --prefix integrations/opencode/plugin)
The Rust CLI in cli/ (CI job rust, not a gate step): format, lint at zero warnings (each function under the fixed cognitive bar in cli/clippy.toml, 15 — the same number as JS — with its lint level in cli/Cargo.toml, no exception: a function over it is rebuilt; clippy::pedantic on, each allowed lint with its reason in cli/Cargo.toml), testscargo fmt --check && cargo clippy --all-targets --locked -- -D warnings && cargo test --locked, run in cli/ (needs a C linker for build scripts, and just on the path for cli/xtask's tests of the justfile: the dev shell has both, CI's rust job installs just)
Native process identity, JS/Rust writer interoperability and review page's refusal of a step file that is not a plain file — a hard link on every host, a FIFO and a symlink on Unix, a symlink on Windows only where the runner may create one (the case is skipped, with its reason printed, where it may not) (CI job store-native, macOS and Windows matrix; requires Node 22 and the native Rust toolchain)cargo test -p craft --locked --test process_identity --test paged, run in cli/; cross-compilation does not replace this runtime check
Regenerate the parity files the CLI owns (content/parity/verify-cases.json, plan-cases.json, prompt-cases.json: only their expected side, the input kept; memory-sections.json, the finished step's memory part that integrations/shared/rust-audit-engine.test.mjs reads, whole; gate-provenance.json, the Gate section's provenance line of a flakeless Nix gate whose linters both ran clean, written by the Nix gate tests and read by integrations/shared/cli-review-gate.test.mjs, whole; CI's rust job runs it and fails on any git diff in content/parity). memory-cases.json, sort-cases.json, hook-cases.json, finding-post-cases.json and pr-rejections-cases.json (what the JavaScript finding-post and pr-rejections built and printed, held by cli/crates/craft-review/src/publish/doubtful/parity.rs and src/rejections/parity.rs), cost-cases.json (what the JavaScript enrich-cost --run-id wrote, held by cli/crates/craft-store/tests/cost_parity.rs) and posthoc-store-cases.json (the sorting-choice and develop-cycle writes the JavaScript writer made, in store-cases.json's shape, read by cli/crates/craft-store/tests/parity.rs beside it) are frozen golden data the CLI's parity tests read, no JS test writes them any more: regenerated by hand; judge-prompt-cases.json (the memory judges' prompts the JavaScript sift built) and triage-cases.json (what the JavaScript triage-findings engine dispatched, filed and returned per case, read by cli/crates/craft-triage/src/parity.rs) are frozen golden data too, no JS test writes them any more: edited by hand (realm @nick/craft, #616); cost-problem-cases.json (which stored costs are usable, and the cost a run filed in parts is priced by) is edited by hand and held by cli/crates/craft-store/tests/cost_problem_parity.rs (#658), frozen from the JavaScript rule it replaced; retro-cases.json (a run store, a hook log and the figures the retired JavaScript run-store report printed over them, held by cli/bin/craft/tests/retro_parity.rs) is frozen golden data, edited by hand; the tables craft runs retro, hooks and round-pairs print over that store are held in cli/bin/craft/tests/retro_text/, rewritten after a change of their form with CRAFT_UPDATE_TEXT=1 cargo test -p craft --test retro_text; store-cases.json (the run store's writes, both writers byte for byte) is written by its JS test: UPDATE_STORE_PARITY=1 npx vitest run --config integrations/shared/config/vitest.config.mjs integrations/shared/store-parity.test.mjs, lock-protocol.json (the index lock both writers assert) and stop-causes.json (the notRun lines of a run its driver stopped, held by cli/crates/craft-review/src/filing/unfinished.rs and integrations/shared/cli-review-stop.test.mjs) are edited by handCRAFT_UPDATE_PARITY=1 cargo test -p craft-review parity, run in cli/ — plain cargo test, one process: a per-test-process runner (cargo-nextest) can lose a write
Marketplace manifest (.claude-plugin/marketplace.json)just plugin-validate (npx --yes @anthropic-ai/claude-code plugin validate . --strict)
Plugin manifest and its hooks (integrations/claude-code, its skills/content and nested integrations/shared/integrations/claude-code/src symlinks dereferenced into a temporary copy as an install lays it out — the validator reads nothing in a symlinked directory; validate . reads only the marketplace)just check-plugin (integrations/shared/validate-plugin.mjs: plugin validate <copy>/.claude-plugin/plugin.json --strict through npx --yes @anthropic-ai/claude-code)
Audit the OpenCode plugin's locked production closure (blocking at high in CI; needs the network, so offline it is CI's to run — not reproducible, realm #141)npm audit --prefix integrations/opencode/plugin --omit=dev --audit-level=high
Static analysis, semgrep public rule sets (CI job semgrep, image pinned there; the rules come from the registry per run, so not reproducible)semgrep scan --metrics=off --error --strict --timeout 0 --max-target-bytes 0 --config .semgrep/child-process.yml --config p/javascript --config p/typescript --config p/nodejs --config p/security-audit --config p/secrets --config p/default --exclude integrations/shared/config --exclude integrations/shared/fixtures integrations/shared integrations/pi integrations/opencode/plugin integrations/claude-code/workflows
Quality delta between two checkouts — complexity, lint/type errors, tests, Knip, import cycles; a signal for review, not a gate (CI job quality-delta, PRs only, writes the job summary and always passes)node integrations/shared/quality-delta.mjs --base <checkout> --head <checkout> — Markdown on stdout; each checkout needs its own npm ci and npm ci --prefix integrations/opencode/plugin (e.g. a git worktree add <dir> origin/main)

Prettier formats JS, TS and JSON/YAML config (the Format row; cargo fmt for cli/, in the rust job). .githooks/pre-commit (POSIX sh, wired by npm ci through the prepare script, which sets core.hooksPath inside a git checkout only) checks the staged files fast — Prettier, ESLint on the staged lint-scope files, cargo fmt --check when Rust is staged — and names the fix on failure; it is not the gate: the full gate runs once, on the merge candidate ("Iteration" under "Session lifecycle"), and without the hook the same staged checks run before the push; the audit and semgrep rows are outside the gate (network; offline they are CI's to run: the audit as its own steps of the test job, semgrep as its own job); CI runs the same gate (five jobs: test, semgrep for the semgrep row, rust for the Rust CLI row, store-native for native macOS/Windows writer checks, and quality-delta, PRs only, for the quality-delta row; the release-target builds are a workflow of their own, native-builds.yml, below); the quality-delta row is a signal, not a gate — it never has to pass. Not a gate: craft runs ls | show <id> | stats --by version|name|project | check | retro [<version>] | hooks | round-pairs (the binary, cli/bin/craft/src/runs.rs) reads the run store by streaming its files — filters by project, branch, name, version, time and verdict (retro takes the same filters and --engine <key>|latest, and sums per workflow its verdicts, refute basis, thinned panels, the full-plan token pool, real cost by token part and surface gate; the runs by kind — the workflow, a review's depth and lens scope, with minutes and agents per run and the cost of the runs whose cost is usable, a run filed in parts priced by its parts' shares summed once, the others counted by why; engines and version collisions; what did not run, the verifications saved, the harm cap, the files no profile covered and the agents not registered; memory, memory contradictions per chain, sorting, develop cycles and depth; lenses with NOISE; and the runs that did not finish, listed by the same slice; hooks reads ~/.craft/hooks.jsonl, or --log, per event against the runs the filters keep; round-pairs pairs consecutive review rounds of one branch for the re-review cost); a table, or NDJSON with --json; an unreadable line or record passed over and counted on stderr; ties ordered by UTF-16 code units, no locale; check exits 1 when it finds anything; node integrations/shared/match-external-findings-cli.mjs --repo <owner/name> --pr <n> [--decisions <file>] compares an external reviewer's PR findings with the run store's ledgers on that branch (candidates without --decisions, buckets and the craft-only side with it; it calls gh); node integrations/shared/engine-source-map.mjs <engine> workflow.js:<line>:<column> reads a position the Workflow tool reports in a bundled engine (its line counted with meta cut out; a bare <line>:<column> is the shipped file's own) back to its line in integrations/claude-code/src/ or integrations/shared/; npm run test:mutation runs Stryker over integrations/shared/ (integrations/shared/config/stryker.config.mjs; in place, so it rewrites integrations/shared/ while it runs — nothing else alongside), and the weekly mutation workflow (.github/workflows/mutation.yml, also by hand) runs it on CI and keeps the report as an artifact; below the floor (row above) the run turns red and is reported in one open issue (a new one, or a comment on the one already open) — it blocks nothing. What each gate does not cover — realm @nick/craft, #121.

Project structure

Layers: integrations/claude-code/src/ engines and integrations/shared/ modules → built into integrations/claude-code/workflows/; the craft binary (cli/) runs the review for every host, reached through bin/craft; each integrations/<host>/ holds one host's delivery or says where it lives. MAP.md maps the contents.

  • skills/ — 42 skills, one directory each with a SKILL.md.
  • integrations/claude-code/ — the Claude Code plugin: .claude-plugin/plugin.json, agents/, hooks/, workflows/, and skills, content and README.md as symlinks to the root ones; nested integrations/shared and integrations/claude-code/src project the canonical shared modules and authored engines (a load in place, --plugin-dir, follows them into the checkout). The root marketplace's entry installs it from the claude-code-plugin branch ("source": { "source": "url", "url": "https://github.com/gurinderu/craft.git", "ref": "claude-code-plugin" }, no entry version: the version is the one in its plugin.json), whose every commit is one release's delivery with the links dereferenced into real files, written by .github/workflows/claude-code-plugin.yml (called by release-please on each release) through node integrations/shared/materialize-claude-code.mjs --branch claude-code-plugin --message <text> (a clean checkout of the tag; it commits the branch, the job validates the committed tree with claude plugin validate --strict and pushes it) — a clone of integrations/claude-code with core.symlinks=false, the Windows default, would hold one-line text files where the links are, and the harness would cache them as they are; the branch has none: on Linux with core.symlinks=false the plugin installs with all its files. Not observed on Windows, where the hooks are POSIX shell commands run by Claude Code's shell. The branch is never edited by hand, and a change to the delivery reaches it only with a release.
  • integrations/claude-code/agents/ — 5 Claude Code review agents (rust-reviewer, nix-reviewer, rust-architecture-reviewer, rust-security-scanner, rust-miri), engine-service, the review engines' service-step agent, and review-task, the lean read-only agent the review driver runs a task naming no agent on (omitClaudeMd: true, no Skill or MCP tool; integrations/shared/cli-review-task.mjs).
  • integrations/claude-code/hooks/ — hooks.json: the SessionStart, UserPromptSubmit, SubagentStart and PreToolUse (Agent tool) hooks, each run as integrations/shared/craft-hook.sh <name> — the cached craft hook session-start|user-prompt|subagent-start|reviewer-dispatch of its own version, never waited for; while it is absent the script makes the repo test itself (integrations/shared/craft-hook-repo.sh) and, only where the repo has role signs and the switch is on, the start starts its download in the background (integrations/shared/craft-fetch.sh, lock ~/.craft/bin/<version>/.lock; at most once an hour, its log, try and end beside it as ~/.craft/bin/<version>.{log,attempt,status}) and says so in one systemMessage, a failed try once, the others on stderr; under Codex it says the sandbox line itself (integrations/shared/craft-hook-absent.sh); a failing binary is one systemMessage per session (~/.craft/hook-failed/<session>, pruned after a day). integrations/shared/craft-hook.test.mjs holds the script's found to the binary's over every case. Their texts and the OpenCode work hook's are held byte for byte to the Node hooks they replaced by content/parity/hook-cases.json, frozen golden data: a change of a text or decision edits that file by hand; integrations/shared/craft-hook.test.mjs holds the script's repo test and sandbox line to the same cases. The PostToolUse hook on the Bash tool, run as integrations/shared/pr-opened-hook.sh (it hands a call that says pr create or pr new and prints a pull request's numbered URL to the cached craft hook pr-opened of its own version and never downloads the binary).
  • integrations/claude-code/src/ — the engines as authored, scripts for the Workflow tool: review.js (the review: the driver of the Rust CLI's step protocol, the hottest surface), rust-audit.js, triage-findings.js, audit.js (the audit of a whole project, the thin driver of craft audit, with the audit skill).
  • integrations/claude-code/workflows/ — the same engines as shipped (each with its .js.map): generated from integrations/claude-code/src/ by npm run build:engines and committed (the harness loads them from here); never edited by hand.
  • content/ — the review's knowledge as data: prompt templates (prompts/, {{name}} placeholders filled by integrations/shared/content.mjs's render), agent answer schemas (schemas/<name>.schema.json), language profiles (profiles/; Rust and Nix extends the general one, merged once at load by cli/crates/craft-review/src/profile/inherit.rs; runbook.json takes a Markdown file whose changed lines touch a step against an external system, as cli/crates/craft-review/src/runbook.rs and runbook/ read it from the working tree) and the parity files shared with the CLI's tests (parity/); the build inlines them into integrations/claude-code/workflows/, each content file's base name unique.
  • cli/ — the craft Rust CLI, a cargo workspace: bin/craft (the command: init, the reviewer's profile, with its probe of the codebase-memory-mcp code graph whose callers join the consumers list; hook pr-opened, the check of an opened PR for a full review; hook session-start | user-prompt | subagent-start | reviewer-dispatch | opencode-message | opencode-compacted, the role hooks and the OpenCode work hook (src/hook/role/), the one writer of ~/.craft/hooks.jsonl; review start | submit | status | gate | comment, the step protocol the Claude Code engine drives, and review page, the next page of a step one of them wrote with --paged (src/paged.rs); review post, one doubtful finding the reviewer chose posted on the PR and its choice recorded; pr rejections, a PR's review-thread rejections read as decision records (both reached by the addressing-findings skill through integrations/shared/craft-cli.sh); triage start | submit | status, the triage of findings on the step protocol (src/triage.rs; start --record files its record in the run store itself; submit takes --limit, --resume and --abandoned as the review's does; the Claude Code triage-findings engine drives it, integrations/shared/cli-triage-*.mjs over cli-step-driver.mjs); audit start | submit | status, the audit of a whole project on the step protocol (src/audit.rs; start --path, --batch-bytes and --lens-agents scope it, start --record files a finished pass's record in the run store, submit --resume on a finished audit reads the files it left unread; the Claude Code audit engine drives it, integrations/shared/cli-audit-*.mjs over cli-step-driver.mjs; audit run --backend codex|pi|opencode, the binary driving those steps itself through the shared host loop); review run --backend codex|pi|opencode, its own driver of the steps (--delegate hands opencode's tasks to the process that runs it, src/run/delegate.rs); review probe; memory reindex, craft's own index of its records in the harness's memory directory (src/memory.rs), the per-record lines moved out of MEMORY.md; runs, the run store read (src/runs/visit.rs the one walk a resumed run once; retro over craft-store's retro/, hooks in src/runs/hooks.rs, round-pairs in src/runs/pairs.rs over craft-store's retro/pairs.rs), and its post-hoc writes runs enrich-cost | sorting-choice | develop-cycle | retro-done (src/runs/write.rs over craft-store's cost/, sorting.rs, develop.rs, posthoc.rs, amend.rs), which the skills and engines reach through integrations/shared/craft-cli.sh with no Node; filing_worker.rs, the time-bounded child process for run-store writes), crates/craft-agent (agent backends — the claude, codex, pi and opencode CLIs; the Anthropic API not implemented — and the concurrency runner), crates/craft-review (the review step by step: its work, its state between steps, its report), crates/craft-step (the step protocol every kind of run shares — the task generic over its kind, its files, the answer taken, checked and retried, the notes on a refused answer file left in place, the stop on the account's usage limit (src/stop.rs), the pending step; the review is its first kind), crates/craft-triage (the triage of findings, triage-findings, as the binary runs it — the second kind of the step protocol: its state, its steps and its run, derived at every step from its arguments and answers — the gatherers, repeats collapsed, the memory's sift over craft-review's memory, the validators and the plan agent with their prompts, a prior ledger carried, the noise classes, the pinned ledger, the plan's banners and the run record — held to the engine by content/parity/triage-cases.json), crates/craft-audit (the audit of a whole project, the third kind of the step protocol: the scout of the git-tracked files, each routed to the review's language profile and cut into batches of whole files under a byte budget, the lenses that judge code as it stands over each batch as many as the budget buys, the verifiers of Medium and above, the report with its ## Verdict block, unread.txt and unverified.md beside it, and one run record per finished pass; its lens prompt is content/prompts/audit-lens.md), crates/craft-store (the run store: the binary's own writer of its records, checkpoints and index under the JS writer's lock, byte for byte as integrations/shared/craft-log-run.mjs writes them — held by content/parity/store-cases.json, which integrations/shared/store-parity.test.mjs writes (UPDATE_STORE_PARITY=1) — and the streaming reader under craft runs), crates/craft-tui (the progress view), test-support/; its version is the plugin's (release-please moves cli/Cargo.toml and cli/Cargo.lock), and each release carries its binaries.
  • justfile — the gate: gate (calls cargo xtask gate) and one recipe per step in the gate group (set positional-arguments), each step npm run --silent <script> or cd cli && cargo xtask <check>; a recipe that takes base gets the mutation floor's base. cli/xtask/src/repo_justfile.rs runs this justfile with just (stand-ins for npm and cargo) to hold that the base reaches cargo xtask check-mutation-floor as one argument and just gate's arguments reach cargo xtask gate; CI's rust job installs just for it.
  • cli/xtask — the repository's own checks as cargo xtask <name> (alias in cli/.cargo/config.toml), a workspace member never shipped: the release builds -p craft only (release-please.yml, native-builds.yml). src/cli.rs holds both commands over a root and a just program, so their tests run them on a scratch repository with a logging stand-in for just; gate runs the justfile's gate group (src/gate.rs, reading the justfile with src/justfile.rs); gate-steps is the gate's completeness and its recipes' form (src/gate_steps.rs, src/coverage.rs, src/allowlist.rs with the two forms in src/allowlist/forms.rs, what names a check in src/sources.rs and src/keys.rs, the exclusions with their reasons in src/exclusions.rs), and holds its reader of the justfile to just --summary --unsorted. The repository checks moved from integrations/shared/check-*.mjs are listed in src/checks.rs, each a module over the repository root with its tests beside it: check-js-boundary (src/js_boundary.rs), check-workflow-size (src/workflow_size.rs), check-evals (src/evals.rs), check-mutation-floor (src/mutation_floor.rs and mutation_floor/: the floor file's form and ratchet in floor.rs; config.rs imports the Stryker config through a short inline Node script, since the config computes what Stryker reads, and judges the values it prints) and check-skills (src/skills.rs and skills/: frontmatter, references, prose launch names, an agent's reach to the skills it names); src/js.rs keeps the JavaScript semantics they relied on (trim, UTF-16 length, \s, path.join). The checks of check-dup, check-workflows, check-workflow-types and check-delivery-parity are still integrations/shared/check-*.mjs, run through their scripts.
  • bin/craft — compatibility path forwarding to integrations/shared/craft-cli.sh, the POSIX entry shared by shell hosts, the review engine's fetch and the skills that get the binary (review-init, develop, addressing-findings, memory), including packages without bin/. The shared entry carries the release-please version stamp and runs ~/.craft/bin/<version>/craft, first obtaining it through craft-fetch.sh and craft-fetch-http.sh (release URL, REST fallback, SHA-256, owner-checked lock); craft-bin.mjs ensure uses the same download off win32; on win32 Node downloads itself even where Git Bash has sh, while the sh callers under Git Bash, MSYS and Cygwin use craft-fetch.sh and cache craft.exe (except the hooks, which do not cover Windows). --ensure [--background | --failure] retains the fetch-only, hourly-background and one-time-failure modes; --ensure --print-path validates and prints the executable without running it; CRAFT_BIN selects a local build. Both entries are executable.
  • integrations/shared/config/ — ESLint, Vitest, Stryker, Knip and dependency-cruiser configurations; root package scripts pass their paths explicitly. integrations/shared/fixtures/semgrep/ holds the rule examples.
  • integrations/shared/ — the CI checkers (check-*.mjs), the run-record write path (run-record.mjs, run-logging.mjs, craft-log-run.mjs), the modules the engines import, the engine harness (engine-harness.mjs) and the scripted craft audit the audit engine's tests drive through it (audit-engine-script.mjs), craft-bin.mjs (the binary cache; its ensure runs craft-fetch.sh), craft-review-run.mjs (one bin/craft review run --events json for a host's tool, shared by pi and OpenCode), cli-step-loop.mjs, cli-step-commands.mjs, cli-step-binary.mjs and cli-step-service.mjs (the step rounds, the craft <kind> submit|status commands, getting the binary and the plugin root, and the service agent with its prompts, which any kind's driver shares; the review's are cli-review-*.mjs), and cli-step-driver.mjs with cli-step-rounds.mjs, cli-step-read.mjs, cli-step-options.mjs, cli-step-record.mjs and cli-step-answer.mjs (the whole driver of a kind that ends in files the session reads, the triage and the audit, each giving only its arguments, start, finished step and answer: cli-triage-*.mjs, cli-audit-*.mjs), the hooks' entries, run-store-load.mjs (the store loader match-external-findings-cli.mjs imports; the report the retired analyze-runs.mjs printed is craft runs retro | hooks | round-pairs), and their tests.
  • integrations/opencode/ — the parallel OpenCode delivery: agents/, commands/, plugin/ (TypeScript; its review tool runs bin/craft review run --backend opencode through integrations/shared/craft-review-run.mjs, with --delegate and the agents OpenCode lists (--agents): each task comes back to the plugin as a task event and runs as a child session of the calling session (review-children.ts); its work hook (work-hook.ts) runs the cached craft hook opencode-message | opencode-compacted, starting bin/craft --ensure --background when it is absent and saying a failed try once (--ensure --failure); the review-task agent is kept light on both lines: on 2.x light-agent.ts registers the context, compaction and generate hooks, which cut the repository's instructions and every tool but glob, grep, read and shell out of that agent's model requests in place — the hooks remove every offer but the four and the texts, which a deny does not (realm @nick/craft, #694, #695); on 1.x host-v1.ts registers experimental.chat.system.transform, which cuts the repository's instructions out of that agent's system text alone (light-agent-v1.ts; realm @nick/craft, #707); light-agent-shared.ts is what the two share, and the agent's file denies craft's own review, rust-audit and triage-findings by name (realm @nick/craft, #691); on 2.x its progress reaches the TUI's prompt footer through the craft.review RPC — progress-rpc.ts on the server, review-footer.mjs in the TUI, loaded from plugin/tui/, a directory install.sh links as plugins/craft-review-footer), scripts/, install.sh (1.x). On 2.x it installs with opencode plugin add git+https://github.com/gurinderu/craft#opencode-v<version> from the opencode-plugin branch, whose every commit is one release's package tagged opencode-v<version>: integrations/shared/opencode-package.mjs lays it out (the checkout's relative layout, its own package.json with no scripts — 2.x refuses a git package with a prepare — the plugin's two entries, the Claude Code manifest the craft binary takes a root by, and no dependencies: it refuses a shipped module that imports an npm package at run time, the TUI entry's host-supplied @opentui/solid and solid-js aside), integrations/shared/materialize-opencode.mjs commits and tags it, run by .github/workflows/opencode-plugin.yml (called by release-please on each release, the same release-tag guard as claude-code-plugin.yml); 2.x reads no agents/commands/skills folder in a package, so the plugin registers them itself there (plugin-content.ts); the review command is /craft-review (2.x has a built-in /review). The branch is never edited by hand.
  • .codex-plugin/ and .agents/plugins/ — the Codex plugin manifest and marketplace, at the root because Codex leaves symlinks out of the plugin root it copies; the manifest's hooks names the Claude Code hooks file; integrations/codex/README.md says why.
  • integrations/pi/ — the pi package's craft-review skill (skills/); the root package.json's pi manifest loads it and the extension integrations/pi/pi-extension.mjs, nothing else.
  • .claude-plugin/ — the marketplace manifest.
  • flake.nix and .envrc — the dev shell (nix develop, or direnv): the pinned Rust toolchain with rust-analyzer, Node 22, a C linker, cargo mutants, just, jq and nixfmt (nix fmt); CI does not use it.
  • evals/ — the skill-triggering corpus (evals.json) and its README; docs/ — LESSONS.md, observability.md.
  • .claude/settings.json — the repo's hooks (committed); role agents in .claude/agents/ are machine-local projections, not in git.
  • MAP.md — a map of the repo's contents; README.md — the human-facing entry point.
  • Run-store internals: integrations/shared/index-turn.mjs and cli/crates/craft-store/src/lock/{turn,ticket}.rs share local writer admission; integrations/shared/process-identity.mjs reads Linux identity directly and calls the cached binary on macOS/Windows. craft-store/src/process_identity.rs and its native modules serve Rust admission and the CLI's hidden __craft-process-identity command (bin/craft/src/process_identity.rs, real-helper tests in bin/craft/tests/process_identity.rs). integrations/shared/filing-transaction.mjs and src/filing.rs with src/filing_io.rs in that crate publish and replay pending writes; src/js/string.rs holds JavaScript UTF-16 strings. cli/crates/craft-store/tests/{lock_interop,filing_interop,utf16}.rs and cli/bin/craft/tests/runs_utf16.rs exercise both writers and the binary's UTF-16 reads.

craft runs recurring [--project <dir>] [--path <p>]… [--store <dir>] [--unverified] prints one JSON object regardless of --json; --unverified adds the unverified findings' groups apart, under unverified, each finding held by git diff to its line at <dir>'s HEAD (realm @nick/craft, #636). Selection and grouping live in cli/crates/craft-review/src/recurring/; the CLI is in cli/bin/craft/src/runs.rs. The skills call the binary directly ("$CRAFT_BIN" runs recurring …); there is no Node adapter. Its tests run in the Rust job. Ties are ordered by UTF-16 code units rather than the host locale.

Native manifest discovery and legacy external import share cli/crates/craft-review/src/externals.rs and externals/, called by cli/bin/craft/src/init.rs, init/memory.rs and init/paths.rs (craft init, whose repeatable --path names the manifests to read in place of the walk). Library tests live in externals/tests/; CLI tests in cli/bin/craft/tests/externals.rs and externals/. The regex engine dependency is pinned in cli/Cargo.lock.

Triage driver interoperability is exercised by cli/bin/craft/tests/triage_driver.rs: Node renders the real JavaScript commands, Bash runs them against Cargo's freshly built binary, and task files carry the answers through to a plan in an isolated HOME. It also exercises resume recovery and record re-filing. triage_refused.rs and triage_refused/stdin.rs test exit-code boundaries and piped stdin. These tests run in the Rust job and require Node and Bash.

craft triage run --backend codex|pi|opencode and craft audit run --backend codex|pi|opencode use the host driver in cli/bin/craft/src/run/, each with its lifecycle adapter — run/triage.rs and run/triage/, run/audit.rs and run/audit/ — implementing the Lifecycle trait of run/protocol.rs (the review's is Review there): the step that ends the loop, the resume hint, the answer to how the loop ended and the recovery of a lost step; what the two kinds that end in files share is run/stepped.rs. cli/bin/craft/src/triage.rs and audit.rs also expose the step commands they call in-process. Native transport and lifecycle probes live in cli/bin/craft/tests/triage_run.rs and triage_run/, audit_run.rs and audit_run/, and run in the Rust job. A change to the shared driver also runs the existing review-driver and interruption tests. README.md documents the commands; docs/observability.md documents their runtime field.

The init-native job (.github/workflows/native-builds.yml) makes the release build and runs the native craft-review external-discovery tests on the release's five targets: both Linux musl architectures, both Darwin architectures and Windows MSVC. Its command in cli/ is cargo build --release --locked --target <target> -p craft (the shipped binary alone, as the release builds it) followed by cargo test --release --locked -p craft-review --target <target> externals; musl uses CC_<target_with_underscores>=musl-gcc. It runs on each push to main and on a PR that touches a Cargo.toml or build.rs under cli/, cli/Cargo.lock, cli/rust-toolchain.toml, cli/.cargo/, the discovery code (cli/crates/craft-review/src/externals.rs, externals/, and cli/crates/craft-store/src/js/, the strings it hands the regexp engine), that workflow or release-please.yml — not on every PR (realm @nick/craft, #671); where it runs on a PR, its five checks must pass before merge, in addition to the checks below. A PR it does not run on gets no Linux musl and no release-profile compile at all, and can still break a target: read main's run after the merge (gh run list --workflow native-builds --branch main --limit 1).

OpenCode 1.x review notifications are in integrations/opencode/plugin/host-v1-progress.ts, with their own tests beside it. They use the SDK's TUI notification API; the 2.x footer stays in progress-rpc.ts and review-footer.mjs. integrations/opencode/plugin/host-v1-child.ts owns 1.x child creation, prompting, cancellation and bounded stopping; host-v1-child.test.mjs covers lifecycle and review-queue composition.

Code conventions

  • Meaning lives in the realm, code references it: a comment carrying rationale, discarded alternatives or the shape of an integration is a node; in code — "(realm @nick/craft, node #N)", for the discarded too ("not cached: #N"). Mechanics — in words in place. Having cited a node, check it says that; it diverged — fix the node. This repo is public (MIT, marketplace): references belong in integrations/shared/, integrations/claude-code/src/ and cli/ code, not in README.md, MAP.md or skill bodies.
  • A skill's or agent's description is delivery, not decoration: a skill loads by its description, so a rule living only in the body never fires. Change a skill's behaviour — re-read its description in the same move.
  • No runtime dependencies: what ships rests on the Node standard library; the root package.json is private with devDependencies only — the test runner (Vitest, realm @nick/craft, #140) included (#124).
  • Typed errors in the Rust CLI: the library crates in cli/ return typed thiserror errors; anyhow only in bin/craft, where the error is printed for the user. A reason an agent's answer is retried (validate::check, handoff::read_answer) is data for the retry prompt, not an error, and stays a String.
  • eqeqeq is { null: 'ignore' } on purpose: x != null means "neither null nor undefined"; do not "fix" it to !==.
  • Testing discipline: unit tests cover integrations/shared/**, integrations/pi/** and integrations/opencode/plugin/**, cargo test covers cli/; workflow scripts are exercised through integrations/shared/engine-harness.mjs, skill bodies only by static checkers. No coverage threshold. Tests are local to the change: a component has its own module and tests, a test of the layer above checks only the composition. Logic that must be executed and sits in integrations/claude-code/src/*.js is extracted into integrations/shared/ and imported back; the build bundles it (realm @nick/craft, #210).
  • Gotchas do not live here: they are rule nodes on the realm steps they constrain — #119–#126 for the gate, the two deliveries and run records; reference them here and in code.

Running a review

  • A review request goes to the background: dispatch the reviewer agent with run_in_background: true and keep working; report the verdict when it completes. A synchronous review only on explicit request.
  • Always a fresh agent: every review, a delta check after a fix included, is a new agent with a clean context — never SendMessage to a prior one; restate the diff range and intent each time.

What to update when

  • AGENTS.md — what can be learned from a realm node is not written here; it holds what is needed before an agent reaches the realm (commands, the entry into orientation, invariants a linter cannot express, forks that must stop you) and changes when those change. Cleaning out prose means moving it into the carrying nodes, not deleting it.
  • REALITY.md — when a claim class's carrier appears, changes or turns out unreachable; dated measurements go to the realm.
  • MAP.md and "Project structure" — in the same commit that moves, renames or adds a component's files.
  • The @nick/craft realm — every merge ("Session lifecycle").

Git workflow

  • Forge: GitHub (https://github.com/gurinderu/craft); CLI gh. Observe with gh pr checks <n> --watch, gh pr view <n>; trunk as the forge sees it — gh api repos/gurinderu/craft/commits/main --jq .sha. Never treat a local ref as current — git fetch origin main first.
  • Conventional commits (feat:/fix:/chore:/refactor:/docs:/test:) — release-please parses them, so the prefix carries the version; branches feat/…, fix/…, chore/…; PR titles in the same format.
  • PR body — short: what changed and the case number, plus the lines the review rules above put there (dropped Low findings); work progress and case lines are not copied into the PR.
  • No co-author trailer and no "Generated with Claude Code" — neither on commits nor in PR bodies.
  • The gate is one call: just gate, always whole (the owner's accepted relaxation — no affected-only mode; realm @nick/craft, #118); do not assemble its steps by hand, and read its raw exit code (the audit and semgrep rows need the network — offline they are CI's). CI calls the same gate on the batch's PR and on main; when to run it — "Iteration" under "Session lifecycle".
  • Review, push, then PR (realm @nick/craft, #127): the cold reviewer reads the local branch in its own worktree; push once its verdict is in and its blocking findings are closed, then open the PR. A batch's branch whose review is done does not live without a PR.
  • Definition of done: a PR into main, gh pr checks <n> --watch green (test — just gate plus the shipped-dependency audit —, semgrep, rust and both store-native matrix checks; quality-delta always ends green and is read, not waited on; a red one means reading the log for the failed step), merged without conflicts. release-please cuts releases in a separate PR — merging a feature is not a release; that PR gets no CI of its own, so release-please.yml's targets-built job holds the release: while a merged release PR is pending it waits for native-builds on that PR's merge commit, the one release-please tags, and cuts nothing unless it is green — merge the release PR on a green main; after a red run, re-run it when the runner was at fault and then the release-please workflow. A commit that does not build for a target is not released, and until its version is skipped the guard fails on every push and release-please opens no release PR. To skip it, in this order: merge the fix into main together with "last-release-sha": "<the release PR's merge commit>" at the top level of release-please-config.json (that push's guard still fails, and that is expected); on the release PR swap the label autorelease: pending for autorelease: tagged; re-run the failed release-please run — with nothing pending the guard passes and release-please opens the next release PR from the manifest's version, counting only the commits after that merge commit. No tag is pushed: the skipped version gets no tag, no GitHub release, no binaries and no delivery, so nothing that installs by tag can pick it up; its CHANGELOG.md entry stays as written. Swapping the label before the config lands lets the next push open a release PR counting up to 500 commits. Once the next release is tagged, last-release-sha no longer matters and may be dropped in any later PR. This way out is read in release-please 17.3.0's source and not yet walked on the forge (realm @nick/craft, #671); CRAFT_VERSION in review.js moves with the manifest.
  • The session that leads a batch merges its PR itself once the review has converged: the reviewer and craft:review each gave Approve or Warning from a run that read the change, on the head being merged (the delta check after fixes included), and left no Medium-or-higher finding open, each one closed by a fix the delta check confirmed (a Medium-or-higher finding the session rejected, even with its why recorded, sends the merge to the owner) — craft:review's "nothing to review" on a docs-only diff counts only beside the reviewer's own verdict on that head; test, semgrep, rust, both store-native and, where it runs on the PR (its paths — "Project structure"), init-native's five are green on the commit being merged (quality-delta is read, not waited on; main has no branch protection, so GitHub enforces none of them); the PR merges without conflict. A new head with no change of content (a pull of main, a rebase) keeps the verdict. Then gh pr merge <n> --merge --match-head-commit <that head> and the acts of "Merge → realm" (the owner's standing word; realm @nick/craft, #190). A check that did not run or read nothing — no cold review, a usage limit, a stopped or INCOMPLETE run, NEEDS_CONTEXT, a run that ended before any lens ran — sends the merge to the owner, and so does release-please's release PR (branch release-please--branches--main, label autorelease: pending).
  • The claude-code-plugin branch is moved by the release job (claude-code-plugin.yml, called with each release's tag; the 0.42.0 release created it). A dispatch (gh workflow run claude-code-plugin.yml -f ref=vX.Y.Z, the input required, no default) runs only from main (GitHub dispatches only a default-branch workflow) and only re-publishes the branch from a release tag: the job refuses any ref that is not vX.Y.Z, not a tag on origin at the checked-out commit, or whose plugin.json version is not that tag's, so it never ships unreleased content under the last release's version.
  • Never --no-verify, --force, --no-gpg-sign, git reset --hard without an explicit instruction.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.