Semgrep Rule Variant Creator
This skill generates diverse Semgrep rule variants from a single rule, accelerating code analysis and finding subtle issues effectively.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add semgrep-rule-variant-creator npx -- -y @trustedskills/semgrep-rule-variant-creator
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"semgrep-rule-variant-creator": {
"command": "npx",
"args": [
"-y",
"@trustedskills/semgrep-rule-variant-creator"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
The semgrep-rule-variant-creator skill generates variations of existing Semgrep rules. It allows users to create new, customized rules based on established patterns and logic, facilitating more targeted code analysis. This is useful for adapting security checks to specific project contexts or identifying subtle deviations from coding standards.
When to use it
- Customizing Security Checks: Adapt a general Semgrep rule to focus on a particular vulnerability within your codebase.
- Enforcing Coding Standards: Create variations of existing rules to enforce nuanced aspects of your team's coding style guidelines.
- Extending Existing Rules: Build upon the foundation of established rules to cover new code patterns or technologies.
- Rapid Prototyping: Quickly generate multiple rule variants for experimentation and comparison.
Key capabilities
- Rule variation generation
- Customization of existing Semgrep rules
- Adaptation for specific project contexts
- Enforcement of coding standards
Example prompts
- "Create a variant of the 'C' rule that only flags instances where the variable is used after its initialization."
- "Generate three variations of the 'SQL injection' rule, each with different levels of strictness."
- "Modify the existing 'hardcoded_credentials' rule to ignore files in the 'secrets' directory."
Tips & gotchas
- Requires a working knowledge of Semgrep rules and syntax.
- The quality of generated variants depends on the clarity and specificity of the initial rule.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.