agentleFS
chetan25chetan25/harness-claude-skills/skills/harness-verifier/SKILL.md

harness-verifier

Skill1 starsChanged 3 months agoMITView on GitHub

Use after generating or changing code in a harness task to verify it against quality gates — run the project's real lint, type-check, format, and test commands, check the code matches the project's naming/structure/import conventions and grounding diagrams, and gate scope creep (complexity/YAGNI) and drift from the original spec artifact (spec-conformance). Reports pass/fail and drives fixes until green before the work is considered done.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify changed code against the project's real quality gates.

    line 9
  2. Distinctive:

    Don't assume — read them from the repo:

    line 18
  3. Very specific:

    Node/TS: read package.json scripts (e.g.

    line 19
  4. Very specific:

    Python: check pyproject.toml / tox.ini / Makefile for ruff/flake8/pylint, mypy/pyright, pytest, black/ruff format.

    line 20
  5. Distinctive:

    If a gate has no configured command in the project, note it as "not configured" — don't invent one or run a global tool the project doesn't …

    line 24
  6. Very specific:

    Run each available gate with Bash and capture real output.

    line 27
  7. Distinctive:

    Only check diagrams that were loaded for this task.

    line 45
  8. Very specific:

    Use the chrome-devtools MCP server (already available via .mcp.json) to get a comparable current-build artifact, matching what kind of spec …

    line 70
  9. Very specific:

    If SPEC ARTIFACT: is "none" (or requirement.md's ## Artifacts are all "none" for the feature-complete pass), report this gate as …

    line 89
  10. Very specific:

    If anything is red: read the actual error, fix the cause (debug deliberately with superpowers:systematic-debugging if it's not obvious), …

    line 108
  11. Distinctive:

    Don't paper over failures: Don't loosen configs, skip tests, or add blanket ignores to make a gate green unless the user explicitly asks.

    line 114
  12. Distinctive:

    Honest reporting: If a gate can't run (missing dep, broken script), say so plainly rather than marking it passed.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Harness Verifier

Verify changed code against the project's real quality gates. You run the project's actual tooling with Bash and read the results — there is no external verifier program. Never claim a check passed without running it and seeing the output (superpowers:verification-before-completion).

When to run

  • Called by the dispatched task instance itself, as part of its own build-verify-test loop, before it reports back to harness-orchestrator.
  • Also invoked as the orchestrator's feature-complete spec-conformance pass, once all tasks are done.

Procedure

1. Discover the project's commands

Don't assume — read them from the repo:

  • Node/TS: read package.json scripts (e.g. lint, typecheck, test, format). Use the project's package manager (npm/pnpm/yarn per lockfile).
  • Python: check pyproject.toml / tox.ini / Makefile for ruff/flake8/pylint, mypy/pyright, pytest, black/ruff format.
  • Go: go vet, golangci-lint, gofmt -l, go test ./....
  • Other stacks: find the equivalent from the manifest/Makefile/CI config.

If a gate has no configured command in the project, note it as "not configured" — don't invent one or run a global tool the project doesn't use.

2. Run the gates

Run each available gate with Bash and capture real output. Scope to the changed code where the tooling allows (faster, clearer signal):

  • Lint
  • Type-check
  • Format check (check mode, e.g. prettier --check, black --check — don't auto-reformat the whole repo)
  • Tests (the suite, or the relevant subset)

3. Check pattern + diagram conformance

Compare the changed files against the generated project-patterns-* skill (if present, under .claude/skills/) and the surrounding code:

  • Naming (files, symbols) matches conventions.
  • Imports follow the project's style (aliases vs relative).
  • New files live in the right place; structure matches siblings.

If you catch the exact same pattern violation a second time in this run (not just a new instance of a general category — the same specific rule violated twice), note it as a Learning candidates line in your report back to the orchestrator (see the dispatch brief's required report format) — that's one of the triggers for staging a durable learning.

Also check the change respects the diagrams it was grounded on (named in the task's context packet):

  • diagrams/layers.mmd — the change introduces no dependency the layering rules forbid.
  • diagrams/data-flow.mmd — new flow follows the canonical path (e.g. doesn't have a route reach the DB directly if the flow goes through a service).

Only check diagrams that were loaded for this task; if none were, skip this sub-check.

4. Check complexity / YAGNI conformance

Runs on every task — cheap, no browser required. Get the task's actual changed-file set (git diff --stat or equivalent) and check it against the context packet's acceptance criteria and task text:

  • New files: does each one trace to a bullet in the acceptance criteria or the task description? Flag any that don't.
  • New dependencies: flag any addition (package.json/requirements.txt/etc. diff) not required to satisfy the stated task.
  • New abstractions (interface, base class, factory, strategy, extra indirection layer) for what the task asked as one concrete thing: check project-patterns-*/project-architecture for precedent, or an explicit extensibility requirement in the task text. Neither present → flag, citing the file/lines.
  • Unused exports: Grep the repo for references to newly exported symbols; zero references outside their own definition → flag as dead code.
  • Optional: flag a task phrased as one small change that produced an outsized number of new files/directories relative to sibling features.
COMPLEXITY GATE
  new files:        LoginFormFactory.ts, AbstractFormStrategy.ts — not traceable to task/criteria
  new deps:         none
  new abstractions: FormValidatorInterface (no precedent in project-patterns-ts, task didn't ask for pluggable validators)
  unused exports:   none
RESULT: 2 items flagged

5. Check spec conformance (UI tasks + feature-complete)

Runs when the context packet's SPEC ARTIFACT: is not "none" and the task is UI-touching, or when invoked as the orchestrator's feature-complete pass (harness-orchestrator step 7) — in the latter case, compare the whole built surface, not just this task's diff, against requirement.md's ## Artifacts.

Use the chrome-devtools MCP server (already available via .mcp.json) to get a comparable current-build artifact, matching what kind of spec artifact exists:

  • Screenshot/mock provided: navigate the running app, take_screenshot, save under .claude/harness/verify/. Compare screenshot-vs-screenshot.
  • Reference URL provided: navigate both the reference URL and the local build; screenshot both, and take_snapshot (DOM/accessibility tree) both for a structural cross-check.
  • Description only, no image: navigate/interact per the description, capture a screenshot plus list_console_messages/list_network_requests, and judge against a checklist derived from the description.
  • Non-UI spec (API/CLI behavior): the comparable artifact is a request/response or terminal transcript, not a screenshot.

Judge conformance yourself against an itemized checklist derived from the spec (present/missing elements, layout shape, copy correctness, obviously wrong colors/typography); when the reference is a live URL, also use the structural DOM diff to catch whole-section drift the visual judgment might miss. Report itemized matches and mismatches — never a bare "looks close":

SPEC CONFORMANCE — Login page
  reference: .claude/harness/spec-assets/login-mock.png
  actual:    .claude/harness/verify/spec-actual-login-20260901-1.png
  [x] header + logo present
  [x] email/password fields present
  [ ] MISMATCH: reference has one "Sign in" CTA; actual adds unrequested "Sign in with SSO"
  [ ] MISMATCH: reference is a centered card; actual is full-width, no card container
RESULT: 2 mismatches

If SPEC ARTIFACT: is "none" (or requirement.md's ## Artifacts are all "none" for the feature-complete pass), report this gate as not-configured / n/a rather than skipping it silently.

6. Report

Summarize each gate as pass / fail / not-configured with the key evidence:

VERIFICATION — <path or "changed files">
  lint          ✅
  type-check    ❌  LoginModal.tsx:12  Property 'children' has no initializer
  format        ✅
  tests         ✅  8 passed
  patterns      ✅  naming / imports / location OK
  diagrams      ✅  respects layers.mmd / data-flow.mmd
  complexity    ⚠️  2 items flagged
  spec-conform  ❌  2 mismatches
RESULT: 3 gates failing

7. Drive fixes

If anything is red: read the actual error, fix the cause (debug deliberately with superpowers:systematic-debugging if it's not obvious), and re-run that gate. Repeat until all configured gates pass. Only then is the task verified.

For complexity and spec-conform, concrete/structural findings (an untraceable new file, a missing element, wrong copy, an extra unrequested UI element — which registers on both gates at once, since unrequested UI is simultaneously spec drift and scope creep) get fixed and re-verified the same way, capped at 2 attempts. Remaining purely subjective findings (aesthetic spacing/color nuance on spec-conform, or a judgment call on complexity the task text doesn't clearly resolve) are reported to the user with the evidence rather than looped on indefinitely — point to the design-verify skill for spec-conform aesthetic follow-up.

Guardrails

  • Evidence before claims. "Tests pass" requires a test run you can point to.
  • Don't paper over failures. Don't loosen configs, skip tests, or add blanket ignores to make a gate green unless the user explicitly asks.
  • Honest reporting. If a gate can't run (missing dep, broken script), say so plainly rather than marking it passed.

See also

  • harness-orchestrator — each dispatched task instance calls this itself; also invokes the feature-complete spec-conform pass
  • harness-context-loader — supplies the acceptance criteria and SPEC ARTIFACT: this checks against
  • superpowers:verification-before-completion, superpowers:systematic-debugging
  • design-verify — recommended follow-up for aesthetic-only spec-conform findings

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.