semgrep-rule-variant-creator

Port Semgrep rules to new languages with applicability analysis and test-driven validation.

Updated Jul 10, 2025
One-click install
npx skills add https://github.com/Superlend/superloop-core-contracts --skill semgrep-rule-variant-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-variant-creator
Source: https://github.com/Superlend/superloop-core-contracts/tree/main/.cursor/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator
Command: npx skills add https://github.com/Superlend/superloop-core-contracts --skill semgrep-rule-variant-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables teams to port existing Semgrep rules to new target languages by generating language-specific variants and ensuring robust test coverage.

Core Features & Use Cases

  • Independent language cycles: Each target language is ported through its own four-phase workflow (applicability analysis, test creation, rule creation, validation).
  • Per-language artifacts: Produces separate rule+test directories for every target language, with updated metadata linking back to the original rule.
  • Batch porting: Supports porting a single rule to multiple languages in one operation, while preserving language idioms and AST structures.

Quick Start

Run the semgrep-rule-variant-creator on an existing rule to port it to Go, Java, and Python, generating per-language variants and tests ready for validation.

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 new programming languages?

Port Semgrep rules to new programming languages by generating language-specific variants with applicability analysis, independent rule and test directories, and test-driven validation to preserve language idioms.

What is the best way to convert static analysis rules from one language to multiple target languages?

Converting static analysis rules to multiple target languages is best handled through batch porting, which processes each language through an independent workflow cycle while preserving AST structures and language idioms.

Can I port a single Semgrep rule to multiple languages in one operation?

Yes, you can port a single Semgrep rule to multiple languages in one operation, as the process supports batch porting and outputs separate rule and test directories for each target language.

Does porting Semgrep rules to a new language require creating new test files?

Porting Semgrep rules to a new language requires test-driven validation, meaning the process creates independent test files alongside the language-specific rule variants to ensure the ported rules function correctly.

How does applicability analysis work when converting Semgrep rules for different languages?

Applicability analysis for converting Semgrep rules evaluates whether the original rule logic applies to the target language, ensuring the generated variant respects the new language syntax before rule creation and validation.

What steps are involved in creating multilanguage variants of Semgrep rules?

Creating multilanguage variants of Semgrep rules involves a four-phase workflow per target language: applicability analysis, test creation, rule creation, and validation, outputting variants with updated metadata linking back to the original.