semgrep-rule-creator
Skill by REVREBEL
Creates custom Semgrep rules with matching test files for security vulnerabilities, bug patterns and code patterns. Built for developers and security teams writing their own static analysis detections, with taint mode preferred for data flow issues.
Install semgrep-rule-creator
Built from the published package, never by AI.
git clone --depth 1 https://github.com/REVREBEL/skills-library /tmp/skills-library && mkdir -p ~/.claude/skills && cp -r /tmp/skills-library/task-folder/agents/skills/semgrep-rule-creator ~/.claude/skills/semgrep-rule-creatorRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/REVREBEL/skills-library /tmp/skills-library && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills-library/task-folder/agents/skills/semgrep-rule-creator ~/.gemini/antigravity-cli/skills/semgrep-rule-creatorAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install semgrep-rule-creator in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The semgrep-rule-creator skill guides an AI assistant through writing custom Semgrep rules for security vulnerabilities, bug patterns and code patterns. It follows a set order: analyze the problem, write tests first, analyze the AST, write the rule, and iterate until all tests pass. Each rule is saved in a directory named after its rule ID, with one YAML rule file and one test file that uses ruleid and ok annotations.
The workflow prefers taint mode for data flow issues and falls back to pattern matching when needed. The skill requires reading Semgrep documentation before writing rules and requires all tests to pass before optimizing. It is meant for developers and security teams who need custom static analysis detections. It is not meant for running existing Semgrep rulesets.
Written from the project's SKILL.md and checked against it.
What it can do
- Taint mode rulesWrites rules that track untrusted input from sources to dangerous sinks.
- Pattern matching rulesWrites simple syntactic rules when no data flow tracking is needed.
- Test file creationCreates a test file with ruleid and ok annotations for vulnerable and safe cases.
- Rule testingRuns semgrep --test on the rule and test file and iterates until tests pass.
- Documentation reviewUses WebFetch to read the Semgrep documentation before writing a rule.
What you need
- Semgrep CLI
- WebFetch access to Semgrep documentation
Try asking
- Write a Semgrep taint rule that flags request input passed to eval()
- Create a Semgrep rule and test file for os.system calls built from user input
- Help me write a custom Semgrep rule that enforces a coding standard in Python
Good to know
- Not for running existing Semgrep rulesets.
- Each YAML file must contain only one Semgrep rule.
- Generic language rules (languages: generic) are not allowed.
- todoruleid and todook test annotations are forbidden.
Security check
B- Allowed to use Bash, Write, Edit without limitsIn
SKILL.md
Checked automatically: task-folder/agents/skills/semgrep-rule-creator/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: BashReadWriteEditGlobGrepWebFetch
Alternatives to semgrep-rule-creator
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
semgrep-rule-creator: common questions
Can this skill run existing Semgrep rulesets?
No. The source says not to use this skill for running existing Semgrep rulesets. General static analysis without custom rules should use the static-analysis skill instead.
How are rules tested?
Each rule has a test file with ruleid and ok annotations. The skill runs semgrep --test against the rule and test file and requires all tests to pass.
Why does this skill prefer taint mode?
Taint mode tracks data flow, so it alerts only when untrusted data reaches a dangerous sink. The source says this reduces false positives for injection vulnerabilities compared with plain pattern matching.
How do I install semgrep-rule-creator?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is semgrep-rule-creator free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is semgrep-rule-creator safe to use?
It scores 64 of 100. Grades: maintenance A, licence A, quality C. Security check: grade B (allowed to use bash, write, edit without limits). Review the code before you install. How grades work.
What are alternatives to semgrep-rule-creator?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
