rust-development
Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration
Best use case
rust-development is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Rust development best practices for the Guts project - idiomatic code, error handling, async patterns, and commonware integration
Teams using rust-development should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/rust-development/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How rust-development Compares
| Feature / Agent | rust-development | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/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.
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 optimizingRelated Skills
zero-trust-config-helper
Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.
managing-autonomous-development
Enables Claude to manage Sugar's autonomous development workflows. It allows Claude to create tasks, view the status of the system, review pending tasks, and start autonomous execution mode. Use this skill when the user asks to create a new development task using `/sugar-task`, check the system status with `/sugar-status`, review pending tasks via `/sugar-review`, or initiate autonomous development using `/sugar-run`. It provides a comprehensive interface for interacting with the Sugar autonomous development system.
overnight-development
Automates software development overnight using git hooks to enforce test-driven Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.
rust-mcp-server-generator
Generate a complete Rust Model Context Protocol server project with tools, prompts, resources, and tests using the official rmcp SDK
ros2-development
Comprehensive best practices, design patterns, and common pitfalls for ROS2 (Robot Operating System 2) development. Use this skill when building ROS2 nodes, packages, launch files, components, or debugging ROS2 systems. Trigger whenever the user mentions ROS2, colcon, rclpy, rclcpp, DDS, QoS, lifecycle nodes, managed nodes, ROS2 launch, ROS2 parameters, ROS2 actions, nav2, MoveIt2, micro-ROS, or any ROS2-era robotics middleware. Also trigger for ROS2 workspace setup, DDS tuning, intra-process communication, ROS2 security, or deploying ROS2 in production. Also trigger for colcon build issues, ament_cmake, ament_python, CMakeLists.txt for ROS2, package.xml dependencies, rosdep, workspace overlays, custom message generation, or ROS2 build troubleshooting. Covers Humble, Iron, Jazzy, and Rolling distributions.
ros1-development
Best practices, design patterns, and common pitfalls for ROS1 (Robot Operating System 1) development. Use this skill when building ROS1 nodes, packages, launch files, or debugging ROS1 systems. Trigger whenever the user mentions ROS1, catkin, rospy, roscpp, roslaunch, roscore, rostopic, tf, actionlib, message types, services, or any ROS1-era robotics middleware. Also trigger for migrating ROS1 code to ROS2, maintaining legacy ROS1 systems, or building ROS1-ROS2 bridges. Covers catkin workspaces, nodelets, dynamic reconfigure, pluginlib, and the full ROS1 ecosystem.
docker-ros2-development
Best practices for Docker-based ROS2 development including multi-stage Dockerfiles, docker-compose for multi-container robotic systems, DDS discovery across containers, GPU passthrough for perception, and dev-vs-deploy container patterns. Use this skill when containerizing ROS2 workspaces, setting up docker-compose for robot software stacks, debugging DDS communication between containers, configuring NVIDIA Container Toolkit for GPU workloads, forwarding X11/Wayland for rviz2 and GUI tools, or managing USB device passthrough for cameras and serial devices. Trigger whenever the user mentions Docker with ROS2, docker-compose for robots, Dockerfile for colcon workspaces, container networking for DDS, GPU containers for perception, devcontainer for ROS2, multi-stage builds for ROS2, or deploying ROS2 in containers. Also trigger for CI/CD with Docker-based ROS2 builds, CycloneDDS or FastDDS configuration in containers, shared memory in Docker, or X11 forwarding for rviz2. Covers Humble, Iron, Jazzy, and Rolling distributions across Ubuntu 22.04 and 24.04 base images.
apify-actor-development
Develop, debug, and deploy Apify Actors - serverless cloud programs for web scraping, automation, and data processing. Use when creating new Actors, modifying existing ones, or troubleshooting Actor code.
docker-development
Docker and container development agent skill and plugin for Dockerfile optimization, docker-compose orchestration, multi-stage builds, and container security hardening. Use when: user wants to optimize a Dockerfile, create or improve docker-compose configurations, implement multi-stage builds, audit container security, reduce image size, or follow container best practices. Covers build performance, layer caching, secret management, and production-ready container patterns.
vue-development-guides
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
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
WooCommerce store development workflow covering store setup, payment integration, shipping configuration, and customization.