一键导入
audit-security
Run a single-session security audit on the codebase
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run a single-session security audit on the codebase
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a single-session AI optimization audit on the codebase
Run a single-session code review audit on the codebase
Run a single-session engineering productivity audit on the codebase
Run a comprehensive enhancement audit across the entire project - code, product, UX, content, workflows, infrastructure, external services, and meta-tooling.
Run a single-session performance audit on the codebase
Run a comprehensive multi-stage automation audit with parallel agents
| name | audit-security |
| description | Run a single-session security audit on the codebase |
| supports_parallel | true |
| fallback_available | true |
| estimated_time_parallel | 15 min |
| estimated_time_sequential | 60 min |
/audit-security| Condition | Mode | Time |
|---|---|---|
| Task tool available + no context pressure | Parallel | ~15 min |
| Task tool unavailable | Sequential | ~60 min |
| Context running low (<20% remaining) | Sequential | ~60 min |
| User requests sequential | Sequential | ~60 min |
When to use: Task tool available, sufficient context budget, no S0/S1 in scope
Focus Areas:
Files:
src/api/**/*.ts (API routes)middleware.tslib/auth*.tsFocus Areas:
Files:
package.json, package-lock.jsonFocus Areas:
Files:
config/**Focus Areas:
Files:
.claude/ configscrypto, random, hash patternsInvoke all 4 agents in a SINGLE Task message:
Task 1: vulnerability-scanner agent - audit auth, input validation, OWASP
Task 2: supply-chain-auditor agent - audit dependencies, npm packages
Task 3: framework-security-auditor agent - audit framework security, headers
Task 4: ai-code-security-auditor agent - audit AI patterns, crypto, files
Each agent prompt MUST end with:
CRITICAL RETURN PROTOCOL:
- Write findings to the specified output file using Write tool or Bash
- Return ONLY: `COMPLETE: [agent-id] wrote N findings to [output-path]`
- Do NOT return full findings content — orchestrator checks completion via file
Dependency constraints: All 4 agents are independent -- no ordering required. Each writes to a separate JSONL section. S0/S1 findings trigger immediate notification but do not block other agents.
When to use: Task tool unavailable, context limits, or user preference
Execution Order (priority-first):
Total: ~60 min (vs ~15 min parallel)
Checkpointing: After each category, write intermediate findings to file before continuing. This protects against context loss.
{
"started_at": "ISO timestamp",
"categories_completed": ["Auth", "Input"],
"current_category": "DataProtection",
"findings_count": 24,
"last_file_written": "stage-2-findings.jsonl"
}
Step 0: Episodic Memory Search
Before running security audit, search for context from past security sessions:
mcp__plugin_episodic_memory_episodic_memory__search({
query: ['security audit', 'S0', 'vulnerability'],
limit: 5,
});
mcp__plugin_episodic_memory_episodic_memory__search({
query: ['OWASP', 'injection', 'auth bypass'],
limit: 5,
});
Why this matters:
Step 1: Check Thresholds
Run npm run review:check and report results. Check for security-sensitive file
changes.
Step 2: Gather Current Baselines
Collect these metrics by running commands:
# Dependency vulnerabilities (extract summary without truncating JSON)
npm audit --json 2>/dev/null | node -e '
try {
const d = JSON.parse(require("fs").readFileSync(0,"utf8"));
console.log(JSON.stringify(d.metadata?.vulnerabilities ?? d.vulnerabilities ?? {}, null, 2));
} catch (e) {
console.log("{\"error\": \"Invalid JSON from npm audit\"}");
}
'
# Security lint warnings
npm run lint 2>&1 | grep -i "security" | head -10
# Check for .env files (existence only - no permission/owner metadata needed)
ls .env* 2>/dev/null || echo "No .env files found"
Step 3: Load False Positives Database
Read docs/technical-debt/FALSE_POSITIVES.jsonl and filter findings matching:
securityexpires date passed)Note patterns to exclude from final findings.
Focus Areas (12+ Categories):
.claude/ configs, agent prompts, LLM
integrations with user input (S0)any types, * CORS, overly
permissive rules (S1)For each category:
Additional Checks for AI-Assisted Codebases:
eval(, new Function(, Function( - dynamic code executiondangerouslySetInnerHTML - XSS vectorsprocess.env in client components - boundary leakspostinstall, preinstall in package.json - supply chain.claude/ that could be prompt injectionScope:
src/, components/, lib/, .claude/node_modules/, dist/, build/, docs/, tests/1. Markdown Summary (display to user):
## Security Audit - [DATE]
### Baselines
- npm audit: X vulnerabilities (Y critical, Z high)
- Security patterns: X violations
- Security-sensitive files: X changed since last audit
### Findings Summary
| Severity | Count | OWASP Category | Confidence |
| -------- | ----- | -------------- | ----------- |
| S0 | X | ... | HIGH/MEDIUM |
| S1 | X | ... | HIGH/MEDIUM |
| S2 | X | ... | ... |
| S3 | X | ... | ... |
### Critical/High Findings (Immediate Action)
1. [file:line] - Description (S0/OWASP-A01) - DUAL_PASS_CONFIRMED
2. ...
### False Positives Filtered
- X findings excluded (matched FALSE_POSITIVES.jsonl patterns)
### Dependency Vulnerabilities
- ...
### Recommendations
- ...
2. JSONL Findings (save to file):
Create file: docs/audits/single-session/security/audit-[YYYY-MM-DD].jsonl
Category field: category MUST be security. Also include owasp_category
and cvss_estimate fields.
3. Markdown Report (save to file):
Create file: docs/audits/single-session/security/audit-[YYYY-MM-DD].md
Full markdown report with all findings, baselines, and remediation plan.
Read
CANON/templates/AUDIT_TEMPLATE.mdfor: Evidence Requirements, Dual-Pass Verification, Cross-Reference Validation, JSONL Output Format, Context Recovery, Post-Audit Validation, MASTER_DEBT Cross-Reference, Interactive Review, TDMS Intake & Commit, Documentation References, Agent Return Protocol, and Honesty Guardrails.
Skill-specific TDMS intake:
node scripts/debt/intake-audit.js <output.jsonl> --source "audit-security-<date>"
Security audit triggers (check AUDIT_TRACKER.md):
| Version | Date | Description |
|---|---|---|
| 1.0 | 2026-02-25 | Initial implementation |