/claude-harness:lot-auditfrom claude-harness
Audits a lot branch for security, performance and architecture before the PR is opened, fixes its findings, and writes the consolidated report docs/audits/lot-N.md. Use after lot-review, at the end of a lot, or when the user asks for an audit, a security review or an architecture review of lot work.
Ships in claude-harness. 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.
Audits the current lot branch before the PR, fixes what it finds, and writes one
consolidated report. A Critical finding left unfixed blocks the PR:
lot-deliverables.yml fails while the report carries an unresolved Critical row.
lot-test → lot-review → [lot-audit] → lot-ship
docs/audits/lot-N-review.md must exist for the current lot. Missing → stop
and tell the user to run lot-review first.
AUDIT_REPO=$(git rev-parse --show-toplevel)
git -C "$AUDIT_REPO" branch --show-current | grep -qE '^(feat|fix|chore)/lot-'
grep -qiE "(^|[^a-z])lot[ -]$N([^0-9]|$)" "$AUDIT_REPO/<Lots file>"
Both checks must pass (the match is case-insensitive: ## LOT 18, ## Lot 18
and ## lot 18 all occur). Otherwise stop and tell the user to reopen the
session in the audited repository: Skill(security-review) reviews the current
working directory and takes no repository argument. Every git command below
carries -C "$AUDIT_REPO", and every path resolves inside it.
Task Progress:
- [ ] Step 0 — lot-review deliverable present
- [ ] Step 0b — the session runs in the audited repository
- [ ] Step 1 — Context (lot, diff, touched files)
- [ ] Step 2 — Security audit
- [ ] Step 3 — Performance audit
- [ ] Step 4 — Architecture audit
- [ ] Step 5 — Coverage exclusions review
- [ ] Step 6 — Migration hygiene
- [ ] Step 7 — Fix the findings
- [ ] Step 8 — Consolidated report
- [ ] Step 9 — Commit the deliverable
The skill ends at the last box. Steps 2 to 6 produce findings, never a
deliverable: whatever a step returns, the security-review report included, is
an input of step 7, never the audit's result, and never the end of the turn.
git -C "$AUDIT_REPO" fetch -q origin develop
rtk proxy git -C "$AUDIT_REPO" log --first-parent origin/develop..HEAD --oneline
git -C "$AUDIT_REPO" diff origin/develop...HEAD --stat
The diff is against the fetched origin/develop, never the local develop.
Read the lot's section in the Lots file for its specific risks (credentials,
authorisation, export, file paths, payment, migrations): one Read of the
Current lot section range the SessionStart hook printed, or of the range
python3 <this skill's base directory>/../../hooks/lotfile.py section "$AUDIT_REPO" N
gives when it printed none. Then only the
files the lot touched and their direct dependencies.
Skill(security-review)
Give it the diff scope (branch changes vs origin/develop) and instructions
built from the repository's CLAUDE.md: stack, secrets handled, routes exposed,
the lot's specific risks. When the diff fits in this session's context, run its
discovery and false-positive phases inline, without sub-agents, and say so in
the report. Keep its findings for the Security table, then go on to step 3 in
the same turn.
If the skill is unavailable, use the manual checklist in checklists.md and say so in the report.
Review the diff against the Performance checklist in checklists.md.
Review the diff against the Architecture checklist in
checklists.md, CONVENTIONS.md and the repository's CLAUDE.md.
Read Coverage exclusions from the Gate parameters. An exclusion covering a
business package or class is a Warning, with its removal proposed and the
resulting real coverage stated.
Only when Migrations directory is not n/a:
A (added) against
origin/develop (git -C "$AUDIT_REPO" diff --name-status origin/develop...HEAD).
A modified merged migration is Critical.Fix the findings in this step, without re-running lot-review:
Apply the fixes, inside the lot's diff and its direct dependencies, each the smallest complete change (CODE-6).
<Validation command> green.
Commit them:
fix(N): apply the lot audit findings
A finding that needs a decision (an authorization model, a deviation from the lot's specification, a schema change) is not fixed by default: ask the owner, all such findings in one batch, then apply the answers and commit as above. A finding left unfixed stays in the report with its reason; an unfixed Critical blocks the PR. Under the autopilot, see Autopilot instead.
Write $AUDIT_REPO/docs/audits/lot-N.md, in English:
# Lot Audit — Lot N — [branch name]
**Harness ref:** [version of the installed harness that ran this audit, see below]
**Scope:** N modified files | **Fix commit:** [short SHA, or "none needed"] | **Verdict:** Ready for PR / Blocked
## Summary
| Dimension | Critical | Warning | Info |
|--------------|----------|---------|------|
| Security | | | |
| Performance | | | |
| Architecture | | | |
## Security
| Severity | Location | Finding | Action |
|----------|----------|---------|--------|
| … | `path:line` | … | fixed in <sha> / owner decision: … / open: <reason> |
## Performance
| Severity | Location | Finding | Action |
|----------|----------|---------|--------|
## Architecture
| Severity | Location | Finding | Action |
|----------|----------|---------|--------|
## Coverage exclusions
| Exclusion | Business code? | Proposed action |
|-----------|----------------|-----------------|
## Migrations
[status A check, expand/contract verdict, or "n/a"]
## Lot-specific notes
[whatever this lot alone required]
## Recommended next steps
1. …
The Harness ref is the installed copy of the plugin that ran:
python3 <this skill's base directory>/../../hooks/plugin-currency.py --installed-version
Empty output (an agent that loads no plugin) → the version main declares:
git -C ~/ENV/projets/claude-harness fetch -q origin main
git -C ~/ENV/projets/claude-harness show origin/main:plugins/claude-harness/.claude-plugin/plugin.json | jq -r .version
| Severity | Meaning |
|---|---|
| Critical | Blocks the PR (security flaw, conventions violation, data-loss risk) |
| Warning | Fixed in this lot, or tracked explicitly |
| Info | Optional improvement |
A fixed row stays in its table, its Action saying how and where it was fixed:
the CI guard looks for the resolution, not for the row's absence. It reads it
in the Action cell only, which must open with fixed in <sha> or
owner decision: …; any other start, open: … included, blocks the PR.
Recommended lot: when a Critical cannot be fixed within the lot's scope, the
same Warning dimension recurs on consecutive lots, or a cross-cutting theme
appears (secrets, validation, entity exposure, CORS, authentication, export
injection, coverage fiction), add a Recommended lot section (reason, proposed
row, affected files). The Lots file changes only on the user's approval, in a
commit of its own.
The tree is green: Step 7 ran the gate. This commit adds only the report and
its census rows, so it does not rerun it (GATE-2); cmp CLAUDE.md AGENTS.md
is silent (DOC-1).
A new report enters the ## Project documents census of CLAUDE.md, copied
to AGENTS.md (DOC-1).
Commit the report and the census, nothing else (GATE-8):
docs(N): add the lot audit report
Do not push: the push belongs to lot-ship.
Applies only when printenv HARNESS_AUTOPILOT prints 1: the autopilot script
sets it, and a model's account of the session is never the signal. No owner is
present, so nothing is asked; every finding falls in one of three classes:
| Class | Findings | What you do |
|---|---|---|
| Fixed, without a question | Every Critical and Warning: bugs, and findings with a security, performance or maintainability impact | Fixed in Step 7, Validation command green, committed fix(N): apply the lot audit findings |
| Ignored | Info, and minor findings with no added value: style or naming preference, comments, micro-optimisations with no measurable effect, opportunistic refactorings | Neither fixed nor turned into a recommended lot; the report keeps the row, action rejected: minor (autopilot) |
| Exception, which stops the run | The fix needs a data model change or a migration (ASK-1, CODE-3), a new dependency (ASK-1), an authorization model change, or a deviation from the lot's specification | Not fixed, action open: owner decision (autopilot); commit the report (Steps 8 and 9), then end the turn blocked, one question per exception |
blocked, since an unfixed Critical blocks the PR.Validation command still rejects at the second attempt is reverted
(git -C "$AUDIT_REPO" restore <path>) and deferred; a Critical one ends the
turn blocked.docs/audits/, the Lots file and docs/memory.md, whatever
the status, and stops the run otherwise.Lots file changes only on the user's approval.rtk proxy git log; every repository read is scoped to
$AUDIT_REPO.What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/bootstrap-projectGenerates a harnessed repository from templates/project: documents, gate parameters, plugin declaration, CI caller and dependabot, then verifies the result against harness-invariants. Use when starting a new project, or when bringing an existing repository under the harness for the first time./dep-updateChecks and updates a project's dependencies, applying patch and minor bumps and proposing majors, then validating the build before commit. Use when the user asks for a dependency update, wants to know what is outdated, or before writing a lot PR./harness-syncDetects and fixes drift between a repository's harness documentation and the reality of its code, settings and lots. Use after editing CLAUDE.md or a skill, when the stack, conventions or lot scope evolved, after a lot, or when the user asks to refresh, check or improve the harness.Other plugins' skills for the same job
npx claudepluginhub selimlbouraya/claude-harness --plugin claude-harness