semgrep-rule-creator

semgrep-rule-creator is a skill for Claude Code from waybarrios/opencode-power-pack. It costs 37 tokens per session (1,561 once invoked), scanned A, original, MIT.

A rule-writing assistant for Semgrep, a tool that searches source code for security problems, bugs, and unwanted patterns.

In plain words
What is it for?
Use it to create and test Semgrep rules, including rules that follow data from user input to a dangerous operation, or enforce coding standards.
Why use it?
It helps turn a specific code pattern or vulnerability into a tested detection instead of relying on an unverified match.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the opencode-power-pack plugin — 54 skills shipped together

Good fit Use it to create and test Semgrep rules, including rules that follow data from user input to a dangerous operation, or enforce coding standards.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/waybarrios/opencode-power-pack/semgrep-rule-creator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add waybarrios/opencode-power-pack --skill semgrep-rule-creator
Clone the repo
git clone --depth 1 https://github.com/waybarrios/opencode-power-pack

Made for: Claude Code.

Or install opencode-power-pack, the plugin that ships this one along with the rest of its 54 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for semgrep-rule-creator

README.md
[![agentmods](https://agentmods.dev/badge/skills/waybarrios/opencode-power-pack/semgrep-rule-creator.svg)](https://agentmods.dev/skills/waybarrios/opencode-power-pack/semgrep-rule-creator)
Your own site
<a href="https://agentmods.dev/skills/waybarrios/opencode-power-pack/semgrep-rule-creator"><img src="https://agentmods.dev/badge/skills/waybarrios/opencode-power-pack/semgrep-rule-creator.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,561 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high YARA Match · line 125
    YARA rule matched a known webshell pattern (PHP, Python, JSP, or ASPX webshell).
    Fix: Remove the webshell code immediately. Webshells provide unauthorized remote command execution. Audit the skill for additional backdoors or persistence mechanisms.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01561
Opus 5 $0.00018 $0.00781
Sonnet 5 $0.00007 $0.00312
Haiku 4.5 $0.00004 $0.00156

Measured 8d ago against content hash 06febe15e6ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

semgrep-rule-creator scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

pattern: os.system("rm " + $VAR)
Origin

Copies of this mod

4 near-identical copies found in the catalogue:

skills/semgrep-rule-creator/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Semgrep Rule Creator

Create production-quality Semgrep rules with proper testing and validation.

When to Use

Ideal scenarios:

  • Writing Semgrep rules for specific bug patterns
  • Writing rules to detect security vulnerabilities in your codebase
  • Writing taint mode rules for data flow vulnerabilities
  • Writing rules to enforce coding standards

When NOT to Use

Do NOT use this skill for:

  • Running existing Semgrep rulesets
  • General static analysis without custom rules (use static-analysis skill)

Rationalizations to Reject

When writing Semgrep rules, reject these common shortcuts:

  • "The pattern looks complete" → Still run semgrep --test --config <rule-id>.yaml <rule-id>.<ext> to verify. Untested rules have hidden false positives/negatives.
  • "It matches the vulnerable case" → Matching vulnerabilities is half the job. Verify safe cases don't match (false positives break trust).
  • "Taint mode is overkill for this" → If data flows from user input to a dangerous sink, taint mode gives better precision than pattern matching.
  • "One test is enough" → Include edge cases: different coding styles, sanitized inputs, safe alternatives, and boundary conditions.
  • "I'll optimize the patterns first" → Write correct patterns first, optimize after all tests pass. Premature optimization causes regressions.
  • "The AST dump is too complex" → The AST reveals exactly how Semgrep sees code. Skipping it leads to patterns that miss syntactic variations.

Anti-Patterns

Too broad - matches everything, useless for detection:

# BAD: Matches any function call
pattern: $FUNC(...)

# GOOD: Specific dangerous function
pattern: eval(...)

Missing safe cases in tests - leads to undetected false positives:

# BAD: Only tests vulnerable case
# ruleid: my-rule
dangerous(user_input)

# GOOD: Include safe cases to verify no false positives
# ruleid: my-rule
dangerous(user_input)

# ok: my-rule
dangerous(sanitize(user_input))

# ok: my-rule
dangerous("hardcoded_safe_value")

Read the full file on GitHub · 162 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 162 lines · 37 tokens per session scan A 06febe15e6ca

Subscribe to this mod's changes

semgrep-rule-creator is a skill published in the GitHub repository waybarrios/opencode-power-pack (495 stars, last pushed today), licensed MIT. It adds 37 tokens to every session and 1,561 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

review-loop

Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until APPROVE. Use before claiming any behavioural change is done, and on requests like "review loop", "adversarial review", "independent review", "get this verified"…

sangrokjung/claude-forge · 100 tokens

ln-22-codebase-auditor

Audits cross-cutting code health, security, delivery, and maintainability when no specialist audit is primary. Not for a single delivery review.

levnikolaevich/claude-code-skills · 38 tokens

dx-audit

Audits libraries, CLIs, and SDKs using 38 rules for public contracts, package exports, piped output, errors, and configuration. Use when asked to "audit my CLI", "review my SDK", "make this agent-friendly", or diagnose package type resolution. For agentic product trust use ax-audit; for docs use docs-writing.

mblode/agent-skills · 76 tokens

silent-failure-hunter

Audits error-handling code in a pull request for silent failures, broad catch blocks, unjustified fallbacks, and unactionable error messages. Surfaces hidden failures users would otherwise hit in production. Use when reviewing PRs that add or modify try/catch, error callbacks, or fallback logic.

jasmedia/cc-pr-reviewer · 67 tokens

bugfix

Fix a bug with xReview peer review. Codex is the developer, a peer LLM agent reviews your work. Use when: /bugfix, fix a bug with review.

tonychen15/xReview · 40 tokens

error-audit

Audit code for silent error swallowing, fallbacks to degraded alternatives, backwards compatibility shims, and UI that fails to show errors to the user. Finds and fixes all occurrences in the specified scope.

markmdev/meridian · 43 tokens