semgrep-rule-variant-creator

Generate Semgrep rule variants from an exemplar to extend vulnerability coverage.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/balic-AI-ML-R-D-Resources/eliza_autonomous_agents --skill semgrep-rule-variant-creator-balic-ai-ml-r-d-resources
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: semgrep-rule-variant-creator
Source: https://github.com/balic-AI-ML-R-D-Resources/eliza_autonomous_agents/tree/main/packages/skills/skills/semgrep-rule-variant-creator
Command: npx skills add https://github.com/balic-AI-ML-R-D-Resources/eliza_autonomous_agents --skill semgrep-rule-variant-creator-balic-ai-ml-r-d-resources

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create variant Semgrep rules from existing detections to catch related vulnerability patterns. Use when extending a Semgrep rule to cover additional code patterns, languages, or frameworks, when a rule catches one variant but misses others, or when adapting rules for a different tech stack.

Core Features & Use Cases

  • Generate a family of related Semgrep rules from a single exemplar to broaden coverage across languages, frameworks, and patterns.
  • Facilitate workflow: analyze the original rule, identify missing variants, create framework-specific variants (e.g., Django, SQLAlchemy), and organize them under a single rule family.
  • Use case: extend a Python SQL-injection rule to cover f-strings, string concatenation, and ORM variants across Django and Flask.

Quick Start

Create a variant rule set by analyzing an existing Semgrep rule and exporting new framework-specific variants.

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 extend a Semgrep rule to cover additional vulnerability patterns in Python?▼

To extend Semgrep rules for additional Python vulnerability patterns, you generate comprehensive variants from a single exemplar. This process analyzes the original rule and produces framework-specific detections using pattern-either and pattern-not constructs.

How do I create Semgrep variants for Django and Flask frameworks?▼

Creating Semgrep variants for Django and Flask involves analyzing an existing rule and generating framework-specific rules. This aligns static code analysis detections with real-world code patterns across different tech stacks.

Does Semgrep pattern matching support f-strings and ORM code analysis?▼

Semgrep pattern matching supports f-strings, string concatenation, and ORM variants. It enumerates missing variations from a base rule to broaden vulnerability coverage across Python frameworks like SQLAlchemy.

What is the best way to organize multiple Semgrep rule variants?▼

The best way to organize multiple Semgrep rule variants is to group them under a single rule family. This approach structures the generated framework-specific patterns cohesively to extend vulnerability detection.

Can I adapt a static analysis rule for a different tech stack?▼

You can adapt a static analysis rule for a different tech stack by generating a family of related Semgrep rules. This workflow analyzes the original detection and creates variants for new languages and frameworks.