AI Blocks

Putting the blocks together

This is taking longer than expected.

Try againBrowse the library
AI Blocks · All skills by job · Minds · Mini tools · How it works · From a source · Apps

AI Blocks › Keep your code secure

Code scan rule writer

Describe a bug pattern. Get a tested Semgrep rule that finds it across your code.

Code scan rule writer is a free AI skill for the job "Keep your code secure". Give the instructions to an AI assistant that supports the required files and tools, then review its output.

Free · No account · CC BY 4.0 licence · Made by sickn33 · Level: expert · Thinking: high

Made by sickn33. See the original on GitHub; we copied it as it is, with its licence.

What it does

Describe a bug pattern once and get a Semgrep rule that finds it everywhere in your code. The rule is tested, so it catches the bad cases and leaves safe code alone. It writes the rule, then a test file with cases that should match and cases that should not. It runs the Semgrep test command and fixes the rule until both sides pass. It uses taint mode when data must be followed from user input to a risky call, since plain pattern matching gets noisy there. It pushes back on shortcuts like "the pattern looks complete" or "one test is enough". You need Semgrep installed.

You give it

You get

Use it when

How to use it

  1. Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
  2. Ask for the job in your own words. Your AI opens the skill when it fits.
  3. It works best when your AI can run code and read your project files.

More for Keep your code secure

Every keep your code secure skill