Download for MacApple silicon, macOS 14+
Skill

add-and-validate-guardian-developer-semgrep-rule

@semgrep Updated 2026-10-22

write a custom semgrep rule with the user, add it to guardian in either user or repo scope, and prove it fires by writing a file that should trip it. use when someone wants guardian to catch something it currently misses, asks to write or add a semgrep rule, or wants a project convention enforced on the code claude writes.

Install

With your agent

Install OMGSkills skill "semgrep/guardian:plugin/skills/add-and-validate-guardian-developer-semgrep-rule" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.

Manual command

git clone https://github.com/semgrep/guardian /tmp/guardian && ln -s /tmp/guardian/plugin/skills/add-and-validate-guardian-developer-semgrep-rule ~/.claude/skills/add-and-validate-guardian-developer-semgrep-rule

From README

write a semgrep rule and add it to guardian guardian scans every file claude writes or edits. a custom rule makes it catch something the deployment's ruleset does not — a project convention, a deprecated internal api, a footgun this team keeps hitting. rules live in two places, both read on every scan: /.semgrep/guardian-rules/ — user scope, follows the user into every repository /.semgrep/guardian-rules/ — repo scope, follows the code, so everyone who clones it gets the rule add rules with adddevelopersemgreprule rather than writing into those directories by hand: it resolves the scope's directory and will not write over a rule already there. it does not check the rule itself or count it against the deployment's limit — that happens when a scan reads the rules, and step 5 is how you find out. a file can hold one rule or a rules: list. a file that fails to parse is rejected whole, so rules kept in one file are sent together or not at all.