A behavior-driven skill for authoring high-quality YARA-X detection rules, teaching you to think and act like an expert YARA author.
YARA-X Focus: This skill targets YARA-X, the Rust-based successor to legacy YARA. YARA-X powers VirusTotal's Livehunt/Retrohunt production systems and is 5-10x faster for regex-heavy rules. Legacy YARA (C implementation) is in maintenance mode.
This skill doesn't dump YARA syntax at you. Instead, it teaches:
- Decision trees for common judgment calls (Is this string good enough? When to abandon an approach?)
- Expert heuristics (mutex names are gold, API names are garbage)
- Rationalizations to reject (the shortcuts that cause production failures)
An expert uses 5 tools: yarGen, FLOSS, yr CLI, signature-base, YARA-CI. Everything else is noise.
# macOS
brew install yara-x
# Or from source
cargo install yara-x
# Verify installation
yr --versionpip install yara-x
# or with uv
uv pip install yara-xAdd this plugin to your Claude Code configuration:
claude mcp add-plugin /path/to/yara-authoringGuides authoring of YARA-X rules for malware detection with expert judgment.
Covers:
- Decision trees for string quality, when to abandon approaches, debugging FPs
- Expert heuristics from experienced YARA authors
- Rationalizations to reject (common shortcuts that fail)
- Naming conventions (CATEGORY_PLATFORM_FAMILY_DATE format)
- Performance optimization (atom quality, short-circuit conditions)
- Testing workflow (goodware corpus validation)
- YARA-X migration guide for converting legacy rules
- Chrome extension analysis with
crxmodule - Android DEX analysis with
dexmodule
Triggers: YARA, YARA-X, malware detection, threat hunting, IOC, signature
The skill includes two Python scripts that require uv to run:
Validates YARA-X rules for style, metadata, compatibility issues, and anti-patterns:
uv run yara_lint.py rule.yar
uv run yara_lint.py --json rules/
uv run yara_lint.py --strict rule.yarEvaluates string quality for efficient atom extraction:
uv run atom_analyzer.py rule.yar
uv run atom_analyzer.py --verbose rule.yar| Document | Purpose |
|---|---|
| style-guide.md | Naming conventions, metadata requirements |
| performance.md | Atom theory, optimization techniques |
| strings.md | String selection judgment, good/bad patterns |
| testing.md | Validation workflow, FP investigation |
- YARA-X Documentation (official)
- YARA-X GitHub
- Neo23x0 YARA Style Guide
- Neo23x0 Performance Guidelines
- signature-base Rule Collection
- YARA-CI
The scripts use PEP 723 inline metadata, so dependencies are resolved automatically by uv run.
If you have existing rules written for legacy YARA:
- Run validation:
yr check --relaxed-re-syntax rules/ - Fix issues identified (see SKILL.md migration section)
- Validate without relaxed mode:
yr check rules/
Note: Use
--relaxed-re-syntaxonly as a temporary diagnostic tool. Fix all identified issues rather than relying on relaxed mode permanently.
Common migration issues:
- Unescaped
{in regex patterns - Invalid escape sequences (
\R→\\R) - Base64 patterns on strings < 3 characters
- Negative array indexing