Skill-Doctor
AGENTS.md12 starsChanged 2 months agoApache-2.0View on GitHub
This file governs any AI coding agent (Claude Code, Cursor, Codex CLI, Gemini CLI, etc.) operating in this repo. Read CONTEXT.md before writing code. Read DEPENDENCIES.md before adding a crate. Skill Doctor is a Rust security scanner for AI agent skill files. The product is a single statically linked binary whose deterministic L1 layer is the shippable core. Everything else is elective and must degrade to reduced coverage, never to an error. Each folder under skills/ is an Agent Skill…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- paper-writingSkill
- research-surveySkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 1 is common, 3 are distinctive, and 2 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Rust only: No Python, no Node, no shell interpreter in the product runtime.
- Common: line 47
Secrets: Never store secret *values* — only environment key *names* — in findings, reports, or logs.
- Very specific: line 65
Before opening a PR, all of the following must pass: cargo fmt --check, cargo clippy -D warnings, cargo test --workspace, and the binary …
- Distinctive: line 85
Every new capability that can be absent must report reduced structural coverage, not fail.
- Distinctive: line 90
Every detector PR ships with: a rule, a positive fixture, a hard-negative fixture, and a test.
- Very specific: line 91
Update sd-bench/RESULTS.md only via the harness.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — working agreement for coding agents in this repository
This file governs any AI coding agent (Claude Code, Cursor, Codex CLI, Gemini CLI, etc.) operating
in this repo. Read CONTEXT.md before writing code. Read DEPENDENCIES.md before adding a crate.
What this project is
Skill Doctor is a Rust security scanner for AI agent skill files. The product is a single statically linked binary whose deterministic L1 layer is the shippable core. Everything else is elective and must degrade to reduced coverage, never to an error.
Skills — load before acting
Each folder under skills/ is an Agent Skill (SKILL.md). Load the matching one instead of improvising. If two apply, load both.
| Skill | Load when |
skills/project-context | start of a session, architecture, where code lives |
skills/rust-workspace | crates, Cargo.toml, deps |
skills/rust-invariants | defaults, scoring, LLM/MCP, features |
skills/rust-idioms | everyday Rust: errors, ownership, clippy |
skills/rust-perf | speed, RSS, binary size, rayon/mmap, §7.3 targets |
skills/rust-testing | tests, fixtures, determinism |
skills/ci-cd | GitHub Actions, required checks, TestMu, OS matrix |
skills/yara-rules | detectors, YARA-X, SDTM IDs |
skills/neutralize-sd11 | L2, MCP, envelopes |
skills/cli-sarif | clap, exit codes, SARIF |
skills/release-publish | crates.io, npm, tags |
skills/review-bots | CodeRabbit / Greptile / Intelligence AI |
skills/unsafe-sandbox | unsafe, L3 process harness |
Non-negotiable invariants (do not violate; PRs that break these are rejected)
- Rust only. No Python, no Node, no shell interpreter in the product runtime. (npm is only a binary installer; Node is never required to scan.)
- No mandatory LLM. L1 must run with zero network, zero key, zero account. Semantic analysis (L2) is host-delegated and optional.
- Additive-only invariant. A probabilistic/L2 verdict may add findings or raise confidence.
It may never remove, downgrade, or suppress a deterministic L1 finding. This is enforced in
skill-doctor-core::scoringand covered by a dedicated test; do not weaken it. - Determinism. In
--deterministicmode, output is byte-identical across runs: pin timestamps, directory walk order, and iteration order over unordered collections (sort before serialize). - Rules compiled at build time. YARA-X rules are compiled once in
skill-doctor-rules'build.rsand embedded in the binary. Never compile rules per invocation. - SD-11 safety. Any content sent to any model MUST pass through
skill-doctor-neutralizefirst. No code path may hand raw skill content to an LLM. - Secrets. Never store secret values — only environment key names — in findings, reports, or logs.
- CLI-first. Plain scrolling text is the default output. The TUI is behind the
tuifeature and is never the default. - Exactly the four contributions described in the whitepaper. Do not invent scope.
Build / test / lint commands
cargo build --release # build the binary
cargo test --workspace # all tests except access-gated real_malware
cargo clippy --workspace -- -D warnings # lint gate (must be clean)
cargo fmt --all --check # formatting gate
cargo run -p skill-doctor -- scan ./examples/hello-skill
cargo build --release --features sandbox # include L3 behavioral process harness
./sd-bench/run.sh --pinned # reproduce the benchmark against pinned competitorsBefore opening a PR, all of the following must pass: cargo fmt --check, cargo clippy -D
warnings, cargo test --workspace, and the binary must pass its own scan (skill-doctor
scan-all . --fail-on HIGH).
Where things live
- New detector? Add the engine in
skill-doctor-core/src/l1/, a YARA-X rule inrules/, and a fixture incorpora/. Register the SDTM-v1 class inskill-doctor-core/src/taxonomy.rs. - New threat class (SD-12+)? Update
taxonomy.rs,rules/, Appendix A mapping, and add fixtures. - MCP tool/schema change?
skill-doctor-mcp/src/— keep theskill_doctor_scantool schema stable. - Output format change?
skill-doctor-cli/src/report/(text, json, sarif). Rule IDs are stable and human-assigned; never renumber existing IDs (baselines and suppression lists depend on them).
Conventions
- Errors:
thiserrorin libraries,anyhowonly at the CLI boundary. - Concurrency:
rayonfor the file/engine fan-out;tokioonly insideskill-doctor-mcpand the optional network layer. - No
unsafeoutsideskill-doctor-sandbox; if unavoidable elsewhere, justify it in a// SAFETY:comment and gate it behind review. - Every new capability that can be absent must report reduced structural coverage, not fail.
Commit / PR expectations
- Conventional Commits (
feat:,fix:,perf:,docs:,test:,bench:). - Every detector PR ships with: a rule, a positive fixture, a hard-negative fixture, and a test.
- Update
sd-bench/RESULTS.mdonly via the harness; never hand-edit measured numbers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

