Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

semgrep-rule-variant-creator

Skill by mwathiben

Ports existing Semgrep rules to new target languages. Each language gets its own rule and test directory after an applicability check. Aimed at security engineers working across polyglot codebases.

  • Score 47
  • 0 stars
  • GPL-3.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install semgrep-rule-variant-creator

Built from the published package, never by AI.

git clone --depth 1 https://github.com/mwathiben/hush-private-bookmarks /tmp/hush-private-bookmarks && mkdir -p ~/.claude/skills && cp -r /tmp/hush-private-bookmarks/.claude/skills/semgrep-rule-variant-creator ~/.claude/skills/semgrep-rule-variant-creator

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install semgrep-rule-variant-creator in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The semgrep-rule-variant-creator skill ports an existing Semgrep rule to one or more target languages. For each language it runs an applicability analysis that returns a verdict: applicable, applicable with adaptation, or not applicable. If the rule applies, it writes tests first, then the ported rule, then validates it with the Semgrep CLI.

Each applicable language gets its own directory containing a YAML rule and a test file with ruleid and ok annotations. The skill requires at least two vulnerable and two safe test cases per variant and needs a 100% test pass before a variant is complete. It points to the semgrep-rule-creator skill for core rule-writing guidance. It is meant for developers and security teams who want to extend rule coverage across languages.

Written from the project's SKILL.md and checked against it.

What it can do

  • Applicability analysisChecks per language whether the vulnerability class and an equivalent construct exist in the target language.
  • Test creationWrites vulnerable and safe test cases using target language idioms before the rule is written.
  • Rule creationTranslates patterns and metadata into a ported YAML rule, using AST dumps to guide the translation.
  • ValidationRuns semgrep --validate and semgrep --test on each variant and iterates until all tests pass.
  • Taint debuggingUses semgrep --dataflow-traces to debug taint rules.

What you need

  • Semgrep CLI installed
  • An existing Semgrep rule as a YAML file or YAML content
  • One or more target languages

Try asking

  • Port this sql-injection Semgrep rule to Go and Java.
  • Check whether this XSS Semgrep rule applies to Python and TypeScript.
  • Create rule and test directories for each applicable target language.

Good to know

  • Not for creating new rules from scratch; use semgrep-rule-creator instead.
  • Does not run existing rules against code.
  • Each variant must reach a 100% test pass; partial passes are not accepted.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/semgrep-rule-variant-creator/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: Bash Read Write Edit Glob Grep WebFetch

Alternatives to semgrep-rule-variant-creator

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

semgrep-rule-variant-creator: common questions

When should I not use this skill?

The source says not to use it to create a new rule from scratch, to run existing rules against code, or for minor syntax variations within the same language.

What files does it produce?

For each applicable language it produces a directory named <rule-id>-<language> containing a YAML rule file and a test file.

What happens if a language does not fit?

The applicability analysis can return NOT_APPLICABLE, in which case that language is skipped and the reason is documented.

How do I install semgrep-rule-variant-creator?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is semgrep-rule-variant-creator free?

The code is published under the GPL-3.0 licence. The service it connects to may have its own pricing.

Is semgrep-rule-variant-creator safe to use?

It scores 47 of 100. Grades: maintenance C, licence C, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to semgrep-rule-variant-creator?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

semgrep-rule-variant-creator Install

Add to stack

Loading.