neo-rust
Skill7 starsChanged 6 months agoMITView on GitHub
Use this skill when writing, refactoring, debugging, modernizing, or auditing Rust code. Trigger for .rs files, Cargo projects, Rust 2024 Edition or version-specific features (up to Rust 1.100+), ownership/borrowing/lifetime issues, Result/Option error handling, async closures, unnecessary clone/performance work, unsafe code review, or modern Rust architecture.
In this repository28 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-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
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Write safe, maintainable, and idiomatic Rust code (targeting Rust 2021 / 2024 Editions through Rust 1.100+) by leveraging the type system, …
- Very specific: line 24
Excessive
.clone(): Do not clone just to appease the borrow checker. - Very specific: line 25
Unchecked
.unwrap()/panic!(): Never call .unwrap() or panic!() in library or production paths. - Very specific: line 38
Perceive (Inventory & Version Check): Check Cargo.toml for edition ("2021" vs "2024") and rust-version (MSRV), scan .rs files, and identify …
- Very specific: line 44
Format & Deliver: Run cargo fmt and present the output using the matching template below.
≈ “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
Neo Rust Expert
Write safe, maintainable, and idiomatic Rust code (targeting Rust 2021 / 2024 Editions through Rust 1.100+) by leveraging the type system, ownership boundaries, and modern language/Cargo conventions.
Gotchas
- Async Mutex Across
.await:std::sync::MutexGuardis notSendand cannot cross.awaitpoints. Limit the lock to an inner{}block before.await, or usetokio::sync::Mutex. - Excessive
.clone(): Do not clone just to appease the borrow checker. Prefer borrowed parameters (&str,&[T],&T) or restructure ownership and lifetimes. - Unchecked
.unwrap()/panic!(): Never call.unwrap()orpanic!()in library or production paths; propagate errors withResult<T, E>,Option<T>,?, orlet...else. - Edition 2024 Unsafe Env & FFI: In Rust 2024 Edition (1.85+),
std::env::set_var/remove_varareunsafe(multi-threaded data races), and FFI requiresunsafe externblocks plus#[unsafe(no_mangle | export_name | link_section)]. Prefer config injection orCommand::envfor child processes. - Edition 2024 RPIT Capture &
#[expect]: Return-positionimpl Trait(-> impl Trait) captures all in-scope lifetimes by default in Edition 2024—use+ use<'a, T>to restrict captures. Prefer#[expect(lint, reason = "...")]over#[allow(lint)]so obsolete suppressions surface as warnings.
Feature Roadmap (Rust 1.85 / 2024 Edition – 1.100.0)
- Rust 1.85 & 2024 Edition: Native async closures (
async || {},AsyncFn*), RPITuse<..>precise capturing,Future/IntoFuturein prelude, narrowerif let/tail temporary scopes,unsafe extern&#[unsafe(...)], MSRV-aware Cargo resolver. - Rust 1.86 – 1.93: Trait upcasting (
&dyn Subtrait->&dyn Supertrait),slice/HashMap::get_disjoint_mut,std::io::pipe,letchains (if let ... && let ...),#[unsafe(naked)], const generic_inference,mismatched_lifetime_syntaxeslint,cargo publish --workspace. - Rust 1.94 – 1.99:
slice::array_windows::<N>(), Cargo configinclude& TOML 1.1,cfg_select!macro,if letmatch guards,Copyrange types (core::range::*),assert_matches!, defaultv0symbol mangling,Layout::for_value_raw&extern "C"variadics. - Rust 1.100.0: Stabilized Never Type (
!),std::alloc::Allocator(Box::new_in,Vec::new_in),std::mem::DropGuard(new,dismiss),bool::toggle/Vec::from_fn/str::trim_prefix, Cargomin-publish-age&cargo::unused_dependencies.
Workflow
- Perceive (Inventory & Version Check): Check
Cargo.tomlforedition("2021"vs"2024") andrust-version(MSRV), scan.rsfiles, and identify the task type (feature development, refactoring, or code review). - Reason (Dynamic Reference Routing): Load only the reference docs needed for the task:
- Architecture, Design & Modern Rust APIs: Load patterns.md.
- Code Review, Refactoring & Pitfall Fixes: Load anti-patterns.md.
- Naming, Project Layout, Cargo & Toolchain Setup: Load coding-style.md.
- Act & Validate (Compile & Clippy Loop): Implement changes matching the target edition/MSRV, then run
cargo checkandcargo clippy --all-targets -- -D warnings. Inspect compiler diagnostics and iterate until zero warnings remain. - Format & Deliver: Run
cargo fmtand present the output using the matching template below.
Output Templates
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 `let` chains and `array_windows` for safe, flat logic]
* [e.g., Replaced `.clone()` with `&str` for zero-copy borrowing]
## 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]Documentation
Official References
- The Rust Programming Language (The Book)
- Rust Edition Guide (Rust 2024 Edition)
- Rust Standard Library (
std) Documentation - The Rust Reference
- Rust API Guidelines
- The Cargo Book
- Rustc Book (Lints & Compiler Options)
- Clippy Lints Documentation
- Official Rust Release Notes & Blog
- Tokio Async Runtime & Sync Documentation
Internal References
- Rust Design Patterns & Modern 1.85–1.100+ Idioms
- Rust Anti-Patterns, Hazards & Modernization Fixes
- Rust Coding Style, Toolchain & Cargo Standards
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.

