What problem does it solve? Writing Semgrep rules by hand often produces patterns with hidden false positives, missed vulnerable variants, and untested edge cases. This Skill enforces a strict test-first workflow so every custom rule is validated against both vulnerable and safe code before it ships. ## Core Features & Use Cases - Test-first rule creation: Write annotated test files (ruleid:/ok:) before the rule, then iterate with semgrep --test until all tests pass. - Taint mode guidance: Prioritizes taint mode for data flow vulnerabilities (sources, sinks, sanitizers) to reduce false positives on injection-style bugs. - AST-driven pattern writing: Uses semgrep --dump-ast to understand how Semgrep parses code, plus an optimization pass that removes redundant patterns. - Use Case: You need to detect user input reaching eval() in a Python codebase. The Skill walks you through writing tests, building a taint-mode rule, debugging with --dataflow-traces, and optimizing the final YAML. ## Quick Start Ask the agent to create a Semgrep rule that detects a specific vulnerability pattern in your language, and it will produce a tested rule YAML plus an annotated test file.