semgrep-rule-variant-creator

Automate Semgrep rule variant creation and porting across languages.

1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/rohanbhatia27/rohanstutoring-redesign --skill semgrep-rule-variant-creator-rohanbhatia27
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-variant-creator
Source: https://github.com/rohanbhatia27/rohanstutoring-redesign/tree/main/.agents/skills/semgrep-rule-variant-creator
Command: npx skills add https://github.com/rohanbhatia27/rohanstutoring-redesign --skill semgrep-rule-variant-creator-rohanbhatia27

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python, semgrep, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill automates the process of creating language-specific variants of existing Semgrep rules, streamlining the porting of rules to new languages.

Core Features & Use Cases

  • Rule Variant Creation: Automatically generate rule+test directories for each target language.
  • Applicability Analysis: Analyze whether a rule applies to a target language before porting.
  • Test-First Approach: Write tests before creating rules to ensure accuracy and coverage.
  • Use Case: When you need to port a Semgrep rule from one language to another, such as from Python to Java.

Quick Start

Use the semgrep-rule-variant-creator skill to port the 'sql-injection' rule to Go and Java.

Frequently Asked Questions about semgrep-rule-variant-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I port Semgrep rules to a different programming language?

To port Semgrep rules to a different programming language, this Skill analyzes applicability for equivalent constructs, generates test files first, and translates the rule into the target language directory structure.

What is the best way to automate Semgrep rule creation for multiple languages?

Automating Semgrep rule creation for multiple languages is handled by analyzing target language constructs, writing tests before rule translation, and automatically generating the required rule and test directories.

Do I need Python and Semgrep installed to create rule variants?

Yes, you need Python and Semgrep installed as dependencies to execute tasks, analyze applicability, and generate the rule and test files required for language porting.

Can I check if a Semgrep rule applies to a target language before porting?

Yes, applicability analysis checks whether a Semgrep rule applies to a target language by verifying equivalent constructs before the rule translation and test generation process begins.

Why write tests before creating Semgrep rule variants?

Writing tests before creating Semgrep rule variants ensures accuracy and coverage by establishing expected results first, allowing the translated rule to be validated immediately against the target language constructs.

What are the limitations when porting Semgrep rules across languages?

Porting Semgrep rules across languages is limited to target languages with equivalent constructs, meaning rules relying on language-specific features without direct equivalents cannot be automatically translated.