agentleFS
mtarcuremtarcure/claude-vibe-squad/.agents/skills/variant-analysis/SKILL.md

variant-analysis

Skill162 starsChanged 2 months agoMITView on GitHub

Use immediately after one defect is confirmed to sweep for structurally related siblings across current code, history, copies, vendored forks, services, or languages; encode a repeatable Semgrep or AST query, gate each hit independently, and propose one root-cause fix.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use codeql and insecure-defaults.

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.
  • ElasticSkill

    codeql

    Work with CodeQL in Kibana — write, test, and debug custom queries locally, fetch scan results from GitHub, and validate inline suppression comments. Use when writing or debugging CodeQL queries, running CodeQL unit tests, analyzing SARIF results, fetching scan results, or checking codeql suppression justifications.

    Also in 3 projects that use this

  • the-huginSkill

    insecure-defaults

    Detects fail-open vulnerabilities where applications run insecurely with missing configuration. Finds hardcoded credentials, weak env var fallbacks, and insecure-by-default settings. Adapted from Trail of Bits methodology.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    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:

    After one defect is confirmed, find every sibling of it in the codebase before closing the issue — the first instance is rarely the only …

    line 9
  2. Very specific:

    Search structurally, not textually.

    line 14

“Common” is measured: kept by at least 6 in 10 of the 8 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

Variant Analysis

After one defect is confirmed, find every sibling of it in the codebase before closing the issue — the first instance is rarely the only one.

Steps

  1. Characterize the root cause precisely: the unsafe primitive, the missing check, and the condition that makes it exploitable. A vague characterization finds nothing.
  2. Decide the variant axes to sweep: same primitive elsewhere, same call site with a different input source, same missing check in sibling handlers, and the same idiom in other languages or services in the repo.
  3. Search structurally, not textually. Encode the pattern as a Semgrep rule via semgrep-rule-author or an AST query; grep misses reformatted and refactored instances, which are the ones that survive.
  4. Sweep history as well as the working tree: the same defect frequently exists in a copied file, a vendored fork, or a branch that was never merged back.
  5. For each candidate hit, run the reachability and impact gates from findings-filter — a variant is only a finding if it is independently reachable.
  6. Group confirmed variants under the single root cause and propose one structural fix, such as a safe wrapper or a type that makes the unsafe state unrepresentable, rather than N local patches.
  7. Where a local patch is unavoidable, add the rule to the repo's static-analysis config so future instances are caught at review time.
  8. Record the sweep's coverage explicitly: which axes were swept, which paths were excluded, and what would still be missed. An unbounded "we looked" claim is not coverage.

Acceptance

  • The root cause is stated as primitive + missing check + exploitability condition.
  • The sweep is structural (rule or AST query), with the query recorded and re-runnable.
  • Vendored, copied, and historical instances were searched, not just the working tree.
  • Each variant passed reachability and impact gates independently.
  • A single structural fix is proposed where possible, and a detection rule is added to prevent regression.
  • Sweep coverage and known gaps are stated explicitly.

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.