rust-design
Skill0 starsChanged 2 months agoMITView on GitHub
Use when deciding or reviewing Rust CLI responsibilities, module boundaries, or abstractions for a concrete change.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rust-buildSkill
- rust-cli-interfaceSkill
- rust-cli-testingSkill
- rust-concurrencySkill
- rust-debuggingSkill
- rust-distributionSkill
- rust-errorsSkill
- rust-filesystemSkill
- rust-idiomaticSkill
- rust-implementSkill
- rust-ioSkill
- rust-memorySkill
- rust-performanceSkill
- rust-processesSkill
- rust-testingSkill
The file
Files
Rust Design
Design for cohesion: each rule has a natural home, and callers need little knowledge of its implementation. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open.
Trace arguments and configuration through the operation to output and effects. Keep parsing, useful computation, and process-level decisions distinguishable where their contracts differ. A small command can remain a small program; introduce modules or a library target when they provide useful ownership, reuse, or test access.
Prefer concrete types, functions, and explicit dependencies. Use traits for real capabilities or variation, not a counterpart for every struct. Standard Read and Write boundaries often provide sufficient flexibility. Choose generics or dynamic dispatch for the actual caller relationship; account for monomorphized code size and dispatch costs when relevant, without blanket bans on either.
Let types express meaningful invariants and ownership. Keep lifetime parameters local where possible. Avoid self-referential structures, global mutable state, or Arc and Mutex merely to simplify wiring. A builder or configuration layer needs enough real choices to justify its cost.
Evaluate a boundary by the knowledge it removes from callers. Centralize shared policy while preserving independent reasons to change. Keep allocation and effect ownership explainable across the retained boundaries.
For analysis or review, make no edits. Anchor each material finding in the affected code, caller, and requirement or concrete maintenance cost; explain the smallest justified correction. Distinguish a contract violation from a design heuristic. A named smell alone is not a defect, and a review need not manufacture findings.
For requested refactoring, preserve output, failures, ordering, mutation, and resource lifetime. Finish when the changed responsibility has a clear owner, retained abstractions earn their cost, and focused checks cover the behavior at risk; no separate design phase is required.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

