Skill Detail

SAST Rule Compiler for Semgrep

Compiles and validates custom Semgrep SAST rules using the semgrep-core engine. Tests pattern matching against sample codebases and generates rule performance benchmarks with p/ci rulesets.

Security & VerificationCodex

Compiles and validates custom Semgrep SAST rules using the semgrep-core engine. Tests pattern matching against sample codebases and generates rule performance benchmarks with p/ci rulesets.

Security & Verification Codex Security Reviewed
INSTALL WITH ANY AGENT
npx skills add agentskillexchange/skills --skill sast-rule-compiler-semgrep Copy

The SAST Rule Compiler for Semgrep skill streamlines the creation and validation of custom Static Application Security Testing rules for the Semgrep engine. It provides an interactive workflow for writing pattern, pattern-either, pattern-not, and taint-mode rules with immediate feedback against test codebases.

The skill validates rule YAML syntax against the Semgrep rule schema, checks metavariable bindings for consistency, and runs pattern compilation through semgrep-core to catch regex errors and unsupported language features. It includes a benchmark mode that profiles rule performance against large codebases, identifying rules that exceed scan-time budgets.

For teams using Semgrep App, the skill can push rules to custom rule packs and validate them against the p/ci, p/security-audit, and p/owasp-top-ten rulesets to avoid conflicts. It supports all 30+ languages in Semgrep’s grammar registry and can generate autofix patterns using the fix: directive. Output includes rule coverage reports showing which CWE IDs are addressed and gap analysis against OWASP benchmarks.