/claude-harness:lot-testfrom claude-harness
Checks and completes the tests of a lot in a new session, after the development's close: black-box tests drawn from the lot's specification, test files only, coverage gate green at the repository's own threshold. Use after lot-start closed the development, before lot-review, or when the user mentions tests, coverage, JUnit, Vitest, Karma, JaCoCo or verification.
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.
Runs in a new session, under any profile, once lot-start has closed the
development (its Step B3). The lot's tests were written with its code (GATE-3):
this skill checks and completes them, it does not rewrite them. A fresh
look finds the forgotten cases; it does not know the decisions behind the code,
so it never touches the code.
development → close → [lot-test] → lot-review → lot-audit → lot-ship
Read the ## Gate parameters table of the repository's CLAUDE.md and use its
values throughout; this skill hard-codes no command and no threshold.
| Parameter | Used for |
|---|---|
Stack | Selects the backend or frontend part of section 2 |
Validation command | The single command run in section 3 |
Coverage tool | Where the gate is wired and where the report lands |
Coverage threshold | The current ratchet value |
Coverage exclusions | The list reviewed in section 3.2 |
Lots file | The lot's scope and acceptance criteria |
A missing section or parameter → stop and ask the user to fill it.
git status --porcelain # must print nothing
START=$(git rev-parse HEAD) # the starting point of this run
Write down the SHA START holds: a shell variable does not survive from one
Bash call to the next, so section 5 uses that SHA, never a new
git rev-parse HEAD, which would make the check pass on an empty range.
A dirty tree → stop and report it: the development is not closed, or a previous run left a test revealing a bug (section 1, step 6), whose fix belongs to a development session.
Then read docs/memory.md (MEM-1), if it exists, and the lot's section in the
Lots file: 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 <root> <lot>
gives when it printed none.
You write test files only, chosen by Stack:
Stack | Test files |
|---|---|
backend | under src/test/ |
frontend | *.spec.ts |
harness | under tests/ |
other | any file, each one listed in your report |
The one other file you may write is docs/audits/lot-N-friction.md, your
friction entry (GATE-9). Never modify production code, an existing assertion, or the coverage
configuration (threshold, exclusions).
The lot's acceptance criteria are the test list.
List what the lot added or modified, against the fetched origin/develop,
never the local develop:
git fetch -q origin develop
git diff --name-status origin/develop...HEAD
Fill the business-rule matrix (section 2) and find each row's existing test.
For each criterion or branch left uncovered, write a black-box test: drawn from the lot's specification, not from the code, so that it asserts what the code should do rather than what it does. Write it as CODE-6 says: the smallest complete test, on the fixtures and helpers already there.
Validation command green (section 3) → commit the added tests:
test(N): complete the lot coverage. Nothing added → no commit.
A test you added is red → it has revealed a bug. Do not fix it: no
change to the code, no weakened assertion (GATE-2). Put it in a new test file
of its own, the bug at its top as a comment (expected, actual). Commit the
other added tests only if the Validation command is green with that file
moved out of the repository for the run, never skipped or disabled; then put
it back, uncommitted in the working tree. Go to section 4, then stop and
report the bug: a development session fixes it, and lot-test runs again in
a new session.
CLAUDE.md or of the lot section gets a dedicated test.Fill it before writing anything. One row per rule, none without a test.
Rule (from the lot section or CLAUDE.md) | Kind | Expected test |
|---|---|---|
| … | unit / integration | … |
Rows that recur and are easy to forget:
| Rule family | Expected test |
|---|---|
| Server-computed totals or references | Client-supplied value is ignored; the server value is the one asserted |
| State guards (finalised, cancelled, archived) | Mutation attempt → domain exception → the documented HTTP status |
| Snapshotted values (rates, prices) | Changing the source after the snapshot does not alter existing rows |
| Secrets and passwords | Never serialised, never logged — asserted on the response body and the log output |
| Authentication on protected routes | Unauthenticated → 401; valid credentials → 200 |
| Export injection (CSV, spreadsheet) | A cell starting with =, +, - or @ is neutralised |
| Authorisation / ownership | A user cannot read or mutate another user's row |
| Route (frontend) | Navigating to the path renders its component, through the real router |
| Route guard (frontend) | Denied → redirect to the documented route; allowed → the route renders |
| HTTP interceptor (frontend) | The header or error handling it adds is asserted on the request the HTTP testing controller sees |
Stack = backend)Stack = frontend)loadComponent / loadChildren loader is covered only once the
route is navigated; a routes spec navigates each lazy path
(app.routes.spec.ts) rather than an exclusion.integration-check (GATE-5).After a red test, rerun that test alone in the Stack's targeted form (a suite
file under tests/ for harness, one test class or filter for a backend or
frontend), then the full command once on the final tree: its green run covers
the commit (GATE-1, GATE-2).
<Validation command>
It runs the tests and enforces the coverage threshold; red blocks the commit
(GATE-2). Then open the report of Coverage tool: a global percentage above the
threshold can hide a business class at 0 %.
Challenge every entry of Coverage exclusions:
The threshold only goes up: never lowered, never disabled, never an exclusion added to turn a build green. A lot that cannot reach it is a finding to report.
Gate parameters read; no command or threshold improvisedSTART noted, docs/memory.md read<Validation command> greenCoverage exclusions reviewed, any business-package exclusion reportedtest(N): complete the lot coveragegit diff --name-only "$START" HEAD
Every path listed is a test file of the table in section 0.1, or the friction
file. Another path →
stop and report it; never rewrite the history to hide it. The check sees
only this run's commits: a fix committed by a development session before the
run is not in it. lot-review checks the test(N) commits again.
Whatever the profile, stop after this skill (LOT-7): tell the user to end the
session, run /home/selim/.local/bin/claude-profile claude if the profile is
deepseek, and open a new session for lot-review, then lot-audit and
lot-ship.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
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./i-have-adhdShape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress tangents, give specific time estimates, make wins visible. Invoke with /i-have-adhd; stays on until "stop adhd mode"./integration-checkRuns the smoke test of a frontend against its real backend, by hand or through the repo's Integration command, and writes docs/audits/lot-0-integration.md, which every frontend PR requires. Use before the first frontend PR, when the API contract changed, or when the user mentions integration, the real backend, end-to-end or the contract./lot-auditAudits 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.npx claudepluginhub selimlbouraya/claude-harness --plugin claude-harness