Individual skill

semgrep-rule-authoring

Use when a vulnerability or pattern and target language need a new Semgrep rule, or an existing rule needs porting to another language. Not for running scans: use semgrep-security-scan.

.devin/skills/semgrep-rule-authoring/SKILL.md

Read pinned source

Source commit b0e8ce89a19fac880251dc3ea1babfeb4503a4fe

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Instructions only
Last checked
Nov 4, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
55
Repository last updated
Sep 28, 2026
License
Apache-2.0

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Semgrep rule authoring

## Contract

| Field | Bound contract |
|---|---|
| Trigger | The user supplies a vulnerability, bug, or code pattern and target language and asks for a new custom Semgrep detection (author mode), or supplies an existing static-analysis rule to port to another language (port mode). |
| Authority | Reversible local: writes only the single new rule directory (author) or the user-specified output directory (port); rollback is deleting the directory created by the run. Runs only local analyzer commands and never installs tooling. No remote mutation. |
| Side effect | Author mode: exactly one rule directory containing one YAML rule and one annotated language test file. Port mode: one subdirectory under the output directory containing the translated rule and its annotated test file; the source rule is never modified. Both modes execute Semgrep validation, tests, AST dump, and scan. |
| Done | Author mode: the rule is specific, uses taint mode when data flow warrants it, all vulnerable/safe/edge/nested tests pass before and after optimization, YAML validates, and final output has no uninterpolated metavariables. Port mode: the target language has an explicit applicability verdict and, when applicable, the port passes its graded vulnerable/safe/edge matrix under the pinned analyzer version. |

## Not for

- Running a security scan with existing rules: use semgrep-security-scan.