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

variant-analysis

Skill220 starsChanged 18 days 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.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use yara-rule-authoring, second-opinion and 1 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.
  • TheWatcher01Skill

    yara-rule-authoring

    Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.

    Also in 3 projects that use this

  • MicrosoftSkill

    second-opinion

    Independent review of current work or a past session. USE WHEN a user wants a second opinion. DO NOT USE WHEN ordinary code review is wanted — use code-review.

    Also in 3 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    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 15 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 15 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.