Install the "write-cve-rule" agent skill from https://github.com/evdenis/cvehound/tree/main/.agents/skills/write-cve-rule into .claude/skills/write-cve-rule/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-cve-rule", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add evdenis/cvehound --skill write-cve-rule -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "write-cve-rule" agent skill from https://github.com/evdenis/cvehound/tree/main/.agents/skills/write-cve-rule into .agents/skills/write-cve-rule/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-cve-rule", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add evdenis/cvehound --skill write-cve-rule -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "write-cve-rule" agent skill from https://github.com/evdenis/cvehound/tree/main/.agents/skills/write-cve-rule into .cursor/skills/write-cve-rule/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-cve-rule", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add evdenis/cvehound --skill write-cve-rule -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "write-cve-rule" agent skill from https://github.com/evdenis/cvehound/tree/main/.agents/skills/write-cve-rule into .gemini/skills/write-cve-rule/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-cve-rule", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add evdenis/cvehound --skill write-cve-rule -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "write-cve-rule" agent skill from https://github.com/evdenis/cvehound/tree/main/.agents/skills/write-cve-rule into .github/skills/write-cve-rule/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-cve-rule", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add evdenis/cvehound --skill write-cve-rule -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "write-cve-rule" agent skill from https://github.com/evdenis/cvehound/tree/main/.agents/skills/write-cve-rule into .opencode/skills/write-cve-rule/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-cve-rule", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
write-cve-rule
GitHub stars
138
Token cost
~2.5k tokens
SKILL.md length
1,295 words
Files
3 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
GPL-3.0
At a glance
Write, debug, or validate a CVEhound detection rule (.cocci or .grep) for a Linux kernel CVE.
Works in 6 steps: Gather the inputs → Decide what to match → Write it → …
Adding a rule under cvehound/cve/
SKILL.md covers 1. Gather the inputs, 2. Decide what to match, 3. Write it and 4. Validate, plus 3 more sections
Runs Shell scripts from its folder; calls git and uv
What it does
Write Cve Rule is an agent skill from evdenis/cvehound. Write, debug, or validate a CVEhound detection rule (.cocci or .grep) for a Linux kernel CVE. Use when adding a rule under cvehound/cve/, when a rule's slow tests fail, or when asked why a rule does or doesn't fire on a kernel tree. Not for general Coccinelle work outside this repository.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `scripts/compare-rule.sh` and `scripts/validate-rule.sh`).
It sits in Security, covering Vulnerability scanning. It works with Linux. The repository describes itself as: Check linux sources dump for known CVEs. The licence is GPL-3.0.
When your agent uses it
Adding a rule under cvehound/cve/
A rules slow tests fail
Asked why a rule does
Doesnt fire on a kernel tree
Example prompts
“s slow tests fail, or when asked why a rule does or doesn”
“/write-cve-rule”
Requirements
A Bash shell
Workflow steps
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit ad72a1c. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
Ships 2 files in scripts/ (Shell), which the agent can run.
Shell commands in SKILL.md call:
git
uv
From the folder's file list and the shell code blocks in SKILL.md.
Network
No URLs in SKILL.md. Its commands use git and uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Write Cve Rule loads about 2.5k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 1,295 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~76
When it runs· the whole SKILL.md, loaded when a task matches
~2.5k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
Download SKILL.mdSave it as .claude/skills/write-cve-rule/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
write-cve-rule
description
Write, debug, or validate a CVEhound detection rule (.cocci or .grep) for a Linux kernel CVE. Use when adding a rule under cvehound/cve/, when a rule's slow tests fail, or when asked why a rule does or doesn't fire on a kernel tree. Not for general Coccinelle work outside this repository.
Writing a CVEhound detection rule
A rule is one file in cvehound/cve/CVE-YYYY-NNNNN.cocci (or .grep). That is the
entire change. Do not add, edit, or parametrize tests — tests/conftest.py discovers
every rule and generates the whole suite from the file's metadata headers.
Syntax questions go to docs/COCCINELLE_CHEATSHEET.md. Everything below is workflow and
the things about this repository that will otherwise trip you up.
1. Gather the inputs
You cannot start without these:
CVE ID
the mainline fix commit hash
the commit that introduced the bug, if it is known
the affected file paths, relative to the kernel root
bash
git -C tests/linux show <fix_commit> # the diff is the specification
git -C tests/linux log -1 --format=%H <fix_commit>
Look for a Fixes: trailer in the fix commit message — that is usually the introducing
commit. If there is none and you can only guess, you will use Detect-To: instead.
2. Decide what to match
Read the diff and take the first branch that applies:
The fix…
Approach
Match
adds code (a check, an init)
Missing Fix Detection
the absence of it, via ... when != <the new code>
changes a value or flag
Unfixed Code Detection
the old value
removes code
Unfixed Code Detection
the presence of the removed code
refactors logic
Unfixed Code Detection / hybrid
the distinctive vulnerable shape
Match the invariant, not the era. The rule runs on every commit in Fixes..Fix and
on old stable branches — the code's exact shape drifts across that range, and a pattern
that transcribes today's spelling (the precise condition, per-era disjunction branches)
silently misses the eras nobody transcribed. Prefer a stable anchor that existed the
whole time (the call or computation that is the bug — that line gets the star) plus a
@fixed@ helper matching what the fix added, with the error rule depends on !fixed.
cvehound/cve/CVE-2017-1000112.cocci is the worked example;
docs/WRITING_RULES.md → "Rule 7: Match the invariant, not the era" has the full
treatment and the loosening toolbox.
Then read three existing rules of the same shape before writing yours — they are the real
house style, and they encode workarounds no prose captures:
bash
cd cvehound/cve
grep -l "memset" *.cocci # initialization bugs
grep -l "copy_to_user" *.cocci # information leaks
grep -l "when != if" *.cocci # missing checks
grep -l 'depends on' *.cocci # inter-rule dependencies
grep -l 'depends on .*&&' *.cocci # conjunctions: several conditions must hold
3. Write it
Start from contrib/blank.cocci. The skeleton:
cocci
/// Files: <paths from kernel root, space-separated, one line>
/// Fix: <full hash of the fixing commit>
/// Fixes: <full hash of the introducing commit> // or Detect-To: <hash>
@err@
@@
vulnerable_function(...)
{
...
* <the line that identifies the vulnerability>
...
}
A rule is match rules only. The report is the *: on a match spatch prints a unified diff
of the starred lines, and CVEhound reads that. No output means no detection. There is no
script rule and no position/@pfor reporting — the rules must run under a spatch
built without Python. (A position used as a match constraint is still fair game; see
cvehound/cve/CVE-2020-27777.cocci.)
Non-negotiables:
Anchor the pattern in a named function. A bare return -1; or kfree(x); with no
enclosing context is the single largest source of false positives here.
Never declare a virtual rule. CVEhound passes no -D, so a rule gated on one is
dropped before translation and reports nothing, silently. To turn a rule off, comment it
out and say why.
* is not decoration. It switches the patch into match mode, which flips the default
quantification of un-annotated ... from forall to exists. Adding or removing it
changes what matches. Every rule stars a line, so that flip is always in force: never
write exists in a rule header — it is a no-op. To make one ellipsis hold on all
paths (a when != guard otherwise only constrains a single witness path), annotate that
ellipsis with when forall.
Star the deciding rule only, and only its identifying line. A starred rule prints
whenever it matches, whatever the other rules did — so a * on a helper (classically
a @fix@ rule that recognises the fix) reports on fixed trees, and starring several
lines across ... reports a partial match.
Star a line spatch can delete — in every version of the range. A star on a lone }
is silently dropped (the branch matches and reports nothing); a star on a token an
older version builds via a macro aborts spatch with "try to delete an expanded token".
Independent sites are separate starred rules (OR); a conjunction needs depends on.
Chain the rules so the last one depends on all the others —
@err_c depends on err_a && err_b@ — and star only that last rule. See
cvehound/cve/CVE-2021-3347.cocci and cvehound/cve/CVE-2021-3609.cocci for the AND,
cvehound/cve/CVE-2016-5195.cocci for the OR.
Filter by function with the pattern, not after the fact. "Only in foo()" is written
by anchoring inside the definition — foo(...) { ... when any <pattern> ... when any },
with \(foo1\|foo2\) for several. Never wrap a statement body in <+... ...+>: same
meaning, orders of magnitude slower. See cvehound/cve/CVE-2021-28971.cocci,
cvehound/cve/CVE-2017-1000112.cocci.
The rule's literal tokens decide how much of the tree spatch parses. A name left
literal where a metavariable would do, or more than five rules that star something in
one file, and spatch stops skipping files it cannot match. validate-rule.sh measures
it; docs/WRITING_RULES.md → "Rule 8: Keep the grep query selective" explains it.
docs/WRITING_RULES.md → "Rule 2: Star discipline" has the full treatment of the star
rules — the corpus exceptions, the failure symptoms, and the measured costs.
When the rule is a judgement call, prefer a false positive — a missed CVE is worse
than a noisy one.
It checks the filename, the metadata block, that the rule parses, that no star sits on a
lone brace, that the Files: paths resolve at both ends of the range -- the fix commit
and Fixes:/Detect-To: -- and that the rule fires at Fix~and at the old end of
the range, and is silent at Fix. A spatch failure at any of those (the
expanded-token abort, typically) is reported as its own verdict; .grep rules get the same
three detection verdicts through grep. It does this by extracting just the Files: paths at
each commit, so it does not touch or check out the kernel working tree.
Then the real thing, which is the authority:
bash
uv run pytest --runslow --cve=CVE-YYYY-NNNNN
5. Repository gotchas
A Files: path that resolves nowhere is silent. If none of the paths exist,
check_cve skips the rule unless the caller explicitly requests all_files=True, which
turns a bad path into a false negative. A rename does this as surely as a typo: the tests
run the rule across the whole Fixes..Fix range and on old stable branches, so list every
name the file has had there (drivers/tty/n_hdlc.c drivers/char/n_hdlc.c). The validator
checks both ends and prints the historical name when the older end has none.
The hashes are test inputs.test_03_on_fix checks out Fix: and Fix~;
test_04_on_fixes does the same around Fixes:/Detect-To:; test_05_between_fixes_fix
checks every commit in between. A wrong hash is a failing test, not a cosmetic error.
Fixes: and Detect-To: populate the same field — set exactly one.
Register legitimate failures as data, never as xfail. If a fix was never backported
to a stable branch, add the (cve, branch) pair to missing_backports in
tests/conftest.py — and delete it once the backport lands: the xfail is strict, so a
backported pair fails the suite. If the upstream Fixes: tag is wrong, add
(cve, reason) to ownfixes in tests/test_00_metadata.py.
Disputed CVEs go in cvehound/cve/disputed/. Directory placement is the only thing
that drives the all / assigned / disputed groups; the default --cve assigned
skips that directory.
Headers are never resolved. CVEhound runs spatch with --no-includes, so match what
is written in the .c file, not what a macro expands to after preprocessing.
A content overlay never shadows your work here — in a dev checkout cvehound uses
the repo's own cvehound/cve/ unless CVEHOUND_CONTENT is set, and the test suite pins
CVEHOUND_CONTENT=none. cvehound update writes only to ~/.local/share/cvehound/.
6. .grep rules
Use these only when Coccinelle cannot express the pattern (assembly, tracepoint macros).
Format: the same /// metadata block, then one regex per line. All patterns must
match for the CVE to be reported; the file is consumed by grep -rPzle, so the regexes
are PCRE with \s, \w, and cross-line matching available. See
cvehound/cve/CVE-2017-1000255.grep.
Reference
docs/WRITING_RULES.md — the complete guide: metadata semantics, worked examples from
five real CVEs, advanced techniques, troubleshooting
docs/COCCINELLE_CHEATSHEET.md — syntax and the vulnerability-pattern catalog
Write Cve Rule next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
Configure and execute agentless vulnerability scanning using network protocols, cloud snapshot analysis, and API-based discovery to assess systems without installing endpoint agents.
Configure and execute authenticated (credentialed) vulnerability scans using OpenVAS/Greenbone Vulnerability Management (GVM) with SSH, SMB, or ESXi credentials to detect local vulnerabilities…
Write, debug, or validate a CVEhound detection rule (.cocci or .grep) for a Linux kernel CVE. Write Cve Rule is an agent skill from evdenis/cvehound.grep) for a Linux kernel CVE.
When should I use Write Cve Rule?
Write Cve Rule fits situations like: adding a rule under cvehound/cve/; A rules slow tests fail; asked why a rule does; doesnt fire on a kernel tree.
How do I install Write Cve Rule in Claude Code?
Run `npx skills add evdenis/cvehound --skill write-cve-rule -a claude-code`. Or copy the skill folder (.agents/skills/write-cve-rule in evdenis/cvehound) into .claude/skills/write-cve-rule in your project. Claude Code loads it when a task matches its description.
How do I install Write Cve Rule in Codex?
Run `npx skills add evdenis/cvehound --skill write-cve-rule -a codex`. Or copy the skill folder (.agents/skills/write-cve-rule in evdenis/cvehound) into .agents/skills/write-cve-rule in your project. Codex loads it when a task matches its description.
Can I use Write Cve Rule in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add evdenis/cvehound --skill write-cve-rule -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-cve-rule, .gemini/skills/write-cve-rule, .github/skills/write-cve-rule and .opencode/skills/write-cve-rule in your project.
What does Write Cve Rule need to run?
Going by SKILL.md and its folder, Write Cve Rule needs a shell for the scripts in its folder and the command-line tools its instructions call (git and uv). Our summary lists: A Bash shell.
Does Write Cve Rule access the network?
SKILL.md contains no URLs. Its commands use git and uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Is Write Cve Rule safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
What licence does Write Cve Rule use?
Write Cve Rule is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Write Cve Rule use?
About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
What are the alternatives to Write Cve Rule?
Skills that share tags, products or a category with Write Cve Rule: Performing Agentless Vulnerability Scanning (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Performing Authenticated Scan With Openvas (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Host Cve Validator (infometa/workbuddyskills, 344 stars) and Kernel Security (mohitmishra786/low-level-dev-skills, 253 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Write Cve Rule?
evdenis (a GitHub user) maintains it in evdenis/cvehound, which has 138 GitHub stars. The repository was last updated on October 2, 2026.
Source: evdenis/cvehound on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.