rust-code-organization

Official

Structure Rust code with clear modules.

Authorgar-ai
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Rust projects often suffer from tangled module layouts and unclear public APIs, making maintenance and onboarding difficult. This Skill provides patterns for organizing code by domain, using traits to abstract behavior, and employing newtypes to prevent type confusion, enabling safer, more maintainable codebases.

Core Features & Use Cases

  • Module Structure: organize code by feature or domain rather than by type, with clearly defined module boundaries.
  • Traits for Abstraction: define behavior as traits to enable flexible, testable implementations.
  • Builder Pattern: use builders to construct complex configurations in a safe, readable way.
  • Newtype Pattern: wrap primitive types to enforce type safety across APIs.
  • Function Composition: compose small, reusable functions to build complex logic.
  • Extension Traits: add methods to existing types without altering their definitions.
  • Guidelines: recommend module visibility rules, trait usage, and minimal public API surfaces.
  • Examples: references to typical directory layouts and patterns such as module/mod.rs, cfg attributes, and public exports.

Quick Start

Refactor or scaffold a Rust project to use modular modules, trait abstractions, and newtypes for clean APIs.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: rust-code-organization
Download link: https://github.com/gar-ai/mallorn/archive/main.zip#rust-code-organization

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.