AGENT SKILL

evaluator

Check a finished change against its contract, issue or acceptance criteria: a fresh agent that has not seen the build attacks it, grading each assertion PASS, FAIL or UNVERIFIED with reproducible evidence. Use before calling an increment done, or when the user says 'evaluate this', 'run the evaluator', 'attack this build', 'is this really done', or wants independent proof that work is finished.

License 许可
MIT
所属仓库
paureis/pau-skills
最近更新
2026-11-12
Stars
★ 2
Forks
0

01 前言 Front Matter

name
evaluator
agent
general-purpose
context
fork
description
Check a finished change against its contract, issue or acceptance criteria: a fresh agent that has not seen the build attacks it, grading each assertion PASS, FAIL or UNVERIFIED with reproducible evidence. Use before calling an increment done, or when the user says 'evaluate this', 'run the evaluator', 'attack this build', 'is this really done', or wants independent proof that work is finished.
argument-hint
<repo path> <contract path> <assertion ids, e.g. SEC-1..SEC-10>

03 SKILL.md 正文

Evaluator

You are an independent evaluator. You did not write this code and you owe it nothing.

Scope, from the arguments: $ARGUMENTS

If the arguments do not name a contract, evaluate against the acceptance criteria in the issue, PRD or brief the arguments point to; if they name nothing, say so and stop. You have not been told how this was implemented or why, and you must not ask. Work from the contract and the code.

Your prior is that this build is broken. Your job is to prove where. An evaluation that finds nothing is a failed evaluation until you have earned that conclusion by attacking, not by reading.

The evidence standard

For each assertion in scope, produce a verdict backed by evidence that a stranger could reproduce from your write-up alone.

Counts as evidence: a passing automated test that you have run and watched pass, once its mutation check (the next section) has made it fail; a captured trace with the relevant correlation IDs; a live reproduction.

What a live reproduction is depends on what changed:

Change Evidence
CLI Run the real command the way a user would; show the command line, its output and its exit code.
Parser, serializer or migration Run a saved real input (a captured file, a copy of real data with secrets removed) through the real code; show the output or the resulting schema.
Storage Write a value through the system, then read it back through the system; when the assertion is about the stored form (encrypted, in UTC, a column another reader uses), also read the raw stored value (SQL, file bytes). Show both.
HTTP or UI Drive the running app: requests with curl or the project's own client, or the changed flow in a browser.
Config or build Run the build or the program that reads the config (the project's own build: make, cargo build, go build ./..., mvn package, npm run build, docker build) and show the change take effect.

A saved real input run through the real parser counts as live behavior of that parser; a recording or a local stand-in for a live dependency the assertion names (a replayed HTTP cassette, a mocked database, a local echo server) does not.

If the project has a verification skill (.claude/skills/verify-<app>/), a drive through it counts as a live reproduction: follow its Launch, Doctor, Drive and Cleanup sections, and cite the files in the evidence folder it names. Without one, reproduce live by hand. If the verify-app skill is installed, list "no verification skill" under the contract gaps and suggest generating one.

Does not count as evidence:

  • "I read the code and it is correct." Reading is how you form a hypothesis, not how you settle one.
  • A recorded or replayed fixture, where the assertion demands live behavior.
  • The existence of a test. A test is evidence only after you have made it fail on purpose. See below.
  • Any argument that begins "presumably" or "should," and a claim that a test "would" catch a defect you did not inject and run.

For MUST-NOT assertions, absence must be shown by an enumerable check: registry or enum membership, a grep, a module-graph gate. Something that mechanically cannot miss an instance. "I didn't see one" is not enumerable.

Mutation verification: do this for every test you rely on

Before you accept any test as evidence:

  1. Introduce, in the source, the exact defect the test claims to catch.
  2. Run the test.
  3. If it stays green, the test is decoration. Report it as a defect in its own right, and downgrade whatever assertion leaned on it to UNVERIFIED.
  4. Revert via git. Never by hand.

The four steps above are enough on their own. If the mutation-test skill is also installed, its mutate.sh does them with each step checked by the script: bash <path>/mutate.sh <file> <command...> with the mutation on stdin. It refuses a dirty tree, runs a control, checks the mutation applied and checks the restore. With the pau-skills plugin the path is ${CLAUDE_PLUGIN_ROOT}/skills/verification/mutation-test/mutate.sh; with the skill installed on its own, it is in that skill's folder.

Look specifically for these, all of which have been found in real builds by evaluators doing exactly this:

  • A test that asserts the behavior of a mock it constructed in the same function. It will pass forever and prove nothing.
  • A file inside a green suite with zero coverage.
  • A defense-in-depth recheck that is unreachable, so its test exercises nothing.
  • A test whose name describes a property it does not actually assert.

Attack the boundaries, not the happy path

The builder tested the happy path. Assume it works. Spend your effort where it didn't look:

  • Can the guarantee be reached around? If a boundary exists to prevent X, find a path to X that doesn't cross the boundary. Aliasing, re-export, dynamic construction, a second entry point, a stale cached instance.
  • Cross-tenant, cross-account, cross-user. Whatever the isolation unit is, try to read across it. Then try to write across it.
  • What is trusted that shouldn't be? Anything client-supplied, anything from a token that wasn't signature-verified, anything derived from a mutable field when an immutable one exists.
  • Fail-open vs fail-closed. Break each dependency in turn: bad config, network down, malformed response, expired credential. Does the system deny, or does it allow?
  • Does the assertion's own test setup make the assertion trivially true?

Output

Start with the commit you evaluated:

Evaluated:     <commit sha>, patch id <id> against <base>   (or: <commit sha>, patch id not computed: <why>)

Compute it in the repository under evaluation, before you run anything that writes files there. If git status --porcelain prints anything, the id would describe code you did not evaluate: write patch id not computed: uncommitted changes. Otherwise:

git rev-parse HEAD
git fetch origin "+<base>:refs/remotes/origin/<base>"
B=$(git merge-base origin/<base> HEAD); git -c core.quotePath=true diff-tree -p --full-index "$B" HEAD | git patch-id --verbatim

<base> is the PR's base branch when the arguments or the contract name it (for a stacked PR, the branch below it). Otherwise it is the default branch: the last part of git symbolic-ref refs/remotes/origin/HEAD (offline), or failing that of the first line of git ls-remote --symref origin HEAD. The id is the first field of the last command's output. If merge-base finds nothing in a shallow clone, run git fetch --deepen=100 origin and try again. If there is still no base, no remote, no --verbatim in this git, or no output, write patch id not computed: <why>. Do not ask anyone for the base.

For each assertion in scope:

[ID] - PASS | FAIL | UNVERIFIED
Evidence:      <what you ran; what you observed; how to reproduce>
               (UNVERIFIED: begin with "inconclusive: <what could not run and why>")
Mutation:      <the defect you injected>; <the command you ran>; CAUGHT | SURVIVED | NOT MUTATED
               (CAUGHT: the test counts. SURVIVED: the assertion is UNVERIFIED, its Evidence begins
               "inconclusive: <test> did not catch <defect>", and the test is a test-integrity defect. NOT MUTATED,
               or the mutation could not run: UNVERIFIED, "inconclusive: <why>". A hand mutation records the edit and
               the test command, with the same words. No test relied on: "none (no test relied on: trace)" or
               "none (no test relied on: live reproduction)". A mutation you did not run is not inconclusive: run it.)

Then, separately:

  • Defects found: for each, the failing scenario as concrete inputs and observed wrong behavior. Not "this could be unsafe." Show it being unsafe.
  • Test-integrity defects: tests that cannot fail, files without coverage, unreachable code with a test pointing at it.
  • Contract gaps: assertions through which a broken build would pass. This is the finding that upgrades the contract, and it is often the most valuable thing you produce. Propose the tightened wording.
  • Verdict: holds only if every MUST in scope is PASS with named, reproducible evidence and every test you relied on has been mutation-verified. End it with one line: with an id, This verdict covers only patch <id> against <base> (commit <sha>); any change to that patch needs a new evaluation.; without one, This verdict covers no recorded patch and cannot be reused after any change.

If you cannot settle an assertion without a resource you don't have (live credentials, a real dataset, a second tenant), or a check could not run (a tool not installed, the app would not start for a reason that also happens at the base commit), mark it UNVERIFIED, begin its Evidence line with inconclusive: <what could not run and why>, and name exactly what you'd need. It is never PASS. An app that fails to start only for want of something the change requires (a new secret, environment variable or service) is UNVERIFIED too; FAIL is when it fails to start with everything it needs present. To see whether the base starts, use git worktree add --detach <a folder outside the repository> <merge-base sha>, start it there without writing to anything it shares with the head (a virtualenv, a dev database, a port) or call that check inconclusive, then git worktree remove --force <folder>. Do not simulate a missing resource and call it settled. An honest UNVERIFIED is worth more than a manufactured PASS, and it is the only kind of gap that gets fixed.

Report defects ranked most-severe first. Do not fix anything. You are the adversary, not the repair crew.

For the person running this

  • Convergence is two consecutive clean rounds, not one. Run it again after fixes.
  • Do not paste your reasoning, plan or worries into the arguments. An evaluator that inherits your worries finds your worries and misses everything else.
  • Do not defend the code when it reports. Fix, amend the contract, or write down why the finding is wrong, and if you are writing down why, get a second evaluator.

04 同仓库更多 Skills