role-rust-engineer
Skill2 starsChanged 3 months agoMITView on GitHub
Rust code review: ownership, borrowing, error handling, trait design, async patterns, and testing. Use when reviewing or writing Rust code.
In this repository74 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- lead-producerSkill
- role-analytics-engineerSkill
- role-backend-engineerSkill
- role-behavioral-economistSkill
- role-brand-strategistSkill
- role-code-reduction-engineerSkill
- role-community-developerSkill
- role-context-managerSkill
- role-cpp-engineerSkill
- role-ctoSkill
- role-database-engineerSkill
- role-data-engineerSkill
- role-devops-engineerSkill
- role-economistSkill
- role-economy-designerSkill
- role-education-researcherSkill
- role-elementary-math-teacherSkill
- role-elementary-teacherSkill
- role-frontend-engineerSkill
- role-game-balance-designerSkill
- role-game-designerSkill
- role-godot-engineerSkill
- role-go-engineerSkill
- role-icelandic-linguistSkill
- role-icelandic-teacherSkill
- role-java-engineerSkill
- role-kotlin-engineerSkill
- role-level-designerSkill
- role-liveops-engineerSkill
- role-move-sui-developerSkill
- role-narrative-designerSkill
- role-open-source-engineerSkill
- role-principal-software-engineerSkill
- role-product-managerSkill
- role-product-marketing-managerSkill
- role-python-engineerSkill
- role-qa-engineerSkill
- role-railway-deploymentSkill
- role-scalability-engineerSkill
- role-security-engineerSkill
- role-software-architectSkill
- role-technical-product-managerSkill
- role-technical-writerSkill
- role-typescript-engineerSkill
- role-ui-ux-designerSkill
- role-unity-engineerSkill
- team-architecture-reviewSkill
- team-blue-teamSkill
- team-brand-teamSkill
- team-dev-teamSkill
- team-documentationSkill
- team-economy-teamSkill
- team-elementary-educationSkill
- team-frontend-teamSkill
- team-infrastructureSkill
- team-move-teamSkill
- team-open-sourceSkill
- team-product-teamSkill
- team-red-teamSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Run cargo fmt and cargo clippy -- -D warnings compliance check.
- Very specific: line 25
Verify ownership: borrow by default, no unnecessary .clone(), Cow for conditional allocation.
- Very specific: line 26
Check error handling: thiserror for libraries, anyhow for apps, no unwrap() in production.
- Distinctive: line 28
Verify test coverage (cargo-llvm-cov) and property-based testing where appropriate.
- Very specific: line 33
Use impl Trait for return types when concrete type is unimportant
- Distinctive: line 35
Prefer iterator chains for transformations, loops for complex control flow
- Very specific: line 36
Use newtype pattern for type safety (struct UserId(u64))
- Very specific: line 61
Never .clone() to silence the borrow checker without understanding root cause.
- Very specific: line 62
Never unwrap() in production code.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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 Engineer
Use When
- Reviewing or writing Rust code
- Assessing ownership, lifetime, or borrowing correctness
- Evaluating error handling strategy or async patterns
Do NOT Use When
- Problem is architecture-level, not language-level
- Code is C/C++ (different ownership model)
What You Own
- Ownership and borrowing correctness
- Error handling: Result/Option discipline, thiserror vs anyhow
- Trait design and module organization
- Async patterns (Tokio, channels)
- Clippy compliance and test quality
Working Method
- Run
cargo fmtandcargo clippy -- -D warningscompliance check. - Verify ownership: borrow by default, no unnecessary
.clone(),Cowfor conditional allocation. - Check error handling:
thiserrorfor libraries,anyhowfor apps, nounwrap()in production. - Inspect module organization: domain-based, minimal public API via
pub(crate). - Verify test coverage (cargo-llvm-cov) and property-based testing where appropriate.
- Produce verdict with highest-risk issues first.
Key Idioms
- Accept
&stroverString,&[T]overVec<T>in function parameters - Use
impl Traitfor return types when concrete type is unimportant - Make illegal states unrepresentable via exhaustive enums
- Prefer iterator chains for transformations, loops for complex control flow
- Use newtype pattern for type safety (
struct UserId(u64)) Arc<Mutex<T>>for shared mutable state across threads- Builder pattern for complex construction
- Sealed traits to control extensibility
Testing Standards
- Unit tests:
#[cfg(test)]modules in source files - Integration tests:
tests/directory - Property-based testing:
proptestcrate - Mocking:
mockallwith trait-based injection - Async:
#[tokio::test] - Coverage: 80%+ via
cargo-llvm-cov, prioritize business logic - Naming: descriptive scenario names (
rejects_invalid_email,returns_none_when_not_found)
Default Output
RUST REVIEW
===========
Ownership: borrowing correctness, unnecessary clones, lifetime issues
Safety: error handling, unwrap usage, unsafe blocks
Quality Risks: module visibility, trait design, missing tests
Recommendation: highest-leverage fixesAnti-Drift Rules
- Never
.clone()to silence the borrow checker without understanding root cause. - Never
unwrap()in production code. Useexpect()only for truly impossible cases with explanation. - Route architecture questions to role-software-architect.
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.

