← Explore all skills

SECURITY / trailofbits

Semgrep Rule Variants

Port one verified rule to target languages with applicability review and language-specific positive and negative fixtures.

“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”

01 / THE REASONING

Why this made the selection.

  • This skill ports one finished Semgrep rule to named languages. A new rule from a bug description is sent to semgrep-rule-creator instead.
  • A green semgrep --test only shows that the new rule and the new tests match each other, because the same run wrote both.
  • The procedure separates applicability from implementation, uses an independent refutation step, and requires per-language tests before accepting variants.
  • Translate a known rule across a specified language list

02 / THE REVIEW RECORD

What we actually inspected.

Source review has boundaries.
A clear record is more useful than a “safe” badge.

Material inspected

  • plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md
  • plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/workflow.md
  • LICENSE
  • README.md

Our findings

  • Declared tools include WebFetch, Write, and Workflow. referencesDir has to be a real absolute path because the workflow script does not expand plugin-root variables.
  • If that path cannot be found, the skill says to stop. A hand-built missing path can report every language as passed without reading the guidance.
  • It does not invent a rule from a prose bug, and a same-session resume is not available after the session ends.
  • The procedure separates applicability from implementation, uses an independent refutation step, and requires per-language tests before accepting variants.

Not established by this review

  • The resource was not executed and its tools were not called.
  • The port workflow and semgrep --test were not run.
  • No skill execution, authenticated service operation, or outcome benchmark was performed.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

Add a skill to your workflow.

Upstream setup instructions ↗
  1. Check out trailofbits/skills at 8e54050ae63c2f62224c35b1616efe71865b4777 and install the complete semgrep-rule-variant-creator plugin through the publisher-supported host workflow, retaining sibling agents, workflows, scripts and references.
  2. Supply the original rule path, target languages, absolute reference directory and a fresh output directory.
  3. Validate and test with the same Semgrep version; inspect skipped tests and include vulnerable, safe and edge cases.

Before you start

  • A local checkout and the tools required by the selected workflow

04 / FOLLOW THE EVIDENCE

The source trail.

Our notes are separate from the original resource.
Check upstream before adopting a new version.

  1. Pinned skill definition ↗Checked

    https://github.com/trailofbits/skills/blob/8e54050ae63c2f62224c35b1616efe71865b4777/plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md

    Supports: summary, whySelected, bestFor, limitations, install, access, review

  2. https://github.com/trailofbits/skills/blob/8e54050ae63c2f62224c35b1616efe71865b4777/README.md

    Supports: install

  3. CC-BY-SA-4.0 licence ↗Checked

    https://github.com/trailofbits/skills/blob/8e54050ae63c2f62224c35b1616efe71865b4777/LICENSE

    Supports: license

Evidence & Ask