rust-code-expert
Skill5 starsChanged 21 days agoMITView on GitHub
Use when Rust-specific ownership, lifetimes, traits, Result flow, async/Tokio, unsafe, FFI, Cargo, or native-target design determines the solution.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-md-fixerSkill
- arch-docsSkill
- book-to-markdownSkill
- docset-updaterSkill
- humanizerSkill
- news-release-docsSkill
- pdf-guideSkill
- readme-docsSkill
- screenshot-docsSkill
- see-also-docsSkill
- setup-install-usage-docsSkill
- bptools-writer-expertSkill
- color-accessibility-expertSkill
- css-creative-expertSkill
- game-design-expertSkill
- geometry-expertSkill
- glass-expertSkill
- hic-human-interact-expertSkill
- openscad-3d-printing-expertSkill
- podman-expertSkill
- postgresql-expertSkill
- pyside6-engineerSkill
- solid-js-expertSkill
- svg-creator-expertSkill
- typescript-engineerSkill
- ui-ux-engineerSkill
- vision-expertSkill
- wasm-rust-expertSkill
- webwork-writer-expertSkill
- delegate-manager-to-subagentsSkill
- gas-town-workflowSkill
- hang-checkSkill
- html-game-parallel-builderSkill
- parallel-planSkill
- stay-busySkill
- repo-rules-readerSkill
- blueprint-plan-drafterSkill
- ideonomy-plainSkill
- ideonomy-richSkill
- make-goalSkill
- modest-plan-drafterSkill
- audit-code-reviewerSkill
- old-python-code-reviewSkill
- prune-testsSkill
- unit-test-starterSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 11 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill for small, compilable Rust changes with explicit ownership, an error contract, a target triple, and executable proof.
- Distinctive: line 13
Start with references/task_selection.md to classify the request, then use references/topic_index.md for focused guidance, a local source, …
- Distinctive: line 30
Read references/project_workflow.md for the project-shaped sequence and artifact locations.
- Distinctive: line 37
Keep unsafe, FFI, and PyO3 boundaries small, documented, and wrapped by a safe Rust-facing API.
- Distinctive: line 41
Prefer direct ownership and borrowing, explicit trait bounds, and standard library types before adding dependencies.
- Very specific: line 46
Run cargo fmt --check, cargo check, focused cargo test, and cargo clippy -- -D warnings from the relevant workspace root.
- Distinctive: line 48
Use compiler diagnostics as the first ownership and type oracle, then add a deterministic unit, integration, CLI, FFI, or performance test.
- Distinctive: line 50
Read references/testing_and_oracles.md to choose the required oracle and measurement.
- Distinctive: line 59
Prefer ownership-first APIs that return owned values, immutable borrows, or scoped mutable borrows according to the caller's responsibility.
- Distinctive: line 61
Use enums and trait implementations to represent domain alternatives and shared behavior.
- Very specific: line 63
Use thiserror for library error types and anyhow for application-level context when the target already uses those patterns.
- Distinctive: line 67
Use Tokio for asynchronous I/O or concurrency, and make cancellation, timeouts, and task ownership visible in the API.
- Very specific: line 88
Follow references/topic_index.md when the local corpus is absent, consult the official Rust Book, Rustonomicon, Cargo Book, or docs.rs, and …
- Distinctive: line 94
When using this skill, produce:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Rust code expert
Overview
Use this skill for small, compilable Rust changes with explicit ownership, an error contract, a target triple, and executable proof.
Own core Rust language work, Cargo workflow, and native-target delivery.
Route browser and WebAssembly targets to wasm-rust-expert.
Start with references/task_selection.md to classify the request, then use
references/topic_index.md for focused guidance, a local source, and an oracle.
Workflow
- Classify the Rust task and name its contract.
- Identify the crate, binary or library boundary, target triple, public API, inputs, outputs, ownership transfer, error type, and performance concern.
- Match borrow checker, lifetime, trait, Cargo, Tokio, unsafe, FFI/PyO3, Result, CLI, or performance work in references/topic_index.md.
- Select
wasm-rust-expertforwasm-bindgen,wasm-pack,web-sys,wasm32-unknown-unknown, browser bundles, browser canvas, and native-versus-Wasm parity.
- Detect the project shape and establish the work surface.
- Inspect
Cargo.toml,Cargo.lock,src/, workspace members, existing tests, target-specific configuration, CI commands, and the failing compiler output. - Existing project: name the owning module, public call sites, current tests, and the narrowest behavior to preserve.
- Greenfield project: create the smallest crate, domain and error types, an entry point, and one executable success path.
- Read references/project_workflow.md for the project-shaped sequence and artifact locations.
- Model ownership before editing implementation details.
- Draw the value flow: creator, borrower, mutator, consumer, and lifetime relationship at each API edge.
- Express invalid states with enums, compose behavior with traits, and expose
fallible operations as
Resultwith contextual errors. - Keep unsafe, FFI, and PyO3 boundaries small, documented, and wrapped by a safe Rust-facing API.
- Implement one focused vertical slice.
- Make the smallest change that fulfills the contract in the owning module.
- Prefer direct ownership and borrowing, explicit trait bounds, and standard library types before adding dependencies.
- Confirm the crate API and compatible version in
docs.rs, then usecargo addand record feature and target requirements inCargo.toml.
- Build executable evidence as the change develops.
- Run
cargo fmt --check,cargo check, focusedcargo test, andcargo clippy -- -D warningsfrom the relevant workspace root. - Use compiler diagnostics as the first ownership and type oracle, then add a deterministic unit, integration, CLI, FFI, or performance test.
- Read references/testing_and_oracles.md to choose the required oracle and measurement.
- Review the delivered behavior.
- Confirm the command, library API, or binding returns actionable errors with useful
Resultcontext. - Recheck feature flags, platform assumptions, public documentation, and benchmark conditions before reporting a performance conclusion.
Implementation defaults
- Prefer ownership-first APIs that return owned values, immutable borrows, or scoped mutable borrows according to the caller's responsibility.
- Use enums and trait implementations to represent domain alternatives and shared behavior; keep generic bounds close to the API they constrain.
- Use
thiserrorfor library error types andanyhowfor application-level context when the target already uses those patterns. - Build CLI tools with a typed argument structure, validated inputs, stable stdout, actionable stderr, and explicit process exit behavior.
- Use Tokio for asynchronous I/O or concurrency, and make cancellation, timeouts, and task ownership visible in the API.
- Encapsulate unsafe operations in a small module with invariants, preconditions, and safe tests at the boundary.
- Confirm Rust, Cargo, Tokio, clap, PyO3, maturin, and crate APIs in official
documentation or
docs.rsbefore relying on version-sensitive details. - Load references/local_books.md and references/reference_survey.md when the local corpus is present.
Quality bar
- Compile every affected target and keep
cargo clippy -- -D warningsclean. - State the ownership and lifetime model in code, comments, or API names where a reader needs it to use the interface correctly.
- Make error behavior observable with
Resulttests, exit-status assertions, or binding-level exception checks. - Validate unsafe, FFI, and PyO3 seams with a safe wrapper test and a boundary invariant.
- Measure performance with a representative workload and report the command, data shape, baseline, and result.
- Follow references/topic_index.md when the local
corpus is absent, consult the official Rust Book, Rustonomicon, Cargo Book,
or
docs.rs, and run the compiler plus the selected test or oracle.
Output expectations
When using this skill, produce:
- The target shape, owning crate and module, native target, and selected topic route.
- A concise ownership, lifetime, trait, and error-handling rationale for the change.
- A file- and symbol-specific implementation or recommendation, including safe boundary invariants for unsafe, FFI, or PyO3 work.
- Executed Cargo commands, test or oracle results, and performance measurements when performance is in scope.
- A clear next step when an external API, target platform, or benchmark input needs user confirmation.
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.

