semgrep-rule-variant-creator

Port existing Semgrep rules to target languages with per-language rule and test directories.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/DobricLilujun/LabAgentSkill --skill semgrep-rule-variant-creator-dobriclilujun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-variant-creator
Source: https://github.com/DobricLilujun/LabAgentSkill/tree/main/skillsHub/skills_scaling/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator
Command: npx skills add https://github.com/DobricLilujun/LabAgentSkill --skill semgrep-rule-variant-creator-dobriclilujun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Port existing Semgrep rules to multiple target languages by generating independent rule+test directories per language, enabling accurate cross-language rule coverage.

Core Features & Use Cases

  • Port rules to new languages while preserving rule logic and test coverage.
  • Generate per-language directories containing ported rule YAML and corresponding tests.
  • Facilitate independent validation and iteration per language in multi-language codebases.

Quick Start

Provide an existing Semgrep rule and one or more target languages to generate per-language rule+test directories.

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 existing Semgrep rules to multiple programming languages at once?

To port Semgrep rules to multiple programming languages, provide an existing rule YAML and a list of target languages. The process generates independent directories per language, each containing the ported rule YAML and corresponding tests for isolated validation.

What is the best way to translate Semgrep rules for a polyglot codebase?

Translating Semgrep rules for a polyglot codebase is best handled by generating dedicated rule and test directories per target language. This extends rule coverage across multiple languages while preserving original logic and enabling independent iteration.

Can I generate test files automatically when porting Semgrep rule YAML?

Yes, generating test files is handled automatically when porting Semgrep rule YAML. The process outputs directories named with the rule and target language, containing both the adapted rule YAML and the corresponding test files for immediate validation.

Do I need an existing Semgrep rule before porting it to new languages?

Yes, an existing Semgrep rule in YAML format or equivalent rule content is required before porting. This original rule and a list of target languages are the required inputs to generate the per-language directories for the ported rules.

How does cross-language Semgrep rule porting handle independent validation?

Cross-language Semgrep rule porting handles independent validation by creating separate directories for each target language. Each directory contains the ported rule YAML and its corresponding tests, allowing you to validate and iterate on each language independently.

What are the limitations of porting Semgrep rules across polyglot codebases?

Porting Semgrep rules across polyglot codebases is limited by the construct similarity between the original and target languages. The process is most applicable when translating rules to languages with similar constructs, relying on an existing rule YAML to function properly.