agentleFS
caidanwcaidanw/skills/adversarial-review/SKILL.md

adversarial-review

Skill9 starsChanged 4 months agoMITView on GitHub

Adversarially hunt for correctness bugs and regressions in a change set. Use when reviewing a diff before finalizing, during a cleanup pass, or when asked to find bugs, pressure-test, or stress-test recently modified code. Triggers on "find bugs", "what could break", "review for correctness", "did I break anything", "hunt regressions", "adversarial review", or "pressure-test this change".

63 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use design-doc, status and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • maragudkSkill

    design-doc

    For when you're asked to write a design doc or specification, especially after a brainstorm or feature design session.

    Also in 3 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 6 projects that use this

  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 3 projects that use this

  • DockerSkill

    research

    Research a documentation topic — locate affected files, understand the problem, identify what to change. Use when investigating an issue, a question, or a topic before writing a fix. Triggers on: "research issue 1234", "investigate what needs changing for #500", "what files are affected by #200", "where is X documented", "is our docs page about Y accurate", "look into how we document Z".

    Also in 3 projects that use this

  • VercelSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 11 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 56 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to distrust. The diff is guilty until a named input clears it.

    line 17
  2. Distinctive:

    No credit for good intent, partial fixes, or "probably fine."

    line 18
  3. Distinctive:

    Read the supplied frozen review target.

    line 26
  4. Very specific:

    Follow the result through overload resolution and type erasure.

    line 59
  5. Distinctive:

    If the API has side effects, verify the side effect and returned success/error response separately.

    line 60
  6. Distinctive:

    Do not apply ordinary closure-return rules to result builders or intentionally side-effect-only closures.

    line 62
  7. Distinctive:

    Ask "if I deleted this change, what breaks?" — tests whether it is necessary and what it regresses.

    line 71
  8. Distinctive:

    Do not speculate about breakage you cannot trace to a specific code path.

    line 79
  9. Distinctive:

    Read the surrounding context first — callers, guards, sanitizers.

    line 80
  10. Distinctive:

    Prefer one strong finding over five weak ones.

    line 83
  11. Distinctive:

    Before surfacing anything, attack your own findings.

    line 87
  12. Distinctive:

    If the change holds up under attack, say so plainly.

    line 101

“Common” is measured: kept by at least 6 in 10 of the 56 edited versions of this file we could read. “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

Adversarial Review

Assume the change is wrong until a concrete input proves it right. Hunt correctness bugs the change introduced — not style, not security. One finding you can trigger beats ten you cannot.

Stance

  • Default to distrust. The diff is guilty until a named input clears it.
  • No credit for good intent, partial fixes, or "probably fine."
  • Happy-path-only is a defect. If code only works on the example input, that is the finding.
  • A specific attack angle ("what input makes this throw?") finds bugs. "Review this code" produces polite nothing.

Scope

Review the change, not the codebase.

  • Read the supplied frozen review target. If none was supplied, use git diff. Every finding ties to a changed line.
  • Trace the blast radius: for each changed signature, return shape, nullability, or unit, read its callers. A rename or a newly-nullable return breaks stale callers the diff never shows — the regression pure-diff review structurally misses.
  • Hand off, do not duplicate. Style → simplify. Comment intent → code-comments. Type design → parse-dont-validate. Security → security-review. Framework idioms → typescript / no-use-effect / macos-swift-desktop.

This is read-only. Propose fixes; do not apply them, and do not touch code outside the change.

What to hunt

Bug classThe tell
Null / optionalA value from an API, map lookup, regex match, or DB row is dereferenced without a guard
Boundary / off-by-oneIndex math, slice bounds, < vs <=, empty or single-element input
Swallowed errorEmpty catch, catch-log-continue, ignored error/Result return, un-awaited rejection
Happy-path gapWorks on the demo input; empty / zero / negative / huge / missing-field / dependency-down untested
Race / orderingShared mutable state, check-then-act, an await between a read and its write
State mutation / aliasingMutates a passed-in object, array, or default arg the caller still holds
Async / awaitA promise used as its value, a forgotten await, async inside forEach, sequential-vs-parallel slip
Type coercion== vs ===, truthy 0 / "" / [], implicit string↔number, NaN
Result-type lossA generic closure or callback silently produces Void/unit, an optional, or a wider type than the caller expects
Type-erasure boundaryA value flows through Any, unknown, catch-all overloads, dynamic JSON, IPC, persistence, or plugin APIs before its shape is checked
Resource leakAcquire (file, socket, lock, listener, subscription) with no release on every path — especially the error path
Inverted logicFlipped boolean, wrong operator, bad default, De Morgan slip — plausible, but takes the wrong branch
Contract mismatchSignature / units / nullability / return shape changed but not all callers; or a call with wrong or hallucinated args
Partial changeOne branch updated but not its twin; a flag without the gated code; a migration without its reader; leftover TODO

Weight the hunt: fresh, often agent-written code skews to happy-path gaps, missing null and edge guards, swallowed errors, mismatched or hallucinated APIs, and half-finished refactors. Look there first.

Trace result flow before type erasure

At every generic closure, callback, actor hop, transaction, lock helper, retry wrapper, or task body whose result is consumed:

  1. State the concrete result type the caller expects.
  2. Verify every value-producing path actually returns that type. In Swift, when a generic closure result is inferred from its body without a concrete non-Void context, a multi-statement ordinary closure with no explicit return can infer Void even when its final expression produces a value. A concrete expected result usually turns the omission into a compiler error instead.
  3. Follow the result through overload resolution and type erasure. Any, catch-all overloads, and dynamic serializers can turn a compile-time mistake into a runtime failure.
  4. If the API has side effects, verify the side effect and returned success/error response separately. "The mutation happened" does not prove the protocol response succeeded.

Do not apply ordinary closure-return rules to result builders or intentionally side-effect-only closures. Prefer a concrete expected type at serialization, IPC, persistence, and plugin boundaries so accidental widening fails compilation.

Technique

For each changed function:

  1. State its contract in one line before reading the body — inputs, output, side effects. Then check the body actually delivers it.
  2. Assume every variable can be null and every external call can fail. Find the first line that does not survive that assumption.
  3. Construct one concrete failing input and trace it line by line to the suspect spot. Verify it actually reaches that line — not a plausible neighbor.
  4. Ask "if I deleted this change, what breaks?" — tests whether it is necessary and what it regresses.
  5. For every added regression test, ask whether restoring the defect makes that test fail. A helper-level test that bypasses the changed production boundary is not regression coverage.

Report only what you can trigger

The gate that keeps findings high-signal:

  • Name the input or path that triggers the bug. Cannot name it → do not report it.
  • Do not speculate about breakage you cannot trace to a specific code path.
  • Read the surrounding context first — callers, guards, sanitizers. A line that looks unsafe alone is often safe in context.
  • Tag each finding with severity and a confidence: high / medium / low.
  • Exception: high-impact bugs (data loss, corruption, crash on common input) — report even at lower confidence, and state what is uncertain.
  • Prefer one strong finding over five weak ones. Do not pad.

Self-verification

Before surfacing anything, attack your own findings. For each, try to prove it false: re-read the trigger path, confirm the guard you assumed was missing really is missing, confirm the input really reaches the line. Drop anything you cannot defend.

This pass is what separates real findings from plausible noise. Do not skip it.

Output

For each surviving finding:

  • Location — file and line in the diff
  • The bug — one sentence
  • The trigger — the concrete input or sequence that makes it fail
  • Severity + confidence
  • Suggested fix — propose, do not apply

If the change holds up under attack, say so plainly. Finding nothing is a valid, honest result — do not invent bugs to look thorough.

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.