npx skills add ...
npx skills add anthropics/defending-code-reference-harness --skill vuln-scan
Static source-code vulnerability scan. Reads a target directory (and THREAT_MODEL.md if present), spawns parallel review subagents per focus area, and writes VULN-FINDINGS.json + .md for /triage to consume. Read-only — no building, running, or network. For execution-verified crashes, use vuln-pipeline instead. Use when asked to "scan for vulns", "review this code for security issues", "find bugs in <dir>", or as the step between /threat-model and /triage.
npx skills add anthropics/defending-code-reference-harness --skill vuln-scan
Static vulnerability review of a source tree. Produces VULN-FINDINGS.json
(+ a human-readable .md) that /triage ingests directly.
This skill does not execute code. It reads source and reasons about it.
For execution-verified findings (ASAN crashes, reproducing PoCs), point the
user at vuln-pipeline run <target> — see README Step 2.
Tool fallbacks. Prefer the dedicated Glob and Grep tools. Some sessions
do not provision them — allowed-tools is a permission filter, not a loader,
so listing them here does not make them appear. When Glob/Grep are
unavailable, fall back to the read-only Bash commands whitelisted above:
rg --files <scope> / ls -R for enumeration, rg -n / grep -rn for
search, wc / head / file for sniffing. These are the ONLY permitted
Bash commands; do not write helper scripts or pipe target content into a
shell interpreter.
<target-dir> (required) — directory to scan. Relative or absolute.--focus <area> — scan only this focus area (repeatable). Skips recon.--single — no subagent fan-out; one sequential pass. Use on tiny targets
or when debugging the prompt.--extra <file> — append the contents of <file> to the review brief
(after the category list). Use to add org-specific vulnerability classes,
compliance checks, or stack-specific patterns. Plain text; same shape as
the category blocks below.--no-score — skip the Step 3b confidence pass (saves a round of
subagents). Findings keep the scanner's self-reported confidence only.<target-dir>. If it doesn't exist or has no source files, stop
with an error.<target-dir>/THREAT_MODEL.md. If present, parse its section 3 "Entry
points & trust boundaries" table and section 4 "Threats" table for focus areas
and threat classes. This is the preferred scoping input.--focus: do a quick recon — list the
source tree, read entry points and dispatch code, and propose 3-10 focus
areas using the pattern <subsystem> (<function/file>) — <key operations>.
Same shape as harness/prompts/recon_prompt.py.--focus was given, use exactly those.Tell the user the focus areas you'll scan and the source-file count before fanning out.
Unless --single, spawn one Task subagent per focus area in parallel.
Cap at 10 concurrent. Each subagent gets the review brief below with its
focus area filled in. On tiny targets (<15 source files), fall through to
--single automatically.
<finding> blocks from all subagents. Drop category=none
placeholders.file:line with the
same category, keep the one with the longer description and note the
duplicate id. (Heavy dedupe is /triage's job; don't over-engineer here.)F-001, F-002, ... in (severity desc, file, line)
order.--no-score)A cheap second-opinion read that ranks findings by signal quality.
Nothing is dropped — this pass calibrates confidence so humans and
/triage see high-signal findings first. Spawn one Task subagent per
finding in parallel with the brief below. Shallow: re-read and score, not
a full reachability trace.
Resolve: overwrite each finding's confidence with the score
(normalized to 0.0-1.0) and attach confidence_reason. Re-sort findings
by (confidence desc, severity desc, file, line) and reassign ids
F-001.. in that order. Compute low_confidence_count = findings with
confidence < 0.4, for the summary line.
Write both files to <target-dir>/:
VULN-FINDINGS.json — the /triage ingest shape:
Findings are sorted by confidence desc (then severity, file, line), so
the top of the file is the highest-signal material.
VULN-FINDINGS.md — human-readable: a summary table (id | severity |
category | file:line | title), then one ### F-NNN section per finding with
the full description.
Tell the user:
> /triage <target-dir>/VULN-FINDINGS.json --repo <target-dir>vuln-pipeline run <target> (README Step 2).docker, no network.
If the user asks you to "reproduce" or "confirm with a PoC," decline and
point at vuln-pipeline.file:line you emit must be
something you Read or Grep'd. If unsure of the exact line, cite the
function and say so in the description.<target-dir>. Don't follow symlinks or .. out of it./triage, not final verdicts. This skill
never drops a finding — Step 3b only ranks. /triage does the rigorous
N-vote verification and is where false positives actually get removed.The focus-area recon pattern and memory-safety quality tiers are lifted
from this repo's own harness/prompts/find_prompt.py and
harness/prompts/recon_prompt.py — the same logic the autonomous pipeline
uses, applied statically. The broader category menu, DO-NOT-REPORT
exclusions, per-finding confidence pass, and
exploit_scenario/recommendation output fields are adapted from
anthropics/claude-code-security-review's
/security-review command.