rust-skills
AGENTS.md2 starsChanged 3 months agoBSD-3-ClauseView on GitHub
Context for coding agents that work in this repository. This repo holds agent skills about Rust; it contains no Rust crate and no build system. Do not add one. rust-skills is a public catalog of agent skills for Rust work, distributed through skills.sh and installed with the vercel-labs skills CLI. The content must stay free of private identifiers. Layout is flat. One directory per skill: There is no nesting below skills/<name>/, apart from references/. Do not add scripts, assets, or…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository44 other files it gives its agents.
- cargo-workflowsSkill
- ffi-error-progress-cancelSkill
- memory-modelSkill
- rust-android-buildSkill
- rust-async-internalsSkill
- rust-borrow-semanticsSkill
- rust-callback-boundsSkill
- rust-cliSkill
- rust-code-styleSkill
- rust-compiler-errorsSkill
- rust-copy-on-writeSkill
- rust-crate-architectureSkill
- rust-crate-releaseSkill
- rust-databaseSkill
- rust-debuggingSkill
- rust-disciplineSkill
- rust-embedded-no-stdSkill
- rust-event-loop-stateSkill
- rust-hot-pathSkill
- rust-ios-buildSkill
- rust-iterator-implSkill
- rust-jniSkill
- rust-lintsSkill
- rust-macrosSkill
- rust-native-linkingSkill
- rust-networkingSkill
- rust-observabilitySkill
- rust-panic-safetySkill
- rust-pattern-semanticsSkill
- rust-performanceSkill
- rust-pin-projectionSkill
- rust-sanitizers-miriSkill
- rust-securitySkill
- rust-send-syncSkill
- rust-serdeSkill
- rust-swift-ffiSkill
- rust-tddSkill
- rust-test-toolsSkill
- rust-type-erasureSkill
- rust-unsafeSkill
- rust-varianceSkill
- rust-wasmSkill
- uniffi-boundarySkill
- uniffi-packaging-versioningSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
22 rules. About 0 are common, 9 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
Add no other frontmatter key unless a task asks for it.
- Distinctive: line 57
Write in ASD-STE100 Simplified Technical English: short sentences, simple present tense, active voice, one instruction per sentence.
- Very specific: line 59
Use the imperative for instructions.
- Distinctive: line 64
Remove every project-specific path, crate name, package name, and internal tool name.
- Very specific: line 68
Keep SKILL.md under 500 lines (the validator enforces it) and near 5,000 tokens.
- Distinctive: line 73
Do not add a "When to use this skill" section.
- Distinctive: line 80
Use "never", "always", "must", and severity labels only for a correctness, safety, data-loss, or irreversible-release hazard, and give the …
- Distinctive: line 86
Prefer a triage table (symptom, cause, fix) over prose for failure handling.
- Very specific: line 90
Never write a function with an empty body under a non-unit return type.
- Distinctive: line 93
Never define one name twice in a single code block to show a before and an after.
- Very specific: line 110
Write skills/<name>/SKILL.md with the frontmatter above and a body that follows the authoring conventions.
- Very specific: line 114
Add one row to the catalog table in README.md, in the section that matches the subject.
- Very specific: line 118
Add at least one row to tests/routing-cases.md: a phrase a user is likely to type, and the new skill.
- Very specific: line 148
every frontmatter value survives a real YAML parser unchanged: no : , no #, no leading indicator character, because the skills CLI and the …
- Very specific: line 151
every Markdown link resolves from the file that holds it and stays inside the skill directory, every references/*.md code span exists, and …
- Very specific: line 153
every phrase in tests/routing-cases.md still appears in the description it routes to, and every skill has at least one routing case.
- Very specific: line 180
Run it after any frontmatter edit.
- Very specific: line 198
Use npx skills add ./ --list to inspect the catalog, and npx skills use ./ --skill <name> to read one skill.
- Very specific: line 206
Commit subject: skill(<name>): <what changed>, for example skill(rust-unsafe): add Tree Borrows review checklist.
- Distinctive: line 209
Do not mention Claude, Claude Code, or Anthropic in commit messages or pull request text.
- Very specific: line 210
Do not add Co-Authored-By trailers.
- Distinctive: line 211
Update the README.md catalog row in the same pull request that adds or renames a skill.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
Context for coding agents that work in this repository. This repo holds agent skills about Rust; it contains no Rust crate and no build system. Do not add one.
Project overview
rust-skills is a public catalog of agent skills for Rust work, distributed through skills.sh
and installed with the vercel-labs skills CLI. The content must stay free of private
identifiers.
Layout is flat. One directory per skill:
skills/<name>/SKILL.md the skill itself, always present
skills/<name>/references/*.md optional deep material, loaded on demand
README.md the catalog table and the routing graph
scripts/validate-skills.py catalog structure checks (tests: scripts/test_validate_skills.py)
tests/routing-cases.md phrase -> skill, checked against every description
checks/ compile-check harness for the rust examples; check.sh runs CI
research/ primary-source findings and catalog decisionsThere is no nesting below skills/<name>/, apart from references/. Do not add scripts,
assets, or index files unless a task asks for them.
The SKILL.md contract
Each SKILL.md starts with YAML frontmatter that follows the Agent Skills specification.
Three keys, and nothing else by default:
---
name: rust-unsafe
description: Use when adding or reviewing an unsafe block, a raw-pointer dereference, or a transmute ... Covers E0133, E0793, and unsafe attributes.
license: BSD-3-Clause
---Rules:
namemust equal the directory name. Use lowercase letters, digits, and hyphens.descriptionis one line, 1024 characters maximum. It is the only text an agent reads before it decides to open the skill, and some runtimes keep only its start when many skills are installed. Start withUse whenand the task, then put the strongest trigger terms in the first sentence. Say what the skill covers in one clause. Prefer categories of user intent over keyword lists; keep exact tokens a user pastes (error codes, lint, tool, crate, and API names). Aim for 300 to 600 characters. Do not write "you", a capability inventory, or a catch-all such as "any Rust change". Add a "not for X" boundary only where a sibling skill is a likely misroute.licenseisBSD-3-Clausefor every skill in this repo.- Add no other frontmatter key unless a task asks for it.
The body starts at an # Title heading directly after the frontmatter.
Authoring conventions
- Write in ASD-STE100 Simplified Technical English: short sentences, simple present tense, active voice, one instruction per sentence.
- Use the imperative for instructions. Write
Run cargo nextest run --no-fail-fast, notYou may want to consider running the tests. - Give concrete commands, flags, file names, and thresholds. Generic advice has no value in a skill; the agent already knows it. Keep Rust-specific guardrails that prevent a correctness, soundness, security, ABI, release, or tooling error, even when a strong model often knows them.
- Remove every project-specific path, crate name, package name, and internal tool name. The skills must apply to any Rust workspace.
- Tag every code block with a language:
rust,bash,toml,yaml,kotlin,swift,text. - Keep
SKILL.mdunder 500 lines (the validator enforces it) and near 5,000 tokens. Put gotchas, triage tables, verifier commands, and escalation rules first. Move conditional material, long examples, and background toreferences/<topic>.md. Link each reference directly fromSKILL.mdat the point of need with the condition to read it ("Readreferences/x.mdwhen ..."). A reference over 100 lines starts with a short contents list. - Do not add a "When to use this skill" section. The description does that job, and the body loads only after the agent chose the skill.
- Name another skill by its name only ("the
rust-securityskill, when it is installed"). An install of one skill has no sibling directories, so a path into another skill is a dead link. - Give each rule one home in the catalog. Other skills point to the owner in one line.
- State the verifier: which command proves which claim, when to run it, and what a green result does not prove. Scale it to the risk. Do not add "double-check" or "verify again" steps.
- Use "never", "always", "must", and severity labels only for a correctness, safety, data-loss, or irreversible-release hazard, and give the reason. Mark a team preference as a default.
- Skills run on many models and agents. Do not describe how a model behaves, and do not require a harness feature (subagents, plan mode, nightly, a specific test runner) without a fallback.
- Label a dated fact with its version or date ("as of Rust 1.98.1"). Do not write "at time of writing". Re-run a measurement before you change its toolchain label.
- Prefer a triage table (symptom, cause, fix) over prose for failure handling.
- Compile any Rust example that is meant to be complete before you commit it.
bash checks/check.shdoes this for the whole catalog. A snippet that does not compile teaches the wrong thing with full confidence. - Never write a function with an empty body under a non-unit return type.
fn f() -> Result<T> { // implementation }does not compile; writetodo!(). This is the single most common defect the compile check finds. - Never define one name twice in a single code block to show a before and an after. Use two blocks. One block cannot hold both, and a reader cannot tell which definition is live.
- Tag a fence that must not compile:
```rust,compile_failfor a deliberate error demonstration, and name the code when you know it:```rust,compile_fail,E0499. The gate then requires that code, so the block proves what the prose says it proves. - Tag a portable behavior probe
```rust,runand definefn main(). CI first requires clean compilation, then builds and runs it on the native host. Keep it on the standard library. A run block cannot containTODO,FIXME,todo!(), orunimplemented!(). - Tag
```rust,ignoreonly for code nocargo checkcan judge: a build-scriptinclude!, a nightly-only feature, a failure that arrives at monomorphization, or a crate the harness cannot hold (the list is inchecks/Cargo.toml). It is the one way out of the gate, and nothing else removes a block from it. Prefer fixing the example.
How to add a skill
- Create
skills/<name>/. - Write
skills/<name>/SKILL.mdwith the frontmatter above and a body that follows the authoring conventions. Addskills/<name>/references/*.mdonly for material that is conditional or does not fit in the size budget. - Add one row to the catalog table in
README.md, in the section that matches the subject. Link the name toskills/<name>/SKILL.md. Add one node to the routing diagram. Every skill appears exactly once in both places. - Add at least one row to
tests/routing-cases.md: a phrase a user is likely to type, and the new skill. The phrase must appear in the newdescription. A skill with no routing case fails validation. The check is a regression lint, not proof that routing works: do not add a keyword to a description only to satisfy it.
How to verify a change locally
One command runs every gate CI runs, on the toolchain checks/rust-toolchain.toml pins:
bash checks/check.shA green run locally means a green run in CI. The one gate that can be missing is the skills-CLI
discovery step, which needs npx; check.sh says so out loud when it has to skip it, and CI
always runs it. check.sh writes only under checks/ and a temporary directory, so run and rerun
it without asking.
1. Catalog structure
python3 scripts/validate-skills.pyIt checks, for every skill:
- frontmatter keys stay inside the Agent Skills spec, and the three required keys are present;
nameequals the directory name and uses the allowed character set;descriptionis one plain line, long enough to state what and when, and under 1024 characters;- every frontmatter value survives a real YAML parser unchanged: no
:, no#, no leading indicator character, because the skills CLI and the agent runtimes read the file with one; SKILL.mdis at most 500 lines;- every Markdown link resolves from the file that holds it and stays inside the skill directory,
every
references/*.mdcode span exists, and no file names askills/<name>/repository path; - every phrase in
tests/routing-cases.mdstill appears in the description it routes to, and every skill has at least one routing case; - the README catalog lists exactly the skills that exist on disk;
- the README Mermaid routing graph names every skill exactly once.
2. Compile and behavior-check the examples
checks/README.md lists the commands for each phase. Every ```rust block in skills/ is
read, and its fence decides what happens to it. An untagged block is type-checked; most are
fragments that name types the prose defines, and the analyzer buckets those and ignores them. A
rust,run block must compile cleanly and then run on the native host within ten seconds. The gate
fails on an example that never reached the compiler, a failing run block, a compile_fail block
that compiled or missed the code its fence names, or a compile error the analyzer cannot
attribute to an undefined symbol or to the extraction wrapper.
checks/baseline.txt is empty and should stay empty. When the gate reports a new suspect, fix
the example. Add a baseline line only for a failure no fence tag can express, with a comment
saying why. Add a crate to checks/Cargo.toml when a skill starts using it, or every block that
imports it silently degrades to a fragment. checks/README.md has the full description.
check.sh then confirms the CLI still discovers the catalog. This lists the skills and installs
nothing:
npx skills add ./ --listRun it after any frontmatter edit. The CLI and the agent runtimes parse frontmatter with a real
YAML parser: a : in a description once hid a whole skill, and a # cut one in half.
plain_scalar_problem in scripts/validate-skills.py rejects both, but the CLI is the only
end-to-end proof.
What main enforces
main blocks force-pushes and branch deletion, and merged head branches are deleted
automatically. Status checks are not required, so a direct push still lands: CI reports on it,
it does not gate it. Run bash checks/check.sh before you push, because nothing else will.
Do not run skills remove inside this repository
npx skills remove --skill <name> treats this repository's own skills/ directory as an
install location and deletes the source directory. It does this even when you never ran
skills add. The deletion is silent and it is not staged in git, so an uncommitted skill is
lost outright.
Use npx skills add ./ --list to inspect the catalog, and npx skills use ./ --skill <name>
to read one skill. Neither writes to skills/. If you need to test an install and a removal,
do it in a scratch directory, never in a checkout of this repository.
Pull request conventions
- One skill per pull request where practical. A catalog-wide edit, such as a rename of a shared term, may touch many files in one pull request.
- Commit subject:
skill(<name>): <what changed>, for exampleskill(rust-unsafe): add Tree Borrows review checklist. For repository-level files usedocs: <what changed>orchore: <what changed>. - Do not mention Claude, Claude Code, or Anthropic in commit messages or pull request text.
- Do not add
Co-Authored-Bytrailers. - Update the
README.mdcatalog row in the same pull request that adds or renames a skill.
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.

