solid-rust
/solid-rust
Pomaga pisać i refaktoryzować kod Rust z warstwami src/modules/[feature]/ i interfejsami w traits.rs według SOLID, z plikami w limicie FUSE_SOLID_MAX_LINES.
- Autor
- fusengine ↗
- Repozytorium
- agents ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 12.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 14
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 12.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pomaga pisać i refaktoryzować kod Rust z warstwami src/modules/[feature]/ i interfejsami w traits.rs według SOLID, z plikami w limicie FUSE_SOLID_MAX_LINES.
Oryginalny opis (EN)
Use when writing or refactoring Rust code, structuring src/modules/[feature]/ layers, or defining traits.rs interfaces (SOLID, files within FUSE_SOLID_MAX_LINES).
Jak działa
- Agent Workflow (MANDATORY)
- DRY - Reuse Before Creating (MANDATORY)
- Architecture (Modules MANDATORY)
- Critical Rules (MANDATORY)
- Reference Guide
- Forbidden
Podgląd SKILL.md
---
name: solid-rust
description: "Use when writing or refactoring Rust code, structuring src/modules/[feature]/ layers, or defining traits.rs interfaces (SOLID, files within FUSE_SOLID_MAX_LINES)."
versions:
rust: "2024"
user-invocable: true
references: references/solid-principles.md, references/single-responsibility.md, references/open-closed.md, references/liskov-substitution.md, references/interface-segregation.md, references/dependency-inversion.md, references/architecture-patterns.md, references/templates/module.md, references/templates/service.md, references/templates/trait-def.md, references/templates/handler.md, references/templates/error.md, references/templates/test.md
related-skills: solid-detection
---
<objective>
SOLID Rust enforces a modular architecture for Rust 2024 edition: every feature lives under `src/modules/[feature]/` (handlers.rs, services.rs, repository.rs, traits.rs, models.rs) with shared code in `src/core/`, traits live only in `traits.rs` or `src/core/traits/`, generics use trait bounds instead of concrete types, `thiserror` handles custom errors, and every public item carries a rustdoc `///` comment.
Before writing any new code it requires a DRY check against `src/core/services` and `src/core/traits`. See `solid-principles.md` for the overview, the per-principle references for SRP/OCP/LSP/ISP/DIP detail, and the templates for module/service/trait/handler/error/test scaffolding.
</objective>
# SOLID Rust - Modular Architecture
## Agent Workflow (MANDATORY)
Before ANY implementation, spawn 3 agents in parallel, one `Agent` call each with a `name`:
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)
| Layer | Location |
|-------|----------|
| Handlers | `src/modules/[feature]/handlers.rs` |
| Services | `src/modules/[feature]/services.rs` |
| Repositories | `src/modules/[feature]/repository.rs` |
| Traits | `src/modules/[feature]/traits.rs` |
| Models | `src/modules/[feature]/models.rs` |
| Shared | `src/core/{services,traits,models}/` |
**NEVER use flat `src/` structure - always `src/modules/[feature]/`**
---
## Critical Rules (MANDATORY)
| Rule | Value |
|------|-------|
| File limit | `FUSE_SOLID_MAX_LINES` |
| Handlers | Thin, 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 |
---
## Reference Guide
### Concepts
| Topic | Reference | When to consult |
|-------|-----------|-----------------|
| **SOLID Overview** | [solid-principles.md](references/solid-principles.md) | Quick reference |
| **SRP** | [single-responsibility.md](references/single-responsibility.md) | Fat structs |
| **OCP** | [open-closed.md](references/open-closed.md) | Adding impls |
| **LSP** | [liskov-substitution.md](references/liskov-substitution.md) | Trait contracts |
| **ISP** | [interface-segregation.md](references/interface-segregation.md) | Fat traits |
| **DIP** | [dependency-inversion.md](references/dependency-inversion.md) | Generics/DI |
| **Architecture** | [architecture-patterns.md](references/architecture-patterns.md) | Modular crate |
### Templates
| Template | When to use |
|----------|-------------|
| [module.md](references/templates/module.md) | Feature module structure |
| [service.md](references/templates/service.md) | Business logic service |
| [trait-def.md](references/templates/trait-def.md) | Trait definition |
| [handler.md](references/templates/handler.md) | HTTP handler (Axum) |
| [error.md](references/templates/error.md) | Custom errors (thiserror) |
| [test.md](references/templates/test.md) | Unit + integration tests |
---
## Forbidden
| Anti-Pattern | Fix |
|--------------|-----|
| Files over `FUSE_SOLID_MAX_LINES` | Split by responsibility |
| 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>` |
Pliki w paczce (14)
- SKILL.md 4 KB
- references/architecture-patterns.md 10 KB
- references/dependency-inversion.md 9 KB
- references/interface-segregation.md 8 KB
- references/liskov-substitution.md 9 KB
- references/open-closed.md 8 KB
- references/single-responsibility.md 5 KB
- references/solid-principles.md 2 KB
- references/templates/error.md 10 KB
- references/templates/handler.md 9 KB
- references/templates/module.md 11 KB
- references/templates/service.md 9 KB
- references/templates/test.md 13 KB
- references/templates/trait-def.md 10 KB
Wersje
W bazie nie ma innych skilli o nazwie solid-rust.
Migawka bazy z 13.11.2026 · wersja paczki e2dc9a8e041e (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 90solid-go
Pomaga pisać i refaktoryzować kod Go z warstwami internal/modules/[feature]/ i interfejsami w ports/ według SOLID, z plikami w limicie FUSE_SOLID_MAX_LINES. - 90solid-python
Pomaga pisać i refaktoryzować kod Python z warstwami modules/[feature]/ i interfejsami opartymi na Protocol według SOLID, z plikami w limicie FUSE_SOLID_MAX_LINES. - 100rust-programming
Pomaga pisać, przeglądać i refaktoryzować kod Rust: crate'y w workspace, publiczne API, obsługę błędów, async i ownership. - 100rust-development
Podpowiada nazewnictwo, typowanie, obsługę błędów i dokumentację w Rust według oficjalnych wytycznych przy pisaniu i refaktoryzacji. - 100rust-pro
Pomaga pisać i przeglądać kod Rust, w tym projekty Cargo, zmiany własności i pożyczek, async, traity, błędy, uwagi clippy i testy. - 100rust-patterns
Podaje idiomatyczne wzorce Rust: własność, obsługę błędów, cechy, współbieżność i dobre praktyki przy pisaniu lub przeglądzie kodu.