Pattern-to-Rule Skill

Translate CVE behavioral patterns into generalized Semgrep rules.

Updated Dec 25, 2025
One-click install
npx skills add https://github.com/chrismcmacken/bounty-hunter --skill pattern-to-rule-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Pattern-to-Rule Skill
Source: https://github.com/chrismcmacken/bounty-hunter/tree/main/.claude/skills/pattern-to-rule
Command: npx skills add https://github.com/chrismcmacken/bounty-hunter --skill pattern-to-rule-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pattern-to-Rule converts concrete CVE-driven behavioral patterns into generalized Semgrep rules that detect the same security pitfalls across any codebase, without tying to a specific library version.

Core Features & Use Cases

  • Abstracts CVE patterns into library-agnostic rule templates suitable for multiple languages.
  • Generates taint-mode aware rule skeletons, sources, sinks, and sanitizers to enable robust detection.
  • Provides test scaffolds and metadata references to accelerate patching and verification across large repos.

Quick Start

Use this Skill to seed a Semgrep rule from a CVE pattern, then run a scan against repos/ or your project to validate coverage.

Frequently Asked Questions about Pattern-to-Rule Skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Semgrep rules from CVE patterns?

To create Semgrep rules from CVE patterns, you translate concrete behavioral vulnerabilities into generalized, library-agnostic rule templates. This process involves pattern abstraction, rule templating, and test scaffolding to ensure broad detection.

How does taint-mode analysis work for static security scanning?

Taint-mode analysis for static security scanning tracks untrusted data from sources through sanitizers to sinks. Generating taint-mode aware rule skeletons ensures Semgrep accurately detects vulnerabilities across multiple languages and frameworks.

Can I generate library-agnostic security rules for multiple languages?

Yes, you can generate library-agnostic security rules by abstracting CVE behavioral patterns. This approach removes ties to specific library versions, allowing generalized Semgrep rules to detect similar security pitfalls across any codebase.

What is the best way to automate CVE rule generation for large repositories?

The best way to automate CVE rule generation for large repositories is seeding a Semgrep rule from a CVE pattern and generating test scaffolds. This accelerates patching, metadata referencing, and verification across extensive codebases.

Do I need to provide CVE details to extract static analysis patterns?

Yes, you must provide CVE details to extract static analysis patterns. The rule generation process requires CVE detail intake to accurately abstract behavioral patterns and produce production-ready rule templates.

Are generated Semgrep rules tied to specific library versions?

No, generated Semgrep rules are not tied to specific library versions. Pattern abstraction specifically converts concrete CVE-driven vulnerabilities into generalized, library-agnostic rules for broader codebase coverage.