rust-development

Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration

242 stars

Best use case

rust-development is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration

Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "rust-development" skill to help with this workflow task. Context: Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/rust-development/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/abdelstark/rust-development/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/rust-development/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How rust-development Compares

Feature / Agentrust-developmentStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Rust Development Skill for Guts

You are developing a Rust project using commonware primitives for decentralized infrastructure.

## Code Style Guidelines

### General Principles

1. **Idiomatic Rust**: Follow Rust idioms and conventions
2. **Memory Safety**: Leverage the borrow checker, avoid unsafe unless absolutely necessary
3. **Error Handling**: Use `thiserror` for library errors, `anyhow` for applications
4. **Documentation**: Every public item needs docs with examples

### Formatting & Linting

```bash
# Always run before committing
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
```

### Error Handling Pattern

```rust
use thiserror::Error;

#[derive(Debug, Error)]
pub enum RepositoryError {
    #[error("repository not found: {0}")]
    NotFound(String),

    #[error("permission denied for repository: {0}")]
    PermissionDenied(String),

    #[error("storage error: {0}")]
    Storage(#[from] StorageError),
}

pub type Result<T> = std::result::Result<T, RepositoryError>;
```

### Async Patterns

Use Tokio for async runtime with structured concurrency:

```rust
use tokio::sync::{mpsc, oneshot};

// Prefer channels over shared state
pub struct Service {
    tx: mpsc::Sender<Command>,
}

impl Service {
    pub async fn query(&self, request: Request) -> Result<Response> {
        let (tx, rx) = oneshot::channel();
        self.tx.send(Command::Query { request, reply: tx }).await?;
        rx.await?
    }
}
```

### Module Structure

```rust
// lib.rs - re-export public API
pub mod error;
pub mod types;
pub mod service;

pub use error::{Error, Result};
pub use types::*;
pub use service::Service;
```

### Testing

```rust
#[cfg(test)]
mod tests {
    use super::*;

    #[tokio::test]
    async fn test_feature() {
        // Arrange
        let service = Service::new().await;

        // Act
        let result = service.do_something().await;

        // Assert
        assert!(result.is_ok());
    }
}
```

## Commonware Integration

### Key Crates

- `commonware-cryptography`: Use for Ed25519 signatures
- `commonware-p2p`: Use for peer-to-peer networking
- `commonware-consensus`: Use for BFT consensus
- `commonware-storage`: Use for persistent storage
- `commonware-codec`: Use for serialization

### Example: Using Cryptography

```rust
use commonware_cryptography::{Ed25519, Signer, Verifier};

pub struct Identity {
    keypair: Ed25519,
}

impl Identity {
    pub fn new() -> Self {
        Self {
            keypair: Ed25519::generate(),
        }
    }

    pub fn sign(&self, message: &[u8]) -> Signature {
        self.keypair.sign(message)
    }
}
```

## Cargo.toml Best Practices

```toml
[package]
name = "guts-core"
version = "0.1.0"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
description = "Core types and traits for Guts"
repository = "https://github.com/AbdelStark/guts"
keywords = ["decentralized", "git", "p2p"]
categories = ["development-tools"]

[dependencies]
# Use workspace dependencies
thiserror = { workspace = true }
tokio = { workspace = true }

[dev-dependencies]
tokio-test = { workspace = true }

[lints.rust]
unsafe_code = "deny"
missing_docs = "warn"

[lints.clippy]
all = "warn"
pedantic = "warn"
nursery = "warn"
```

## Performance Considerations

1. Use `Arc` for shared ownership across async tasks
2. Prefer `bytes::Bytes` for zero-copy networking
3. Use `dashmap` for concurrent hash maps
4. Profile with `flamegraph` before optimizing

Related Skills

vue-development-guides

242
from aiskillstore/marketplace

A collection of best practices and tips for developing applications using Vue.js. This skill MUST be apply when developing, refactoring or reviewing Vue.js or Nuxt projects.

ralph-tui-create-beads-rust

242
from aiskillstore/marketplace

Convert PRDs to beads for ralph-tui execution using beads-rust (br CLI). Creates an epic with child beads for each user story. Use when you have a PRD and want to use ralph-tui with beads-rust as the task source. Triggers on: create beads, convert prd to beads, beads for ralph, ralph beads, br beads.

wordpress-woocommerce-development

242
from aiskillstore/marketplace

WooCommerce store development workflow covering store setup, payment integration, shipping configuration, and customization.

wordpress-theme-development

242
from aiskillstore/marketplace

WordPress theme development workflow covering theme architecture, template hierarchy, custom post types, block editor support, and responsive design.

wordpress-plugin-development

242
from aiskillstore/marketplace

WordPress plugin development workflow covering plugin architecture, hooks, admin interfaces, REST API, and security best practices.

voice-ai-engine-development

242
from aiskillstore/marketplace

Build real-time conversational AI voice engines using async worker pipelines, streaming transcription, LLM agents, and TTS synthesis with interrupt handling and multi-provider support

voice-ai-development

242
from aiskillstore/marketplace

Expert in building voice AI applications - from real-time voice agents to voice-enabled apps. Covers OpenAI Realtime API, Vapi for voice agents, Deepgram for transcription, ElevenLabs for synthesis, LiveKit for real-time infrastructure, and WebRTC fundamentals. Knows how to build low-latency, production-ready voice experiences. Use when: voice ai, voice agent, speech to text, text to speech, realtime voice.

systems-programming-rust-project

242
from aiskillstore/marketplace

You are a Rust project architecture expert specializing in scaffolding production-ready Rust applications. Generate complete project structures with cargo tooling, proper module organization, testing

salesforce-development

242
from aiskillstore/marketplace

Expert patterns for Salesforce platform development including Lightning Web Components (LWC), Apex triggers and classes, REST/Bulk APIs, Connected Apps, and Salesforce DX with scratch orgs and 2nd generation packages (2GP). Use when: salesforce, sfdc, apex, lwc, lightning web components.

rust-pro

242
from aiskillstore/marketplace

Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.

rust-async-patterns

242
from aiskillstore/marketplace

Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.

python-fastapi-development

242
from aiskillstore/marketplace

Python FastAPI backend development with async patterns, SQLAlchemy, Pydantic, authentication, and production API patterns.