semgrep-rule-variant-creator
Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.
npx skills add waybarrios/opencode-power-pack --skill semgrep-rule-variant-creator --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Semgrep Rule Variant Creator Port existing Semgrep rules to new target languages with proper applicability analysis and test-driven validation. ## When to Use **Ideal scenarios:** - Porting an existing Semgrep rule to one or more target languages - Creating language-specific variants of a universal vulnerability pattern - Expanding rule coverage across a polyglot codebase - Translating rules between languages with equivalent constructs ## When NOT to Use Do NOT use this skill for: - Creating a new Semgrep rule from scratch (use `semgrep-rule-creator` instead) - Running existing rules against code - Languages where the vulnerability pattern fundamentally doesn't apply - Minor syntax variations within the same language ## Input Specification This skill requires: 1. **Existing Semgrep rule** - YAML file path or YAML rule content 2. **Target languages** - One or more languages to port to (e.g., "Golang and Java") ## Output Specification For each applicable target language, produces: ``` <original-rule-id>-<language>/ ├── <original-rule-id>-<language>.yaml # Ported Semgrep rule └── <original-rule-id>-<language>.<ext> # Test file with annotations ``` Example output for porting `sql-inj
- When to Use
- When NOT to Use
- Input Specification
- Output Specification
- Rationalizations to Reject
- Strictness Level
- Overview
- Foundational Knowledge
- Four-Phase Workflow
- Phase 1: Applicability Analysis
- Phase 2: Test Creation (Test-First)
- Phase 3: Rule Creation
- Phase 4: Validation
- Quick Reference
Validate YAML semgrep --validate --config rule.yaml Run tests semgrep --test --config rule.yaml test-file semgrep --dataflow-traces -f rule.yaml test-file
What does the semgrep-rule-variant-creator skill do?
Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.
How do I install it?
Run `npx skills add waybarrios/opencode-power-pack --skill semgrep-rule-variant-creator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From waybarrios/opencode-power-pack, a repository with 443 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.