rust

Guide Rust code implementation with ownership, async runtime, and error-handling patterns.

16|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/JCETools-Petra/JCE-Opencode-Tools --skill rust-jcetools-petra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust
Source: https://github.com/JCETools-Petra/JCE-Opencode-Tools/tree/main/config/skills/rust
Command: npx skills add https://github.com/JCETools-Petra/JCE-Opencode-Tools --skill rust-jcetools-petra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust projects often stall due to confusing ownership and lifetimes, inconsistent error-handling choices, and uncertainty about the right async runtime and testing patterns.

Core Features & Use Cases

  • Error-handling decision guidance: chooses library-grade errors with thiserror vs application-grade propagation with anyhow, including guidance for mixed crates and adding context.
  • Async/runtime selection: recommends tokio, embassy, or simpler blocking approaches based on workload and constraints, plus multi-threaded vs single-threaded executor selection.
  • Ownership and concurrency patterns: clarifies when to use moves, borrows, Rc/Arc, and interior mutability like RefCell/Mutex/RwLock.
  • Implementation and quality heuristics: emphasizes Rust 2024 edition considerations, common robust patterns (newtypes, builder/type-state), iterator/parallelism practices, and verification checklists (fmt/clippy/test/audit).

Quick Start

Ask for help applying the Rust skill guidance to your repository’s failing code by stating the crate type (library, binary, or mixed), the async needs (yes/no and runtime constraints), and the specific error messages you see when running tests or clippy.

Frequently Asked Questions about rust

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

FAQPage Schema
How do I choose between thiserror and anyhow for Rust error handling?

For Rust error handling, choose thiserror for library-grade custom error types and anyhow for application-grade error propagation with context. This skill provides decision guidance for mixed crates to ensure consistent error management across your project.

When should I use tokio versus embassy for async Rust?

Select tokio for standard multi-threaded async workloads and embassy for embedded runtime constraints. This skill recommends the appropriate async executor or simpler blocking alternatives based on your specific workload and system limitations.

What is the best way to manage Rust ownership with Rc, Arc, and interior mutability?

Managing Rust ownership requires clarifying when to use moves, borrows, Rc, or Arc, alongside interior mutability like RefCell, Mutex, or RwLock. This skill maps your concurrency scenarios to the correct safety-oriented ownership patterns.

How do I fix failing Rust tests and clippy warnings in a mixed-crate codebase?

To fix failing Rust tests and clippy warnings, apply implementation heuristics and verification checklists including fmt, clippy, test, and audit gates. This skill helps debug code by mapping scenarios to robust patterns like newtypes and builders.

Does this Rust guidance apply to the Rust 2024 edition?

Yes, this Rust guidance applies to the 2024 edition, emphasizing common robust patterns such as newtypes, builder type-state, and iterator practices. It ensures your library, binary, or mixed-crate codebase follows modern safety-oriented verification.