| name | audit-fix-loop |
| description | Runs the full multi-agent audit workflow, fixes every issue, re-audits until Architecture, Correctness risk, and Complexity debt are all grade A, then commits via git-commit. Use ONLY when the user explicitly invokes audit-fix-loop, $audit-fix-loop, or “use audit-fix-loop”—not for standalone audits, plan execution, or implicit routing. Does not replace phase-audit or deploy gates. |
Audit–Fix Loop
Purpose
Audit → fix everything → audit again in a loop until the audit rubric
shows A for Architecture, Correctness risk, and Complexity debt,
then one final git-commit for the accumulated fixes.
Use When
- The user explicitly invokes
audit-fix-loop, $audit-fix-loop,
or clearly asks to use audit-fix-loop (same intent boundary as
execute-plan-hardcore—no implicit routing).
Do Not Use When
- The user only asked for a read-only audit—use
audit.
- The user is executing a checked-in plan and wants the hardcore gate after
plan work—prefer
execute-plan-hardcore.
- A single phase needs plan rubric review—use
phase-audit.
- Git writes are forbidden and nothing overrides that.
Authority Model
Explicit invocation of audit-fix-loop authorizes:
- Running the full
audit procedure as part of this skill even if the
current message does not contain the substring audit—this skill is
the explicit request for audit and implementation fixes until grades reach
A (overrides audit’s default “surface only unless asked” rule for
this workflow only).
- Multiple audit cycles with multi-agent depth per
audit (parallel
Task charters when the harness supports it; sequential charters when not).
git-commit once after A / A / A is achieved, following
git-commit staging and message rules (whole-tree default unless the user
narrows scope).
If audit-fix-loop was only inferred from vague wording—stop before
fixes or commit and confirm intent.
Procedure
-
Establish scope once (whole repo, paths, diff, or feature)—same table as
audit. State it in each audit report header.
-
Audit pass (read + grade): Follow audit end-to-end:
- Mechanical signals from repo root, aligned with
audit for this
repo: pytest (or python -m pytest); lint only when the repo
defines a standard lint command in pyproject.toml or docs—otherwise skip
and note “no configured lint.” When the audited surface includes
kokoro.js/, add targeted checks there (e.g. npm test) per
audit.
- Delegate multiple readonly charters when depth warrants it (when in
doubt, parallelize per
audit).
- Merge, dedupe, assign P0–P3 severities, and Architecture /
Correctness risk / Complexity debt grades (A–F).
-
Pass condition: all three grades are A. If mechanical checks fail,
treat failures as P0 and fix before accepting any A.
-
If any grade is below A: fix all issues that block A (prioritize
P0/P1 and mechanical failures). Re-run targeted checks; iterate code
until ready for a fresh audit.
-
Loop: Return to step 2 with a full audit pass (not only a
spot-check) until A / A / A. Re-scope if the diff or risk surface grew.
-
Stuck loop: After complete cycles, if A / A / A is blocked by a
product or architecture tradeoff, stop, report grades and the blocker,
and ask the user—do not spin forever.
-
Final commit: When step 5 passes, run git-commit once for all
changes produced by the loop (subject/body per git-commit; whole-tree
staging unless the user specified otherwise).
Boundaries
- Do not grade-inflate;
audit rubric applies.
- Do not lower thresholds to reach A—raise quality.
git-commit runs after grades are A / A / A, not after the first
audit pass unless the first pass already meets A (still follow
git-commit for recording).
Relation to Other Skills
audit: Defines the audit procedure, charters, mechanical checks, and
grading; audit-fix-loop adds mandatory fix iterations and a final
commit.
execute-plan-hardcore: Plan execution plus audit-to-A gate;
audit-fix-loop is only the audit–fix–commit loop (no plan phases).
git-commit: Final step; post-commit behavior in git-commit is
not a substitute for step 2 above.
Mirror paths (kokoro-coreml)
Canonical skill files live under .claude/skills/. .cursor/skills
and .agents/skills are symlinks to ../.claude/skills (tracked in git
so Linux and macOS both resolve). On case-insensitive volumes (typical
macOS), .Claude and .claude are the same directory—this skill is
visible as .cursor/skills/audit-fix-loop/, .agents/skills/audit-fix-loop/,
and .claude/skills/audit-fix-loop/ (or .Claude/skills/...).