rust

Generate secure Rust implementations with Tokio async patterns and Result-based error handling.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/Probably-Group/Dev-AID --skill rust-probably-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust
Source: https://github.com/Probably-Group/Dev-AID/tree/main/.dev-aid/skills/expert/rust
Command: npx skills add https://github.com/Probably-Group/Dev-AID --skill rust-probably-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common Rust security and reliability failures while speeding up correct implementation for real-world Rust codebases, including async services and safe abstractions.

Core Features & Use Cases

  • Secure coding guardrails: Block unsafe memory use patterns, command injection, path traversal, and unsafe archive extraction.
  • Production-grade error handling: Avoid panics by eliminating unwrap/expect in production flows and promoting structured Result-based designs with thiserror-style errors.
  • Async & systems-ready patterns: Use Tokio-appropriate patterns (spawn_blocking for CPU-bound work, async IO for network/file tasks) and disciplined unsafe documentation when unavoidable.
  • Scope: Applies when implementing Rust features like services, CLI/library code, secure file handling, boundary validation, and FFI-adjacent safety wrappers.

Quick Start

Use the rust skill to generate a Rust function that validates inputs, safely reads a user-specified file under a base directory using canonicalization, and returns a Result type without panicking.

Frequently Asked Questions about rust

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

FAQPage Schema
How do I prevent path traversal and command injection when handling file inputs in Rust?

Safe archive extraction in Rust requires validating paths within extraction boundaries and avoiding unsafe memory patterns. Using spawn_blocking for CPU-bound decompression tasks and propagating thiserror-style Result types prevents panics during extraction failures.

What is the best way to handle errors in production Rust code without causing panics?

Production Rust error handling eliminates unwrap and expect calls in favor of structured Result-based designs with thiserror-style errors. This approach safely propagates failures through trust boundaries without triggering application panics.

How do I use Tokio for async file IO and CPU-bound work in Rust services?

Tokio async patterns in Rust dictate using async IO for network and file tasks while offloading CPU-bound work to spawn_blocking. This discipline prevents runtime blocking and maintains safe async execution boundaries.

When should I use unsafe in Rust and how do I document its invariants?

Unsafe Rust should be avoided unless absolutely necessary for FFI wrappers or low-level abstractions. When unavoidable, disciplined unsafe usage requires thoroughly documenting the safety invariants that callers must uphold to maintain memory safety.

Does Rust work for building secure CLI tools that process untrusted user inputs?

Rust is suited for secure CLI tools processing untrusted inputs by enforcing boundary validation, canonicalizing filesystem paths, and safely executing commands. Structured Result types ensure reliable execution without unwrap-induced panics.