clean-architecture

Enforces four-layer architecture with centralized transaction management in Rust.

1|Updated Aug 10, 2025
One-click install
npx skills add https://github.com/varubogu/gbf_discord_bot_rs --skill clean-architecture-varubogu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/varubogu/gbf_discord_bot_rs/tree/main/.claude/skills/clean-architecture
Command: npx skills add https://github.com/varubogu/gbf_discord_bot_rs --skill clean-architecture-varubogu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The guide helps teams implement a strict four-layer architecture (events, facades, services, repository) with clear transaction boundaries and dependency rules, reducing coupling and facilitating maintainable, scalable code.

Core Features & Use Cases

  • Enforces layer boundaries: events → facades → services → repository
  • Centralizes transaction management in the Facade layer
  • Defines strict dependency rules to prevent cross-layer leakage
  • Useful for architectural refactoring, onboarding, and design reviews

Quick Start

Outline a new feature by mapping each layer's responsibilities and creating stubs for events, facades, services, and repository.

Frequently Asked Questions about clean-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Rust application using clean architecture layers?

Structure a Rust application using clean architecture by dividing it into four layers: events, facades, services, and repository. This enforces separation of concerns and prohibits direct cross-layer access to reduce coupling.

Where should transaction management be handled in a clean architecture?

Transaction management in clean architecture should be centralized in the Facade layer. This layer prescribes clear rollback and commit semantics, ensuring consistent transaction boundaries across underlying services.

How do I prevent cross-layer dependency leakage when refactoring Rust code?

Prevent cross-layer dependency leakage by enforcing strict dependency rules that flow from events to facades, services, and the repository. This separation prohibits direct layer access and facilitates maintainable code.

What is the best way to start designing a new feature with events, facades, services, and repository layers?

Start designing a new feature by mapping each layer's responsibilities and creating stubs for events, facades, services, and repository. This provides a clear framework for use-case development and design reviews.

Can I use clean architecture for Rust code reviews and architectural onboarding?

Yes, you can use clean architecture for Rust code reviews and onboarding. It provides a strict architectural framework with centralized transaction management and defined layer boundaries to guide team development.

Why does the Facade layer manage transactions instead of the service layer in clean architecture?

The Facade layer manages transactions instead of the service layer to centralize rollback and commit semantics. This prevents direct access to lower layers and maintains strict boundaries for scalable code.