agentsclimarketplace

Solid rust

Skill fusengine/agents/plugins/solid/skills/solid-rust

SOLID principles for Rust 2024+. Files < 100 lines, traits separated, modular architecture. Modules MANDATORY. Use when: writing or refactoring Rust code, structuring src/modules/[feature]/ layers, or defining traits.rs interfaces.From its SKILL.md

Install
npx -y skills add fusengine/agents --skill solid-rust

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 22 stars22 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.8 KB, 815 tokens by cl100k_base, as published. Nobody here has run it

SOLID Rust - Modular Architecture

Agent Workflow (MANDATORY)

Before ANY implementation, use TeamCreate to spawn 3 agents:

  1. fuse-ai-pilot:explore-codebase - Analyze existing architecture
  2. fuse-ai-pilot:research-expert - Verify Rust docs via Context7
  3. fuse-ai-pilot:sniper - Post-implementation validation

DRY - Reuse Before Creating (MANDATORY)

Before writing ANY new code:

  1. Grep the codebase for similar traits, services, or logic
  2. Check shared locations: src/core/services/, src/core/traits/
  3. If similar code exists -> extend/reuse instead of duplicate
  4. If code will be used by 2+ features -> create it in src/core/

Architecture (Modules MANDATORY)

LayerLocationMax Lines
Handlerssrc/modules/[feature]/handlers.rs50
Servicessrc/modules/[feature]/services.rs100
Repositoriessrc/modules/[feature]/repository.rs100
Traitssrc/modules/[feature]/traits.rs30
Modelssrc/modules/[feature]/models.rs50
Sharedsrc/core/{services,traits,models}/-

NEVER use flat src/ structure - always src/modules/[feature]/


Critical Rules (MANDATORY)

RuleValue
File limit100 lines (split at 90)
Handlers< 50 lines, delegate to services
Traitstraits.rs or src/core/traits/ ONLY
Rustdoc/// on every public item
Error handlingUse thiserror for custom errors
GenericsUse trait bounds, not concrete types

Reference Guide

Concepts

TopicReferenceWhen to consult
SOLID Overviewsolid-principles.mdQuick reference
SRPsingle-responsibility.mdFat structs
OCPopen-closed.mdAdding impls
LSPliskov-substitution.mdTrait contracts
ISPinterface-segregation.mdFat traits
DIPdependency-inversion.mdGenerics/DI
Architecturearchitecture-patterns.mdModular crate

Templates

TemplateWhen to use
module.mdFeature module structure
service.mdBusiness logic service
trait-def.mdTrait definition
handler.mdHTTP handler (Axum)
error.mdCustom errors (thiserror)
test.mdUnit + integration tests

Forbidden

Anti-PatternFix
Files > 100 linesSplit at 90
Traits in impl filesMove to traits.rs
Box<dyn Any>Use proper trait bounds
Flat src/ structureUse src/modules/[feature]/
Unwrap in library codeUse Result<T, E>

What ships with it: 13 files

111.9 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.