A Claude Code skill for running structured security audits with actionable remediation plans.
# Clone to your Claude skills directory
git clone https://github.com/wrsmith108/claude-skill-security-auditor.git ~/.claude/skills/security-auditornpx tsx scripts/index.ts [options]This skill activates when you mention:
- "npm audit"
- "security vulnerability"
- "dependency vulnerability"
- "CVE"
- "security check"
- "audit dependencies"
- "check vulnerabilities"
- Execute
npm audit --jsonand parse structured output - Classify vulnerabilities by severity (critical, high, medium, low)
- Extract CVE identifiers, affected versions, and fix versions
- Distinguish direct vs transitive dependencies
- Generate markdown reports with remediation commands
- Support risk acceptance via
security-exceptions.json - Provide CI-friendly exit codes
npx tsx scripts/index.tsnpx tsx scripts/index.ts --jsonnpx tsx scripts/index.ts --fail-on highnpx tsx scripts/index.ts --fail-on criticalnpx tsx scripts/index.ts --cwd /path/to/projectCreate a security-exceptions.json file in your project root to accept known risks:
{
"exceptions": [
{
"id": "GHSA-xxxx-xxxx-xxxx",
"reason": "Not exploitable in our usage context",
"expires": "2025-06-01",
"approvedBy": "security-team"
}
]
}Accepted vulnerabilities are tracked separately in the report.
The skill generates a markdown report with:
- Summary table by severity
- Detailed breakdown of high+ severity issues
- Transitive dependency analysis
- Copy-paste remediation commands
- List of accepted risks (if any)
| Code | Meaning |
|---|---|
0 |
No vulnerabilities above threshold |
1 |
Vulnerabilities found above threshold (with --fail-on) |
2 |
Error running audit |
- name: Security Audit
run: npx tsx scripts/index.ts --fail-on high- Node.js and npm installed
- Valid
package.jsonin target directory - Optional:
package-lock.jsonfor accurate audit
- Fixed: Replaced hardcoded
~/.claude/skills/paths with relative paths for portability across different install locations
MIT
- ci-doctor - Diagnose CI/CD pipeline issues
- version-sync - Sync Node.js versions
- flaky-test-detector - Detect flaky tests
- docker-optimizer - Optimize Dockerfiles