audit - review code quality against the project standards
Context reuse: Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed.
First action: Before project inspection, preflight, or any other tool call,
publish running to blueprint/.state/run.json using the dashboard activity
contract in AGENTS.md.
Where this sits in the workflow:
/implement or /autopilot -> [audit] -> fixes or /complete
(code exists) (review + (repair quality issues
ledger) or close the feature)
/check proves behavior against the spec. /doctor checks Blueprint setup and
workflow health. This skill checks the code itself through either a broad review
or one focused lens: quality, security, performance, or tests.
It reviews code without changing it: it never edits source files, installs
dependencies, commits, merges, pushes, or starts product work. A normal audit's
one write is the findings ledger at blueprint/context/findings.md (Step 4),
the durable record of findings and their status. Independent mode may also
write blueprint/context/review.md using the exact record contract in
reference/independent-review.md.
The quality-gate config controls when another workflow invokes this skill
automatically. An explicit /audit or $audit request always selects the audit
regardless of whether the applicable gate is manual, conditional, or always.
A selected independentReview gate invokes independent mode instead of letting
the builder satisfy its own review. When both audit and independent review are
selected, one passing independent review satisfies the audit gate.
A missing config means built-in defaults. If it exists but is invalid, stop and
point to /doctor before writing the findings ledger.
Input
Treat scope and lens as separate controls. Arguments may appear in either order,
such as /audit security current or /audit src/auth tests.
Optional scope:
- no scope argument: use
current when an active feature exists, otherwise use
changed when local changes exist, otherwise use full
current: audit the active current-feature.md, every committed feature-branch
change from its merge base through HEAD, staged and unstaged changes,
untracked source files, and nearby code affected by the feature
changed: audit staged, unstaged, and untracked source files plus nearby code
full: audit all project-owned source, tests, and configuration while excluding
dependencies, generated files, build output, coverage output, caches, vendored
code, and minified assets unless the user explicitly includes them
- path or directory: audit that area and the tests or callers needed to understand it
Optional lens:
- no lens: review all four lenses
quality: maintainability, duplication, dead code, consistency, complexity,
and standards drift
security: authorization, input trust, injection, data exposure, secret
handling, and unsafe configuration
performance: query, network, rendering, memory, payload, concurrency, and
unbounded-work risks
tests: missing coverage for important logic, weak assertions, skipped or
focused tests, poor isolation, brittle mocks, and likely flakiness
full is always the full-project scope, not a lens. /audit full therefore runs
all lenses across the full project. When only a lens is supplied, select scope
with the normal no-scope rules. A focused pass may name one or more lenses. If
the request names multiple lenses, review their union and report them separately.
If the requested scope is unclear, pick the smallest useful scope and state it.
If the lens is unclear, use all lenses and state that choice.
Optional review mode:
independent: prepare or complete an independent review of current across
all four lenses. It cannot be combined with changed, full, a path scope,
or a focused lens because a completion receipt must cover the whole active
work item.
Independent mode
/audit independent current is a two-context workflow. The builder prepares a
request. With review.independentExecution: "manual", the selected fresh
reviewer session runs the same command to complete it. With automatic, the
current adapter may start a fresh isolated reviewer subagent after preparing the
request. Blueprint verifies the exact target and later staleness. The adapter,
model, and fresh-context identity remain declared metadata.
An explicit invocation uses this execution setting even when the active
workflow's independentReview gate is manual; that gate value disables only
automatic selection by the workflow.
Read reference/independent-review.md before either phase.
Phase A - prepare the handoff
Use this phase when blueprint/context/review.md has no current pending
request for HEAD and the current spec hash.
A current pending request without Requested execution is legacy and manual
only. Never add execution fields to it or run a subagent against it. Stop with
the fresh-session handoff; Phase B must omit Actual execution so the legacy
request and receipt keep both execution fields absent.
- Require an active spec with every build step checked and status
verified, a
non-default work branch, a reliable merge base, and a working tree matching
the target except existing blueprint/context/review.md and
blueprint/context/findings.md evidence.
Independent mode accepts only a locally recorded remote default branch,
local main, or local master as its enforceable base ref. Stop when none
reliably covers the active work.
The current full HEAD must be the approved application-code checkpoint.
Include the verified spec when tracked; for a new ignored-spec request, prepare
the exact local Spec snapshot under the reference contract. Never force-add
it or change ignore visibility. Never create a commit inside Audit. If any
tracked, staged, unstaged, or untracked path other than those two evidence
paths differs from the target, stop and ask the user to approve a review
checkpoint through /implement, even when normal checkpoint commits are
disabled. Do not create a checkpoint solely for review/findings changes.
This normal Phase A exception never allows snapshot Git differences or
overwriting conflicting completion-recovery evidence.
- Read installed adapters from
blueprint/.state/manifest.json when valid.
For older installs, detect .agents/skills as codex and .claude/skills
as claude. These files prove project support, not that the external runtime
is installed or authenticated.
- Resolve the review executor from
review.independentExecution:
- For
manual, ask which detected adapter and available model should review.
Recommend an equal-or-stronger coding model, a different model family when
practical, and high reasoning for sensitive work. Offer a fresh session in
the current adapter as the fallback. Do not invent available models or
offer an adapter that is not installed in the project.
- For
automatic, use only a live child-agent capability in the current
adapter that can start with no builder transcript, disclose the exact
reviewer adapter and model, and wait for completion. Spawn a generic fresh
isolated child through the current runtime. Do not discover, select, or
depend on a globally installed role, skill, prompt, or another workflow
such as TraversyFlow. If the runtime cannot start that generic child from
project-local instructions, or capability, isolation, identity, model,
completion, or access to the same ignored spec/snapshot inputs cannot be
confirmed, use the manual path in the original checkout.
- Record the full target SHA, full merge-base SHA, the exact local base ref
used to calculate it, exact spec SHA-256, current adapter and model,
requested reviewer adapter and model, requested execution from
review.independentExecution, workflow, and
whether the configured Check gate is required. For a new ignored-spec request,
create or reuse the exact snapshot first and record Spec snapshot as defined
in the reference. Never add that field to an existing pending or completed
record. Write the pending template exactly. Copy the full model identifier
exposed by the active runtime or session metadata (for example,
gpt-5.6-sol), never a generic family label
such as GPT-5. If the runtime does not expose an exact identifier, record
unknown (runtime did not expose exact model) instead of guessing. When the
reviewer runtime cannot select a specific model before opening the session,
record the exact runtime-default sentinel from the reference contract.
- Execute the configured path:
- For
manual, set dashboard activity to ready and give the exact handoff
command for the selected adapter. Claude Code uses
/audit independent current; Codex uses $audit independent current;
Copilot and OpenCode receive the equivalent plain-language instruction.
Tell the user to open a fresh session in the original checkout with only the
handoff, not the builder chat. Include target/base SHAs and, when present,
the exact snapshot path and spec hash.
- For
automatic, freeze all parent product, test, spec, and config changes.
Start one generic isolated child without the builder transcript. Instruct
it to read the project-local Audit skill and
audit/reference/independent-review.md from the current adapter tree, then
execute Phase B using the same local spec/snapshot inputs against the
prepared request. All review instructions come
from that installed Blueprint project. The reviewer may write only
blueprint/context/findings.md and blueprint/context/review.md; it must
not repair code, change the spec, commit, or perform external actions. Wait
for completion, then reread and validate the normal receipt before
continuing. Record fresh subagent as its reviewer context.
If automatic execution fails or any required property becomes uncertain, keep
the pending request intact, set activity to ready, and stop with the existing
manual fresh-session handoff. Never let the builder review its own work or skip
a selected independent-review gate.
The builder never performs Phase B itself. It may continue only after a manual
reviewer session or automatic isolated reviewer produced a valid current receipt.
Phase B - perform the review
Use this phase when a current pending request exists.
- Confirm the current adapter matches
Requested reviewer, the current model
matches Requested model unless the runtime-default sentinel was selected,
and a sentinel request now records the exact model exposed by the session,
HEAD matches Target commit, the recorded base ref still produces the
recorded merge base, the exact spec hash matches, and no path differs from
the target except blueprint/context/review.md and
blueprint/context/findings.md. When Spec snapshot is present, verify both
raw spec/snapshot hashes and every path, visibility, and Git condition in the
reference. Stop on any mismatch or stale state.
- Proceed only from the fresh reviewer handoff. Record
fresh session for a
manual reviewer or fresh subagent for an automatic isolated reviewer. This
is a declaration, never cryptographic proof. If the reviewer has the builder
conversation or is the builder continuing in place, stop and request a fresh
context. For a legacy request with no Requested execution, require a fresh
reviewer session, record fresh session, and omit Actual execution.
- Run Steps 1 through 3 across
current with quality, security, performance,
and tests together. Review the code fresh against the recorded
Base commit and Target commit; exclude the request and findings files
from the code scope. Existing findings are context, never the review
checklist.
- Run
/check from the reviewer session when the request says Check is
required. Follow Check's server and evidence boundaries. A required check
that cannot run prevents a passing receipt.
- Update the findings ledger through Step 4, then replace the pending request
with a completed receipt. Use
passed only when the whole target was
reviewed, required checks passed, and no P0 or P1 finding is open or
fixed. Copy the reviewer's full runtime model identifier using the same
rule as Phase A. Record Check result and keep all four receipt sections
non-empty, using an explicit None entry when appropriate. List every
unavailable verification command under Remaining risk, even when Check was
not required and the receipt may still pass. Otherwise use
changes-requested and name the exact blockers. Record actual automatic
with fresh subagent, or actual manual with fresh session, including an
explicit manual fallback from an automatic request.
- Report the receipt target, reviewer adapter and model, commands, evidence,
findings, remaining risk, and whether the receipt passed. Never repair code
from the reviewer session.
After changes are requested, the builder repairs through /implement, obtains
approval for a new checkpoint, and prepares a new request. The next reviewer
pass reviews the complete new delta, not only the old findings.
A local-spec-only revision may reuse the same approved product HEAD after normal
spec and verification gates, with a new snapshot/request and full fresh review;
it never requires an empty commit.
Step 1 - gather context
Resolve this required context:
AGENTS.md
blueprint/config.json
blueprint/context/project-overview.md
blueprint/context/coding-standards.md
blueprint/context/current-feature.md
blueprint/context/findings.md, for existing IDs and statuses
blueprint/context/review.md, for independent request and receipt state
blueprint/context/ai-interaction.md
blueprint/build-plan.md, when feature order matters
- git branch and working tree status
- relevant source files, tests, and configs for the chosen scope
For current, changed, and path scopes, begin with the diff or named area and
follow only the callers, dependencies, tests, and contracts needed to verify a
reachable finding. Do not survey unrelated directories. For full, preserve the
declared exclusions and inspect by bounded area rather than dumping the project
into one response.
For current, resolve the comparison base without network access:
- Use a base branch declared by the active spec or project instructions.
- Otherwise use the locally recorded remote default branch when available.
- Otherwise use an existing local
main, then master.
- Find the merge base and inspect the committed delta through
HEAD, then add
staged, unstaged, and untracked work.
- If no reliable base exists, say so and use the active spec plus local changes.
Never claim that committed feature work was fully covered in that case.
Do not fetch or pull to discover the base. For full, state the excluded paths
before reviewing so generated or third-party code does not consume the audit.
Prefer rg and targeted file reads. Do not dump large files into the response.
Step 2 - run available signals
Use existing commands only. Do not install tools.
Run or inspect only the signals relevant to the selected lens and scope:
- lint and typecheck commands when declared and relevant
- test command for the tests lens or when it directly validates a suspected risk
- build command when the selected lens needs compilation or bundle evidence
- existing security command for the security lens, when declared and locally runnable
- existing performance command for the performance lens, when declared and locally runnable
- targeted lightweight searches for the chosen lens, such as unused exports and
copied logic for quality, unsafe trust boundaries for security, repeated or
unbounded work for performance, and skipped or weak tests for tests
Do not run broad checks unrelated to a focused lens. If a useful command is
missing, report that as a gap. Do not invent a pass or claim that a focused
review covered the other lenses.
Step 3 - review the code
For all lenses, ground findings in reachable code and project-specific
expectations. Apply only the selected lens or lenses:
- Quality: duplicated logic, dead or unused code, unreachable paths,
oversized modules, abstractions that do not pay for themselves, risky missing
abstractions, speculative dependencies, services, configuration surfaces,
compatibility layers or security machinery, inconsistent patterns, and drift
from the standards or spec. Untuned stack-specific template defaults are not
established requirements.
- Security: missing authentication or authorization, client-controlled
ownership, injection, unsafe parsing or deserialization, sensitive-data
exposure, secret handling, insecure defaults, and trust-boundary mistakes.
Inspect existing dependency or scanner output when available, but never imply
that local manifest inspection is a current vulnerability scan.
- Performance: N+1 queries, repeated network or database work, unnecessary
rendering, blocking work on hot paths, unbounded loops or collections, memory
growth, oversized payloads, missing pagination, and unsafe concurrency. Mark
hypotheses as unverified when runtime or profiling evidence is missing.
- Tests: important logic without coverage when a test command exists, weak
assertions, tests that only mirror implementation, excessive mocking, shared
state, time or order dependence, skipped or focused tests, placeholder tests,
swallowed failures, and missing browser or integration evidence where behavior
crosses a real boundary. Never invent a coverage percentage.
Do not nitpick harmless style differences unless they signal drift from the local
patterns. Prefer a short list of real findings over a broad list of guesses.
For a proportionality finding, state in Suggested fix what can be deleted,
which existing, standard-library, native-platform, or installed mechanism
replaces it, and which current requirement would be lost. Use None when no
current requirement would be lost. If the suggested fix removes or changes
shipped behavior, require an explicit user decision and never describe it as an
automatic repair.
Do not broaden a focused pass because another category might be interesting.
Do not report or call out non-critical concerns from omitted lenses, even as
suggestions for a later audit. If an obvious P0 is directly encountered outside
the selected lens, report and record it as an out-of-lens critical risk, but do
not continue searching that other lens.
If a possible secret is found, never quote its value, paste the matching source
line, or include raw command output containing it. Report only the redacted secret
category, file, line, risk, and remediation. Redact sensitive values from all
audit evidence before responding.
Step 4 - update the findings ledger
blueprint/context/findings.md is the durable record of findings. Chat reports
do not survive a context clear; the ledger does. It is the only file this skill
writes. If it is missing (an older install), create it with a # Findings
heading first.
The ledger never scopes the review. Review the code fresh in Step 3, then
record what the review found. Working from the open findings as a checklist and
verifying only those is the exact failure this file exists to prevent: a repair
can introduce a new defect that no existing entry points at.
One block per finding. The header line is the machine-readable contract and must
keep this exact shape; the prose below it is for humans and may vary:
### F-03 [P0] open - Retained auth volumes carry the run label
**File:** ops/agent-proof/compose.yaml:86
**Found:** 2026-07-21 by /audit (scope: current; lens: security)
**Why it matters:** ...
**Suggested fix:** ...
**Resolution:**
IDs are sequential within the ledger (F-01, F-02, ...), never reused and
never renumbered while their entries live here, even after a finding closes.
Bare IDs are scoped to the live ledger: /complete archives resolved entries
under a work-item prefix (feature 12's first F-03 becomes 12/F-03, and its
second build's becomes 12-build-2/F-03). The build attempt comes from the verified
spec/history proof, not arbitrary filename text; fix and rollback prefixes stay
their archive filenames. That prefixed form is the permanent reference. A later
ledger that has emptied and reset starts at F-01 again without colliding. Severity reuses the P0-P3
scheme from Step 5; only P0 and P1 block /complete. Status is one of:
| Status |
Meaning |
Blocks P0/P1 at /complete |
unverified |
Suspected, no confirming evidence yet |
No |
open |
Confirmed, not yet repaired |
Yes |
fixed |
Repaired, not yet re-reviewed |
Yes |
closed |
Repaired and re-reviewed against the new code |
No |
accepted |
Not fixing, by the user's explicit decision; reason recorded in Resolution |
No |
invalid |
Re-examination proved the finding wrong; evidence recorded in Resolution |
No |
After the review:
- Append each new confirmed finding as
open with the next sequential ID, one
past the highest ID present in the ledger (entries carried forward from
earlier work count; a fresh ledger starts at F-01).
- Record an unverified risk worth tracking as
unverified. It is a lead, not a
defect, and never gates a merge.
- Update the entries this pass re-examined: correct the status or severity and
note the evidence in Resolution.
- Move a
fixed finding to closed only when all three hold: this pass's
reviewed set included the finding's file, re-examining the repaired code
confirmed the original defect is gone and the repair introduced no new one,
and the report names the finding as closed. An unrelated new finding in the
same file gets its own entry and does not keep the repaired one open. Never
close a finding implicitly.
- Set
accepted only on the user's explicit decision in the current session,
and record their reason. Never accept a finding on their behalf.
- Set
invalid only when re-examination shows the finding was wrong, and
record that evidence in Resolution. It is a review verdict (or the
user's explicit call), never a shortcut past the gate for blocked work.
fixed blocking /complete is deliberate: a repair is not done when the code
changes, it is done when a review has looked at the result. /implement marks
repairs fixed; only a review pass moves them to closed.
Step 5 - report findings
Lead with findings, ordered by severity, using the IDs the ledger assigned:
F-04 [P1] Title
File: path:line
Why it matters: ...
Suggested fix: ...
Severity:
P0 - data loss, security break, or code that cannot ship
P1 - likely bug, broken contract, missing guard, or high-risk duplication
P2 - maintainability issue worth fixing before the feature closes
P3 - small cleanup, consistency issue, or follow-up candidate
Use P0 or P1 only when a concrete code path, violated contract or security
boundary, failing command or test, or reproducible behavior confirms the risk. If
the evidence is incomplete, list it under Unverified risks with the missing
validation instead of presenting it as a confirmed high-severity finding.
An otherwise pure proportionality finding is P2 or P3. Raise it to P0 or P1 only
when the unnecessary machinery causes a concrete reachable defect or violates an
established security or data-integrity boundary.
If there are no findings, say that clearly for the selected lens and name any
remaining risk or missing signal, such as "no test command declared" or
"browser flow not audited."
Then include:
- ledger changes: findings added, updated, or closed this pass, by ID
- commands run and results
- selected scope
- selected lens or lenses
- base branch, merge base, and commit range for
current, when available
- files or directories reviewed
- generated, third-party, or otherwise excluded paths
- applicable standards checked
- browser or runtime evidence inspected, when relevant
- skipped, focused, or placeholder tests found, when the tests lens was selected
- checks that were unavailable or could not run
- suggested repair order
- independent receipt status and target, when independent mode ran
For full, say whether coverage was complete or partial. Never label a partial
review as a full-project audit.
Rules
- A normal audit writes only the findings ledger. Independent Phase A may also
create the exact local spec snapshot and pending request. Phase B may write
only
blueprint/context/findings.md and blueprint/context/review.md.
Never edit, format, install, commit, merge, push, or delete anything else.
- Never let a builder complete its own independent request in the same session.
- Never silently substitute another reviewer adapter or model.
- A stale receipt is no receipt. Re-review the complete new checkpoint.
- A focused lens is not a broad audit. State what was not reviewed and never
imply that omitted lenses passed.
- The ledger reports status; it never defines what the review looks at. Do not
turn open findings into the review checklist.
- Never fetch, pull, or run network-backed audit tools without explicit approval.
- Never reproduce secrets or sensitive values in findings or command output.
- Findings first. Keep summaries short.
- Ground every finding in a file path and line number when possible.
- Avoid speculative rewrites. Recommend the smallest fix that removes the risk.
- Respect existing project patterns over generic advice.
- Do not require perfection. The goal is code that is understandable, consistent,
testable where it matters, and safe to keep building on.
Formatting
Format the output to match the project's conventions in
blueprint/context/ai-interaction.md: concise, scannable markdown, with lists for
enumerations and tables for matrices rather than dense paragraphs.
1---2name: audit3description: Audit current changes, a path, or the full project for quality, security, performance, or test problems and record durable findings. Independent mode prepares or completes a fresh-reviewer checkpoint handoff. Use for /audit, independent review, security review, code quality review, dead code, duplication, or standards drift.4---56# audit - review code quality against the project standards78**Context reuse:** Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed.910**First action:** Before project inspection, preflight, or any other tool call,11publish `running` to `blueprint/.state/run.json` using the dashboard activity12contract in `AGENTS.md`.1314Where this sits in the workflow:1516 /implement or /autopilot -> [audit] -> fixes or /complete17 (code exists) (review + (repair quality issues18 ledger) or close the feature)1920`/check` proves behavior against the spec. `/doctor` checks Blueprint setup and21workflow health. This skill checks the code itself through either a broad review22or one focused lens: quality, security, performance, or tests.2324It reviews code without changing it: it never edits source files, installs25dependencies, commits, merges, pushes, or starts product work. A normal audit's26one write is the findings ledger at `blueprint/context/findings.md` (Step 4),27the durable record of findings and their status. Independent mode may also28write `blueprint/context/review.md` using the exact record contract in29`reference/independent-review.md`.3031The quality-gate config controls when another workflow invokes this skill32automatically. An explicit `/audit` or `$audit` request always selects the audit33regardless of whether the applicable gate is `manual`, conditional, or `always`.34A selected `independentReview` gate invokes independent mode instead of letting35the builder satisfy its own review. When both audit and independent review are36selected, one passing independent review satisfies the audit gate.37A missing config means built-in defaults. If it exists but is invalid, stop and38point to `/doctor` before writing the findings ledger.3940## Input4142Treat scope and lens as separate controls. Arguments may appear in either order,43such as `/audit security current` or `/audit src/auth tests`.4445Optional scope:4647- no scope argument: use `current` when an active feature exists, otherwise use48 `changed` when local changes exist, otherwise use `full`49- `current`: audit the active `current-feature.md`, every committed feature-branch50 change from its merge base through `HEAD`, staged and unstaged changes,51 untracked source files, and nearby code affected by the feature52- `changed`: audit staged, unstaged, and untracked source files plus nearby code53- `full`: audit all project-owned source, tests, and configuration while excluding54 dependencies, generated files, build output, coverage output, caches, vendored55 code, and minified assets unless the user explicitly includes them56- path or directory: audit that area and the tests or callers needed to understand it5758Optional lens:5960- no lens: review all four lenses61- `quality`: maintainability, duplication, dead code, consistency, complexity,62 and standards drift63- `security`: authorization, input trust, injection, data exposure, secret64 handling, and unsafe configuration65- `performance`: query, network, rendering, memory, payload, concurrency, and66 unbounded-work risks67- `tests`: missing coverage for important logic, weak assertions, skipped or68 focused tests, poor isolation, brittle mocks, and likely flakiness6970`full` is always the full-project scope, not a lens. `/audit full` therefore runs71all lenses across the full project. When only a lens is supplied, select scope72with the normal no-scope rules. A focused pass may name one or more lenses. If73the request names multiple lenses, review their union and report them separately.7475If the requested scope is unclear, pick the smallest useful scope and state it.76If the lens is unclear, use all lenses and state that choice.7778Optional review mode:7980- `independent`: prepare or complete an independent review of `current` across81 all four lenses. It cannot be combined with `changed`, `full`, a path scope,82 or a focused lens because a completion receipt must cover the whole active83 work item.8485## Independent mode8687`/audit independent current` is a two-context workflow. The builder prepares a88request. With `review.independentExecution: "manual"`, the selected fresh89reviewer session runs the same command to complete it. With `automatic`, the90current adapter may start a fresh isolated reviewer subagent after preparing the91request. Blueprint verifies the exact target and later staleness. The adapter,92model, and fresh-context identity remain declared metadata.93An explicit invocation uses this execution setting even when the active94workflow's `independentReview` gate is `manual`; that gate value disables only95automatic selection by the workflow.9697Read `reference/independent-review.md` before either phase.9899### Phase A - prepare the handoff100101Use this phase when `blueprint/context/review.md` has no current `pending`102request for `HEAD` and the current spec hash.103104A current pending request without `Requested execution` is legacy and manual105only. Never add execution fields to it or run a subagent against it. Stop with106the fresh-session handoff; Phase B must omit `Actual execution` so the legacy107request and receipt keep both execution fields absent.1081091. Require an active spec with every build step checked and status `verified`, a110 non-default work branch, a reliable merge base, and a working tree matching111 the target except existing `blueprint/context/review.md` and112 `blueprint/context/findings.md` evidence.113 Independent mode accepts only a locally recorded remote default branch,114 local `main`, or local `master` as its enforceable base ref. Stop when none115 reliably covers the active work.116 The current full `HEAD` must be the approved application-code checkpoint.117 Include the verified spec when tracked; for a new ignored-spec request, prepare118 the exact local `Spec snapshot` under the reference contract. Never force-add119 it or change ignore visibility. Never create a commit inside Audit. If any120 tracked, staged, unstaged, or untracked path other than those two evidence121 paths differs from the target, stop and ask the user to approve a review122 checkpoint through `/implement`, even when normal checkpoint commits are123 disabled. Do not create a checkpoint solely for review/findings changes.124 This normal Phase A exception never allows snapshot Git differences or125 overwriting conflicting completion-recovery evidence.1262. Read installed adapters from `blueprint/.state/manifest.json` when valid.127 For older installs, detect `.agents/skills` as `codex` and `.claude/skills`128 as `claude`. These files prove project support, not that the external runtime129 is installed or authenticated.1303. Resolve the review executor from `review.independentExecution`:131 - For `manual`, ask which detected adapter and available model should review.132 Recommend an equal-or-stronger coding model, a different model family when133 practical, and high reasoning for sensitive work. Offer a fresh session in134 the current adapter as the fallback. Do not invent available models or135 offer an adapter that is not installed in the project.136 - For `automatic`, use only a live child-agent capability in the current137 adapter that can start with no builder transcript, disclose the exact138 reviewer adapter and model, and wait for completion. Spawn a generic fresh139 isolated child through the current runtime. Do not discover, select, or140 depend on a globally installed role, skill, prompt, or another workflow141 such as TraversyFlow. If the runtime cannot start that generic child from142 project-local instructions, or capability, isolation, identity, model,143 completion, or access to the same ignored spec/snapshot inputs cannot be144 confirmed, use the manual path in the original checkout.1454. Record the full target SHA, full merge-base SHA, the exact local base ref146 used to calculate it, exact spec SHA-256, current adapter and model,147 requested reviewer adapter and model, requested execution from148 `review.independentExecution`, workflow, and149 whether the configured Check gate is required. For a new ignored-spec request,150 create or reuse the exact snapshot first and record `Spec snapshot` as defined151 in the reference. Never add that field to an existing pending or completed152 record. Write the pending template exactly. Copy the full model identifier153 exposed by the active runtime or session metadata (for example,154 `gpt-5.6-sol`), never a generic family label155 such as `GPT-5`. If the runtime does not expose an exact identifier, record156 `unknown (runtime did not expose exact model)` instead of guessing. When the157 reviewer runtime cannot select a specific model before opening the session,158 record the exact runtime-default sentinel from the reference contract.1595. Execute the configured path:160 - For `manual`, set dashboard activity to `ready` and give the exact handoff161 command for the selected adapter. Claude Code uses162 `/audit independent current`; Codex uses `$audit independent current`;163 Copilot and OpenCode receive the equivalent plain-language instruction.164 Tell the user to open a fresh session in the original checkout with only the165 handoff, not the builder chat. Include target/base SHAs and, when present,166 the exact snapshot path and spec hash.167 - For `automatic`, freeze all parent product, test, spec, and config changes.168 Start one generic isolated child without the builder transcript. Instruct169 it to read the project-local Audit skill and170 `audit/reference/independent-review.md` from the current adapter tree, then171 execute Phase B using the same local spec/snapshot inputs against the172 prepared request. All review instructions come173 from that installed Blueprint project. The reviewer may write only174 `blueprint/context/findings.md` and `blueprint/context/review.md`; it must175 not repair code, change the spec, commit, or perform external actions. Wait176 for completion, then reread and validate the normal receipt before177 continuing. Record `fresh subagent` as its reviewer context.178179If automatic execution fails or any required property becomes uncertain, keep180the pending request intact, set activity to `ready`, and stop with the existing181manual fresh-session handoff. Never let the builder review its own work or skip182a selected independent-review gate.183184The builder never performs Phase B itself. It may continue only after a manual185reviewer session or automatic isolated reviewer produced a valid current receipt.186187### Phase B - perform the review188189Use this phase when a current pending request exists.1901911. Confirm the current adapter matches `Requested reviewer`, the current model192 matches `Requested model` unless the runtime-default sentinel was selected,193 and a sentinel request now records the exact model exposed by the session,194 `HEAD` matches `Target commit`, the recorded base ref still produces the195 recorded merge base, the exact spec hash matches, and no path differs from196 the target except `blueprint/context/review.md` and197 `blueprint/context/findings.md`. When `Spec snapshot` is present, verify both198 raw spec/snapshot hashes and every path, visibility, and Git condition in the199 reference. Stop on any mismatch or stale state.2002. Proceed only from the fresh reviewer handoff. Record `fresh session` for a201 manual reviewer or `fresh subagent` for an automatic isolated reviewer. This202 is a declaration, never cryptographic proof. If the reviewer has the builder203 conversation or is the builder continuing in place, stop and request a fresh204 context. For a legacy request with no `Requested execution`, require a fresh205 reviewer session, record `fresh session`, and omit `Actual execution`.2063. Run Steps 1 through 3 across `current` with quality, security, performance,207 and tests together. Review the code fresh against the recorded208 `Base commit` and `Target commit`; exclude the request and findings files209 from the code scope. Existing findings are context, never the review210 checklist.2114. Run `/check` from the reviewer session when the request says Check is212 required. Follow Check's server and evidence boundaries. A required check213 that cannot run prevents a passing receipt.2145. Update the findings ledger through Step 4, then replace the pending request215 with a completed receipt. Use `passed` only when the whole target was216 reviewed, required checks passed, and no P0 or P1 finding is `open` or217 `fixed`. Copy the reviewer's full runtime model identifier using the same218 rule as Phase A. Record `Check result` and keep all four receipt sections219 non-empty, using an explicit `None` entry when appropriate. List every220 unavailable verification command under Remaining risk, even when Check was221 not required and the receipt may still pass. Otherwise use222 `changes-requested` and name the exact blockers. Record actual `automatic`223 with `fresh subagent`, or actual `manual` with `fresh session`, including an224 explicit manual fallback from an automatic request.2256. Report the receipt target, reviewer adapter and model, commands, evidence,226 findings, remaining risk, and whether the receipt passed. Never repair code227 from the reviewer session.228229After changes are requested, the builder repairs through `/implement`, obtains230approval for a new checkpoint, and prepares a new request. The next reviewer231pass reviews the complete new delta, not only the old findings.232A local-spec-only revision may reuse the same approved product HEAD after normal233spec and verification gates, with a new snapshot/request and full fresh review;234it never requires an empty commit.235236## Step 1 - gather context237238Resolve this required context:239240- `AGENTS.md`241- `blueprint/config.json`242- `blueprint/context/project-overview.md`243- `blueprint/context/coding-standards.md`244- `blueprint/context/current-feature.md`245- `blueprint/context/findings.md`, for existing IDs and statuses246- `blueprint/context/review.md`, for independent request and receipt state247- `blueprint/context/ai-interaction.md`248- `blueprint/build-plan.md`, when feature order matters249- git branch and working tree status250- relevant source files, tests, and configs for the chosen scope251252For `current`, `changed`, and path scopes, begin with the diff or named area and253follow only the callers, dependencies, tests, and contracts needed to verify a254reachable finding. Do not survey unrelated directories. For `full`, preserve the255declared exclusions and inspect by bounded area rather than dumping the project256into one response.257258For `current`, resolve the comparison base without network access:2592601. Use a base branch declared by the active spec or project instructions.2612. Otherwise use the locally recorded remote default branch when available.2623. Otherwise use an existing local `main`, then `master`.2634. Find the merge base and inspect the committed delta through `HEAD`, then add264 staged, unstaged, and untracked work.2655. If no reliable base exists, say so and use the active spec plus local changes.266 Never claim that committed feature work was fully covered in that case.267268Do not fetch or pull to discover the base. For `full`, state the excluded paths269before reviewing so generated or third-party code does not consume the audit.270271Prefer `rg` and targeted file reads. Do not dump large files into the response.272273## Step 2 - run available signals274275Use existing commands only. Do not install tools.276277Run or inspect only the signals relevant to the selected lens and scope:278279- lint and typecheck commands when declared and relevant280- test command for the tests lens or when it directly validates a suspected risk281- build command when the selected lens needs compilation or bundle evidence282- existing security command for the security lens, when declared and locally runnable283- existing performance command for the performance lens, when declared and locally runnable284- targeted lightweight searches for the chosen lens, such as unused exports and285 copied logic for quality, unsafe trust boundaries for security, repeated or286 unbounded work for performance, and skipped or weak tests for tests287288Do not run broad checks unrelated to a focused lens. If a useful command is289missing, report that as a gap. Do not invent a pass or claim that a focused290review covered the other lenses.291292## Step 3 - review the code293294For all lenses, ground findings in reachable code and project-specific295expectations. Apply only the selected lens or lenses:296297- **Quality:** duplicated logic, dead or unused code, unreachable paths,298 oversized modules, abstractions that do not pay for themselves, risky missing299 abstractions, speculative dependencies, services, configuration surfaces,300 compatibility layers or security machinery, inconsistent patterns, and drift301 from the standards or spec. Untuned stack-specific template defaults are not302 established requirements.303- **Security:** missing authentication or authorization, client-controlled304 ownership, injection, unsafe parsing or deserialization, sensitive-data305 exposure, secret handling, insecure defaults, and trust-boundary mistakes.306 Inspect existing dependency or scanner output when available, but never imply307 that local manifest inspection is a current vulnerability scan.308- **Performance:** N+1 queries, repeated network or database work, unnecessary309 rendering, blocking work on hot paths, unbounded loops or collections, memory310 growth, oversized payloads, missing pagination, and unsafe concurrency. Mark311 hypotheses as unverified when runtime or profiling evidence is missing.312- **Tests:** important logic without coverage when a test command exists, weak313 assertions, tests that only mirror implementation, excessive mocking, shared314 state, time or order dependence, skipped or focused tests, placeholder tests,315 swallowed failures, and missing browser or integration evidence where behavior316 crosses a real boundary. Never invent a coverage percentage.317318Do not nitpick harmless style differences unless they signal drift from the local319patterns. Prefer a short list of real findings over a broad list of guesses.320321For a proportionality finding, state in **Suggested fix** what can be deleted,322which existing, standard-library, native-platform, or installed mechanism323replaces it, and which current requirement would be lost. Use `None` when no324current requirement would be lost. If the suggested fix removes or changes325shipped behavior, require an explicit user decision and never describe it as an326automatic repair.327328Do not broaden a focused pass because another category might be interesting.329Do not report or call out non-critical concerns from omitted lenses, even as330suggestions for a later audit. If an obvious P0 is directly encountered outside331the selected lens, report and record it as an out-of-lens critical risk, but do332not continue searching that other lens.333334If a possible secret is found, never quote its value, paste the matching source335line, or include raw command output containing it. Report only the redacted secret336category, file, line, risk, and remediation. Redact sensitive values from all337audit evidence before responding.338339## Step 4 - update the findings ledger340341`blueprint/context/findings.md` is the durable record of findings. Chat reports342do not survive a context clear; the ledger does. It is the only file this skill343writes. If it is missing (an older install), create it with a `# Findings`344heading first.345346**The ledger never scopes the review.** Review the code fresh in Step 3, then347record what the review found. Working from the open findings as a checklist and348verifying only those is the exact failure this file exists to prevent: a repair349can introduce a new defect that no existing entry points at.350351One block per finding. The header line is the machine-readable contract and must352keep this exact shape; the prose below it is for humans and may vary:353354 ### F-03 [P0] open - Retained auth volumes carry the run label355356 **File:** ops/agent-proof/compose.yaml:86357 **Found:** 2026-07-21 by /audit (scope: current; lens: security)358 **Why it matters:** ...359 **Suggested fix:** ...360 **Resolution:**361362IDs are sequential within the ledger (`F-01`, `F-02`, ...), never reused and363never renumbered while their entries live here, even after a finding closes.364Bare IDs are scoped to the live ledger: `/complete` archives resolved entries365under a work-item prefix (feature 12's first `F-03` becomes `12/F-03`, and its366second build's becomes `12-build-2/F-03`). The build attempt comes from the verified367spec/history proof, not arbitrary filename text; fix and rollback prefixes stay368their archive filenames. That prefixed form is the permanent reference. A later369ledger that has emptied and reset starts at `F-01` again without colliding. Severity reuses the P0-P3370scheme from Step 5; only P0 and P1 block `/complete`. Status is one of:371372| Status | Meaning | Blocks P0/P1 at /complete |373|---|---|---|374| `unverified` | Suspected, no confirming evidence yet | No |375| `open` | Confirmed, not yet repaired | Yes |376| `fixed` | Repaired, not yet re-reviewed | Yes |377| `closed` | Repaired and re-reviewed against the new code | No |378| `accepted` | Not fixing, by the user's explicit decision; reason recorded in Resolution | No |379| `invalid` | Re-examination proved the finding wrong; evidence recorded in Resolution | No |380381After the review:382383- Append each new confirmed finding as `open` with the next sequential ID, one384 past the highest ID present in the ledger (entries carried forward from385 earlier work count; a fresh ledger starts at `F-01`).386- Record an unverified risk worth tracking as `unverified`. It is a lead, not a387 defect, and never gates a merge.388- Update the entries this pass re-examined: correct the status or severity and389 note the evidence in **Resolution**.390- Move a `fixed` finding to `closed` only when all three hold: this pass's391 reviewed set included the finding's file, re-examining the repaired code392 confirmed the original defect is gone and the repair introduced no new one,393 and the report names the finding as closed. An unrelated new finding in the394 same file gets its own entry and does not keep the repaired one open. Never395 close a finding implicitly.396- Set `accepted` only on the user's explicit decision in the current session,397 and record their reason. Never accept a finding on their behalf.398- Set `invalid` only when re-examination shows the finding was wrong, and399 record that evidence in **Resolution**. It is a review verdict (or the400 user's explicit call), never a shortcut past the gate for blocked work.401402`fixed` blocking `/complete` is deliberate: a repair is not done when the code403changes, it is done when a review has looked at the result. `/implement` marks404repairs `fixed`; only a review pass moves them to `closed`.405406## Step 5 - report findings407408Lead with findings, ordered by severity, using the IDs the ledger assigned:409410 F-04 [P1] Title411 File: path:line412 Why it matters: ...413 Suggested fix: ...414415Severity:416417- `P0` - data loss, security break, or code that cannot ship418- `P1` - likely bug, broken contract, missing guard, or high-risk duplication419- `P2` - maintainability issue worth fixing before the feature closes420- `P3` - small cleanup, consistency issue, or follow-up candidate421422Use P0 or P1 only when a concrete code path, violated contract or security423boundary, failing command or test, or reproducible behavior confirms the risk. If424the evidence is incomplete, list it under `Unverified risks` with the missing425validation instead of presenting it as a confirmed high-severity finding.426An otherwise pure proportionality finding is P2 or P3. Raise it to P0 or P1 only427when the unnecessary machinery causes a concrete reachable defect or violates an428established security or data-integrity boundary.429430If there are no findings, say that clearly for the selected lens and name any431remaining risk or missing signal, such as "no test command declared" or432"browser flow not audited."433434Then include:435436- ledger changes: findings added, updated, or closed this pass, by ID437- commands run and results438- selected scope439- selected lens or lenses440- base branch, merge base, and commit range for `current`, when available441- files or directories reviewed442- generated, third-party, or otherwise excluded paths443- applicable standards checked444- browser or runtime evidence inspected, when relevant445- skipped, focused, or placeholder tests found, when the tests lens was selected446- checks that were unavailable or could not run447- suggested repair order448- independent receipt status and target, when independent mode ran449450For `full`, say whether coverage was complete or partial. Never label a partial451review as a full-project audit.452453## Rules454455- A normal audit writes only the findings ledger. Independent Phase A may also456 create the exact local spec snapshot and pending request. Phase B may write457 only `blueprint/context/findings.md` and `blueprint/context/review.md`.458 Never edit, format, install, commit, merge, push, or delete anything else.459- Never let a builder complete its own independent request in the same session.460- Never silently substitute another reviewer adapter or model.461- A stale receipt is no receipt. Re-review the complete new checkpoint.462- A focused lens is not a broad audit. State what was not reviewed and never463 imply that omitted lenses passed.464- The ledger reports status; it never defines what the review looks at. Do not465 turn open findings into the review checklist.466- Never fetch, pull, or run network-backed audit tools without explicit approval.467- Never reproduce secrets or sensitive values in findings or command output.468- Findings first. Keep summaries short.469- Ground every finding in a file path and line number when possible.470- Avoid speculative rewrites. Recommend the smallest fix that removes the risk.471- Respect existing project patterns over generic advice.472- Do not require perfection. The goal is code that is understandable, consistent,473 testable where it matters, and safe to keep building on.474475## Formatting476477Format the output to match the project's conventions in478`blueprint/context/ai-interaction.md`: concise, scannable markdown, with lists for479enumerations and tables for matrices rather than dense paragraphs.