trailofbits/trailmark-variant-neighborhood
Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and structurally similar nodes. Use after one issue is found to seed variant-analysis, semgrep-rule-creator, static-analysis, or manual review with graph-derived candidate locations.
npx skills add https://github.com/trailofbits/skills --skill trailmark-variant-neighborhood
Expand one seed issue into graph-derived variant candidates. This skill
generates review targets, not confirmed findings.
trait, hook, handler, adapter, or critical type
variant-analysis, semgrep-rule-creator,static-analysis, or manual review
semgrep-rule-creator directly.
composition workflow.
| Rationalization | Why It Is Wrong | Required Action |
|---|---|---|
| "Nearby code means variant" | Proximity is only a candidate reason | Rank it as a review target |
| "Only exact same names matter" | Variants often share sinks or preconditions, not names | Expand across callers, callees, interfaces, and types |
| "Every candidate is a finding" | This skill outputs candidates for review | Avoid vulnerability claims |
| "Unreachable candidates can be ignored completely" | They may become reachable after refactors | Rank lower or list as deferred |
| "Graph candidates replace semantic pattern work" | Graph structure finds locations, not root-cause semantics | Hand off to variant-analysis, Semgrep, CodeQL, or manual review |
Variant Neighborhood Progress:
- [ ] Step 1: Normalize and bind the seed
- [ ] Step 2: Expand graph neighborhoods
- [ ] Step 3: Rank candidates
- [ ] Step 4: Extract variant pattern guidance
- [ ] Step 5: Emit handoff packet
Accept finding text, file/line, function name, or output from
trailmark-finding-triage. Bind the seed to a Trailmark node and record the
root cause in plain language.
If the seed has no concrete graph binding, stop before inventing variants.
Use the dimensions in
references/neighborhood-patterns.md:
Bound expansion to avoid candidate floods.
Rank with references/ranking.md. Prioritize
entrypoint-reachable, tainted, boundary-adjacent, high-blast-radius, shared
sink, same-interface, and close-distance candidates. Penalize test, mock,
generated, vendor, unreachable, and trusted-internal-only candidates.
Summarize what should be searched for syntactically and what requires semantic
review. Identify whether follow-up belongs in:
variant-analysissemgrep-rule-creatorstatic-analysis with CodeQL or SARIF-producing toolsUse references/output-format.md. Include
ranked candidates, inclusion reasons, exclusions, limitations, and the
variant-analysis handoff.
that code is in scope
Take trailofbits/trailmark-variant-neighborhood from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.