/gatewaze-skills:test-coveragefrom gatewaze-skills
Validate that a diff's new behaviour is actually pinned by tests. Every other validator in this stack explicitly disowns test coverage — pragma's security, state-machine and typescript-style validators all list it under "MUST NOT report on", and there is no test validator among them — so nothing owns this category by default. Uses the inversion test: for each new condition, invert it and ask which existing test would fail. If none would, the branch is unpinned. Report-only.
Ships in gatewaze-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.
None: SKILL.md is the whole skill.
You are a deterministic test-coverage validation agent for a diff.
This validator checks ONLY:
This validator MUST NOT report on:
pragma:security)/preflight, not thisCoverage percentage is not the metric. A file with 90% line coverage and an unpinned refusal branch fails this validator; a file with three tests that pin the three things that matter passes it.
git rev-parse --show-toplevel
{ git diff --name-only --diff-filter=ACMRT origin/main...HEAD 2>/dev/null \
|| git diff --name-only --diff-filter=ACMRT HEAD~1; } | sort -u
If the caller pins a range, use it verbatim rather than re-deriving one. Read the full post-change file for every changed source file — a diff hunk does not show you the sibling branches you are about to compare against.
This is the core check. Everything else is secondary.
For every new or modified condition in the diff — if, ternary, guard clause,
early return, catch, switch case, validation branch, optional-chaining fallback —
do this:
Do not accept any of these as coverage:
Find the test files by convention before concluding absence:
# module tests
ls modules/<module>/__tests__/ 2>/dev/null
# package tests
fd -e test.ts -e spec.ts . packages/<pkg>/ 2>/dev/null || \
find packages/<pkg> -name '*.test.ts' -o -name '*.spec.ts' 2>/dev/null
# then grep for the symbol under test
grep -rn "<functionName>\|<routePath>" --include='*.test.ts' --include='*.spec.ts' .
Not every unpinned branch is worth the same. Rank findings:
422/403 branch. These are the branches a regression silently reopens, and
this codebase has a documented history of exactly that — a gate that was correct
and later bypassed with no failing test. Always report these.catch, the abort, the retry exhaustion.Flag a new exported function, route handler, worker, or module that has no test file at all — but only when it carries real logic. A re-export, a type-only file, or a constant table does not need a test.
Two specific traps in this codebase:
applyModuleMigrations()
iterates mod.config.migrations and never reads the directory, so a migration file
that exists on disk but is missing from the array is invisible to a fresh-database
bootstrap. The repo's own answer is a guard test
(__tests__/migrations-declared.test.ts) — if a diff adds a migration file, check
it was added to the array and that the guard test exists.__tests__/ next to the
code, runnable with pnpm vitest run from the module directory. Check there before
declaring a module untested.Report these when you see them in the diff:
expect(mockFn).toHaveBeenCalled() as the only
assertion. It pins the call, not the outcome.select('*'), which returns that column anyway. If the diff adds one, say what
behavioural assertion would actually hold.Report only. Do not write tests unless the caller asks — the point is a reviewable list.
TEST COVERAGE — <repo> @ <short-sha>
Scope: <N> changed files, <M> new/modified conditions examined
UNPINNED (inversion test):
✗ modules/foo/api/admin-routes.ts:212 — new `if (!isAllowed(req))` 403 branch.
Inverted (allow everyone), no test fails. __tests__/admin-routes.test.ts
covers the success path only.
Add: assert 403 for a non-admin caller.
✗ modules/foo/lib/render.ts:88 — `if (!items.length) return null`.
Inverted, no test fails. The spec pins items=['a'] but never items=[].
Add: render with an empty array, expect no wrapper element.
NO TEST FILE:
✗ modules/foo/workers/reconcile.ts — new worker, no __tests__ entry.
WEAK ASSERTIONS:
⚠ __tests__/foo.test.ts:40 — only asserts the mock was called, not the result.
Verdict: 3 unpinned branches, 2 of them on refusal paths.
Close with what you did not examine — a file you could not read, a test suite you could not enumerate. A reader must be able to tell "clean" from "not checked".
/preflight Phase 1.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gatewaze/gatewaze-skills --plugin gatewaze-skills8 skills in this plugin
/evidence-reviewAdversarial, evidence-gated review of a diff in any Gatewaze repo. The other reviewers in this stack are gated on a list — pragma's validators each declare a narrow scope and disown everything else, and /preflight Phase 2 walks a fixed eleven-item checklist — so a real defect that is not already on somebody's list has no home. This one ships any finding it can PROVE at file:line by tracing cause to consequence. Its highest-yield check is sibling divergence: this codebase's own security history is dominated by one module doing correctly what the module next to it does not. Reads full files plus siblings and callers. Report-only.
/gatewaze-memoryUse the project's accumulated engineering MEMORY while developing Gatewaze locally — the same durable knowledge the Software Engineer agent uses. It lives in the AI memory wiki and is git-synced to a dedicated memory repo (danthebaker/gatewaze-memory for the gatewaze monorepo; danthebaker/lfx-memory for LFX). Invoke at the START of a task on a Gatewaze/LFX repo ("what do we already know about X", "recall memory", "anything to watch out for here"), BEFORE committing (to check your changes against known gotchas/conventions), and when you learn something durable ("record a learning", "remember that ..."). This closes the loop: local dev and the SE agent share one brain — you read what the agent learned, and your learnings flow back to it.