neo-rust
Skill7 starsChanged 6 months agoMITView on GitHub
Use this skill when writing, refactoring, debugging, or auditing Rust code. Trigger for .rs files, Cargo projects, ownership/borrowing/lifetime issues, Result/Option error handling, unnecessary clone/performance work, unsafe code review, or modern Rust architecture.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- generate-skillSkill
- neo-azure-pipelinesSkill
- neo-clarificationSkill
- neo-clean-architectureSkill
- neo-code-reviewSkill
- neo-csharp-interface-generatorSkill
- neo-csharpSkill
- neo-dotnet-ef-coreSkill
- neo-dotnet-minimal-apisSkill
- neo-dotnet-mvcSkill
- neo-dotnetSkill
- neo-dotnet-tag-helperSkill
- neo-dotnet-webapiSkill
- neo-harness-projectSkill
- neo-harnessSkill
- neo-iso-27001Skill
- neo-iso-27701Skill
- neo-javascriptSkill
- neo-opentelemetrySkill
- neo-prSkill
- neo-python-managerSkill
- neo-pythonSkill
- neo-rabbitmqSkill
- neo-stop-slopSkill
- neo-sub-agentSkill
- neo-swiftSkill
- neo-swift-uiSkill
- neo-typescriptSkill
- neo-vueSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Write safe, maintainable, and idiomatic Rust code by strictly following the official design patterns, leveraging Rust's powerful type …
- Distinctive: line 51
Verify newly written or modified Rust code to ensure it is 100% compilable:
- Very specific: line 52
Run cargo check to verify syntax and type checking.
- Very specific: line 53
Run cargo clippy --all-targets -- -D warnings to perform strict static analysis and catch potential code smells.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Neo Rust Expert
Write safe, maintainable, and idiomatic Rust code by strictly following the official design patterns, leveraging Rust's powerful type system, and avoiding anti-patterns.
Gotchas
- Gotcha 1 (Async Mutex Deadlock / Send Error):
In an
asyncfunction, using the standard library'sstd::sync::Mutexand holding itsMutexGuardacross an.awaitboundary will cause a compiler error becauseMutexGuarddoes not implementSendand cannot be transferred across threads.- Solution: Use a local block
{}to limit the MutexGuard lifetime before the.await, or usetokio::sync::Mutexinstead.
- Solution: Use a local block
- Gotcha 2 (Excessive Cloning):
To satisfy the Borrow Checker, beginners often call
.clone()excessively, which introduces significant memory allocation and copy overhead.- Solution: Prioritize passing borrowed references (e.g.,
&strinstead ofString,&[T]instead ofVec<T>), or refactor ownership structures and lifetimes.
- Solution: Prioritize passing borrowed references (e.g.,
- Gotcha 3 (Unsafe Unwrapping):
Using
.unwrap()orpanic!()directly in library or production-grade code will cause the application to crash, violating Rust's safety-first principle.- Solution: Always return
Result<T, E>orOption<T>for graceful error propagation, and use the?operator ormatchexpression to handle them.
- Solution: Always return
Workflow Checklist
Progress:
- Step 1: Perceive & Inventory (Check if
Cargo.tomland.rsfiles exist in the project, and clarify whether the task is "feature development", "refactoring", or "Code Review"). - Step 2: Load Reference (Based on the task type, dynamically load corresponding reference files: load
reference/patterns.mdandreference/coding-style.mdfor writing new code, and loadreference/anti-patterns.mdfor reviews and debugging). - Step 3: Implement & Validate (After writing or modifying code, compile and analyze it locally using
cargo checkandcargo clippy. Fix any warnings or errors until compilation passes cleanly without warnings). - Step 4: Format & Finalize (Run
cargo fmtto format the code according to official guidelines, and present output using the Output Templates).
Detailed Guidelines
Step 1 — Parse & Inventory
- Inspect the current directory to verify if
Cargo.tomlexists. - Analyze the task. For Code Review tasks, read existing changes; for feature development, determine the target modules to create or modify.
Step 2 — Dynamic Reference Loading
To save context space, only this SKILL.md is loaded initially. Once executing the task, the Agent must load the following resources:
- Development & Architecture: Load patterns.md and coding-style.md.
- Review, Refactoring & Debugging: Load anti-patterns.md.
Step 3 — Compile & Clippy Validation Loop
Verify newly written or modified Rust code to ensure it is 100% compilable:
- Run
cargo checkto verify syntax and type checking. - Run
cargo clippy --all-targets -- -D warningsto perform strict static analysis and catch potential code smells. - If validation fails:
- Carefully inspect the
stderrcompiler errors or Clippy suggestions. - Modify the corresponding code.
- Re-run validation until it passes cleanly.
- Carefully inspect the
Output Templates
Present your output using the following structured templates depending on the task type.
Template A: Code Review Report
# Rust Code Review Report
## 1. Executive Summary
* **Score**: [1-10 rating]
* **Summary**: [Overall feedback on code quality, ownership usage, and error handling]
## 2. Findings
> [!IMPORTANT]
> Order findings by severity (Error > Warning > Info).
* **[Severity] Location: `src/main.rs:L12` - [Finding Title]**
* **Description**: [Why is this an issue? Which Rust best practice is violated?]
* **Recommendation**:
```rust
// Idiomatic Rust example demonstrating the fix
```
## 3. Top 3 Recommendations
1. [First actionable improvement]
2. [Second actionable improvement]
3. [Third actionable improvement]Template B: Implementation & Refactoring Summary
# Rust Implementation / Refactoring Summary
## 1. Overview of Changes
[Briefly summarize what Rust modules, structs, or traits were added or refactored]
## 2. Applied Design Patterns & Best Practices
* [e.g., Applied the Typestate Pattern to ensure state safety]
* [e.g., Replaced `.clone()` with `&str` for performance gains]
## 3. Local Verification Results
- [x] `cargo check` passed
- [x] `cargo clippy` passed with zero warnings
- [x] `cargo fmt` completed successfully
## 4. Next Steps
1. [Recommended next action, e.g., run cargo test]
2. [Other relevant suggestions]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.

