/security:security-deep-scanfrom security
Runs a deep, multi-pass security scan over a repository or scoped path using independent discovery workers, semantic merging, and centralized validation. Use for exhaustive scans, not for PRs or diffs.
Ships in security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
If you know another deep scan is already running over the same scope, ask the user whether to continue or stop before doing substantive work.
Deep Security Scan is a higher-recall wrapper around the repository-wide and scoped-path exhaustive-scan machinery in references/repository-wide-scan.md.
It preserves the ordinary security-scan phase model and final report shape, but repeats the most variance-sensitive phase, finding discovery, before centralized judgment.
The wrapper owns orchestration only:
references/repository-wide-scan.mdreferences/phase-finding-discovery.mdreferences/phase-validation.md, references/phase-attack-path-analysis.md, canonical JSON completion, and generated report finalization onceDo not replace the established scan rules with custom shortcuts.
Read references/config-preflight.md and dispatch and await the preflight execution described there with the security_deep_scan capability profile before evaluating the workflow-specific requirements below and before any substantive scan work.
Follow the returned block/warn/suggest/ready results.
On blocked or incomplete, present the exact reasons and any advisory guidance and config delta, ask the user whether to apply the remediation, and stop for the answer before substantive work; do not auto-fail.
Do not treat a config value that differs from a suggested patch as a warning unless the capability requirement itself is unmet.
The phase references (references/phase-threat-model.md, references/phase-finding-discovery.md, references/phase-validation.md, references/phase-attack-path-analysis.md) and the repository-wide and scoped-path exhaustive-scan machinery (references/repository-wide-scan.md) are bundled with this skill and always available, so no plugin-availability check is required before starting substantive scan phases.
This workflow does require parallel delegated workers for repeated discovery. Treat explicit invocation of Deep Security Scan as the user's request for this delegated-worker workflow. If delegation is unavailable in the current environment, do not claim Deep Security Scan ran; explain the limitation and offer an ordinary security scan as the fallback path.
When delegated discovery workers are spawned from the current scan, use the host's default subagent type, model, and reasoning effort.
The canonical worker brief in references/discovery-worker-brief.md is self-contained; spawn each discovery worker with a fresh context (no inherited coordinator history) when your host supports it.
These orchestration and worker rules are purpose-built for deep scanning and take precedence over any general subagent skill (e.g. subagent-patterns) during a deep scan.
Deep Security Scan is the highest-volume workflow in this set, by design: it re-runs discovery with six workers per round, repeating rounds until discovery is saturated or capped, so its discovery work is roughly an ordinary security scan's discovery × six × the number of rounds, plus the centralized validation and attack-path tail.
After the capability preflight returns ready and the target is resolved, and before goal setup or the first discovery round:
<python_command> <plugin_dir>/scripts/generate_rank_input.py make-repo-rank-input --repo <repo_root> --scope <scope> --out <discovery_dir>/rank_input.jsonl): about files × planned top-percent / 100 file-review passes.
You may also give a rough input-token count for one pass as the total in-scope file size in characters divided by about 4.
Then state the deep multiplier: × six workers × the number of rounds.
Report token counts, not money; a dollar cost depends on token pricing, model, and input/output/cache ratios that change.After the capability preflight returns ready, if your host has goal/todo/task-tracking tools, create the coordinator goal capturing the objective; otherwise state the same objective in your first visible update and track it yourself.
The objective should state that the scan must not stop until the shared exhaustive worklists exist, discovery either reaches a terminal state or records the first-round no-plausible-candidates path, canonical discovery artifacts and any candidate ledgers are assembled, centralized validation and attack-path receipts are complete or explicitly deferred when those phases are required, and the final markdown report is written.
Use objective wording shaped like:
Run the Deep Security Scan for <resolved repository target>; do not stop until the shared exhaustive worklists exist, discovery is saturated, capped, or on the first-round no-plausible-candidates path, canonical discovery artifacts and any candidate ledgers are assembled, centralized validation and attack-path receipts are complete or explicitly deferred when those phases are required, and the final markdown report is written.
If a compatible active goal already exists in the coordinator thread, continue under it instead of creating a duplicate.
The coordinator owns the top-level Deep Security Scan goal and must not mark it complete until:
rank_input.jsonl and exhaustive deep_review_input.jsonl exist at the standard discovery pathssaturated or cappedDo not enter Goal Setup until the capability preflight has returned ready and the Cost Gate has been approved by the user.
references/final-report.md.These invariants are part of the workflow contract. Do not relax, reinterpret, or replace them with coordinator improvisation.
6 usable discovery workers per completed round<discovery_dir>/rank_input.jsonl plus one exhaustive shared <discovery_dir>/deep_review_input.jsonl before the first discovery round, and every discovery worker must consume that same shared worklist pair without regenerating, reranking, or overwriting itfinding_discovery_report.md candidate shape through every merge pass; the merged report is the canonical candidate inventory, not a later summary derived from some other inventoryfindings/<candidate_id>/candidate_ledger.jsonl record that names the absorbed worker candidates and ledgers it subsumes before centralized validation beginsStart this setup only after the security_deep_scan capability preflight has returned ready.
references/repository-wide-scan.md first and follow its repository-wide or scoped-path scan semantics exactly.Goal Setup for that active scan context.repo_namesecurity_scans_dirscan_idscan_dirartifacts_dircontext_dirdiscovery_dircoverage_dirreconciliation_dirfindings_dir<context_dir>/threat_model.md path for the later canonical validation threat model that will be synthesized only after the discovery loop reaches a terminal state.<discovery_dir>/rank_input.jsonl once using the ordinary deterministic exhaustive-scan worklist helper: <python_command> <plugin_dir>/scripts/generate_rank_input.py make-repo-rank-input --repo <repo_root> --scope <scope> --out <discovery_dir>/rank_input.jsonl<scope> for a repository-wide target and the exact resolved relative or absolute scoped path for a scoped-path target<python_command> <plugin_dir>/scripts/generate_rank_input.py copy-deep-review-input --rank-input <discovery_dir>/rank_input.jsonl --out <discovery_dir>/deep_review_input.jsonl and declare that worklist pair authoritative and exhaustive for every workerrank_output.jsonl; Deep Security Scan does not use ranked truncation in this versionDo not let individual discovery workers reinterpret or widen the scan target, but do let them independently generate their own target-specific threat models at worker-specific paths before discovery begins.
Run discovery in synchronous rounds:
6 independent discovery workers per round10 rounds totalAlways run at least one round.
Before the first round, read references/discovery-worker-brief.md (the brief each worker receives), references/deep-scan-artifacts.md (worker output paths and merge outputs), and references/semantic-merge.md (the merge rules).
After each round, run the Required Round-Transition Checklist below.
Do not reuse completed discovery workers across rounds. Later rounds should consume only the preserved artifacts, not prior worker state. Before spawning any later round, confirm that every worker from the prior round has completed and become idle; do not interrupt an already completed worker.
While a discovery round is active, keep the coordinator neutral. It may perform orchestration bookkeeping and artifact-health checks, but it must not run its own target-specific discovery lane, form candidate hypotheses, queue likely finding families, or do repository-grounded validation preparation before the round closes.
This stop rule measures discovery saturation only. It does not claim that validated findings or final reportable findings have saturated; validation, canonical JSON completion, and report projection still happen once after the discovery loop completes.
If the first round finds no plausible candidates, write the appropriate canonical no-findings discovery artifact and continue directly to the final security-scan no-findings assembly path.
Execute this checklist in order for every completed round. Do not skip steps.
finding_discovery_report.mdEach discovery worker must be independent:
<discovery_dir>/rank_input.jsonl and exhaustive <discovery_dir>/deep_review_input.jsonl inputsreferences/phase-validation.md, no top-level references/phase-attack-path-analysis.md, and no canonical finalizationThe goal is not shallow parallelism; the goal is independent high-quality discovery diversity from repeated same-brief stochastic passes.
Read references/discovery-worker-brief.md when you spawn each round.
Give every worker the text block in that file verbatim, with only the substitutions its opening lines allow.
Read references/deep-scan-artifacts.md before you assign worker output paths, after each merge pass, and before the centralized tail.
It defines the worker artifact layout and the affected-location contract, the canonical outputs each merge pass retains, the support artifacts to assemble before validation, and the terminal evidence the centralized tail needs.
Read references/semantic-merge.md before each merge pass.
Enter the centralized tail only after the discovery loop has a recorded terminal state:
Before you begin, assemble the support artifacts in references/deep-scan-artifacts.md § Exhaustive Scan Support Artifact Assembly, and confirm the evidence in § Terminal Evidence Before the Centralized Tail.
Once the recorded terminal state is present:
finding_discovery_report.md against the underlying discovery evidence
<reconciliation_dir>/deduped_candidates.jsonl and the canonical per-candidate ledgers match the same merged candidate set and preserve worker provenance<context_dir>/threat_model.md path
<context_dir>/threat_model.md exists, then follow references/phase-validation.md once over the canonical merged discovery inputsreferences/phase-attack-path-analysis.md once over the surviving validated findings and closure rows that require itreferences/final-report.md, then run python <plugin_dir>/scripts/finalize_scan_contract.py --scan-dir <scan_dir> --source-root <repo_root> so finalization generates the markdown report projectionDo not bypass validation simply because a candidate recurred across multiple discovery workers. Recurrence is search evidence, not reportability proof.
report.md.
Populate all report semantics in canonical JSON using references/final-report.md, run python <plugin_dir>/scripts/finalize_scan_contract.py --scan-dir <scan_dir> --source-root <repo_root>, and include the generated markdown report path in the response.references/finding-detail-fields.md from the same validated evidence used in the generated report.references/deep-scan-failure-handling.md are exhausted or for an explicit cancellation path.references/deep-scan-failure-handling.md and follow it before you stop, retry, or continue: missing dependencies or delegated workers, a failed or crashed worker (with or without partial artifacts), a failed or capacity-limited spawn, missing or inconsistent artifacts, malformed affected_locations, orchestration drift, and the ten-round cap.Goal Setup and the worker-local discovery goals described in the worker brief only after the capability preflight has returned ready and when goal/todo/task-tracking tools are available.
Keep their completion boundaries separate.ATTRIBUTION.md (opens in a new tab)references/attack-path-facts.md (opens in a new tab)references/config-preflight.md (opens in a new tab)references/deep-scan-artifacts.md (opens in a new tab)references/deep-scan-failure-handling.md (opens in a new tab)references/discovery-worker-brief.md (opens in a new tab)references/final-report.md (opens in a new tab)references/finding-detail-fields.md (opens in a new tab)references/phase-attack-path-analysis.md (opens in a new tab)references/phase-finding-discovery.md (opens in a new tab)references/phase-threat-model.md (opens in a new tab)references/phase-validation.md (opens in a new tab)references/repo-wide-artifacts-and-ledger.md (opens in a new tab)references/repo-wide-high-impact-families.md (opens in a new tab)references/repo-wide-instance-expansion.md (opens in a new tab)references/repo-wide-validation-closure.md (opens in a new tab)references/repository-wide-scan.md (opens in a new tab)references/scan-artifacts-and-ledger.md (opens in a new tab)references/scan-artifacts.md (opens in a new tab)references/scan-contract.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ahgraber/skills --plugin security4 skills in this plugin
/security-fix-findingUse when the user explicitly asks to fix and verify a validated or plausible security finding. Do not use as the primary trigger for full PR, commit, branch, patch, or repository scans./security-scanUse when the user asks for a security scan or review of a repository, a scoped path (package, folder, or submodule), or a Git-backed change set (pull request, commit, branch diff, or working-tree patch). Point it at the target; it runs the full threat-model, discovery, validation, and attack-path pipeline and writes a report. Do not use to triage externally supplied findings or to fix a single finding./security-triage-findingOther plugins' skills for the same job