rust-architecture

Guide Rust workspace and crate structuring with trade-off-based reasoning.

1|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/NakaSato/gridtokenx-iam-service --skill rust-architecture-nakasato
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-architecture
Source: https://github.com/NakaSato/gridtokenx-iam-service/tree/main
Command: npx skills add https://github.com/NakaSato/gridtokenx-iam-service --skill rust-architecture-nakasato

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you design and refactor Rust project structure so your workspace, crate boundaries, and layering match your scale and constraints, instead of following a template that later becomes painful.

Core Features & Use Cases

  • Modular workspace planning: Choose between single-crate, multi-crate workspace, modular monolith, or microservices based on concrete drivers like team size, deployment independence, and runtime targets.
  • Layering and dependency direction: Apply an explicit acyclic layering model so domain code stays isolated from adapters and infrastructure.
  • Crate and module organization guidance: Select conventions for directory layout, module declaration style, error strategy (thiserror/anyhow/hybrid), and async boundaries (sync core vs async edges).
  • Refactor decision support: Diagnose common failure modes (e.g., crate sprawl, accidental “common” crates, async in pure logic, visibility mismatches) and propose the lowest-cost fix.

Quick Start

Ask the skill to review your current Rust layout and recommend a target workspace/crate structure based on your codebase size, number of binaries, and desired deployment boundaries.

Frequently Asked Questions about rust-architecture

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

FAQPage Schema
How do I structure a Rust workspace with multiple crates for a growing project?

To structure a Rust workspace, you need a virtual manifest and clear dependency direction layering. This skill helps you split modules into crates based on concrete drivers like team size and deployment independence to ensure maintainable growth.

What's the best way to organize Rust module organization when refactoring a monolith?

Organizing Rust module organization during a monolith refactor requires diagnosing failure modes like crate sprawl and accidental common crates. This skill provides trade-off-based reasoning to propose the lowest-cost fix for your directory layout and visibility boundaries.

How do I choose between anyhow and thiserror for Rust error handling across crate boundaries?

Choosing between anyhow and thiserror for Rust error handling depends on your layering model. This skill helps you select a hybrid error strategy that keeps domain code isolated from adapters and infrastructure.

When do I need to separate sync core from async edges in my Rust architecture?

You need to separate sync core from async edges to prevent async from polluting pure logic. This skill diagnoses accidental async in pure logic and helps you choose the right sync-core/async-edge boundaries for your runtime targets.

Can I split a large Rust service into crates without creating accidental common dependencies?

Splitting a large Rust service into crates often risks accidental common crates and dependency cycles. This skill applies an explicit acyclic layering model to ensure crate boundaries match your scale constraints without visibility mismatches.

Does Rust workspace architecture support planning for future microservices?

Rust workspace architecture supports planning for future microservices by choosing between a modular monolith or split crates based on deployment independence. This skill guides trade-off decisions to structure modules for maintainable growth and runtime targets.