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)tools
Use only on the Codex CLI for native image generation or image editing without an API key. Save final PNG files under ~/.cli-jaw/uploads, report web-ready absolute-path markdown, and send to Telegram or Discord only when explicitly requested.
tools
Ranked repository structure map via `cli-jaw map`. Use for codebase overview, structure map, symbol overview, unfamiliar codebase exploration, architecture orientation. Triggers: repo map, structure map, codebase overview, 와꾸, project structure, unfamiliar code.
tools
cli-jaw Design workspace: create, preview, run, and export design pages from the right sidebar. Covers panel UX, direct-write workflow, artifact lifecycle, wireframe generation, design system, and Open Design adapter.
development
MUST USE for infrastructure and delivery work — container builds, deploy pipelines, Kubernetes, Infrastructure as Code, SRE foundations, edge/serverless, ML infrastructure. Triggers: Dockerfile, K8s manifests, CI/CD pipeline, Terraform/IaC, release/deploy, devops/infra/deploy or release_cd task_tags.