agentleFS
gurinderugurinderu/craft/skills/review-init/SKILL.md

review-init

Skill1 starsChanged 41 days agoMITView on GitHub

Your own review profile of a repository for the craft CLI review — `craft init` — in ~/.craft/projects/<id>/review.toml, never committed. Integration points: the external systems this code talks to (kube-ovn), each with its source git URL and deployed tag or commit; it proposes the project memory's `external` records to confirm. CI map: which GitHub CI check runs clippy, tests, fmt or the build, by the workflow's command — read when the gate cannot build. Lenses held to the first round or turned off, by what they found here. Project properties: published library, rule files, controllers, security paths, contracts. Use before a repository's first review, on `not recorded: <system>`, when a deployed version changes, when the gate's build signal is unknown or its CI map missing, or to turn off a lens that finds nothing. Triggers: craft init, set up my review profile, integration points, CI map, turn off a lens, mark security paths. Not for library dependencies, nor the project's shared memory (memory).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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. Very specific:

    Before you propose the entry, follow the job's run: (just lint, make check) to its recipe and see that this recipe runs the command.

    line 144
  2. Very specific:

    When the gate cannot build the branch, it reads the CI map and asks GitHub (gh api, the repository gh names from the checkout's remote) for …

    line 311

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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
SKILL.md

review-init — your review profile of a repository

craft init keeps, per reviewer and per repository, the systems the code integrates with: it calls them over the network or through their API, or implements their contract (a Kubernetes operator watching kube-ovn's CRDs, a client of LINSTOR's REST API). A review reads each one's source at the revision you name, so a claim about how that system behaves rests on its code, not on memory. Library dependencies are not asked for: the review opens the version the lockfile pins on its own.

The profile is read, never built. The review itself is another matter: unless it is started with gate=false (craft review start --no-gate), its mechanical gate builds and runs the branch's code on your machine — clippy runs its build scripts and proc macros (inside the repository's flake dev shell when it defines one, whose shellHook runs too), nix flake check its checks. Review a branch you do not trust with gate=false.

The binary cannot ask you anything inside an agent session. So: propose, ask, write.

1. Recall the memory's external systems

The project's shared memory may already record the systems the code relies on (external records, written by earlier craft releases; the profile is where these systems live now). Recall them with the craft:memory skill — every active external record, every scope — and keep the list as JSON, each record with system, repo, scope and versionFrom with versionMatch, or a stated version. None recalled, or no memory configured: go on without it.

2. Get the binary and propose

CRAFT_BIN="$(sh "<this skill's base directory>/../../integrations/shared/craft-cli.sh" --ensure --print-path)" || exit $?
"$CRAFT_BIN" init --propose --cwd "$(git rev-parse --show-toplevel)" --craft-root "<this skill's base directory>/../.." --memory-externals - <<'CRAFT_MEMORY_EXTERNALS'
<the recalled records as one JSON list, on one line>
CRAFT_MEMORY_EXTERNALS

On POSIX, and in Git Bash on Windows (it caches craft.exe), acquisition and init need no system Node. On native Windows without sh, obtain the same binary with node "<this skill's base directory>/../../integrations/shared/craft-bin.mjs" ensure; the acquired binary performs discovery and import itself. An exported CRAFT_BIN selects a local build.

The quoted heredoc hands the records over as written: the shell reads no ', $ or \ in them. With nothing recalled, drop the heredoc and --memory-externals -. A local build (cargo build --release in craft's cli/) can stand for $CRAFT_BIN. It prints one JSON object: profile (the file's path, outside the repository), exists, integrations (what the profile holds now: name, repo, ref), memory, discovery, ci (the CI map the profile holds now), ciCandidates, lenses, mutants, project, codeGraph (the code graph the profile holds) and codeGraphSays. It writes nothing. Tell the user codeGraphSays as it is, in one line: whether codebase-memory answers, so the review indexes the checkout it reads and adds the graph's callers to the consumers list.

  • memory — the recalled records as candidates, each with system, repo (its source), ref (the revision read now from its versionFrom file with its versionMatch pattern, or its stated version), scope, point (the --point that writes it), profileRef (the revision the profile holds for that system, null when none) and, when the point would be refused, refused with why; refused at the top names each record that gave no candidate (withdrawn, a field missing, its file unreadable or naming no version). ran: false with why when no records were given or they could not be read.
  • discovery — the candidates the repository's deployment manifests name (Helm charts and values, kustomizations, compose files, plain manifests, Terraform git modules) that neither the profile nor the memory covers, each with system, repo (empty or repoGuessed when unsure) and the version the manifest reads; ran: false with why when it could not run. A walkCut says the walk stopped at its bound: run --propose again with --path <file> for each manifest past it (repeatable, at most 24, relative to the repository's top or absolute inside it) — named, only those files are read, in the order given.
  • ciCandidates — what the repository's .github/workflows/*.yml hold for the CI map: resolved, a job whose run: names the cargo command itself, each with check (the job's name:, else its id — the name GitHub reports; a job of a reusable workflow is reported through its calling job, lints / lints, see below; a name: holding ${{ … }} in a trailing (…) gives its literal part before it, Build (${{ matrix.arch }}) the check Build, which each run Build (…) counts for), matrix, signal (clippy, test for cargo test or cargo nextest, fmt, build for cargo build or cargo check), command, workflow, uses (the local actions or reusable workflows its job runs, uses: ./…), ci (the --ci that writes it, those local files already among its sources) and, for a clippy command that does not pass -D warnings, a note: a warning does not fail that check unless the job denies warnings another way, so tell the reviewer before they confirm it; and unresolved, a job calling a recipe (just, make, cargo xtask, a script) whose words hint at a signal, with its runs lines, hints, workflow and uses — or a job whose name: holds ${{ … }} elsewhere, or a cargo job whose check collides with a sibling job (below), each with a note: no entry can name its runs apart; leave it out and say so. An entry whose check holds ${{ is refused at --write. ran: false with why when the workflows could not be read.

3. Find the rest in the code, then ask

Manifests name what the project deploys; an operator usually talks to systems it does not deploy. Look in the code for clients and contracts of external systems: Kubernetes clients of another project's CRDs or API groups, generated API clients, gRPC or OpenAPI specs vendored from another project, SDK imports of a service. Leave out the project's own components and plain libraries.

Then ask the reviewer in words, one numbered list of every candidate (from the profile, the memory, the discovery and the code), each with what you found and where — a memory record with its system, its source and the revision its file names now, and the profile's own revision beside it when they differ:

  • which of these the code really integrates with (drop the rest; add any you missed) — a memory record is a candidate like any other, written only on the reviewer's yes;
  • for each, the git URL of its source (correct a guessed or empty one);
  • the deployed revision: a tag (v1.12.3) or a full 40-character commit — never a branch name, which the review refuses because its cache would serve it stale. A bare version whose upstream tag carries a v is resolved to it.

Tell the reviewer the revision is the profile's word: when the deployment moves to another version, run this again.

3b. The CI map: resolve, then ask

The gate builds the branch with clippy itself. When it cannot — cargo ends with no compiler error, a private registry without a token, say — it reads the CI map and takes the result GitHub reports for the head's commit: a red mapped check blocks the review; a green one is reported and passes nothing — CI informs, it never certifies, so the build signal stays unknown; a pending one gives none; a run that ended cancelled, skipped, timed_out, startup_failure or action_required gives none either (only failure, and a commit status in failure or error, is red). So an entry is a claim that a check runs that command; it is written only on the reviewer's word.

  • Resolve each unresolved candidate by reading the recipe its run line calls — the justfile recipe, the Makefile target, the script, the xtask — in the repository, following it to the cargo command it runs. Propose an entry only with the command line you saw there, quoted as written (cargo clippy --workspace --all-targets -- -D warnings). A bare check name, or a recipe you could not follow to a cargo command, is never coverage: leave it out and say so.
  • List every file the command goes through as the entry's sources, repository-relative: the justfile, the Makefile, the xtask's source, the script, and each local action or reusable workflow the job runs (uses: ./… — a composite action's action.yml). The command must be run, whitespace aside, by a run: line of the check's job or by a line of one of these sources: a command quoted from a recipe with that recipe left out of sources is refused. A cargo alias lives in a .cargo/config.toml (or .cargo/config): the root's and each one on the way from a job's working-directory:, or from a run line's cd <dir>, up to the root are hashed on their own whenever they exist. An entry whose job runs a local uses: it does not list is refused.
  • What counts as running it: one command of the line (split at &&, ||, ;) is the entry's command whole, or it followed by further arguments — never a piece of a longer word or command. Its program is cargo, past env and VAR=x assignments, so echo "cargo clippy" is not one. Refused: --no-run, --help or --version among its words, a trailing & or a pipe, a || before it, or after it unless what follows is exit <non-zero> (|| true, || :, || exit 0 swallow the failure), a step or job whose continue-on-error: is anything but false, and a comment — a # … after an inline run:, a source's comment line. The check must name a job of the workflow (its name: or id, a matrix's <name> (…)): one naming none is refused, not looked up in every job.
  • Confirm the recipe is the one the job calls: a source is read whole, so the command found in a justfile or Makefile may sit in another recipe than the one the job's run: calls. Before you propose the entry, follow the job's run: (just lint, make check) to its recipe and see that this recipe runs the command; say which recipe and line in the list below.
  • Matrix jobs: GitHub reports one check per combination, <check> (<values>); the entry's check is the job's name, and every run named <check> (…) must be green for its signal. A name: holding ${{ … }} is reported expanded: the entry's check is its literal part before the trailing (…) (as proposed), never the literal expression nor one expanded run (Build (amd64) is refused at --write, told to name Build; so is one run of a matrix job named Build). The gate counts every run named <check> or <check> (…) from every workflow of the repo, so a sibling job reported so in any of them — Build (docs) beside Build (${{ matrix.arch }}), or another Build (${{ … }}) job whose own run: lines do not run the command — makes the check unmappable: --propose lists it unresolved with a note when the sibling shares its workflow, --write refuses it either way, and the gate skips a held entry a workflow added since collides with, with a note to run craft init --propose; tell the reviewer, and leave it out unless a job is renamed.
  • Reusable workflows: a job whose own uses: calls a workflow (uses: ./.github/workflows/lints.yml) has no check of its own; GitHub reports each job of the called workflow as <caller> / <job> (lints / lints; through a chain of calls, ci / lints / lints), and a workflow whose one trigger is workflow_call never under the job's bare name. --propose names such a job so, the entry's workflow the called file where its run: lines are; --write refuses the bare name, naming the reported check, and hashes the calling workflow too, so an edit there marks the entry stale. A matrix caller's runs (<caller> (…) / <job>), and a called workflow no workflow of the repository calls, have no check the map can name: leave them out and say so.
  • Then ask the reviewer in words, one numbered list beside the integration points: for each entry, its check, signal, the command line and where you read it (the workflow, or the recipe and its line). They confirm, drop, or correct each; add any check you missed.

The profile also keeps the hash of each file an entry rests on — the workflow, each source, the cargo configs —, taken at the write: when any of them changes or a new cargo config appears on a job's path, or the entry's command is no longer run by its files, the gate skips that entry and says the CI map is stale, naming the file — come back here. The gate reads CI only for a working tree with no uncommitted changes to tracked files: CI built the head's commit, not your edits.

3c. The lens composition: show, then ask

lenses says which review lenses this repository needs, by what they found here alone — never by what the project is about:

  • held — the composition the profile holds, each as the --lens that writes it again (rust:money=off); heldUnread says why the section could not be read, and then a review runs every lens.
  • yield — each lens (profile:lens) over this repository's finished reviews: runs it went in, dead it was planned for and did not run, and confirmed findings by severity.
  • candidates — the lenses with passes runs or more and no confirmed Medium or above, each with the states it may take: first-round (it reads the change once, never in a later round) and off (it does not run). The security lens and a profile's safety lens are never candidates; the concurrency lens is offered first-round only, and a state the profile already holds is not offered again. yieldUnread says why the run store could not be read, and then there is no yield; unreadRecords counts the records passed over, so the yield covers fewer reviews — say so.

With yieldUnread set, give its reason: the store was not read, so this is no finding of no candidates. With no candidates and nothing held, say so in one line and go on. Otherwise ask the reviewer in words, one numbered list: for each candidate, its runs and what it confirmed, and the states it may take; for each held entry, whether to keep it. They confirm a state, keep it as it runs, or drop a held one. Nothing is written without their word. A review started with --all-lenses (allLenses: true in the Claude Code engine) sets the composition aside, so what they turn off is still checked by a release's full review.

3d. The mutants of a change: show, then ask

On a Rust change whose gate's checks passed (a seed tool that did not answer leaves its track unknown and does not stop them), a review runs cargo mutants --in-diff over the change beside its lenses, where the gate's cargo runs, and its report says whether they ran and why not — cargo-mutants not installed included. init does not look for cargo-mutants itself. mutants says what the profile holds: off (they do not run on this repository), budgetSecs (how long they may run; null or 0 is the review's defaultBudgetSecs), flags (the --mutants and --mutants-budget that write it again) and unread (why the section could not be read; a review then takes the defaults, and the next write replaces what is stored — say so before writing). Ask the reviewer in one line whether to keep it, turn the mutants off, or give them another budget; with nothing held and nothing asked for, say so and go on.

3e. The project's properties: show, then ask

project says what a review takes as given about the repository, so its scout need not guess it on every run:

  • held — what the profile holds: library (a published library, or not), rules (the rule files the lenses are handed), controllers (the reconciler lens runs on every change), security_paths (a change under one is security-sensitive) and contracts (a change to one takes the compat lens), each a path or a glob; flags writes them again; unread says why the section could not be read, and then a review takes its scouts' answers alone.
  • offered — what the tracked files say, each with the files it was read from: library, rules, controllers, and security_paths, the directories named for security (auth, crypto, secrets and the like; vendored code aside). No contract is offered: the ones craft knows it applies anyway; the reviewer names any other. offeredUnread says why the files could not be listed.

library and rules set aside what the scout says, either way; the other three only add risk — nothing here makes a change less sensitive or takes a lens away. Ask the reviewer in words, one numbered list: each offer with its files, and each held entry, to confirm, correct or drop.

4. Write

"$CRAFT_BIN" init --write --cwd "$(git rev-parse --show-toplevel)" \
  --point 'kube-ovn=https://github.com/kubeovn/kube-ovn.git@v1.12.3' \
  --point 'linstor=git@github.com:LINBIT/linstor-server.git@v1.29.0' \
  --ci '{"check":"Rust","signal":"clippy","command":"cargo clippy --all-targets -- -D warnings","workflow":".github/workflows/ci.yml","sources":[]}' \
  --ci '{"check":"lint","signal":"clippy","command":"cargo clippy --workspace -- -D warnings","workflow":".github/workflows/ci.yml","sources":["justfile"]}' \
  --lens 'rust:money=off' --lens 'general:concurrency=first-round' \
  --mutants-budget 900 \
  --library no --rule AGENTS.md --security-path src/auth

--write replaces the whole list: pass every point to keep, the ones already there included. The same holds for the CI map, one --ci per entry to keep, and for the project's properties — project.flags as printed to keep them (--no-rules for no rule file), none for none; a path is trimmed of a leading ./ and a trailing /, and one named twice is refused — and for the mutants — mutants.flags as printed to keep them, none for the defaults; a budget beside --mutants off is refused — and for the lenses: one --lens per entry to keep, a held one as held prints it — a write with none leaves the profile with no composition. A lens entry a review would refuse (the security or a safety lens, the concurrency lens off, a lens no profile has) or a lens named twice is named on stderr and nothing is written. A fresh confirmation is a resolved candidate's ci as printed, or the same JSON with the command line you quoted from the recipe and the recipe files in sources; its files are hashed at the write. An entry already held is passed back exactly as ci prints it, hashes included: those are kept as recorded, so a stale entry stays stale until you confirm it again — then pass it without hashes, read anew. A held entry whose files are unchanged is checked as a fresh one is, so an edited one is not kept. A held entry printed with unusable cannot be kept as it is: the gate skips it with that reason and --write refuses it (or, stale, keeps it dead) — drop it, or replace it with a fresh confirmation the reason allows; never pass unusable back. An entry whose command does not run its signal's cargo command, or is found neither in its job's run: lines nor in a source it lists, whose workflow or a source is missing, whose job runs a local uses: it does not list, or whose hashes miss one of its files, is refused and nothing is written. At most 8; a name is letters, digits, ., _ or -. A confirmed memory record goes in as its point, as printed. A refused point is named on stderr and nothing is written; so is a profile written by a craft of another format. Report the file's path, the points, the CI map entries, the lenses, the mutants and the project's properties written, and codeGraphSays in one line.

Allowing the review's commands

In Claude Code the review engine runs the binary through its service agent (craft:engine-service) in the harness's Bash: <binary> review start | submit | status | gate | comment, <binary> the path step 2 printed (~/.craft/bin/<version>/craft). Under auto mode or a strict permission set the harness may refuse one mid-run; the review then stops INCOMPLETE, names the refused command and the rule meant to allow it, Bash(<binary> review:*), and keeps the run's steps. A plugin cannot grant this itself — Claude Code ignores permissionMode on a plugin's agent, and a plugin's settings carry no permissions — so craft never adds it: the user adds the rule with /permissions and continues with craft:review run=<the run directory>. The rule should let the run go on; that an allow rule overrides auto mode's classifier is not yet observed. The path holds the version, so the rule is added again after each plugin update.

The mutants section

On a Rust change whose gate's checks passed (a seed tool that did not answer leaves its track unknown and does not stop them), the review runs the branch's tests once per mutant of the changed lines with cargo-mutants (when cargo mutants answers), beside the lens rounds, for up to 10 minutes. init --write writes this section from --mutants off or --mutants-budget <seconds> (step 4) and replaces it on every write, so mutants.flags as --propose prints them keep it; a write with neither writes the defaults over it. --mutants off writes

[mutants]
off = true

and turns them off on this project; --mutants-budget 300 writes budget_secs = 300 and bounds them instead.

Name it to the reviewer when their suite has side effects (a database, the network) or is heavy.

What the review does with it

craft review start reads the profile and fetches each point's source, shallow, into ~/.craft/sources/<host>/<path>@<ref> (or $CRAFT_SOURCES_DIR), once per revision. A source it cannot fetch (no network, no git, a branch, an unknown tag) is named in the report's External sources section, and that system is reviewed without its context; the review goes on. A finding that names a system the profile lacks prints not recorded: <system>: come back here.

When the gate cannot build the branch, it reads the CI map and asks GitHub (gh api, the repository gh names from the checkout's remote) for the head commit's check runs and statuses. A green CI reads in its Gate section, say, CI for 1a2b3c4: clippy, test green (checks Rust, tests) — informs only, not a pass, and the gate stays unknown; a red check blocks as a local red would; a check still running gives no signal. CI brings no findings on the change's lines, and the Gate section says so. A check of one name in several check suites (two workflows, a re-run in another event) counts in each, so a red in any blocks; within one suite the latest run counts. More check runs or statuses than one page of 100 gives no signal at all, as do uncommitted changes in the working tree. Without a map, without gh or its login, or offline, the gate stays unknown and says why; a stale entry is named with this skill as the way back.

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.