Skip to content
Skill

Detection as code

Guides writing tested, versioned Sigma, YARA, KQL or SPL detection rules

Detection as code is an open-source agent skill for security. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
227
Last commit
License
MIT
Listing updated

Similar skills

About Detection as code

This skill walks an agent through authoring a SIEM or EDR detection rule for a named attacker technique, covering Sigma, YARA, KQL and SPL. It starts by pinning the target technique, the detection platform and its schema version, and confirming that the needed telemetry is available. The rule is then written against real field names, with positive fixtures that must trigger it and negative fixtures that must not.

Before rollout, the workflow calls for syntax validation, a backtest or replay against representative history, and a note of the expected false positive and false negative surface along with rule cost and cardinality. It also asks the agent to record an owner, a version and a rollback plan. Deployment is treated as an operator-gated step, so the agent should not push a live change without approval.

The skill expects a detection engineer to supply the technique, the target platform and access to sample telemetry or history. It is scoped away from incident triage and from scanning source code for defects.

When your agent uses it

Use when a detection engineer must author a Sigma, YARA, KQL, or SPL SIEM/EDR rule for a named TTP—pin the telemetry schema, add must-fire and must-not-fire fixtures, and replay representative history before any gated rollout. Not for incident triage or source-code defect scanning.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (1 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/detection-as-code to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/detection-as-code &&
cp -R "$tmp/.agents/skills/detection-as-code" ~/.claude/skills/detection-as-code &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/detection-as-code inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/detection-as-code to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/detection-as-code &&
cp -R "$tmp/.agents/skills/detection-as-code" ~/.agents/skills/detection-as-code &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/detection-as-code inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/detection-as-code to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/detection-as-code &&
cp -R "$tmp/.agents/skills/detection-as-code" ~/.cursor/skills/detection-as-code &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/detection-as-code inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/detection-as-code

Or copy the folder to ~/.gemini/skills/detection-as-code yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/detection-as-code:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/detection-as-code &&
cp -R "$tmp/.agents/skills/detection-as-code" ~/.copilot/skills/detection-as-code &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/detection-as-code inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git

Then copy claude-vibe-squad/.agents/skills/detection-as-code into your agent's skills folder as detection-as-code. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Telemetry prerequisite check
Confirms the required log sources and schema version exist before a rule is written.
Fixture-based rule testing
Requires positive and negative fixtures so a rule is checked both for firing and for over-firing.
Syntax validation step
Includes validating rule syntax before the rule moves toward any deployment.
Historical replay and backtesting
Replays the rule against representative history and records its false positive and false negative surface.
Gated rollout guidance
Sets rollout mode, ownership, versioning and rollback, with deployment held for operator approval.

Good for

  • Write a Sigma rule for a specific attacker technique and test it against sample logs
  • Draft a KQL query for a Microsoft Sentinel detection and check it against known benign activity
  • Create a YARA rule for a malware family with matching and non-matching sample files
  • Convert a detection idea into a SPL search and record its expected false positive rate
  • Prepare a versioned detection rule with an owner and rollback plan before rollout

Detection as code FAQ

What platforms and rule languages does Detection as code cover?

It covers Sigma, YARA, KQL and SPL rules for SIEM and EDR platforms.

Will the skill deploy rules to production?

No. Deployment is operator-gated, and the skill requires approval before any live change.

What does Detection as code need before writing a rule?

The target technique, the detection platform and schema version, and confirmation that the required telemetry exists.

Is Detection as code meant for incident response or code scanning?

No. It is explicitly not for incident triage or for scanning source code for defects.

How do I install Detection as code in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/detection-as-code to use it in all your projects, or to .claude/skills/detection-as-code in one project.

Does Detection as code run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Detection as code?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Detection as code?

The closest alternatives to Detection as code are Secops detection engineering, Semgrep rule author, Detection engineering coverage evaluation, Semgrep rule creator and Yara rule authoring.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from mtarcure/claude-vibe-squad

  1. Writes alt text, timed captions and transcripts for images, footage and audio

    • Open source
    • 227 GitHub stars
    • Design and media
  2. Guides building product agent system prompts with eval-backed boundaries and output

    • Open source
    • 227 GitHub stars
    • AI models and LLM tooling
  3. Guides authorized adversarial testing of autonomous LLM agents for injection and approval

    • Open source
    • 227 GitHub stars
    • Security
  4. Writes a typed game-event to audio-cue map that hands adaptive audio designs to engines

    • Open source
    • 227 GitHub stars
    • Developer tools
  5. Generates missing README, CHANGELOG, LICENSE and agent-context files at project delivery

    • Open source
    • 227 GitHub stars
    • Developer tools
  6. Builds and proves multi-step exploit chains from weak bug-bounty findings

    • Open source
    • 227 GitHub stars
    • Security