dep-scan
Skill501 starsChanged 17 days agoApache-2.0View on GitHub
Runs Trivy filesystem scan against the repo root and emits structured vulnerability findings (CVE, package, versions) in the SDLC reviewer schema. Use when an agent needs to detect known CVEs in project dependencies for downstream triage or human review.
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/a11y.mdcCursor rule
- nx-generateSkill
- nx-importSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- address-current-branch-reviewSkill
- api-designSkill
- celebration-scene-ideasSkill
- code-review-and-qualitySkill
- create-ticketSkill
- dep-triageSkill
- dial-docsSkill
- extract-to-libSkill
- figmaSkill
- fix-cve-backportSkill
- git-shipSkill
- i18n-stringsSkill
- lean-verificationSkill
- lib-themingSkill
- monitor-ciSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- proactive-security-monitorSkill
- refactoring-auditSkill
- chat-release-notesSkill
- responsive-designSkill
- security-monitor-triagerSkill
- snyk-jira-ingestSkill
- snyk-scan-stubSkill
- snyk-triageSkill
- ui-kit-reviewSkill
- nx-generateSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- nx-generateSkill
- nx-importSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
If /tmp/trivy.json is missing or zero-length after the command, treat it as a scanner failure (see _Heuristics_).
- Very specific: line 123
Use the Write tool to save at the repo root.
- Very specific: line 144
Scanner failure → high-severity finding: If trivy exits non-zero or /tmp/trivy.json is empty/malformed, emit one high-severity finding with …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dependency Scan (Trivy)
Overview
Filesystem scan for known CVEs. Trivy autodetects lockfiles
(package-lock.json, pnpm-lock.yaml, etc.) and produces a JSON
report; this skill parses that report and emits findings in the SDLC
reviewer shape so downstream agents (e.g., /dep-triage) and human
reviewers can consume them uniformly.
This is the scan step only — no triage, no false-positive analysis. That happens downstream.
When to use
- PR-time dependency check (chained before
/dep-triage). - Scheduled dependency scans (nightly, weekly).
- Any flow needing machine-readable vulnerability output that another agent or process will consume.
Required tools
Bash(trivy:*)— to invoke the CLIWrite— to producestage-output.json(auto-granted by the platform)Read,Glob— to inspect lockfiles or scan output if needed
Process
1. Run Trivy
Filesystem scan from repo root, JSON output, medium severity and above.
Use Trivy's --output flag, not shell redirection (>) — Claude
Code's Bash tool rejects shell-redirection operators and would deny the
command:
trivy fs --format json --severity HIGH,CRITICAL,MEDIUM --quiet --output /tmp/trivy.json .Same effect: writes report to /tmp/trivy.json. No >, no |, no
shell-variable expansion — exactly what Bash(trivy:*) allows.
Notes:
--quietsuppresses interactive UI noise.- If
/tmp/trivy.jsonis missing or zero-length after the command, treat it as a scanner failure (see Heuristics).
2. Parse the report
Use the Read tool to load /tmp/trivy.json into your reasoning
context. Do NOT attempt to use cat, head, tail, jq, grep,
awk, or any other shell command to inspect the file — those aren't
in the agent's allowed_tools (only Bash(trivy:*) is) and the Bash
tool will deny them, burning turns on retries. The Read tool is the
intended path for inspecting on-disk JSON.
The file is on the order of tens-to-hundreds of KB; one Read call loads it cleanly.
Trivy's structure:
{
"Results": [
{
"Target": "package-lock.json",
"Type": "npm",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-...",
"PkgName": "lodash",
"InstalledVersion": "4.17.20",
"FixedVersion": "4.17.21",
"Severity": "HIGH",
"Title": "..."
}
]
}
]
}A Result may have no Vulnerabilities array if the target is clean
— skip it.
3. Map each vulnerability to a finding
Lowercase severity; carry through CVE, package, versions:
{
"severity": "high",
"file": "package-lock.json",
"message": "<CVE>: <Title>. Affected: <pkg>@<version>. Fixed in <fixed>.",
"suggested_fix": "Upgrade <pkg> to >=<fixed>.",
"cve": "<CVE>",
"package": "<pkg>",
"installed_version": "<installed>",
"fixed_version": "<fixed>",
"target_type": "<npm|gomod|...>"
}The cve, package, installed_version, fixed_version, and
target_type fields are the contract for /dep-triage — don't omit
them.
4. Set status
passed— no findings at MEDIUM+passed_with_findings— findings exist but all are MEDIUM (no HIGH/CRITICAL)failed— any HIGH or CRITICAL finding
5. Write stage-output.json
Use the Write tool to save at the repo root. Include
payload.scan_summary so downstream consumers don't have to recount:
{
"stage": "scan-deps",
"status": "<above>",
"summary": "Trivy fs: <N> findings (<H> high, <M> medium).",
"payload": {
"scan_summary": {
"total": <N>,
"by_severity": { "critical": <c>, "high": <h>, "medium": <m> },
"scanner": "trivy fs"
},
"findings": [ ... ]
}
}Heuristics
- Scanner failure → high-severity finding. If
trivyexits non-zero or/tmp/trivy.jsonis empty/malformed, emit one high-severity finding withfile: nullandmessagequoting the stderr verbatim, then setstatus: failed. Don't silently produce empty findings. - Truncate verbose descriptions. Trivy's
Descriptionfield can be very long; keep it brief in themessagefield or move detail tocvelookups elsewhere. - Don't filter by reachability here. That's
/dep-triage's job. Emit every CVE Trivy finds at the configured severity threshold.
Output for downstream
The exact shape above is the contract for /dep-triage. The triage
skill keys off cve, package, and installed_version to look up
usage in the repo. Omit those fields and triage degrades to "every
finding marked confirmed."
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
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.

