.claude/skills/sec-context-depth/SKILL.md
Comprehensive AI code security review using 27 sec-context anti-patterns. Use for code review when security vulnerabilities are suspected, especially for AI-generated code.
npx skillsauth add alfredolopez80/multi-agent-ralph-loop sec-context-depthInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform comprehensive security reviews on AI-generated code, detecting 27 security anti-patterns from the sec-context framework.
Based on: Arcanum-Sec/sec-context Source: 150+ security research sources, OWASP, CWE
Before analyzing any code, you MUST read the local reference files that contain the full detection patterns with BAD/GOOD examples:
BREADTH reference (comprehensive coverage of all 27 patterns):
Read: .claude/skills/sec-context-depth/references/ANTI_PATTERNS_BREADTH.md
DEPTH reference (deep-dive into 7 most critical patterns):
Read: .claude/skills/sec-context-depth/references/ANTI_PATTERNS_DEPTH.md
These files contain:
Do NOT rely only on this SKILL.md — the pattern titles below are an index only. The actual detection logic is in the reference files.
Glob pattern="src/**/*.{ts,js,py,java,go}" (adjust to target)| Priority | Score | Action | Count | |----------|-------|--------|-------| | P0 Critical | 21-24 | BLOCKING - Must fix before merge | 13 patterns | | P1 High | 18-20 | BLOCKING - Should fix before merge | 8 patterns | | P2 Medium | 15-17 | ADVISORY - Review and fix if feasible | 6 patterns |
| # | Pattern | CWE | Score | |---|---------|-----|-------| | 1 | Hardcoded Secrets | CWE-798 | 23 | | 2 | API Key Prefixes | CWE-798 | 23 | | 3 | Private Keys | CWE-321 | 23 | | 4 | SQL Injection - String Concat | CWE-89 | 22 | | 5 | SQL Injection - f-string | CWE-89 | 22 | | 6 | Command Injection | CWE-78 | 21 | | 7 | Command Injection - Concat | CWE-78 | 21 | | 8 | XSS - innerHTML | CWE-79 | 23 | | 9 | XSS - document.write | CWE-79 | 23 | | 10 | XSS - React Unsafe | CWE-79 | 23 | | 11 | NoSQL Injection | CWE-943 | 22 | | 12 | Template Injection SSTI | CWE-1336 | 22 | | 13 | Hardcoded Encryption Key | CWE-798 | 22 |
| # | Pattern | CWE | Score | |---|---------|-----|-------| | 14 | JWT None Algorithm | CWE-287 | 22 | | 15 | Weak Hash MD5/SHA1 | CWE-327 | 20 | | 16 | ECB Mode | CWE-327 | 20 | | 17 | DES/RC4 | CWE-327 | 20 | | 18 | Insecure Random | CWE-330 | 18 | | 19 | Path Traversal | CWE-22 | 20 | | 20 | LDAP Injection | CWE-90 | 20 | | 21 | XPath Injection | CWE-643 | 20 |
| # | Pattern | CWE | Score | |---|---------|-----|-------| | 22 | Open CORS | CWE-346 | 17 | | 23 | Verbose Errors | CWE-209 | 16 | | 24 | Insecure Temp Files | CWE-377 | 16 | | 25 | Unvalidated Redirect | CWE-601 | 16 | | 26 | Insecure Deserialization | CWE-502 | 18 | | 27 | Debug Mode | CWE-489 | 15 |
When reviewing code, systematically check:
# Sec-Context Depth Audit Report
## Summary
- Files scanned: N
- Findings: X (P0: N, P1: N, P2: N)
## P0 Critical Findings
### [Pattern Name] (CWE-XXX) - file:line
- **BAD**: [code snippet]
- **GOOD**: [secure alternative from reference]
- **Impact**: [description]
## P1 High Findings
...
## P2 Medium Findings
...
## Recommendations
1. ...
The sec-context-validate.sh hook automatically checks these 27 patterns on every Edit/Write operation via PostToolUse.
development
Living knowledge base management. Actions: search (query vault), save (store learning), index (update indices), compile (raw->wiki->rules graduation), init (create vault structure). Follows Karpathy pipeline: ingest->compile->query. Use when: (1) searching accumulated knowledge, (2) saving learnings, (3) compiling raw notes into wiki, (4) initializing a new vault. Triggers: /vault, 'vault search', 'knowledge base', 'save learning'.
testing
Produce a verifiable technical specification before coding. 6 mandatory sections: Interfaces, Behaviors, Invariants (from Aristotle Phase 2), File Plan, Test Plan, Exit Criteria (executable bash commands + expected results). Use when: (1) before implementing features with complexity > 4, (2) as Step 1.5 in orchestrator workflow, (3) when requirements need formalization. Triggers: /spec, 'create spec', 'write specification', 'technical spec'.
testing
Pre-launch shipping checklist orchestrating /gates, /security, /browser-test, /perf. Ensures nothing ships without passing all quality checks. Use when: (1) before deploying, (2) before merging to main, (3) before release. Triggers: /ship, 'ship it', 'ready to deploy', 'pre-launch check'.
development
Performance optimization skill. Core Web Vitals via Lighthouse, bundle size analysis, metrics tracking over time. Use when: (1) optimizing frontend performance, (2) analyzing bundle size, (3) tracking metrics regression. Triggers: /perf, 'performance audit', 'core web vitals', 'bundle size'.