security-scan
Scan for vulnerable dependencies and CVEs via pnpm lint:security (Trunk Trivy/OSV-scanner), optional pnpm security:grype or pnpm lint:all (Trunk-all plus Grype). Use for dependency CVE checks, security-scoped lint, or post-bump verification.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-01
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- security-scan
- description
- Scan for vulnerable dependencies and CVEs via pnpm lint:security (Trunk Trivy/OSV-scanner), optional pnpm security:grype or pnpm lint:all (Trunk-all plus Grype). Use for dependency CVE checks, security-scoped lint, or post-bump verification.
- compatibility
- Node and pnpm versions per `.node-version` and root `package.json` `engines`; run `pnpm install` from repo root. Run `pnpm exec trunk install` if Trunk-managed linters are missing (see AGENTS.md). `grype` must be on PATH for `pnpm security:grype` and the Grype step in `pnpm lint:all`.
03 SKILL.md 正文
Security scan: vulnerable dependencies
Purpose
Filesystem and dependency vulnerability checks for this TypeScript monorepo:
pnpm lint:security—trunk check --all --scope security(Trivy, OSV-scanner, and other security-scoped linters in.trunk/trunk.yaml).pnpm security:grype— Anchore Grype on the repo root (grypeon PATH; not installed via pnpm — seeknip.jsonignoreBinaries).pnpm lint:all(optional, slower) — full Trunk check across all files, then Grype — CI-style thoroughness.
Default incremental Trunk: pnpm lint (trunk check -y). Prefer pnpm lint:security when the goal is vulnerability scanning.
See AGENTS.md for the layered harness (for example ESLint with eslint-plugin-security alongside Trivy/OSV).
When to use
- Scan for CVEs or vulnerable dependencies
- Third-party / supply-chain review
- After dependency bumps: root and workspace
package.jsonfiles,pnpm-lock.yaml, and rootpackage.jsonpnpm.overrideswhen triaging transitive issues
How to run
From the repository root:
pnpm lint:security
pnpm security:grype
Thorough pass (Trunk-all plus Grype):
pnpm lint:all
If Trunk tools are missing: pnpm exec trunk install per AGENTS.md.
Debugging parity: pnpm security:grype matches grype .. For Trivy/OSV, prefer pnpm lint:security so versions match Trunk; use standalone CLIs only when reproducing or debugging outside Trunk.
Fix loop
- Identify: Parse tool output; note affected manifests (
pnpm-lock.yaml, root orpackages/*/package.json) and CVE IDs. - Triage: Direct versus transitive dependencies; confirm reachability when prioritizing.
- Fix: Prefer
pnpm up, targetedpnpm add, or rootpnpm.overrideswhen appropriate; runpnpm installafter lockfile changes so scans match what you ship. - Verify: Re-run
pnpm lint:securityandpnpm security:grype(orpnpm lint:all) until clean or remaining issues are accepted with rationale.
Termination
- Checks exit zero with no actionable findings, or
- Residual risk is explicitly accepted, or
- Stop after a sensible iteration cap (default: 3) and summarize blockers.
Related commands (repo)
pnpm lint— default Trunk checkpnpm lint:security— security-scoped Trunk (Trivy/OSV and related linters)- CodeQL: codeql-fix when CodeQL is configured for this repo
- Workspace and bumps:
AGENTS.md(pnpm workspace) andCLAUDE.mdfor agent-specific workflows
04 同仓库更多 Skills
security-review
Perform a structured security review of the target code
test-and-fix
Run unit tests and automatically fix code failures, regression bugs, or test mismatches. Use when tests are failing, after implementing new features, or to repair "broken" tests.
setup-dev-env
Set up the development environment for the project. Use when starting work on the project, when dependencies are out of sync, or to fix environment setup failures.
security-vulnerability-audit
Workflow for auditing security vulnerabilities using Trunk (Trivy and OSV-scanner). Use when checking for project vulnerabilities, hard-coded secrets, or repairing security flaws.
postmortem
End-of-session capture of failures, surprises, and lessons so agent behavior and repo config improve. Use after non-trivial work; skip trivial sessions unless something went wrong.
node-upgrade
Safely upgrade Node.js dependencies in pnpm workspaces. Use when asked to "upgrade dependencies", "update packages", "check for updates", or fix version mismatches.