Author, edit, and review GuardDog YARA source-code detection rules (.yar) that follow the capability/threat/risk model. Use when adding a new detection rule, changing an existing rule's patterns or metadata, splitting capabilities from threats, debugging false positives, or writing rule test cases under guarddog/analyzer/sourcecode/.
npx skills add https://github.com/DataDog/guarddog --skill writing-guarddog-rules
GuardDog detects supply-chain malware with a two-layer model. The full reference,
including the philosophy, metadata schema, and worked examples, lives in
WRITING_RULES.md at the repository root (the skill directory is
.claude/skills/writing-guarddog-rules/, so the doc is three levels up). This
skill is the procedural layer: it captures the mental model and the workflow,
and it points to the reference for detail. Read WRITING_RULES.md when you need
the schema specifics, field definitions, or longer examples; do not duplicate it.
(requests.get(, .readFileSync(, subprocess.Popen(). Match calls, not imports.
/etc/passwd, discord.com/api/webhooks,base64.decode + exec together). Not a bare function call.
alone is benign; a threat indicator alone is often a false positive; together they are a risk.
identifies format: {type}.{category}[.{detail}] where type is capability or threat,category is one of network, filesystem, process, runtime, system, metadata.
capability.process.* only pairs withthreat.process.*. General detail matches specific (threat.network + capability.network.outbound),
but conflicting details do not (...outbound + ...inbound).
threat.runtime.* and threat.metadata.* auto-form risks without needing a capability(obfuscation, install hooks, typosquatting, maintainer compromise).
When unsure whether a pattern is a capability or threat: does it show what code *can do* (capability)
or a *suspicious indicator* (threat)? Does it stand alone without a capability (runtime/metadata threat)?
capability vs threat, then category and optional detail.Confirm the matching counterpart exists or will exist so a risk can form.
.yar). Source-code rules are YARA-only and language-agnostic(loaded for every ecosystem). Follow the best practices in WRITING_RULES.md (word boundaries \b,
match method calls not object names, require quote context for bare strings, establish context
with private rules before matching threats). Extract shared building blocks (LOLBAS, hooks) into
.meta files instead of repeating them.
identifies, severity, description. Threat rules also need asingle mitre_tactics. Optional specificity/sophistication default to medium. Also
available: max_hits, path_include. See the schema section of WRITING_RULES.md.
guarddog/analyzer/sourcecode/ as {type}-{category}-{detail}.yar..meta files (shared private rules) are {pattern-name}.meta.
WRITING_RULES.md before finishing.The harness is tests/analyzer/sourcecode/test_sourcecode_yara.py. Key points:
File capability-filesystem-read.yar must contain rule capability_filesystem_read. The
no-false-positive test filters matches to this exact name, so a mismatch silently skips coverage.
tests/analyzer/sourcecode/<rule-id>.<ext> containing code the ruleshould flag (e.g. <rule-id>.py, .js, .go, .rb). The harness asserts the rule matches it.
These are matched by filename prefix.
tests/analyzer/sourcecode/benign/<rule-id>.<ext> withlegitimate code that must NOT trigger the main rule. Every new or changed rule should have one.
.yar files must compile, including include "...meta" references resolving.Run the suite:
make test-yara-rules
# or directly:
uv run pytest tests/analyzer/sourcecode -k <rule-id>
Scan a real package or local path to sanity-check end to end (use uv run):
uv run guarddog pypi scan <package-name> --rules <rule-id>
uv run guarddog pypi scan /path/to/package --output-format json
subprocess.call(). The threat is the LOLBAS tool *inside* the hook. Pair
capability.process.hooks with threat.process.hooks (hook context + curl/wget). See the
Advanced Patterns section of WRITING_RULES.md.
lolbas-proc.meta (bash, python, node) vs lolbas-net.meta(curl, wget, nc). YARA cannot reliably use multiple private rules from one include, so keep
them separate and compose includes per rule.
with private rules rather than matching a bare keyword anywhere.
make docs.Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementing any feature or bugfix, before writing implementation code
Use when you have a spec or requirements for a multi-step task, before touching code
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Use when writing or improving README files. Not all READMEs are the same — provides templates and guidance matched to your audience and project type.
| Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Official Opentrons Protocol API for OT-2 and Flex robots. Use when writing protocols specifically for Opentrons hardware with full access to Protocol API v2 features. Best for production Opentrons protocols, official API compatibility. For multi-vendor automation or broader equipment control use pylabrobot.
Take datadog/writing-guarddog-rules from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.