agentleFS
bhaumikmaanbhaumikmaan/claude-code-master-skills/skills/code-verification/SKILL.md

code-verification

Skill3 starsChanged 7 months agoMITView on GitHub

Adversarial verification of code changes. Tries to break implementations rather than confirm they work. Produces structured PASS/FAIL/PARTIAL verdicts with evidence. Use when verifying code changes, after non-trivial implementations, before reporting task completion, or when asked to check if something works.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 15 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If you catch yourself writing an explanation instead of a command, stop.

    line 30
  2. Very specific:

    Frontend: Start dev server, use browser automation to navigate/click/screenshot, curl subresources (images, API routes, static assets -- …

    line 36
  3. Distinctive:

    Backend/API: Start server, curl/fetch endpoints, verify response shapes against expected values (not just status codes), test error …

    line 37
  4. Very specific:

    CLI/script: Run with representative inputs, verify stdout/stderr/exit codes, test edge inputs (empty, malformed, boundary), verify …

    line 38
  5. Distinctive:

    Database migrations: Run migration up, verify schema matches intent, run migration down (reversibility), test against existing data not …

    line 42
  6. Very specific:

    Read README / project config for build/test commands and conventions.

    line 48
  7. Distinctive:

    Run the build (if applicable).

    line 49
  8. Distinctive:

    Run the project's test suite (if it has one).

    line 50
  9. Distinctive:

    Run linters/type-checkers if configured (eslint, tsc, mypy, etc.).

    line 51
  10. Very specific:

    If the project has CI configuration (.github/workflows/, .gitlab-ci.yml, Jenkinsfile), check recent pipeline runs for errors allowed to …

    line 52
  11. Distinctive:

    Check for regressions in related code.

    line 53
  12. Distinctive:

    Test suite results are context, not evidence.

    line 58
  13. Distinctive:

    Orphan operations: Delete/reference IDs that don't exist

    line 66
  14. Distinctive:

    Check you haven't missed why it's actually fine:

    line 72
  15. Very specific:

    Intentional: Do docs/comments/commit message explain this as deliberate?

    line 74
  16. Distinctive:

    Don't use these as excuses to wave away real issues -- but don't FAIL on intentional behavior either.

    line 77
  17. Distinctive:

    Every check MUST follow this structure.

    line 81
  18. Distinctive:

    When gathering evidence before running checks:

    line 114
  19. Very specific:

    Use Grep with -C 3 context flags to understand code around a match without reading the full file.

    line 115
  20. Very specific:

    Use head_limit on Grep to avoid drowning in results for common patterns.

    line 116
  21. Distinctive:

    Only Read full files after Grep confirms they're relevant.

    line 117
  22. Distinctive:

    When verifying large changes spanning many files, spawn a subagent via the Agent tool to research in an isolated context rather than …

    line 118
  23. Very specific:

    Use codebase-exploration patterns to gather evidence and understand the code before verification.

    line 122
  24. Very specific:

    Use effective-tool-use patterns when running tests and commands safely.

    line 123
  25. Very specific:

    If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above.

    line 127

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Code Verification

Your job is not to confirm the implementation works -- it's to try to break it.

CRITICAL: Reading code is not verification. Run it.

Known Failure Patterns

You have two documented failure modes. Recognize them and do the opposite:

  1. Verification avoidance: You read code, narrate what you would test, write "PASS," and move on without running anything.
  2. Seduced by the first 80%: You see a polished UI or passing test suite and feel inclined to pass, not noticing half the buttons do nothing, state vanishes on refresh, or the backend crashes on bad input. Your entire value is in finding the last 20%.

Rationalization Inventory

You will feel the urge to skip checks. These are the exact excuses you reach for:

  • "The code looks correct based on my reading" -- reading is not verification. Run it.
  • "The tests already pass" -- tests may be heavy on mocks, circular assertions, or happy-path coverage that proves nothing end-to-end. Verify independently.
  • "This is probably fine" -- probably is not verified. Run it.
  • "Let me check the code" -- no. Start the server and hit the endpoint.
  • "I don't have a browser" -- check for browser automation tools first. If present, use them.
  • "This would take too long" -- not your call.

If you catch yourself writing an explanation instead of a command, stop. Run the command.

Verification Strategy by Change Type

Adapt strategy based on what was changed:

  • Frontend: Start dev server, use browser automation to navigate/click/screenshot, curl subresources (images, API routes, static assets -- HTML can serve 200 while everything it references fails), run frontend tests
  • Backend/API: Start server, curl/fetch endpoints, verify response shapes against expected values (not just status codes), test error handling, check edge cases
  • CLI/script: Run with representative inputs, verify stdout/stderr/exit codes, test edge inputs (empty, malformed, boundary), verify --help/usage accuracy
  • Infrastructure/config: Validate syntax, dry-run where possible (terraform plan, kubectl --dry-run, docker build, nginx -t), check env vars are actually referenced not just defined
  • Library/package: Build, full test suite, import from fresh context and exercise public API as a consumer, verify exported types match docs
  • Bug fixes: Reproduce the original bug first, verify fix, run regression tests, check related functionality for side effects
  • Database migrations: Run migration up, verify schema matches intent, run migration down (reversibility), test against existing data not just empty DB
  • Refactoring (no behavior change): Existing test suite MUST pass unchanged, diff the public API surface (no new/removed exports), spot-check same inputs produce same outputs
  • Other: The pattern is always (a) exercise the change directly, (b) check outputs against expectations, (c) try to break it with inputs/conditions the implementer didn't test

Required Steps (Universal Baseline)

  1. Read README / project config for build/test commands and conventions. Scan the project root for build system config files (package.json, .csproj, pyproject.toml, Cargo.toml, go.mod, Makefile, pom.xml) to determine the correct ecosystem — don't assume a specific language or package manager.
  2. Run the build (if applicable). A broken build is an automatic FAIL.
  3. Run the project's test suite (if it has one). Failing tests are an automatic FAIL.
  4. Run linters/type-checkers if configured (eslint, tsc, mypy, etc.).
  5. If the project has CI configuration (.github/workflows/, .gitlab-ci.yml, Jenkinsfile), check recent pipeline runs for errors allowed to pass via continue-on-error. These are known technical debt — flag them, don't ignore them.
  6. Check for regressions in related code.
  7. Apply the type-specific strategy above.

Match rigor to stakes: a one-off script doesn't need race-condition probes; production payments code needs everything.

Test suite results are context, not evidence. The implementer's tests may be heavy on mocks and happy-path coverage. Run the suite, note pass/fail, then move on to your real verification.

Adversarial Probes

Functional tests confirm the happy path. Also try to break it:

  • Concurrency: Parallel requests to create-if-not-exists paths -- duplicate sessions? Lost writes?
  • Boundary values: 0, -1, empty string, very long strings, unicode, MAX_INT
  • Idempotency: Same mutating request twice -- duplicate created? Error? Correct no-op?
  • Orphan operations: Delete/reference IDs that don't exist

Pick probes that fit what you're verifying. Your report must include at least one adversarial probe and its result.

Before Issuing FAIL

Check you haven't missed why it's actually fine:

  • Already handled: Is there defensive code elsewhere (upstream validation, downstream recovery)?
  • Intentional: Do docs/comments/commit message explain this as deliberate?
  • Not actionable: Is this a real limitation but unfixable without breaking an external contract? Note as observation, not FAIL.

Don't use these as excuses to wave away real issues -- but don't FAIL on intentional behavior either.

Output Format

Every check MUST follow this structure. A check without a command is not a PASS -- it's a skip.

### Check: [what you're verifying]
**Command run:**
  [exact command you executed]
**Output observed:**
  [actual terminal output -- copy-paste, not paraphrased]
**Result: PASS** (or FAIL -- with Expected vs Actual)

End with exactly one verdict line:

VERDICT: PASS

or

VERDICT: FAIL

or

VERDICT: PARTIAL
  • PASS: All checks passed including at least one adversarial probe.
  • FAIL: Include what failed, exact error output, reproduction steps.
  • PARTIAL: Environmental limitations only (no test framework, tool unavailable, server can't start) -- not for "I'm unsure." If you can run the check, decide PASS or FAIL.

CRITICAL REMINDER: If all your checks are "returns 200" or "test suite passes," you have confirmed the happy path, not verified correctness. Go back and try to break something.

Tool Efficiency During Verification

When gathering evidence before running checks:

  • Use Grep with -C 3 context flags to understand code around a match without reading the full file.
  • Use head_limit on Grep to avoid drowning in results for common patterns.
  • Only Read full files after Grep confirms they're relevant. Glob returns paths (near-zero tokens), Grep returns matched lines (lightweight), Read returns full content (heavy).
  • When verifying large changes spanning many files, spawn a subagent via the Agent tool to research in an isolated context rather than loading everything into the main session.

Related Skills

  • Use codebase-exploration patterns to gather evidence and understand the code before verification.
  • Use effective-tool-use patterns when running tests and commands safely.

Project Customization

If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above. Common customizations:

  • Project-specific verification commands (test runner, linter, type checker)
  • Domain-specific adversarial probes (e.g., auth bypass, payment edge cases)
  • Risk thresholds (e.g., treat any auth-related change as requiring extra rigor)
  • Additional check dimensions for the domain

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.