programming-rust

Define Rust architectural rules for ownership, error design, traits, and async concurrency.

3|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/Muvon/octomind-tap --skill programming-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: programming-rust
Source: https://github.com/Muvon/octomind-tap/tree/main/skills/programming-rust
Command: npx skills add https://github.com/Muvon/octomind-tap --skill programming-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cargo, clippy, thiserror, anyhow, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you avoid common Rust architecture pitfalls that lead to fragile code, borrow-checker fights, and long-term maintenance pain.

Core Features & Use Cases

  • Idiomatic ownership and data flow guidance: Recommends ownership-first API design patterns that reduce lifetime complexity and clarify mutation boundaries.
  • Error and trait architecture principles: Encourages crate-boundary error enums, clean foreign error conversion, and minimal, orthogonal trait abstractions.
  • Async concurrency safety: Promotes actor/channel patterns over shared mutable state like Arc<Mutex<_>>, especially across .await, to prevent deadlocks and cancellation bugs.

Quick Start

Ask the Skill: “Review my Rust crate’s data flow and propose an ownership-first architecture, including async state handling, error boundaries, and a suggested module layout.”

Frequently Asked Questions about programming-rust

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

FAQPage Schema
How do I design a maintainable Rust architecture that avoids borrow-checker fights?

A maintainable Rust architecture relies on ownership-first API design to reduce lifetime complexity and clarify mutation boundaries. By establishing clear data flow and orthogonal trait abstractions, you prevent borrow-checker fights and long-term maintenance pain.

What is the best way to handle async state in Rust without deadlocks?

Handling async state in Rust without deadlocks requires using actor and channel patterns over shared mutable state like `Arc<Mutex<_>` across `.await` points. This isolation prevents deadlocks and cancellation bugs by avoiding concurrent lock contention.

How do I structure error boundaries and trait abstractions in a Rust crate?

Structuring error boundaries in a Rust crate involves defining crate-boundary error enums with clean foreign error conversion. Pair this with minimal, orthogonal trait abstractions to ensure the architecture remains maintainable and avoids unnecessary complexity.

Does this Rust architecture guidance work for refactoring existing codebases?

Yes, this Rust architecture guidance works for refactoring existing codebases by applying consistent rules for ownership, error boundaries, and async concurrency. It resolves inconsistent designs to eliminate borrow-checker churn and long-term maintenance pain.

Why does using Arc Mutex for async concurrency cause maintenance pain in Rust?

Using `Arc<Mutex<_>` for async concurrency causes maintenance pain in Rust because sharing mutable state across `.await` points frequently leads to deadlocks and cancellation bugs. Actor and channel patterns are recommended to isolate state safely.

Do I need cargo and clippy to review my Rust crate's data flow and module layout?

You need cargo and clippy as foundational dependencies to review your Rust crate's data flow and module layout effectively. They support the architectural review by validating ownership-first designs, error boundaries, and async state handling.