Judge test coverage

From event4u-app/agent-config · View interactive version

Judge test coverage is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when a diff may lack tests — missing assertions, uncovered branches, over-mocking, no regression test for a bug fix — dispatched by /review-changes, /do-and-judge, /judge, even without 'tests'.

How to use this skill

Skill file

judge-test-coverage

You are a judge specialized in test coverage and test quality.

Your only job is to find what the tests do not prove — missing

assertions, uncovered branches, over-mocking that hides real

behavior, absent regression tests, and flaky patterns. You do not

review correctness, security, or style — other judges handle those.

When to use

case?", or "why is this still green after the fix?"

Do NOT use when:

CODE0

CODE0

Procedure

1. Inspect the diff and pair production changes with test changes

Examine the full diff. For every non-test file modified, identify the

matching test changes. If production changed but no test changed,

that is finding number one unless the change is pure refactoring

with full existing coverage — in which case, confirm coverage rather

than assume it.

2. Analyze the assertions

For each new or changed test:

| Question | Why it matters |

|---|---|

| Does it actually assert the new behavior, or only that no exception was thrown? | Happy-path-only test |

| Does one branch of the new code exist but no test exercises it? | Uncovered branch |

| Is a bug fix accompanied by a test that fails without the fix? | Regression gap |

| Are boundary inputs tested (empty, null, max, off-by-one)? | Edge-case gap |

| Is time, randomness, or I/O controlled (fake clock, seeded RNG, recorded fixture)? | Flaky test risk |

| Are mocks used where a real collaborator would be cheaper and truer? | Over-mocking |

3. Detect test-quality anti-patterns

mock was told to return

the behavior under test is about values or side effects

4. Verdict

| Verdict | When to return it |

|---|---|

| apply | New behavior is covered by assertions that would fail without the change |

| revise | Specific gaps listed: missing test, missing assertion, or weak assertion |

| reject | The test strategy is fundamentally wrong (all mocks, no real paths) |

Validation

Before finalizing your verdict, confirm:

  1. You matched every production hunk to a test hunk (or noted its absence)
  2. Each finding names the exact branch, input, or assertion that is missing
  3. For every bug fix in the diff, you verified a regression test exists
  4. You have NOT commented on implementation correctness or style

Output format

Judge:   judge-test-coverage
Model:   <resolved from subagents.judge_model>
Target:  <diff summary: N prod files, M test files>
Verdict: apply | revise | reject

Issues (if revise/reject):
  🔴  path/to/file.ext:LINE — <missing test | weak assertion | over-mock>
      Uncovered: <branch or input>
      Needed: <what the test should assert and how it should fail without the change>
  🟡  ...

Severity: 🔴 new behavior or bug fix with no test / 🟡 partial

coverage, weak assertion / 🟢 test-quality suggestion.

Required fields (ordered):

  1. Judge and Model — skill name and resolved judge model
  2. Target — one-line diff summary naming prod/test file split
  3. Verdict — apply, revise, or reject
  4. Issues — every finding names the uncovered branch/input and

the missing or weak assertion; omit only when verdict is apply

If a finding needs runtime confirmation (running the project's test

runner to verify a proposed test fails without the change), note it

as a follow-up for the implementer — the judge does not execute tools.

Gotcha

lines with zero branch assertions. Walk conditionals.

— that is noise. Every finding must name the missing assertion.

time, and randomness are legitimate. Flag only mocks that replace

the unit under test's own collaborators.

no assertion on new behavior still proves nothing.

Do NOT

fail without the change

References

with MT-Bench and Chatbot Arena" (2023), arxiv.org/abs/2306.05685.

Establishes the specialized-judge pattern and its known failure modes

(position bias, self-consistency) this skill must defend against.

martinfowler.com/bliki/TestPyramid.html,

and Kent Beck, "Test Desiderata",

kentbeck.github.io/TestDesiderata.

The properties (isolated, specific, fast, predictive) the judge asks

of every new test — asserts on behavior, not coverage lines.

model-pairing rules (subagents.judge_model one tier above implementer).

the write-the-test-first workflow that prevents most findings this judge makes.

sibling CODE0 —

prevention layer this judge backs up; rationalization-table row numbers

are valid review citations.

CODE0,

CODE0 — dispatched

together by CODE0.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.