Skills Explorer Add Skills

semgrep-rule-variant-creator

An agent skill by trailofbits, from trailofbits/skills. Tags: code-quality, developer-tools, migration, semgrep.

What it does

Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.

Install

With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:

npx skills add trailofbits/skills --skill semgrep-rule-variant-creator

Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):

git clone --depth 1 https://github.com/trailofbits/skills
cp -r skills/plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator ~/.claude/skills/semgrep-rule-variant-creator

Safety box score

Grade B, low risk: 21 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.

This skill ports Semgrep rules into per-language variants and drives a workflow that reads the rule, writes test/rule files, and validates them with Semgrep. The main risks are bounded file access outside the project to locate references/workflow state, and the fact that it can produce apparently green variants from self-written tests rather than an independent oracle.

Category levels, from 0 (none) to 3 (high)
CategoryLevelWhy
Code & shell execution2 (moderate)It explicitly runs a workflow script and Semgrep commands, including `Workflow({scriptPath: ...})`, `/semgrep-rule-variant-creator:port-rule-to-languages`, and `semgrep --test`.
Network access1 (low)The skill includes `WebFetch` in its allowed tools and links to external docs like `https://semgrep.dev/docs/...`, so it may fetch reference material from the network.
Filesystem reach2 (moderate)It reads outside the project to find references and workflow state via `find ~/.claude ~/.codex ...` and `ls -d ~/.claude/projects/*/*/subagents/workflows/*/`.
Secrets & credentials0 (none)There is no instruction to read tokens, keys, passwords, `.env` files, browser sessions, or other credential stores.
Privilege & persistence0 (none)No sudo, global install, service registration, shell-startup edits, or other privilege-changing action is requested.
Instruction hijack surface0 (none)The text is workflow guidance rather than hostile prompt injection; it does not ask the agent to ignore higher-priority instructions or hide behavior.
Irreversible actions1 (low)The workflow autonomously creates per-language output directories and can resume/re-run phases, but it does not publish, message, deploy, or pay.
Transparency0 (none)All shipped files are plain text (Markdown, YAML, SVG); there are no binaries, minified blobs, or downloaded installers.

Before installing

Rated 2026-10-20 by an automated review of 6 files from the skill's repository.

Source

Repository
trailofbits/skills (all skills from this repository)
Path
plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md
Branch
main
Collection
semgrep-rule-variant-creator
Updated
2026-09-19