Rust Architecture

Use when the user asks about Rust backend structure, Cargo workspace layout, crate boundaries, hexagonal Rust, trait-based DI or choosing axum vs actix-web. Produces a Rust service layout with error architecture. Not for tokio, serde or ownership recipes (use rust-patterns) or language basics (use lang-rust).

45 stars 6 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill rust-architecture
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/rust/architecture ~/.claude/skills/rust-architecture

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Rust Architecture

## Purpose
Structure Rust backend applications with workspace layout, type-driven design, error handling architecture, async runtime patterns, and trait-based abstraction.

## Agent Protocol

### Trigger
User request includes: `Rust project structure`, `Rust workspace`, `Rust crate layout`, `Rust error handling`, `Rust async`, `Rust traits`, `Rust architecture`, `Cargo workspace`.

### Input Context
- Rust edition (2024 for new crates, stable since Rust 1.85; 2021 for existing ones)
- Async runtime (tokio is the default choice; smol for small footprints; async-std is discontinued)
- Web framework (Actix-web, Axum, Rocket, Warp)
- Database (sqlx, diesel, sea-orm, tokio-postgres)
- Build target (Linux server, Lambda, WASM)

### Output Artifact
Workspace layout, crate structure, error type definitions, trait definitions, async main.

### Response Format
Produce artifact directly. No preamble, no postamble, no explanations.

### Completion Criteria
- Workspace with binary + library crates
- Error type implementing std::error::Error
- Trait-based repository abstraction
- Async main with tokio runtime
- Configuration via environment or config file

### Max Response Length
4096 tokens

## Architecture Decision Trees

### Async Runtime: tokio vs async-std vs smol

| Criterion | tokio | async-std | smol |
|-----------|-------|-----------|------|
| Ecosystem | Largest (axum, sqlx, tonic) | Medium | Small |
Read the full skill on GitHub

Details

Skill name
rust-architecture
Path
skills/backend/rust/architecture/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Rust Architecture skill do?

Use when the user asks about Rust backend structure, Cargo workspace layout, crate boundaries, hexagonal Rust, trait-based DI or choosing axum vs actix-web. Produces a Rust service layout with error architecture. Not for tokio, serde or ownership recipes (use rust-patterns) or language basics (use lang-rust).

How do I install the Rust Architecture skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill rust-architecture. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Rust Architecture popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Rust Patterns

45

j4flmao/agent-skills

Use when the user asks about tokio patterns, axum extractors, thiserror vs anyhow, serde, Arc<Mutex> vs RwLock, tower-http middleware or sqlx queries. Produces idiomatic async Rust backend code. Not for workspace layout (use rust-architecture).

Software Development

Ruby Rails

45

j4flmao/agent-skills

Use when the user asks about Ruby on Rails, ActiveRecord callbacks getting out of hand, service objects, Rails API mode, Active Job / Solid Queue, N+1 with includes or RSpec. Produces Rails 8 code with thin models and controllers. Not for Ruby outside Rails or Phoenix (use backend-elixir).

Software Development

Sass Machine Code

45

j4flmao/agent-skills

Use when the user asks about SASS, cuobjdump -sass, nvdisasm, warp stall reasons, long scoreboard, HMMA/HGMMA, FFMA or instruction mix in Nsight Compute. Produces annotated SASS with root cause and a source-level fix. Not for writing PTX or inline asm (use ptx-assembly) or general kernel design (use cuda-programming).

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.