Rust Engineer gives the agent a senior Rust engineer’s workflow for Rust 2021 projects. It analyzes ownership first, designs traits, implements with minimal unsafe code, handles errors with Result and Option, and validates with cargo clippy, cargo fmt and cargo test.
The skill states what to always do (document every unsafe block, fix all clippy warnings, write doctests) and what to avoid (unwrap in production code, needless clones, blocking calls inside async code).
What You Get
- A five-step workflow that ends in cargo clippy, cargo fmt —check and cargo test
- Code patterns for explicit lifetimes, trait default methods, thiserror error enums and tokio join
- A must-do list: borrow before cloning, document every unsafe block, run doctests
- A must-not list: unwrap in production, blocking calls in async code, unnecessary String and clone
- Reference files for ownership, traits, error handling, async and testing
Common Use Cases
- Resolving a borrow checker or lifetime error in existing code
- Designing a trait-based API with generics and associated types
- Building a tokio service with concurrent tasks and typed errors
- Writing FFI bindings with every unsafe block documented
What Makes It Unique
Most language skills list style rules. This one fixes a validation step (clippy with all targets and features, fmt check, tests, doctests, optional benchmarks) and requires a stated safety invariant on every unsafe block. It names the project’s testing tools, including proptest and criterion, as part of the expected output.
Under The Hood
The skill is a SKILL.md plus five reference files that the agent loads by topic (ownership, traits, error handling, async, testing). It ships no scripts. The instructions tell the agent to run cargo fmt, cargo clippy, cargo test and cargo bench in your project, which compile code and write build output to the target folder. The async example in the skill fetches a web page with reqwest, which is sample code for you to adapt and not something the skill runs itself.