/ai_dev:git_auto_reviewfrom ai_dev
Runs an automated review-and-fix loop over a git branch or working tree changes, using git_review as the gate, fixing qualifying findings, and repeating until clean or convergence rules fire.
Ships in ai_dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
<git_auto_review_skill>
git_auto_review is the opt-in automated review-and-fix loop beside `git_review`. It does for a finished change what `task_auto_check` does for a task: it runs `git_review` as its only gate under the `auto_gate_git` contract, fixes the findings that qualify through a single writer agent, verifies each round's fixes refute-by-default, re-reviews the delta, which from round 2 on is the cumulative run change, and repeats until no qualifying finding remains or another of the **Stop rule.** conditions fires. Every fix stays in the working tree, uncommitted, so the user reviews and commits it.<when_to_activate>
Activate when the user asks for an automated review-and-fix pass over either target shape this skill's <inputs> names, the working tree or the checked-out branch:
Route to git_review for manual review of any target, a branch or a pull request included. Route to a task_* sibling for task readiness work; this loop reviews a change, not a task file.
</when_to_activate>
<path_resolution>
Bundled scripts live in scripts/ next to this SKILL.md. Resolve each script's absolute path by combining the directory of this SKILL.md with scripts/<script-name> and invoke that absolute path. Resolve git_review as a same-plugin sibling skill under the skills-tree sibling form git_review/, whose first path component is that sibling's directory name under skills/ and never a repository-root plugins/<plugin>/skills/... browse path. Resolve the three helper agents auto_gate_git, auto_fixer_git, and auto_verifier_git by their published names through the harness's normal agent mechanism; when the harness exposes only file paths, those agents live in the same plugin at ../../agents/ relative to this skill directory.
</path_resolution>
working-tree lane, holding the staged, the unstaged, and the untracked changes, and the local-commits lane, holding the local commits ahead of the upstream. On any other checked-out branch the target is that branch's change: the commits from the merge base of the remote-tracking default ref and HEAD up to HEAD, plus the working tree, meaning the staged, the unstaged, and the untracked changes. The branch target's base is the <remote>/<default> ref <orient> resolves, read without a fetch, so the gate's --no-fetch requirement holds. Every fix lands in the working tree, uncommitted, and the branch's commits and ref stay as they are. Both lane labels are the step strings collect_uncommitted writes in git_review's scripts/collect_review_evidence.sh (working-tree lane: and local-commits lane:), reused as this loop's lane vocabulary.branch <ref> or pull request <ref>, matched case-insensitively. <ref> is a branch name in the shapes git_review's <accepted_forms> accepts (a bare name or the <remote>/<branch> form) or a pull-request URL or number, and it counts as a named target only when it resolves to an existing branch or pull request. A pull-request ref resolves to its head branch through the same <pull_request> route git_review uses. <orient> accepts the named target when it is the checked-out branch and declines otherwise.report.txt as the pending-decisions carrier, and no agent in the run reads its ## Goal or ## Acceptance to widen the review subject or the Scope anchor. A task path that does not resolve to a readable regular file, with a relative value resolved against the repository root, is reported by scripts/run_relay.sh and the run stops under <agent_failure_policy>'s helper-script class at init, so no relay state is created for it.round-cap-authority: user in the skill's own invocation prompt, beside the literal phrase round cap <N>, matched case-insensitively, where <N> is a positive integer. An orchestrator-composed gate or fixer prompt is never a cap source, and the attestation is a caller contract rather than a security boundary: the loop trusts its invoking caller, an orchestrator that writes the line violates that contract, and the harness remains the hard backstop. A positive-integer round cap <N> phrase in the invocation prompt with no attestation line, the observed orchestrator override, is the contract violation the run records while still using the default cap; that is the only case that records round-cap-without-attestation. Absent the attestation the run uses the default cap and records cap-source default; when the attested phrase supplies the cap the run records cap-source user, and an attestation with no round cap <N> phrase records cap-source default. cap-source follows the cap actually used. A phrase whose integer is zero, negative, or non-numeric is not an override: the run reports that the phrase is not an override, records contract-violations none and cap-source default, and proceeds with the default cap.The invoking harness may also supply environment notes. Those notes are the harness's fixture seam, and every note is applied exactly as written. A note describing a staged helper condition routes to <agent_failure_policy>; a note describing a staged loop record or a pre-seeded gate return supplies that record and is applied as written, because the empty-reason eval stages a loop record rather than a helper failure.
<loop_policy>
<single_gate>
git_review is the only review gate. The loop invokes it through auto_gate_git and consumes that agent's structured verdict; it computes no second review score, re-derives no finding, and overrides no gate label.
</single_gate>
<lane_classification>
Lane classification. When auto_gate_git builds the structured verdict, every finding's location is path:start or path:start-end, 1-based inclusive. The coordinate convention, stated once here: location carries working-tree line numbers when the cited lines exist in the working-tree file the fixer edits, so location, the fixer's anchor, and the Stop rule.'s authored-hunk parse share those lines; it still reads path:start or path:start-end with index-world line numbers when the finding has no working-tree counterpart. The sole signal that a finding is not a working-tree line is its lane value local-commits lane; location carries no mark field. auto_gate_git's <output_contract> template stays as that agent states it.
Walk the cases below in order. Cases 1 through 3 and 6 through 10 are terminal: the first matching terminal case sets that finding's location handling, its lane, and its fix disposition. Cases 4 and 5 are location rewrites only: when one matches, rewrite location as it states and continue the same ordered walk from case 6, so a later terminal case assigns lane and disposition. When none of cases 6 through 9 match, case 10 is the terminal case.
(staged) scan-locus. The report cites a path:line hit carrying the (staged) suffix that git_review's <evidence_set> appends for the index line of content only the index holds. Keep the cited index-world path:start or path:start-end with no mark field, assign lane local-commits lane, list the finding as a follow-up task proposal, and make no fix.### staged lines absent. The citation comes from the ### staged section of worktree_diff.txt (the git diff --cached hunk numbering, distinct from the scan-locus suffix) and its added lines no longer appear in the working-tree file at that path. Apply the same disposition as case 1.### staged duplicated, no index-aligned hit. The same ### staged citation whose added lines leave several content matches in the working-tree file and none at the cited index-world numbers. Keep the cited location, assign lane local-commits lane, list the finding as a follow-up task proposal, and make no fix.### staged re-cite to working tree. The same ### staged citation whose added lines still appear in the working-tree file. Match those lines there and number location from the match; when they appear more than once, anchor the occurrence at the cited index-world numbers. This case rewrites location to that working-tree path:start or path:start-end, assigns no lane, and continues the ordered walk from case 6 using the rewritten location.full_diff.txt whose added lines appear in the working-tree file at that path. Match those lines there and renumber location from the match; when they appear more than once, anchor the occurrence at the cited HEAD-side numbers. This case rewrites location to that working-tree path:start or path:start-end, assigns no lane, and continues the ordered walk from case 6 using the rewritten location. A citation whose added lines no longer appear in the working tree falls through to case 10 and is listed with no fix.### unstaged membership. The path and range fall inside a ### unstaged hunk at the working-tree lines the location names. Assign lane working-tree lane.### untracked membership. The path falls in a ### untracked section, read as that whole file's single hunk numbered from its first line, because write_untracked_diffs writes +-prefixed lines with no @@ header. Assign lane working-tree lane.### staged membership. The path and range fall inside a ### staged hunk under the working-tree added-lines match of case 4, so a staged-then-edited change classifies by content rather than by coincident numbers. Assign lane working-tree lane.### staged, ### unstaged, or ### untracked hunk covering them. Assign lane working-tree lane. A finding whose location lies outside a changed line, such as a task-file-anchored finding on an unmodified tracked file, does not meet the Scope anchor. and is listed as a follow-up task proposal with no fix; the lane assignment records only where its lines live. A finding in a local commit or a branch commit whose file the working tree still carries stays fixable every round, because those added lines lie inside both the Scope anchor. and the cumulative run change.lane local-commits lane, which borrows collect_uncommitted's local-commits lane: step string as vocabulary only and asserts no working-tree location and never that the finding concerns a local commit, and make no fix under the non-qualifying classification <convergence> states.auto_gate_git loads this block and applies it as written when it assigns each finding's lane and location; its agent file carries no second copy of these cases.
</lane_classification>
Tag permit. On round 1's first review the tag is none; on a delta re-review the qualifying tag values are open, open and not acknowledged, regressed, and new, each still subject to the other four conditions above. A closed finding and a settled by a decision finding never qualify and receive no fix.
Every gate-listed finding that does not qualify is classified once here and rendered on the two surfaces each already holds. The run lists the finding with its lane and no fix, naming it a follow-up task proposal where it is a pre-existing issue or a scope extension under the Scope anchor., a finding outside the round's review subject, a lane-excluded finding under <lane_classification>, or a tag-excluded finding, meaning closed or settled by a decision, under this paragraph's tag permit. The first rendering surface is the gate's git_review report, which keeps the finding under its heading; that heading's presence follows <first_review_presence> and <delta_presence> as written. This reporting obligation overrides git_review's <non_findings>, <lint_baseline>, and <only_what_is_open> suppression rules inside auto_gate_git's composition of that gate report, so a non-qualifying finding this classification keeps stays present under its heading there. The second surface is report.txt under <relay>, whose not-applied record carries that finding on its own line; a closed or settled by a decision finding an earlier round fixed is re-listed there with its earlier-fix clause naming that round, so the record states that the run fixed it rather than reporting it as unfixed. That record remains only the loop's terminal surface, distinct from the gate report and not itself the subject of those git_review suppression rules.
<scope_anchor>
Scope anchor. A finding meets the Scope anchor when it concerns lines the change added or modified, or a line in a path the original change created. Repository code outside that set is outside the anchor, and a behaviour-level finding on unmodified code is a follow-up task proposal even when the task file's ## Goal and ## Acceptance describe the behaviour.
A reproduction auto_fixer_git adds sits outside the change under review: it is a reproduction-r<round>-finding-<id> file directly in the run's .git_auto_review/<run-stem>/ folder under <relay>, at the path its ledger.txt line names, and git ignores that folder. The gate and the verifier still label a location as reproduction lines when its path matches a path named in ledger.txt. A finding whose location sits only in reproduction lines therefore never meets the Scope anchor; it is listed in the report and receives no fix. The reproduction's own correctness is enforced by the Regression ledger. restore-and-retry, not by gate qualification.
A pre-existing issue and a scope extension go to the report as follow-up task proposals. </scope_anchor>
<regression_ledger>
Regression ledger. The ledger is ledger.txt in the run's relay directory, one reproduction per line, each line the reproduction's path, a tab, then the command that runs it, so the path the Scope anchor. matches a finding's location against is a named field. The path field is relative to the repository root, and for a file reproduction it names that reproduction's file in the run's .git_auto_review/<run-stem>/ folder. A bundled script, scripts/run_ledger.sh, runs each line's command field in order and reports each line's 1-based number with its pass or fail; it exits 0 on an all-passing ledger and on an empty ledger, and exits non-zero naming the 1-based number of the first failing entry.
The orchestrator runs scripts/run_ledger.sh with --cwd set to the repository root after every fix round, so each reproduction finds the repository through its working directory. A failing line restores the round's pre-fix state and repeats the round once with the failing line named to the fixer; a second failure restores the pre-fix state and the Stop rule.'s second-ledger-failure condition stops the run. A restore leaves the relay as it is, so each reproduction survives it together with its ledger line, and the retry extends that same reproduction.
</regression_ledger>
<stop_rule> Stop rule. A round is one gate cycle: the unit the round cap, the consecutive-round stop, and the authored-hunk append all count. The round lifecycle runs in this order.
auto_gate_git call: the first review on round 1, then each delta re-review.Decisions the implementer must make before fixing, or any finding held under Decisions., the round closes on the stop condition "a decision is pending" without invoking triage, auto_fixer_git, the ledger check, or <audit_delta>, including when other findings would otherwise qualify for an automated fix.auto_fixer_git, the ledger check, or <audit_delta>. Triage never runs on an empty qualifying set.auto_verifier_git triage of that verdict, reached only when the qualifying set is non-empty and step 2 did not close the round.auto_fixer_git, the ledger check, or <audit_delta>.auto_fixer_git, the ledger check, or <audit_delta>.CHARTER.md exists and the orchestrator's CHARTER-before-write validation refuses the approved set under <charter_before_write>, after that set is known and before any auto_fixer_git spawn, the round closes on that stop condition without invoking auto_fixer_git, the ledger check, or <audit_delta>. report.txt follows the charter-set-refused reporting <relay> states.scripts/run_snapshot.sh writes the round's pre-fix artefacts, and the round-1 baseline pair when that pair is absent, after Open's gate return is in place and before the first auto_fixer_git invocation. An early-close round invokes neither scripts/run_snapshot.sh nor a rewrite of those artefacts.auto_fixer_git's fix, skipped when step 2, 3, 5, 6, or 7 closed the round.<audit_delta>, with its own one restore-and-retry.authored.txt under the stem directory per the Close cases below. When a Restore undoes the round's writes, or when an early close skipped step 9, authored.txt stays unchanged. After Close, before the next Open, the run evaluates the round-cap stop: every completed gate cycle counts toward the cap, steps 2, 3, 5, 6, and 7 included; when the completed-round count has reached the cap, the run stops under the round-cap condition without opening another round. The cap is a hard ceiling: the run stops and writes report.txt, and no finding reopens a round. The default of 5 and the invoking user's attested override are the only cap sources.A restore-and-retry stays inside its round and never starts or counts a new one. "fix round" and the ledger's "repeats the round once" name this same unit. The run stops when any of these conditions holds:
auto_verifier_git triage of a non-empty qualifying set, the approved set is empty;continue line;<agent_failure_policy>;<audit_delta> unmapped-hunk result after its one restore-and-retry;<concurrent_modification_guard> finds the working tree diverging from that round's pre-fix snapshot for a reason other than this run's fixer;Fix: requires, so the refused path holds no write from this run.The Close cases for the authored.txt rewrite and the self-written stop:
path:start or path:start-end form <lane_classification> already settles, 1-based inclusive, naming the path and the line range auto_fixer_git changed on that path in whole-file coordinates on the working-tree file the gate numbers location against.authored.txt holds the loop's cumulative authored changes at their current whole-file lines.baseline.patch and baseline.untracked.tar under the stem. It is distinct from the per-round pre-fix.patch, pre-fix.untracked.tar, and pre-fix.ignored.manifest that scripts/run_snapshot.sh writes and rewrites each round that reaches step 8, and the per-round writer never writes over the baseline pair.HEAD with baseline.patch applied and baseline.untracked.tar extracted; diff -ruN -U0 against the working tree yields each changed path, fixer-added and fixer-deleted paths included because they are present on only one side, and each hunk's line range on the current working-tree file.location for a path and a line or line range. The finding sits in loop-authored code when that path matches an entry's path and the parsed line or range intersects that entry's range. The stop rule reads only authored.txt.
</stop_rule>
After <orient> accepts the branch, and only then, scripts/run_relay.sh creates .git_auto_review/.gitignore containing the sole line *, creating the .git_auto_review/ directory as part of that write, creates the stem directory, and clears everything an earlier run left there. A gate return for any round is pre-seeded deliberately, so the run's invoker stages one marked pair per pre-seeded round, gate-r<round>.txt plus that round's marker file gate-r<round>.preseed beside it, an empty file whose presence alone marks the pair, created by the harness rather than by the gate, before the run starts. The initialise step's clear preserves every marked per-round pair, keyed by its gate-r<round>.txt, while removing every other file an earlier run left there. The initialise step then writes an empty ledger.txt under the stem, zero reproduction lines, so that path exists before any fixer append.
Each relay file holds exactly one round's record, all under the stem directory:
.git_auto_review/<run-stem>/
gate-r<round>.txt that round's gate return, consumed verbatim
gate-r<round>.preseed empty marker: presence selects the pair
gate-r<round>-prompt.txt the prompt text the round composed
fixer-r<round>.txt prompt-plus-return pairs, in invocation order
verifier-r<round>.txt triage then delta prompt-plus-return pairs
round-r<round>.diff.txt the round's fixer-write diff, diff -U0
ledger.txt the regression ledger
reproduction-r<round>-finding-<id>.<ext>
one file reproduction per finding
report.txt the run's report
pre-fix.patch per-round captured tracked changes
pre-fix.untracked.tar per-round captured untracked files
pre-fix.ignored.manifest per-round captured ignored file paths
baseline.patch round-1 baseline pair, written once
baseline.untracked.tar round-1 baseline pair, written once
authored.txt cumulative authored hunks, current lines
gate-r<round>.txt holds that round's gate return, consumed verbatim as the gate return in place of a gate invocation only when gate-r<round>.preseed is present beside it at the round's start. A gate-r1.txt an earlier run left with no marker is cleared, and the round invokes the gate.
fixer-r<round>.txt holds the round's auto_fixer_git records in invocation order, each one prompt-plus-return pair, its prompt followed by its return, so a retry's additional invocation appends its pair after the prior pair in that same file. verifier-r<round>.txt holds the round's auto_verifier_git records in invocation order: the triage invocation's prompt-plus-return followed by each delta invocation's prompt-plus-return, its prompt followed by its return in each case, so a retry's second delta invocation appends after the first.
round-r<round>.diff.txt holds the round's fixer-write diff. The orchestrator writes it after the round's auto_fixer_git writes and before the verifier's delta invocation by running scripts/run_round_diff.sh with --stem, --round, and --root; that script is the one statement of how the file is written. It rebuilds the round's pre-fix state from pre-fix.patch, pre-fix.untracked.tar, and pre-fix.ignored.manifest, compares that state with the working tree over the tracked, untracked, and ignored file set the snapshot, the concurrent-modification guard, and Restore read, and writes a zero-context unified diff (diff -U0) under the stem, so each hunk is one contiguous changed region. A file the fixer added is one whole-file addition, a file it deleted one whole-file removal, and a tracked file it modified its own hunk; a path whose content is binary carries a path-only hunk with no file content, so the diff stays valid UTF-8 and auto_verifier_git maps the hunk by path. The script leaves out the run's .git_auto_review/ folder and the harness run-output trees the pre-fix.ignored.manifest entry in <snapshots> lists.
The gate prompt the round composes is persisted beside that round's gate record as gate-r<round>-prompt.txt, holding the prompt text the round composed, whether that round invoked auto_gate_git or consumed a pre-seeded return.
ledger.txt holds the run's regression ledger under Regression ledger., and each of the gate and verifier prompts names it among its inputs so both apply the reproduction-line exclusion Scope anchor. defines.
reproduction-r<round>-finding-<id>.<ext> holds the file reproduction auto_fixer_git writes for gate finding <id> of the round in which that reproduction first lands, with the extension its runner needs, and a later round that extends it keeps that path. Reproduction files sit directly in the run's .git_auto_review/<run-stem>/ folder beside the other relay files, and that folder is the one place the fixer writes them. The relay's .gitignore makes git ignore every reproduction there, and the next run's initialise step clears it with the rest of the stem.
report.txt, written under the stem directory at each stop and reprinted to the caller, is the run's report: the loop's own terminal answer, distinct from the git_review report the gate return carries. It carries up to three blocks in this order, each introduced by its exact label line and each emitted only when it has content: the per-round record, the not-applied record, and the final-state block. It prints no empty block and no None. placeholder for one.
The per-round record label line is followed by one line per round that reaches its Close step, step 12 of the Stop rule., an early-close round included. A round the run stops inside — a helper failure under <agent_failure_policy>, a second Regression ledger. failure, or a second <audit_delta> unmapped-hunk result — reaches no Close and gets no line. Its fields, in this order separated by |: round <n> | review <first|delta> | decision <continue|stop> | continue-reason <text|none> | qualifying <id[,id]|none> | triage <id=approved|id=not-approved: reason|none> | fixes <id=path[,path]|none> | ledger <pass|fail|not-run> | delta-audit <pass|fail|unmapped|not-run>. A continue decision names every qualifying finding of the round and why it cannot be deferred; a stop line carries continue-reason none. An empty reason on a continue line forces that round's decision to stop, its continue-reason to none, and the stop condition an empty continue-reason. ledger and delta-audit name that round's final outcome after any restore-and-retry, and read not-run where an early close skipped the check. With two approved findings the round-1 line reads round 1 | review first | decision continue | continue-reason finding 1 and finding 2 both remain unfixed and cannot be deferred | qualifying 1,2 | triage 1=approved;2=approved | fixes 1=report.py;2=notes.md | ledger pass | delta-audit pass.
The not-applied record label line is followed by one line for every finding the run leaves unapplied at the stop, plus one line for each finding an earlier round fixed that the stopping round's gate re-lists as closed or settled by a decision. Its fields, in this order separated by |: <id> | <heading> | <location> | <lane> | <reason class> | earlier-fix <round n|no>. The earlier-fix clause names the round that fixed the finding, and reads earlier-fix no for a finding the run never fixed. The reason class is one of a follow-up task proposal, lane-excluded, tag-excluded (closed), tag-excluded (settled by a decision), triage-not-approved with the verifier's reason, charter-set-refused, decision-pending naming the pending decision entry, or stop-unlanded (<stop condition>) naming the final-state block's stop label for a finding whose approved fix a Restore undid or a stop condition ended the round before it landed. This list is exhaustive over the membership clause.
The final-state block label line is followed by one line, its fields in this order separated by |: stop <condition> | cap-source <user|default> | contract-violations <none|round-cap-without-attestation> | files-changed <path[,path]|none> | pending-decisions <wording|none>. cap-source follows the cap actually used, and contract-violations names the one violation <inputs> records. files-changed names the net working-tree files the run changed at the stop, and pending-decisions carries the wording each pending decision records into a supplied task file. stop carries the Stop rule. condition's label in plain text, never a paraphrase of that rule's prose: spawn-failure, mid-run-death, contract-violating, declared-inability, or helper-script for a helper failure under <agent_failure_policy>; round cap for the cap; a decision is pending; no qualifying finding remains; the approved set is empty; an empty continue-reason; two consecutive rounds whose qualifying findings all sit in code the loop wrote in an earlier round; a second Regression ledger failure; a second audit-delta unmapped-hunk result; a concurrent modification; and a CHARTER-before-write refusal. <agent_failure_policy>, <charter_before_write>, and <initialise> each point their report.txt sentence at the final-state block's stop field.
Every "the report lists", "the report names", and "the report carries" in this skill reads report.txt.
<verification_standard>
Verification runs through auto_verifier_git, refute-by-default, in two modes. Triage mode judges each qualifying finding of the round's gate verdict: it approves a finding only when the fix the finding's Fix: names is real, minimum, scope-anchored, and safe, and returns not-approved with a reason otherwise. Delta mode judges the round's fixer-write diff.
The triage prompt names the round's review subject, the changed-line list the gate's evidence sets yield with untracked created paths included, so the verifier's scope read has evidence to work from. The run applies only the approved set, and it applies no fix at all when the approved set is empty. </verification_standard>
<audit_delta>
After every fix round, write round-r<round>.diff.txt under <relay> as the <relay> paragraph on that file states, then invoke auto_verifier_git in delta mode. When the verifier marks any hunk or path-only entry unmapped, restore the round's pre-fix state, retry the fixer once over the approved findings with the unmapped hunks named, and on a second unmapped result restore the pre-fix state and stop under the Stop rule.'s second-unmapped-hunk condition.
</audit_delta>
<concurrent_modification_guard>
Each round's baseline is that round's pre-fix snapshot: the tracked patch, the untracked-file copy, and the ignored-file manifest pre-fix.ignored.manifest the Restore procedure uses, whose enumerations follow the snapshot's own (git status --porcelain --untracked-files=all for untracked paths and git ls-files --others --ignored --exclude-standard -z for ignored paths), so the guard, the round diff, and the Restore procedure read one tracked, untracked, and ignored path set.
Check the baseline before every auto_fixer_git invocation in the round. The Stop rule.'s concurrent-modification condition fires only when the working tree diverges from that snapshot for a reason other than this run's fixer.
Three path sets are outside the guard. The gate's evidence scratch, which git_review writes outside the reviewed tree; the run's ignored relay directory, its reproduction files included; and the harness run-output trees the pre-fix.ignored.manifest entry in <snapshots> lists never fire the guard, so the ignored set stays bounded to the files a fixer could actually stray into. A restore never deletes a run file.
After every auto_fixer_git write in the round, the orchestrator runs the Regression ledger. check first, then <audit_delta>. Regression ledger. and <audit_delta> each keep their own one restore-and-retry, so a round may invoke auto_fixer_git once for the initial fix and once more per failure class that authorizes a retry. Every invocation receives the round's full approved finding set together with the named failure that class raises, the failing ledger line for a Regression ledger. retry and the unmapped hunks for an <audit_delta> retry, so a retry re-applies the round's other approved fixes after the restore rather than leaving them unlanded.
</concurrent_modification_guard>
<agent_failure_policy> A helper failure stops the run, with no retry. A helper failure is one of five classes:
<output_contract> section arrives summarized or missing, the pre-seeded gate-r1.txt return the stops_on_helper_failure eval stages included;<output_contract> field list is present and complete and that contains, as its own line, the literal marker helper_result: unable, optionally followed on that same line by a tab and a reason. That marker is the sole accepted inability signal, so a complete return without it is a normal verdict, and a return whose field list is summarized or missing stays the contract-violating class even when the marker or other inability prose appears;scripts/run_relay.sh at init, scripts/run_snapshot.sh at the Snapshot step, scripts/run_round_diff.sh when it cannot write the round diff, and scripts/run_restore.sh when it cannot reproduce the captured state. scripts/run_ledger.sh stays outside this class because its non-zero exit has its own move under Regression ledger..Each class carries one label for the final-state block stop field, in this order: spawn-failure, mid-run-death, contract-violating, declared-inability, helper-script. The run stops with no unverified helper text applied, and report.txt's final-state block stop field names the class by that label. A stop that lands before the round's first auto_fixer_git write leaves the working tree at its pre-run state, and a later one runs the round's Restore first, so no half-fixed tree remains, except when the failing helper is scripts/run_restore.sh itself: there Restore cannot have run, so the run leaves the working tree at the state that failed restore produced and makes no further working-tree write.
</agent_failure_policy>
<loop_bounds> The Stop rule. owns the round cap and every stop condition; this block points at that rule by name and restates none of them. </loop_bounds>
Save each round's pre-fix state as three files under the stem directory, written by `scripts/run_snapshot.sh` at the Snapshot step, once the round's gate return is in place and before the first `auto_fixer_git` invocation in the round, and only when that step runs. The writer rewrites them for each round that reaches Snapshot.pre-fix.patch holds the patch of the round's tracked changes with the index and the worktree read together, produced by git diff HEAD --binary --no-color --no-ext-diff, so a staged change and a staged-then-edited change both round trip.pre-fix.untracked.tar holds a copy of the untracked files present before the fix, enumerated with git status --porcelain --untracked-files=all with ignored paths excluded.pre-fix.ignored.manifest holds the ignored file paths present before the fix, enumerated with git ls-files --others --ignored --exclude-standard -z, as NUL-delimited path records. It leaves out the run's own .git_auto_review/ folder and the harness run-output trees, the folders a test harness regenerates on every run: each workspace/, scratch/, .eval_cache/, results/, or .vendor_probe/ folder at any depth under tests/, and each staged tests/wiki/layer2/ sandbox whose folder name starts with AS-, L2-, WI-, WU-, or MP-. This entry is the one statement of the harness run-output trees: scripts/run_snapshot.sh, scripts/run_round_diff.sh, and scripts/run_restore.sh each apply this same exclusion, and every other passage that names those trees points here.On round 1 alone the writer also writes the baseline pair baseline.patch and baseline.untracked.tar, the run's start-state snapshot the Stop rule. diffs authored.txt against, only when that pair is absent, and it never rewrites that pair.
Restore. The procedure every restore-and-retry in this skill runs returns the working tree to the captured state solely from those three per-round files, never touching committed history. Reset every tracked path's working-tree content to HEAD with git restore --source=HEAD --worktree -- ., which leaves the index untouched, and remove a working-tree file the index knows and HEAD does not. Then apply pre-fix.patch forward into the working tree alone, never with --index or --cached, so the captured worktree content the patch's postimage holds becomes the working-tree state again, while the index keeps the content it held at capture, and skip the apply when the patch is empty. Copy each file in pre-fix.untracked.tar back over its working-tree path, and delete the untracked files the fixer added that the copy does not contain. Then delete the ignored files the fixer added that pre-fix.ignored.manifest does not contain, leaving every pre-existing ignored file in place; the restore's ignored enumeration leaves out the run's own .git_auto_review/ folder and the harness run-output trees the pre-fix.ignored.manifest entry lists, so the relay files stay on disk. Remove every parent folder each deletion left empty, up to and including the top-level folder under the repository root. scripts/run_restore.sh carries out this procedure and exits non-zero when it cannot reproduce the captured state.
<charter_before_write>
When CHARTER.md exists at the repository root, the orchestrator validates each approved finding's Fix: paths against that file's boundaries and invariants before the first auto_fixer_git spawn for that finding set. When any path in that set crosses a boundary, the orchestrator refuses the entire approved set without spawning auto_fixer_git, so every approved finding in that set, the crossing member and every non-crossing member alike, holds no write from this run. report.txt's final-state block stop field names the CHARTER-before-write condition, and report.txt's not-applied record lists each finding of that refused approved set on its own line with the class charter-set-refused, which is distinct from a helper failure under <agent_failure_policy>.
</charter_before_write>
</loop_policy>
Resolve the default branch by reading the remote `HEAD` symref `refs/remotes//HEAD` for the remote the checked-out branch's upstream names, `origin` when it names none, and fall back to the `HEAD branch:` line of `git remote show ` when that symref is absent. Both routes advertise a head without moving a ref, so the gate's `--no-fetch` requirement holds.When neither route yields a default branch, abort the run.
Read the checked-out branch with git symbolic-ref --short HEAD. Decline the run in two cases: when that command fails because HEAD is detached, and when the <inputs> named-target input names a branch or pull request other than the checked-out branch, recognized only through that input's literal phrase and never from a bare mention of the words "branch" or "pull request"; a decline on the named target names git_checkout as the skill that puts the repository on it. Otherwise accept the run: the default branch takes the default-branch target, and any other checked-out branch takes the branch target.
Abort and decline are the same terminal move: report the condition and stop there, before any gate call, with no working-tree write and no relay or evidence-scratch artefact created.
Read the optional task file path and the optional round-cap override from the prompt per ``, reporting a phrase whose integer is not a positive integer and proceeding with the default cap, and stopping under ``'s `helper-script` class when the task path does not resolve as that bullet states. Create the relay directory and its `.gitignore`, and clear the stem's leftovers while preserving every marked pre-seeded round pair, through `scripts/run_relay.sh` per ``. Write the empty `ledger.txt`.When scripts/run_relay.sh exits non-zero, the run stops under <agent_failure_policy> at that point and makes no relay write of its own: no .git_auto_review directory, no .gitignore, and no ledger.txt, so a run that dies at init leaves the repository exactly as it found it. The final-state block stop field this run reprints names the class by its literal label helper-script, the same label <agent_failure_policy> assigns that class.
<round_driver>
Drive rounds until the Stop rule. ends the run. Each round composes the auto_gate_git prompt for its target, persists it as gate-r<round>-prompt.txt, and either invokes auto_gate_git or consumes the marked pre-seeded return as written. Round 1 is a first review; from round 2 the prompt names the prior round's gate return path as the prior findings set and directs a <re_review> / <tags> pass under git_review, with no edit to git_review.
From round 2 the gate's review subject is the cumulative run change: the run's base ref diffed against the current tree. The run's base ref is the base state round 1 reviewed against, distinct from the baseline.patch/baseline.untracked.tar authored pair. On a branch target it is the merge base of <remote>/<default> and HEAD. On a default-branch target it is the upstream ref that branch's local-commits lane is read against, so the local commits ahead of it stay inside the subject, and it falls back to HEAD when that branch has no upstream ref. That subject carries the original change's lines plus every fixer write since the baseline, with the current working tree supplying current line numbers only, and repository code outside that diff is outside the subject. On a branch target the subject is the union of the branch-mode evidence and the uncommitted evidence the gate already collects, so the existing two-collection rule stays the mechanism. On a default-branch target the gate adds a third collection, branch mode with --base <upstream> --head <checked-out branch>, because collect_uncommitted writes the local commits as a git log listing with no diff; without that set a defect in a local commit would sit inside the stated subject but stay invisible to the gate, so the subject is that set's union with the uncommitted set. git_review keeps its existing target resolution, a pull request, a branch, or nothing, so the subject is a scope the gate states rather than a new git_review target shape. The prior gate return supplies the prior findings set. A prior finding outside the review subject is re-listed with its prior tag and no fix. A brand-new finding outside the review subject is listed under the existing What should be fixed though it is not a clear bug heading as a follow-up task proposal, carrying the new tag git_review gives a defect first seen in the delta, with no fix; this adds no heading and no new tag value. round-r<round>.diff.txt stays what <relay> says it is, the round's fixer-write diff for the verifier, and is not the gate's subject. A pre-seeded gate return supplies the gate's classification as written, and <convergence>'s qualification and subject filters still apply to it. Round 1 keeps the full-change review. The orchestrator computes the subject once per round from the gate's evidence sets, the branch-mode diff and the uncommitted set, whose ### untracked section carries a created path's content, and names it in the gate prompt; git diff <base-ref> supplies only the tracked-path part, so an untracked created file stays inside the subject. The qualification filter reads that same subject, so a pre-seeded return is filtered against it too.
Then walk the Stop rule. steps in order: early-close checks, Snapshot, the approved fix through auto_fixer_git, the ledger check, <audit_delta>, and Close with its authored.txt rewrite.
</round_driver>
Before returning, verify report.txt exists and carries the final-state block on every path that created a relay, and skip the check on the no-relay init-failure path. When the check finds it missing or incomplete, write it from the in-memory blocks and reprint that; when that write fails, stop and report the fault.
<output_contract>
The run's deliverable is report.txt, written to the relay and reprinted to the caller. It is plain text with one record per line, the | field separator between fields, the ; separator between entries within a field, and the , separator inside an id or path list, with a literal | or ; inside free text escaped as \| or \;, so the file and its reprint read the same and no Markdown rendering is implied. It does not itself produce a git_review report; the gate report lives inside the consumed gate return, which report.txt references through its finding lines.
</output_contract>
task_auto_check drives one task to readiness.task_auto_implement runs implement, audit, and finish for one task.git_auto_review runs the automated review-and-fix loop for a finished change (this skill).Among the hubs whose family blocks list a name, skill_doctor binds that name to the first in name order whose own name is the name or a family-name prefix of it, and otherwise to the first declaring hub in name order, so task_auto_check binds to the task hub, which lists it too. Name git_review in prose, as the opening sentence does: no hub whose name prefixes git_review lists it, so a bullet here would bind it to this hub and pull it into this hub's comparison group.
It reviews; committing, pushing, and review-comment publication stay with the user and the git_* siblings.
</git_auto_review_skill>
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub theafh/ai-modules --plugin ai_dev27 skills in this plugin
/agent_spinnerRun helper agents from an orchestrating agent under one quality contract, whatever the host offers. Establishes the capability tier, declares a phase plan, picks an orchestration shape and width, contains each helper to one path, checks work refute-by-default, and merges cited findings into one verdict-first report. Use when deciding how to run helper agents, sub-agents, or subagents: sizing a fan-out over files, spawning parallel helpers, splitting a review into lenses, running a judge or verifier pass, cross-checking agents' work, containing concurrent writers, aggregating helper reports, recovering failed helpers, or running a serial implement-then-audit loop until the task is stamped audited, in sub-agents. Use it for a multi-agent run plan. Route a backlog-only request to task_* and a wiki request to wiki_fix unless the user names agent_spinner or asks for helpers; those families keep their own contracts. Per-harness facts stay with harness_portability.
/ai_instruction_formattingOrganize AI-consumed content (prompts, rules, skills, commands, agents, system instructions) into pseudo-XML by wrapping each semantic concern in a dedicated tag for role, policy, inputs, and output contract. Use when structuring or reorganizing the body of a SKILL.md, agent or sub-agent definition, command file, rules document (.mdc), CLAUDE.md, AGENTS.md, or GEMINI.md configuration, prompt template, or system prompt into semantic tags, when choosing tag boundaries, or when checking whether an instruction file follows the pseudo-XML convention. This is the structure-and-tags skill; its sibling ai_instruction_writing governs the wording./ai_instruction_writingWrite AI-consumed content using positive, action-oriented language as the primary carrier of every instruction. Use when creating or editing any artifact an AI reads at inference time. Those artifacts include SKILL.md files, .mdc rule files, CLAUDE.md/AGENTS.md/GEMINI.md configuration, prompt templates, system prompts, commands, agent and sub-agent definitions, instruction sets, and persona definitions./format_markdownApply markdown linting compliance and best practices when creating or editing markdown files (.md, .mdc). Covers blank-line rules around block elements, consistent bullet style, fenced code blocks with language identifiers, table alignment syntax, header level progression, list indentation and spacing, and link/image conventions./format_pythonApply formatting standards, code quality rules, structure conventions, linting prevention, and best practices when generating or editing Python code (.py). Covers indentation, quoting, imports, naming, line length, type hints, error handling, logging, data structures, testing, and security practices aligned with common linters (flake8, ruff, pylint)./format_rustApply clippy-aligned Rust practices when writing or editing Rust code (.rs). Covers procedural flow, clippy-driven clarity improvements, minimal imports, Result/Option idioms, the error-versus-invariant model with panic discipline and clippy unwrap_used enforcement, fallible builders following the error idiom by consumer, string prefix/suffix handling, borrowing clarity, iteration style, string building, and function signature grouping.Other plugins' skills for the same job