/claude-harness:lot-reviewfrom claude-harness
Reviews the code of the current lot, applies the retained fixes and asks the owner about the findings that need a decision, then writes docs/audits/lot-N-review.md. Runs only under the claude profile, in a new session. Use after lot-test and before lot-audit, or when the user asks for a code review of the lot.
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.
None: SKILL.md is the whole skill.
Reviews the lot's own code, applies the fixes, and records what happened. No PR
exists yet (lot-ship opens it), so nothing is posted on GitHub.
lot-test → [lot-review] → lot-audit → lot-ship
printenv ANTHROPIC_BASE_URL
Not empty, and its host is not api.anthropic.com → the session runs under the
deepseek profile (LOT-7; the definition is profile() in the plugin's
hooks/lotfile.py). Empty, or https://api.anthropic.com as the desktop app
sets it → the claude profile, go on. Under deepseek, do not review, do not
touch the working tree; print exactly this, then end the turn:
Code review needs the
claudeprofile, in a new session.
- End this session.
- Run
/home/selim/.local/bin/claude-profile claude.- Open a new session.
- Re-run
lot-review.
Never attempt the switch yourself (PROF-1).
REVIEW_REPO=$(git rev-parse --show-toplevel)
git -C "$REVIEW_REPO" branch --show-current
The current branch must match ^(feat|fix|chore)/lot-, and that lot's section
must exist in this repository's Lots file; otherwise stop and tell the
user to reopen the session in the repository holding the lot branch.
Skill(code-review) reads the working directory and --fix writes to it, so a
session in the wrong repository edits the wrong files. Every git command
below carries -C "$REVIEW_REPO", and the deliverable is written inside it.
The target is the local diff against the fetched origin/develop, never the
local develop:
git -C "$REVIEW_REPO" fetch -q origin develop
# gh resolves the repository from the current directory, and follows the
# branch's upstream unless the branch is named.
(cd "$REVIEW_REPO" && gh pr view "$(git branch --show-current)" --json number,url,headRefName) 2>/dev/null
rtk proxy git -C "$REVIEW_REPO" log --first-parent origin/develop..HEAD --oneline
A PR already open (a lot re-reviewed after lot-ship) is said in the report;
the review is still of the local diff. Read the lot's section in the
Lots file: the review is against the lot's stated scope. The SessionStart hook
prints its Current lot section range; without that line, get the range from
python3 <this skill's base directory>/../../hooks/lotfile.py section "$REVIEW_REPO" N, then one Read of it.
Skill(code-review) with arguments: --fix feat/lot-N-<slug> (diff against origin/develop)
Name the branch and the base: a lot branch has no upstream before lot-ship
pushes it, and without a target code-review falls back to main.
--fix applies the retained findings to the working tree, without committing.
It may run as a forked agent writing the tree while this session reads it:
git -C "$REVIEW_REPO" restore <path>) and record its finding as
deferred. The lot's status line in the Lots file and docs/memory.md are
the exceptions.blocked.A finding about code the lot did not touch becomes a candidate lot in Step 4.
Then, yourself, once code-review has returned:
The project memory. Read docs/memory.md (MEM-1) against the code and
the lot's diff. A note that is wrong, stale, or a conclusion without its
reason is a finding, fixed like the others; the header stays, and the file
stays within 6000 characters (wc -m).
The lot-test boundary. Its test(N) commits touch test files only (and
docs/audits/lot-N-friction.md, GATE-9) and never weaken an existing
assertion:
rtk proxy git -C "$REVIEW_REPO" log --format='%h %s' --stat -p --grep='^test[(]' origin/develop..HEAD
A file outside the tests, or an assertion removed or loosened, is a finding.
Read what --fix changed before committing it.
<Validation command> # from Gate parameters, once on the tree the fixes leave (GATE-1)
git -C "$REVIEW_REPO" diff --stat
git -C "$REVIEW_REPO" add -- <the paths listed above, docs/memory.md excepted>
git -C "$REVIEW_REPO" commit -m "fix(N): apply the lot review findings"
fix(N) for a defect, refactor(N) for a cleanup with no behaviour change; two
commits when the lot produced both. A memory correction is its own commit:
git add docs/memory.md, then docs(N): update the project memory. A rejected
finding gets its reason in the report.
Write docs/audits/lot-N-review.md:
# Lot Review — Lot N — [branch name]
**Harness ref:** [version of the installed harness, see below]
**Model:** [the model that ran this review]
**Target:** local diff origin/develop...HEAD
**Reviewed at:** [short SHA of HEAD once the fixes are committed]
**Verdict:** Clean / Fixed / Findings deferred
## Findings
| # | Severity | Location | Finding | Outcome |
|---|----------|----------|---------|---------|
| 1 | … | `path:line` | … | fixed in <sha> / rejected: <reason> / deferred to <lot> |
## Candidate lots
[cross-cutting findings outside this lot's scope, or "none"]
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 then
git -C ~/ENV/projets/claude-harness show origin/main:plugins/claude-harness/.claude-plugin/plugin.json | jq -r .version.
The tree is green: Step 3 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 review report
Do not push: the push belongs to lot-ship.
Report the verdict and the deliverable path, then hand over to lot-audit. Do
not run the audit from this skill (GATE-7).
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 bug (wrong behaviour), and every finding with a security, performance or maintainability impact | Fixed inside the lot's diff, Validation command green, committed as in Step 3 |
| Ignored | 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 candidate lot; the report keeps the row, outcome 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, a deviation from the lot's specification, or a deliverable the lot's section names that the diff does not contain | Not fixed, outcome open: owner decision (autopilot); commit the report (Steps 4 and 5), then end the turn blocked, one question per exception |
blocked.Validation command still rejects at the second attempt is reverted
(git -C "$REVIEW_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.claude profile, in a new session (LOT-7).rtk proxy git log.$REVIEW_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