rust

Enforces Rust coding standards, linting rules, and async IO patterns for workspace development.

1|1|Updated May 14, 2026
One-click install
npx skills add https://github.com/alexmohr/assimilate --skill rust-alexmohr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust
Source: https://github.com/alexmohr/assimilate/tree/main/skills/rust
Command: npx skills add https://github.com/alexmohr/assimilate --skill rust-alexmohr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rust codebases with strict quality gates require consistent enforcement of error handling, formatting, linting, and async patterns. This Skill ensures every .rs file modification follows the project's mandatory rules — no unwrap() in production code, no string-based control flow, proper Result propagation — and passes the full validation pipeline of fmt, clippy, tests, and dependency audits. ## Core Features & Use Cases - Mandatory Code Rules: Enforces error handling with Result and ?, forbids unwrap()/expect()/panic!() outside tests, bans unsafe, wildcard matches, and as numeric conversions. - Style Guide: Provides DO/DON'T examples for iterator chains over for loops, let ... else early returns, variable shadowing, newtype patterns, From/Into conversions, and Display implementations. - Async IO Discipline: Requires tokio::join! directional tasks for bidirectional IO, spawn_blocking for blocking calls, and tokio::fs instead of blocking std::fs in async contexts. - Custom Lint Integration: Covers the no_string_control_flow dylint that forbids comparing strings to literals for control flow outside sanctioned parse boundaries. - Use Case: When asked to add a new endpoint to the Rust server crate, the Skill guides writing idiomatic code, then running cargo +nightly fmt, cargo +nightly clippy --workspace -- -D warnings, cargo test --workspace, and cargo deny check before considering the change complete. ## Quick Start Ask the assistant to modify a Rust source file or Cargo.toml in this workspace and it will apply the required style rules and run the full fmt, clippy, test, and deny validation workflow.

Frequently Asked Questions about rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in Rust without using unwrap?

Return Result from functions and propagate errors with the ? operator instead of calling unwrap() or expect(). Define a concrete error enum with thiserror rather than returning Box<dyn Error>. unwrap() is permitted only inside #[cfg(test)] test modules.

How to write async bidirectional IO with tokio?

Use two independent async tasks joined with tokio::join!, one per direction, instead of a manual select loop. For byte-stream proxying between two AsyncRead + AsyncWrite endpoints, use tokio::io::copy_bidirectional.

Can I call std::fs blocking functions inside async Rust code?

No, blocking calls like std::fs::read_to_string block the async executor thread. Use tokio::fs for async file operations, or wrap genuinely blocking work in tokio::task::spawn_blocking. These blocking methods are denied workspace-wide via clippy::disallowed_methods.

Why does the no_string_control_flow lint reject my string comparison?

The custom dylint forbids comparing &str or String values to literals with ==, !=, or match arms for control flow. Parse the string into an enum first inside from, from_str, try_from, or deserialize functions, then branch on the enum.

What validation steps must pass before committing Rust changes?

Run cargo +nightly fmt with the project config, cargo +nightly clippy --workspace -- -D warnings, cargo test --workspace, and cargo deny check. Never add ignore entries to deny.toml or #[allow] attributes without explicit human approval.