static-analysis/skills/semgrep/SKILL.md
Run Semgrep static analysis scan on a codebase using parallel subagents. Automatically detects and uses Semgrep Pro for cross-file analysis when available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. Spawns parallel workers for multi-language codebases and triage.
npx skillsauth add lidge-jun/cli-jaw-skills semgrepInstall 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.
Run a complete Semgrep scan with automatic language detection, parallel execution via Task subagents, and parallel triage. Uses Semgrep Pro for cross-file taint analysis when available.
Semgrep CLI required:
semgrep --version
Optional — Semgrep Pro enables cross-file taint tracking, inter-procedural analysis, and additional languages (Apex, C#, Elixir):
semgrep --pro --validate --config p/default 2>/dev/null && echo "Pro available" || echo "OSS only"
Use for: security audits, vulnerability scanning, bug pattern detection, first-pass static analysis.
Use instead: binary analysis tools (for binaries), existing CI pipelines (if Semgrep CI configured), CodeQL (cross-file without Pro), semgrep-rule-creator skill (custom rules), semgrep-rule-variant-creator skill (porting rules).
Main agent orchestrates parallel Task subagents:
| Agent | Tools | Purpose |
|-------|-------|---------|
| static-analysis:semgrep-scanner | Bash | Execute parallel semgrep scans per language |
| static-analysis:semgrep-triager | Read, Grep, Glob, Write | Classify findings by reading source context |
Create all 6 tasks with dependencies on invocation:
| Task | Gate | Proceeds when | |------|------|---------------| | Step 1: Detect languages/Pro | — | — | | Step 2: Select rulesets | — | Step 1 done | | Step 3: Get approval | Hard gate | User explicitly approves | | Step 4: Execute scans | Soft gate | Step 3 done | | Step 5: Triage findings | Soft gate | All scan JSONs exist | | Step 6: Report results | — | Step 5 done |
Step 3 hard gate: mark completed only after explicit user confirmation ("yes", "proceed", "approved", or equivalent). The original scan request does not count as approval.
# Check Pro
SEMGREP_PRO=false
if semgrep --pro --validate --config p/default 2>/dev/null; then
SEMGREP_PRO=true
fi
# Find languages by extension
fd -t f -e py -e js -e ts -e jsx -e tsx -e go -e rb -e java -e php -e c -e cpp -e rs | \
sed 's/.*\.//' | sort | uniq -c | sort -rn
# Detect frameworks
ls -la package.json pyproject.toml Gemfile go.mod Cargo.toml pom.xml 2>/dev/null
fd -t f "Dockerfile" "docker-compose" ".tf" "*.yaml" "*.yml" | head -20
Map extensions → categories: Python, JavaScript/TypeScript, Go, Ruby, Java, PHP, C/C++, Rust, Docker, Terraform, Kubernetes.
Follow the Ruleset Selection Algorithm in rulesets.md. Output structured JSON for Step 3 review:
{
"baseline": ["p/security-audit", "p/secrets"],
"python": ["p/python", "p/django"],
"javascript": ["p/javascript", "p/react", "p/nodejs"],
"third_party": ["https://github.com/trailofbits/semgrep-rules"]
}
Third-party rulesets (Trail of Bits, 0xdea, Decurity) are included by default when languages match — they catch vulnerabilities absent from the official registry.
Present a plan covering:
./semgrep-results-NNN/)Approval flow:
Not valid approval: silence, questions about the plan, the original scan request.
Create numbered output directory, then spawn all scan Tasks in a single message:
LAST=$(ls -d semgrep-results-[0-9][0-9][0-9] 2>/dev/null | sort | tail -1 | grep -o '[0-9]*$' || true)
NEXT_NUM=$(printf "%03d" $(( ${LAST:-0} + 1 )))
OUTPUT_DIR="semgrep-results-${NEXT_NUM}"
mkdir -p "$OUTPUT_DIR"
Use subagent_type: static-analysis:semgrep-scanner with approved rulesets from Step 3. See scanner-task-prompt.md for prompt template.
Each task scans one language category, outputting to $OUTPUT_DIR/{lang}-*.json and *.sarif.
After scans complete, spawn triage Tasks using subagent_type: static-analysis:semgrep-triager. See triage-task-prompt.md for prompt template.
Triage reads source context around each finding to classify as true/false positive.
Generate merged SARIF with triaged true positives:
uv run {baseDir}/scripts/merge_triaged_sarif.py [OUTPUT_DIR]
The script reads *-triage.json files, filters to true positives, and writes findings-triaged.sarif. Uses SARIF Multitool if available, falls back to pure Python.
Report summary to user:
findings-triaged.sarif, *-triage.json, raw *.json/*.sarif)| Pitfall | Correct approach |
|---------|-----------------|
| Missing --metrics=off | Always disable telemetry |
| Sequential rulesets | Run in parallel with & and wait |
| Unscoped rulesets | Use --include="*.py" for language-specific rules |
| Reporting raw findings | Always triage to filter false positives |
| Sequential Tasks | Spawn all Tasks in a single message for parallelism |
| Using --config auto | Sends metrics, less ruleset control — use explicit rulesets |
| Skipping Pro check | Pro catches ~2.5× more true positives via cross-file analysis |
| Treating scan request as plan approval | Present plan with parameters, await explicit "yes" |
| Adding/removing rulesets without asking | Only scan with the user-approved ruleset list |
semgrep login + semgrep install-semgrep-pro-j 1 (slower per ruleset; compensated by parallel rulesets)development
Goal execution guidelines with PABCD integration, verification tiers, documentation workflow, and AI-driven planning
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
development
Use this skill any time a spreadsheet file is the primary input or output (.xlsx, .xlsm, .csv, .tsv). This includes: creating, reading, editing, analyzing, or formatting spreadsheets; cleaning messy tabular data; converting between formats; and data visualization with charts. Also use for pandas-based data analysis when the deliverable is a spreadsheet. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration.
tools
Use this skill when the user wants to build a financial model, 3-statement model, DCF valuation, cap table, scenario analysis, or financial projections in Excel. Trigger on: 'financial model', '3-statement model', 'DCF', 'cap table', 'pro forma', 'projections', 'sensitivity analysis', 'waterfall', 'debt schedule', 'break-even', 'discounted cash flow', 'capitalization table', 'fundraising model', 'WACC calculation', 'scenario analysis model'. Input is a text prompt with assumptions. Output is a single .xlsx file with formula-driven, interconnected statement sheets.