semgrep-rule-variant-creator

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

6.5k|561|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/trailofbits/skills --skill semgrep-rule-variant-creator-trailofbits
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-variant-creator
Source: https://github.com/trailofbits/skills/tree/main/plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator
Command: npx skills add https://github.com/trailofbits/skills --skill semgrep-rule-variant-creator-trailofbits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Port existing Semgrep rules to target languages to broaden coverage and maintain testing rigor across language ecosystems.

Core Features & Use Cases

  • Automates creation of language-specific rule and test directories for each target language.
  • Enforces an independent four-phase workflow per language (applicability analysis, test creation, rule creation, validation).
  • Outputs self-contained rule+test directories per variant (e.g., semgrep-rule-variant-creator-golang/ with YAML and tests).

Quick Start

Provide an existing Semgrep rule and one or more target languages to generate per-language variant directories ready for testing.

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

The rule porting process enforces an independent four-phase workflow for each target language: applicability analysis, test creation, rule creation, and validation, ensuring broadened static-analysis coverage.

Does rule porting automatically generate test files for each language variant?

This automated test creation occurs during the independent four-phase workflow, ensuring that each ported static-analysis rule maintains testing rigor across different language ecosystems.

Can I use this to port a single Semgrep rule to multiple languages at once?

By processing each language independently through applicability analysis, test creation, rule creation, and validation, it broadens static-analysis coverage without cross-language interference.

What is the best way to maintain testing rigor when broadening static-analysis coverage?

This approach enforces a four-phase process—applicability analysis, test creation, rule creation, and validation—ensuring every ported Semgrep rule is validated independently.

Do I need to manually create test directories when porting Semgrep rules?

It handles the directory creation and file generation through a structured four-phase workflow, ensuring each static-analysis variant is properly isolated and validated.

Why does my ported Semgrep rule need an applicability analysis phase?

This initial phase of the four-language workflow ensures the ported static-analysis rule is viable, preventing invalid rule generation and maintaining testing rigor across language ecosystems.