plugins/solid/skills/solid-rust/SKILL.md
SOLID principles for Rust 2024+. Files < 100 lines, traits separated, modular architecture. Modules MANDATORY.
npx skillsauth add fusengine/agents solid-rustInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before ANY implementation, use TeamCreate to spawn 3 agents:
Before writing ANY new code:
src/core/services/, src/core/traits/src/core/| Layer | Location | Max Lines |
|-------|----------|-----------|
| Handlers | src/modules/[feature]/handlers.rs | 50 |
| Services | src/modules/[feature]/services.rs | 100 |
| Repositories | src/modules/[feature]/repository.rs | 100 |
| Traits | src/modules/[feature]/traits.rs | 30 |
| Models | src/modules/[feature]/models.rs | 50 |
| Shared | src/core/{services,traits,models}/ | - |
NEVER use flat src/ structure - always src/modules/[feature]/
| Rule | Value |
|------|-------|
| File limit | 100 lines (split at 90) |
| Handlers | < 50 lines, delegate to services |
| Traits | traits.rs or src/core/traits/ ONLY |
| Rustdoc | /// on every public item |
| Error handling | Use thiserror for custom errors |
| Generics | Use trait bounds, not concrete types |
| Topic | Reference | When to consult | |-------|-----------|-----------------| | SOLID Overview | solid-principles.md | Quick reference | | SRP | single-responsibility.md | Fat structs | | OCP | open-closed.md | Adding impls | | LSP | liskov-substitution.md | Trait contracts | | ISP | interface-segregation.md | Fat traits | | DIP | dependency-inversion.md | Generics/DI | | Architecture | architecture-patterns.md | Modular crate |
| Template | When to use | |----------|-------------| | module.md | Feature module structure | | service.md | Business logic service | | trait-def.md | Trait definition | | handler.md | HTTP handler (Axum) | | error.md | Custom errors (thiserror) | | test.md | Unit + integration tests |
| Anti-Pattern | Fix |
|--------------|-----|
| Files > 100 lines | Split at 90 |
| Traits in impl files | Move to traits.rs |
| Box<dyn Any> | Use proper trait bounds |
| Flat src/ structure | Use src/modules/[feature]/ |
| Unwrap in library code | Use Result<T, E> |
development
Use when optimizing entity-based / semantic SEO 2026. Covers entity maps, Google Knowledge Graph resolution, salience scoring, passage-level ranking, about/sameAs/knowsAbout schema, Cloud Natural Language API validation.
development
Use when running SEO, GEO, schema, Core Web Vitals, sitemap, hreflang, E-E-A-T, AI Overviews, technical SEO, or structured data tasks. Covers full-site audits, single-page analysis, schema markup, content quality, AI search optimization, local SEO, sitemap/robots, internal linking, semantic clustering, and search experience.
development
Use when optimizing search experience (SXO). Covers intent matching, user personas, user stories, page-type analysis, dwell time, scroll depth, pogo-sticking prevention.
development
Use when optimizing local SEO. Covers Google Business Profile, NAP consistency, citations, reviews acquisition, Local Pack ranking, location pages, LocalBusiness schema.