/claude-engineering-skills:audit-planfrom Claude Engineering Skills
Iteratively audit a plan file (docs/plans/*.md) with GPT + final gate (Gemini/Claude). Multi-round refinement with an acceptance-rate early-stop (3 rounds default). Ledger-driven suppression on R2+ rounds prevents finding churn. Judges the plan DOCUMENT before anyone builds it. "Was the plan actually built?" is /ux-lock verify — that reads a live app, this reads only the file. Triggers on: "audit the plan", "iterate on the plan", "plan-audit", "audit docs/plans/", "review the plan", "is this plan good", "check the plan", "/audit-plan". Usage: /audit-plan <plan-file> — Audit existing plan iteratively Usage: /audit-plan <task-description> — Generate plan with /plan, then audit
Ships in Claude Engineering Skills. 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.
This skill's last line is an end marker naming the skill between em-dashes, after the Reference files table. If that last line is not in your context (context compaction keeps only the start of a skill), re-read
.claude/skills/audit-plan/SKILL.mdin full before continuing — the later steps, including the mandatory final gate, still apply.
Iteratively refine a plan with GPT until findings plateau, then gate with the independent reviewer (Gemini/Claude).
Input: $ARGUMENTS — either a plan file path (PLAN_AUDIT) or a task
description with no path (PLAN_CYCLE: generate-then-audit).
Where $ARGUMENTS comes from — orchestrator-supplied input first, else
the host's verbatim invocation suffix, else the span of the user's current
message naming this skill or its subject. Never inferred from surrounding
conversation. This site is path+flags; on empty input, ask whether to audit an existing plan or generate one, and stop — the two modes cost differently and are not interchangeable.
Full contract: references/input-acquisition.md.
Worktree preflight — in a linked git worktree the gitignored tooling tree
scripts/.claude-skills/is absent (git worktree adddoes not populate it), so every command below that uses it dies onMODULE_NOT_FOUND. Runnpm run skills:hydratefirst; if no such script exists,references/worktree-preflight.mdholds the entry to add (ask the user first: it editspackage.json). Keys are not copied: put them in~/.audit-loop.env, which every worktree reads.
| Input | Mode |
|---|---|
<plan-file> | PLAN_AUDIT — audit existing plan iteratively |
<task description> (no path) | PLAN_CYCLE — generate plan, then audit |
Validate: the helper scripts resolve, and a GPT route is available —
OPENAI_API_KEY or an active Azure profile (AZURE_OPENAI_ENDPOINT); ask
which ROUTE exists, not whether one variable is set. GEMINI_API_KEY for Step 6
(falls back to Claude Opus when absent). AUDIT_DB_URL for cloud learning
(optional).
If a prerequisite does not resolve, follow references/prerequisite-ladder.md
— do not proceed as though it did, and do not die mid-flow. It defines the
hydrate-then-retry step for absent helper scripts, the labelled adversarial-agent
substitute when the GPT legs have no route, and which of AUDIT_DEGRADED /
AUDIT_NOT_RUN to report so a run that did not happen stays distinguishable
from one that passed.
Initialise session ID: SID=audit-plan-$(node -e "process.stdout.write(Date.now()+'-'+process.pid)") — epoch ms plus a PID, so two sessions started in the same second get separate result, stderr and ledger files.
Kickoff card: /audit-plan — [MODE] — Starting | Plan: <path> | 3 rounds default | SID: $SID.
No skill-to-skill dispatch on this host? Open
.claude/skills/plan/SKILL.mdand follow it inline, passing the task description explicitly (orchestrator-supplied input, rule 0 ofreferences/input-acquisition.md), then return here with the persisted plan path. Same fallback/cycledocuments; blocked results must still reach this skill rather than being swallowed by the inlined planner.
Generate the plan with /plan (auto-detects backend / frontend / full-stack; pass
--scope=… if detection is wrong). Save to docs/plans/<name>.md. Skip for PLAN_AUDIT.
# PLAN_FILE = the ONE plan path /audit-plan was invoked with, assigned verbatim.
# Not a glob: an assignment does not expand it, so the CLI would get the pattern itself.
node scripts/openai-audit.mjs plan "$PLAN_FILE" --mode plan --out .audit/$SID-r1-result.json 2>.audit/$SID-r1-stderr.log
Critical: always pass --mode plan. Without it, Gemini in Step 6 can flag
absent implementations (the plan describes work that doesn't exist yet, which
is by design for plan-audit).
Round 2+ — injects prior rulings as exclusions and suppresses re-raises against the ledger:
node scripts/openai-audit.mjs plan "$PLAN_FILE" --mode plan --round 2 --ledger .audit/$SID-ledger.json --out .audit/$SID-r2-result.json 2>.audit/$SID-r2-stderr.log
Plan audit is single-file — no --passes, --diff, or --changed. When
.requirements/ledger.json exists the prompt gets a <requirements_rubric>
automatically; no flag. Show a results card per round:
ROUND N PLAN AUDIT — <verdict> | H:x M:y L:z | Cost: ~$… | Top: [H1] ….
For each finding, record three orthogonal judgements:
| Dimension | Values | Meaning |
|---|---|---|
| validity | valid / invalid / uncertain | Is the concern real for THIS plan? |
| scope | in-scope / out-of-scope | Does it cite a section the plan owns? |
| action | fix-now / defer / dismiss / rebut | What happens next? |
validity=invalid → action MUST be dismiss or rebutvalidity=uncertain → action MUST be rebut (GPT deliberation)validity=valid + scope=in-scope + HIGH/MEDIUM → fix-nowvalidity=valid + scope=out-of-scope + load-bearing → fix-now (fold into the plan)validity=valid + scope=out-of-scope + independent → defer to "Out of Scope (Future)" plan sectionvalidity=valid + scope=in-scope + LOW → operator choiceScope is decided by impact, not ownership (load-bearing test). "The plan
doesn't own that section" is NOT a defer pass. Ask: does the success of this
plan's design depend on the cited concern? Load-bearing → fold the resolution
into the plan (or an explicit dependency note stating the assumption and how it is
validated); never silent-defer it. Independent → defer. A defer must name
the independence in one sentence; if you can't write it truthfully, it's
load-bearing. When the cited concern is in a module/table the plan's design reads or
writes, independence needs the two-part answer (same column/constraint? same
transaction instance?) → references/triage-rubrics.md §Same-module independence.
Rubrics — apply each; full text in references/triage-rubrics.md, read the section
when its condition holds:
1 sitting) whose §1 Code Trace lacks concrete
file:linerefs and a call path is HIGHungrounded-plan; spot-check each "what exists today" claim a design decision rests on — a mis-described contract is HIGH; an unpinnedfile:lineis LOW (ask forpath:line (sha)).
- **Mode**: campaign) — run node scripts/campaign-contract-check.mjs "$PLAN_FILE";
each problem it prints is HIGH; exit 2 = it did not run, never read as complete.
It proves presence only: judge each control's adequacy yourself./cycle build on un-audited coupled code is HIGH. author-tier: is advisory —
never a finding.| Severity | Deliberation |
|---|---|
| HIGH, MEDIUM | ALWAYS send to GPT deliberation |
| LOW | Claude decides locally |
Only send rebuttal if rebut HIGH or MEDIUM findings exist:
REBUTTAL_FILE=.claude/tmp/rebuttal.md # the rebuttal text you wrote for the disputed finding(s)
node scripts/openai-audit.mjs rebuttal "$PLAN_FILE" "$REBUTTAL_FILE" --out .audit/$SID-resolution.json 2>.audit/$SID-rebuttal-stderr.log
Key on the ACCEPTANCE RATE, not the finding count. write-ledger-entries
prints it for the round you just triaged (acceptance 92% (accepted 11 · dismissed 1 · deferred 0)):
| Acceptance rate this round | Read |
|---|---|
| ≥ ~⅔ accepted as fix-now | PRODUCTIVE — the round bought real corrections. Continue (within the cap). |
| ≤ ~⅓ | STOP — you are dismissing/deferring most of what arrives. That is rigor pressure by definition. |
| in between | Decide on finding character (below), not on counts. |
The count is a secondary backstop, read with the rate (a rising HIGH count alone
is not a stop signal — fixes create new surface; evidence in
references/convergence-evidence.md):
| Condition | Action |
|---|---|
| HIGH count rising and acceptance rate low | STOP — the loop is manufacturing work |
| HIGH count rising and acceptance rate high | Continue — the plan is gaining real surface |
| HIGH count dropping | Continue (the classic converging case) |
| R2+ findings push for v2 features, parser deps | STOP — record as "Out of Scope" |
Cap: 3 rounds, 5 absolute — enforced by openai-audit.mjs. Round 4 exits
4 (CAPPED), a stop for a human call, never a retry, unless the meta-review
(references/meta-review.md, off unless AUDIT_META_REVIEW_T1=on) admits it. On META_STOP/_STRUCTURAL run its debt command;
on PAST_CAP_REQUIRED present the card (references/round-cap-and-structural-card.md)
to the operator: STOP / STRUCTURAL / CONTINUE, their call.
Implementation-completeness findings belong to the code audit. Record the
call (rounds, acceptance, decision id, why) in the plan's audit trail.
When stopping with deferrals, append a ## Out of Scope (Future) section to
the plan listing deferred concerns with rationale.
Step 6 (final review) is MANDATORY after the last audit round, regardless of
convergence. No silent skip; ladder as audit-code's references/gemini-gate.md:
Gemini → Opus → an independent adversarial review agent (same
APPROVE/CONCERNS/REJECT shape) → else FINAL_GATE_SKIPPED, never claiming full
final-gate validation.
After each deliberation round, write ledger entries for every finding before
Step 4 — the ledger drives R2+ rulings injection and suppression. Write the
--triage file with an editor, never as a shell string (rationale prose has
apostrophes). Invocation + status semantics: references/ledger-format.md.
Step 3.5b — record triage outcomes. Cloud labels are automatic:
write-ledger-entries.mjs labels the round it triaged, and each R2+ openai-audit.mjs plan re-checks the prior round. Only if a [finalize] WARN line appeared, run the
manual fallback in references/convergence-evidence.md §Step 3.5b. labelled: 0 with a
non-zero total is a failure, never a pass. Every round, also record dismissed
scope-pressure findings into the LOCAL PlanFpTracker, so future plan audits suppress the
recurring ones:
# --outcomes = THIS round's finding ids and actions (the two below are an example only)
node scripts/write-plan-outcomes.mjs --result ".audit/$SID-r$ROUND-result.json" --outcomes '[{"id":"M3","action":"dismiss"},{"id":"H1","action":"fix-now"}]'
Wait for rebuttal BEFORE editing the plan: rebuttal → response → ledger (3.5) → edit (Step 4) → re-audit (Step 5).
Plans are single files — apply fixes via Edit. ALL HIGH must be addressed (fix or
defer-with-rationale). MEDIUM until ≤2 remain. LOW optional. Show a card:
EDITING PLAN — N findings | Fixed: a | Deferred to "Out of Scope": b | Dismissed: c.
After editing, update ledger entries to remediationState: 'fixed' for fixed items.
Re-audit with R2+ mode (Step 2) on the same plan path, passing --round <N> and
--ledger .audit/$SID-ledger.json; track churn with _hash (resolved / recurring /
new). Stop per the convergence rule above (acceptance rate primary; 3 rounds
default, 5 absolute).
Run the final reviewer — the newest Gemini Pro by default (latest-pro, resolved at runtime; override with FINAL_REVIEW_MODEL) as the final gate. Falls back to Claude Opus when
GEMINI_API_KEY is absent.
Build the transcript first — the reviewer reads a file no earlier step writes. One command; never hand-assemble the JSON:
node scripts/build-audit-transcript.mjs --sid $SID
It folds every .audit/$SID-r<N>-result.json and .audit/$SID-ledger.json into
.audit/$SID-transcript.json (mode inferred from the audit-plan- prefix).
RUN_ID=$(node -e "const fs=require('fs'); try { process.stdout.write(JSON.parse(fs.readFileSync(process.argv[1],'utf8'))._cloudRunId||''); } catch (e) { process.stderr.write('RUN_ID: result artifact unreadable (' + e.message + ') - the verdict will NOT be written back'); }" ".audit/$SID-r$ROUND-result.json")
node scripts/gemini-review.mjs review "$PLAN_FILE" .audit/$SID-transcript.json --mode plan --round 1 --run-id "$RUN_ID" --out .audit/$SID-gemini-result.json 2>.audit/$SID-gemini-stderr.log
--mode plan is as load-bearing here as it is in Step 2 (it defaults to code,
which flags the absent implementations). --run-id arms the gemini_verdict
write-back — omit it and the verdict is recorded nowhere (measurement in
references/convergence-evidence.md).
Act on the result's code-computed gateDisposition (the verdict word is the
reviewer's own): approve → done. approve_with_debt → done — every remaining
finding is release_blocking: false; record each (id, severity, one line) in
the plan's Remaining / debt section (or node scripts/debt-auto-capture.mjs --final-review .audit/$SID-gemini-result.json); never ask the user to override
it. blocked → deliberate on the named blocking items, edit the plan, re-run
as round 2 with --round 2 --prior .audit/$SID-gemini-result.json --out .audit/$SID-gemini-result-v2.json.
Hard cap: 2 Gemini rounds — gemini-review.mjs refuses --round 3. After
round 2, if the disposition is still blocked:
| Round-2 finding character | Action |
|---|---|
| Concrete design defect (wrong contract, unsafe migration, dangling FK) | Fix it in the plan, then escalate to the user with the round-2 result — there is no third round |
| Implementation-completeness (missing step, parameter placement, "specify X") | STOP — fold into the plan as captured items; hand off to /cycle's code audit, which verifies them against real code (the right artifact) |
| Rising coherence/praise + 1 nit/round | STOP — diminishing returns; record the nit, close the gate |
Never a third round for rigor pressure or implementation detail (why:
references/convergence-evidence.md). Record the stop decision (round count + why)
in the plan's audit trail. Deliberation protocol and category-error handling:
references/gemini-gate.md.
Status card after every phase; summarise, never dump raw JSON; show every plan edit with file + line; batch all user decisions into one prompt.
This skill's canonical flow is above. The files below cover specialised situations — read them only when the trigger applies.
| File | Summary | Read when |
|---|---|---|
references/input-acquisition.md | Where a skill's arguments come from on any host, and what to do when there are none. | Reading $ARGUMENTS on a host that does not substitute it, or deciding what empty input means at a site. |
references/triage-rubrics.md | Step 3 rubrics in full — impact-test detail, grounding, test-premise lint, and the §11 execution-clustering checks. | Step 3 — applying a rubric whose one-line form leaves the call borderline, OR ruling on same-module independence. |
references/convergence-evidence.md | Why the stop rules are what they are — acceptance-rate evidence, Gemini-cap rationale, outcome-recording fallback. | Step 3/6 — a stop decision is contested, OR a [finalize] WARN line appeared and Step 3.5b needs the manual fallback. |
references/ledger-format.md | Adjudication ledger schema + writer invocation example for each finding outcome. | Step 3.5 — about to write ledger entries, OR diagnosing R2+ suppression misbehaviour. |
references/gemini-gate.md | Step 7 Gemini independent review protocol — transcript, verdict handling, re-review loop. | Step 6 starting, OR Gemini returned CONCERNS/REJECT and need deliberation rules. |
references/meta-review.md | Automatic meta-review at the round cap: triggers, guard, records, overrides, opt-out. | Exit 4 META_*, or a round admitted. |
references/round-cap-and-structural-card.md | Enforced GPT round cap (plan 3/5, code 6/8), exit 4 CAPPED, and the structural-or-stop card read at the cap. | A round exited 4, OR the audit reached round 3 without converging. |
references/prerequisite-ladder.md | Step 0 prerequisite ladder — absent helper bundle or auditor route, and reporting a run that did not happen. | Step 0 — a prerequisite did not resolve (helper scripts missing, no GPT route), OR about to report a run that degraded or did not happen. |
references/verification-discipline.md | Verification discipline — pinned citations, figure provenance, two-direction proof, attribution, consumer-side checks. | Step 3 — applying the grounding rubric to a plan whose Code Trace cites file:line. |
references/worktree-preflight.md | Worktree preflight remedy — the skills:hydrate npm script to add when a linked worktree lacks the tooling tree. | A command dies with MODULE_NOT_FOUND in a linked worktree AND this repo has no skills:hydrate script. |
— end of /audit-plan —
gate-contract.json (opens in a new tab)references/convergence-evidence.md (opens in a new tab)references/gemini-gate.md (opens in a new tab)references/input-acquisition.md (opens in a new tab)references/ledger-format.md (opens in a new tab)references/meta-review.md (opens in a new tab)references/prerequisite-ladder.md (opens in a new tab)references/round-cap-and-structural-card.md (opens in a new tab)references/triage-rubrics.md (opens in a new tab)references/verification-discipline.md (opens in a new tab)references/worktree-preflight.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
18 skills in this plugin
/ai-context-managementManage AGENTS.md and CLAUDE.md alignment across a repo so Claude, Copilot,
Cursor, Windsurf, and other AI agents share the same project context.
Detects drift, reconciles manually-introduced divergence, and migrates legacy
CLAUDE.md-canonical repos to AGENTS.md-canonical.
Triggers on: "audit AGENTS.md", "check context drift", "AGENTS.md vs CLAUDE.md",
"fix context drift", "migrate to AGENTS.md",
"context sync", "what tools read which file", "ai-context-management".
Usage: /ai-context-management audit — Score drift + report findings
Usage: /ai-context-management reconcile — Apply patches to fix drift
Usage: /ai-context-management migrate — Flip legacy repo to AGENTS.md canonical
/audit-codeIteratively audit code against a plan with GPT + an independent final gate (Gemini, else Claude).
5-pass parallel static analysis (structure, wiring, backend, frontend,
sustainability), R2+ ledger-driven suppression, debt capture for
out-of-scope findings, max 6 rounds with 2-stable-rounds convergence.
Invoke this for ANY code-correctness review, even a small pasted snippet
or diff — don't just review it yourself directly; a single read-through
is not a substitute for the multi-pass GPT + final-gate adjudication this skill
performs, and skipping it means the review didn't actually happen.
Triggers on: "audit my code", "audit my changes", "audit my PR",
"check the implementation", "review my code", "audit code", "/audit-code",
"audit this", "verify the implementation".
Usage: /audit-code <plan-file> — Audit code against plan (--scope diff default)
Usage: /audit-code <plan-file> --scope plan — Audit only files mentioned in the plan
Usage: /audit-code <plan-file> --scope full — Full repo audit
/brainstormMulti-LLM concept-level brainstorming. Sends the user's topic to OpenAI
(and optionally Gemini) so the user can compare independent perspectives
alongside Claude's. Convergence is manual — Claude waits for the user
to ask for synthesis instead of auto-merging the views. Supports model
selection, repo-architecture context attachment (auto on arch topics),
a debate second round, depth budgets, session resume, extra context and
artifact attachment, and saving keeper insights from prior rounds.
Triggers on: "brainstorm", "let's think about", "get other LLMs on this",
"what would Gemini/GPT say", "/brainstorm".
Full command syntax: see the Usage section in this skill.
/click-testStructural DOM audit of a live app — walk every interactive element and
assert semantic-HTML contracts (duplicate IDs, orphan labels, inputs without
names, ARIA misuse, heading hierarchy, missing alt text, undersized touch
targets). Complements /persona-test: persona-test catches narrative UX issues
a real user would hit; click-test catches structural issues that hide in
JS-rendered surfaces and silently break assistive tech, form submissions, or
React reconciliation. Drives a browser via the shared driver contract; optional
--with-modals opens each modal/dropdown and rescans; device presets and
matrix mode cover responsive breakpoints.
Triggers on: "click test", "click-test", "structural audit", "DOM audit",
"accessibility audit", "duplicate ID check", "walk every element",
"audit the DOM", "structural QA", "/click-test".
Full command syntax: see the Usage section in this skill.
/cycleEnd-to-end feature cycle orchestrator. Runs the full skill chain in
sequence: /plan → /audit-plan → (wait for human implementation) →
/audit-code → /persona-test (if frontend/full-stack) → /ux-lock (if
fixes shipped) → /ship-checked. Use when starting a new feature or non-trivial
fix and you want the whole workflow on autopilot. Supports resuming from
an existing plan or straight to code-audit, per-step skips, max-round
pass-through, an opt-in autonomous mode that implements + audits each
plan cluster (the default still pauses for the human), and a remediate
mode that fixes triaged persona-test/audit findings against an accepted
plan with a focused audit and a rerun of only the affected journeys.
Triggers on: "run the full cycle", "do the whole flow", "plan + audit
+ ship", "feature cycle", "remediate the persona findings", "/cycle".
Full command syntax: see the Usage section in this skill.
/explainExplain WHY a piece of code is structured the way it is. Synthesises
architectural-memory similar-symbols, git history (blame + commits +
PR context), AGENTS.md/CLAUDE.md principles, and any plan documents
that mention the target. Useful for onboarding ("why is this here?"),
debugging ("why is X structured this way and not Y?"), and refactoring
("can I change this safely or is there hidden context?").
Pick by INPUT: a TOPIC to survey comes here ("have we touched rate
limiting?"); a CLAIM to test goes to /investigate ("that landed in July" —
it uses --history as one of its instruments). Invoke on the question's
shape, don't pre-check the target exists first — Step 0 validates it and
reports cleanly if missing; don't Grep/Glob and answer directly instead.
Triggers on: "why is this", "explain this code", "why does this exist",
"what is this for", "/explain", "give me context on".
Full command syntax: see the Usage section in this skill.
Generated from the plugin's indexed repository (lbstrydom/claude-engineering-skills) — no native marketplace selected
npx claudepluginhub p/lbstrydom-claude-engineering-skillsOther plugins' skills for the same job