मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग48k · #5714

semgrep-rule-variant-creator

यह क्या करती है

यह टूल code security rules (जिन्हें 'Semgrep rules' कहते हैं) को अलग-अलग programming languages के लिए ढालने में मदद करता है। अगर किसी एक language में एक rule काम करता है, तो यह दूसरी languages के लिए उसी rule का version बनाने में मदद कर सकता है।

कब इस्तेमाल करें

  • ✓किसी मौजूदा security rule को नई language के लिए ढालना।
  • ✓एक ही प्रोजेक्ट की कई languages के लिए एक ही security check के versions बनाना।
  • ✓अपने code की security coverage को उन languages तक बढ़ाना जिन्हें पहले कवर नहीं किया था।

Skill का लिंक

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/semgrep-rule-variant-creator/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/semgrep-rule-variant-creator/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“'sql-injection' rule को Go और Java के लिए ढालो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल जांचता है कि मूल rule नई language में समझ में आता है या नहीं, rule को test करने के लिए code के उदाहरण बनाता है, और फिर नया rule और उसके tests तैयार करता है। यह सुनिश्चित करता है कि हर नया rule अलग से test किया गया हो।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Semgrep Rule Variant Creator

Port existing Semgrep rules to new target languages with proper applicability analysis and test-driven validation.

When to Use

Ideal scenarios:

  • Porting an existing Semgrep rule to one or more target languages
  • Creating language-specific variants of a universal vulnerability pattern
  • Expanding rule coverage across a polyglot codebase
  • Translating rules between languages with equivalent constructs

When NOT to Use

Do NOT use this skill for:

  • Creating a new Semgrep rule from scratch (use semgrep-rule-creator instead)
  • Running existing rules against code
  • Languages where the vulnerability pattern fundamentally doesn't apply
  • Minor syntax variations within the same language

Input Specification

This skill requires:

  1. Existing Semgrep rule - YAML file path or YAML rule content
  2. Target languages - One or more languages to port to (e.g., "Golang and Java")

Output Specification

For each applicable target language, produces:

<original-rule-id>-<language>/
├── <original-rule-id>-<language>.yaml     # Ported Semgrep rule
└── <original-rule-id>-<language>.<ext>    # Test file with annotations

Example output for porting sql-injection to Go and Java:

sql-injection-golang/
├── sql-injection-golang.yaml
└── sql-injection-golang.go

sql-injection-java/
├── sql-injection-java.yaml
└── sql-injection-java.java

Rationalizations to Reject

When porting Semgrep rules, reject these common shortcuts:

Rationalization Why It Fails Correct Approach
"Pattern structure is identical" Different ASTs across languages Always dump AST for target language
"Same vulnerability, same detection" Data flow differs between languages Analyze target language idioms
"Rule doesn't need tests since original worked" Language edge cases differ Write NEW test cases for target
"Skip applicability - it obviously applies" Some patterns are language-specific Complete applicability analysis first
"I'll create all variants then test" Errors compound, hard to debug Complete full cycle per language
"Library equivalent is close enough" Surface similarity hides differences Verify API semantics match
"Just translate the syntax 1:1" Languages have different idioms Research target language patterns

Strictness Level

This workflow is strict - do not skip steps:

  • Applicability analysis is mandatory: Don't assume patterns translate
  • Each language is independent: Complete full cycle before moving to next
  • Test-first for each variant: Never write a rule without test cases
  • 100% test pass required: "Most tests pass" is not acceptable

Overview

This skill guides the creation of language-specific variants of existing Semgrep rules. Each target language goes through an independent 4-phase cycle:

FOR EACH target language:
  Phase 1: Applicability Analysis → Verdict
  Phase 2: Test Creation (Test-First)
  Phase 3: Rule Creation
  Phase 4: Validation
  (Complete full cycle before moving to next language)

Foundational Knowledge

The semgrep-rule-creator skill is the authoritative reference for Semgrep rule creation fundamentals. While this skill focuses on porting existing rules to new languages, the core principles of writing quality rules remain the same.

Consult semgrep-rule-creator for guidance on:

  • When to use taint mode vs pattern matching - Choosing the right approach for the vulnerability type
  • Test-first methodology - Why tests come before rules and how to write effective test cases
  • Anti-patterns to avoid - Common mistakes like overly broad or overly specific patterns
  • Iterating until tests pass - The validation loop and debugging techniques
  • Rule optimization - Removing redundant patterns after tests pass

When porting a rule, you're applying these same principles in a new language context. If uncertain about rule structure or approach, refer to semgrep-rule-creator first.

Four-Phase Workflow

Phase 1: Applicability Analysis

Before porting, determine if the pattern applies to the target language.

Analysis criteria:

  1. Does the vulnerability class exist in the target language?
  2. Does an equivalent construct exist (function, pattern, library)?
  3. Are the semantics similar enough for meaningful detection?

Verdict options:

  • APPLICABLE → Proceed with variant creation

…

अक्सर पूछे जाने वाले सवाल

'Semgrep rules' क्या हैं?

ये recipes की तरह हैं जो प्रोग्राम को code में खास patterns ढूंढना सिखाते हैं, आमतौर पर security समस्याओं या bugs को पहचानने के लिए।

मैं rule को सीधे दूसरी language में कॉपी क्यों नहीं कर सकता?

हर language की अपनी खासियतें और काम करने का तरीका होता है। जो rule एक language में बिल्कुल सही काम करता है, वह दूसरी language में काम न करे या गलत चीज़ें पकड़ने लगे, भले ही दोनों एक जैसी लगती हों।

क्या इसे इस्तेमाल करने के लिए मुझे programming आनी चाहिए?

आपको अनुभवी programmer होने की ज़रूरत नहीं है। टूल ढलाई की प्रक्रिया अपने आप करता है, लेकिन यह समझना कि मूल rule क्या करता है, सही languages चुनने में मदद करता है।

जानकारी

लेखक का मूल विवरण

Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.

repo: sickn33/agentic-awesome-skills

लोकप्रियता

GitHub स्टार
48k
रैंकिंग में स्थान
#5714
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

00-andruia-consultant

48k

आपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।

AI और एजेंटएजेंट

007

48k

आपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।

कोडिंगसिक्योरिटी

10-andruia-skill-smith

48k

आपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।

AI और एजेंटएजेंट

20-andruia-niche-intelligence

48k

आपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।

लेखन और डॉक्यूमेंटरिसर्च

मिलती-जुलती skills