YARA Rule Skill
An agent skill that writes, reviews and speeds up YARA rules per YARA-Forge and yaraQA, compiling each rule before returning it.
- 60 ★ on the repository
- Last commit
Extended access
Why this level
- The skill runs validation scripts and requires Python package installation.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/yara-rule-skillDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The skill runs validation scripts and requires Python package installation.
This is third-party code. Review the repository files before installing.
What it does
YARA Rule Skill puts YARA-Forge and yaraQA practices into an agent context. The skill writes rules from samples or strings you provide, reviews existing rules and returns a findings table with ids, severity and a fix, and it diagnoses slow rules and "too many matches" errors. It compiles every rule it outputs with YARA-X and YARA 4.x, so the result always builds. Strings are grouped by purpose: `$x*` for specific indicators, `$s*` for weak ones, `$a*` for file type selection and `$fp*` for false positive filters. For YARA-Forge release it prepares a rule with no compile warnings, an explicit score and clean metadata.
Who it is for. Malware analysts and threat hunters who write YARA detection rules and want a consistent style and fast rules.
Good fit when
- You need to build a rule with a clear name and metadata from a sample and a set of strings.
- A rule found online must be assessed for logic, speed and false positive risk.
- A rule is slow because of short atoms or an unanchored regular expression.
- Before submitting to YARA-Forge you must clear compile warnings and set a score.
Not a fit when
- You need a ready signature set: the skill teaches rule writing and contains no database.
- Validator dependencies are not installed: compile checks will not run without them.
- You need Sigma or other detection formats: the skill covers YARA only.
Example request
Review this YARA rule, show the yaraQA findings and return a fixed version that compiles.Limitations
The skill only helps write and check rules, so detection quality depends on your samples and domain knowledge. Compile checks need the packages from `scripts/requirements.txt`, installed with `pip install -r`. This is the Community Edition: checks rest on the YARA Style Guide, Performance Guidelines, yaraQA and YARA-Forge as they stood when the skill was published. The skill fires when you talk about YARA rules, and other agents need `SKILL.md` support.
How to disable. Delete the `yara-rule-skill` folder from `~/.claude/skills/` or `.claude/skills/`. The cloned repository and packages installed for the validator can be removed separately.
FAQ
How do I install the skill in Claude Code?
Clone the repository and copy the `yara-rule-skill` folder into `~/.claude/skills/` for personal use or `.claude/skills/` for a project. Then install the validator dependencies.
What do the string prefixes `$x*`, `$s*`, `$a*` and `$fp*` mean?
`$x*` are specific indicators where one hit is enough. `$s*` are weak alone, `$a*` preselect the file type and `$fp*` filter out false positives.
How are rules validated?
Every rule returned is compiled with YARA-X and YARA 4.x. Findings come with ids from yaraQA and the style and performance guides.
Can the skill be used outside Claude Code?
Yes, in any agent that supports `SKILL.md`. The README names OpenClaw and the `~/.openclaw/skills/` folder, and packaging into a `.skill` file uses `installer/package_skill.py`.
What about a rule that gives too many matches?
Ask for a performance diagnosis. The skill walks the checklist: regex quantifiers, short or uniform atoms, alternations, loops and modules.
Discussion
No questions or reviews yet.
Related
SkillsA security scanner for agent skills: finds prompt injection, data exfiltration and malicious code before you install
A security scanner for AI agent skills: static analysis, LLM review and runs of suspicious skills in a Docker sandbox.
Three Semgrep skills for Claude Code and Cursor: secure coding by OWASP, LLM application security, and running Semgrep with custom rules
The SkillHawk static scanner finds dangerous instructions in SKILL.md, MCP configs and AGENTS.md and runs as a GitHub Action
Cybersecurity Skills
Cybersecurity Skills for AI Agents
42 security skills for Claude Code, Cursor and Codex: code and cloud audits, authorization-gated pentesting and incident response
An open library of 65 governance, risk and compliance skills: the agent drafts and gathers, while people make the calls.
README in short
The skill is built from four sources: the YARA style guide, the performance guide, yaraQA with 25 automatic checks and YARA-Forge publication rules. It writes, assesses and optimizes rules.
README badge
Original SKILL.md
--- name: yara-rule-skill description: Writes, reviews, and optimizes YARA rules using the YARA Style Guide, the YARA Performance Guidelines, yaraQA checks, and YARA-Forge quality criteria. Use when the user wants a new YARA rule, a review or quality assessment of an existing rule or rule set, help with a slow, noisy, or non-compiling rule, an explanation of a yaraQA issue ID, or rules that should pass YARA-Forge QA. --- # YARA Rule Authoring and Review Version 2.0. This skill turns four sources into working practice: | Source | Governs | Details | |--------|---------|---------| | [YARA Style Guide](https://github.com/Neo23x0/YARA-Style-Guide) | Rule names, metadata, string groups, condition layout | [references/style.md](references/style.md) | | [YARA Performance Guidelines](https://github.com/Neo23x0/YARA-Performance-Guidelines) (rev. 1.6) | Atoms, regex, condition order, modules | [references/performance.md](references/performance.md) | | [yaraQA](https://github.com/Neo23x0/yaraQA) | Automated checks with IDs (`PA2`, `SM4`, `CE1`, ...) | [references/yaraqa-checks.md](references/yaraqa-checks.md) | | [YARA-Forge](https://github.com/YARAHQ/yara-forge) | Compile gates, quality score, package tiers | [references/yara-forge.md](references/yara-forge.md) | Guideline items that no tool checks have their own IDs in [references/issue-identifiers.md](references/issue-identifiers.md). ## How YARA spends its time Most guidance below follows from the scan model: 1. **Compile:** YARA extracts **atoms** (substrings of up to 4 bytes) from every string. 2. **Search:** one Aho-Corasick pass looks for all atoms of all rules. 3. **Verify:** each atom hit is expanded to a full string match. Regex runs only here. 4. **Condition:** evaluated left to right, stopping at the first decisive result. What follows from it: - String choice is the main cost. A condition cannot stop a string from being searched: `filesize < 200 and $slow_regex` is still slow on every file. - A string without a good atom (shorter than 4 bytes, uniform like `00 00 00 00`, or a regex with no fixed 4-byte run) slows the **whole rule set**, not just its own rule. - Short-circuit evaluation helps only with condition work. Put cheap checks (`uint16(0)`, `filesize`) before expensive ones (`math.*`, hashes, loops, module fields). ## Workflow: write a new rule Copy this checklist into your working notes and complete it in order: ``` - [ ] 1. Scope: target samples, file type, disk or memory, specific family or generic trait - [ ] 2. Category and rule name - [ ] 3. Strings: 3-7 diverse strings grouped as $x / $s / $a / $fp - [ ] 4. Condition: header -> filesize -> other limits -> strings -> FP filters -> expensive checks - [ ] 5. Metadata: description, author, reference, date, hash, score - [ ] 6. Validate with scripts/validate_rule.py; fix and repeat until clean - [ ] 7. Self-review against "Quick checks" below