LLM Skills
~/catalogue/architecture logicielle//SKILL

Architecture épurée

/SKILL

Organiser le logiciel autour de la règle de dépendance : les dépendances du code source s'étendent de l'extérieur vers l'intérieur, des frameworks aux cas d'utilisation, puis aux entités.

wondelaiwondelai
1.7k
17 juin 2026
MIT License
// contenu du skill

name: clean-architecture

description: 'Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to entities. Use when the user mentions "architecture layers", "dependency rule", "ports and adapters", "hexagonal architecture", "use case boundary", "onion architecture", "screaming architecture", or "framework independence". Also trigger when decoupling business logic from databases or frameworks, defining module boundaries, or debating where to put business rules. Covers component principles, boundaries, and SOLID. For code quality, see clean-code. For domain modeling, see domain-driven-design.'

license: MIT

metadata:

author: wondelai

version: "1.2.0"


Clean Architecture Framework

A disciplined approach to structuring software so that business rules remain independent of frameworks, databases, and delivery mechanisms. Apply these principles when designing system architecture, reviewing module boundaries, or advising on dependency management.

Core Principle

Source code dependencies must point inward — toward higher-level policies. Nothing in an inner circle can know anything about an outer circle. This single rule produces systems that are testable and independent of frameworks, UI, database, and any external agency. Business rules are what matter; databases, web frameworks, and delivery mechanisms are details — when details depend on policies, you can defer decisions, swap implementations, and test business logic in isolation.

Scoring

Goal: 10/10. Rate any architecture 0-10 against the principles below. Report the current score and the specific improvements needed to reach 10/10.

1. Dependency Rule and Concentric Circles

Core concept: Organize the architecture as concentric circles — Entities (enterprise business rules) innermost, then Use Cases (application business rules), then Interface Adapters, with Frameworks and Drivers outermost. Source code dependencies always point inward.

Why it works: When high-level policies don't depend on low-level details, you can swap the database, web framework, or API style without touching business logic — the system becomes resilient to the most volatile parts of the stack.

Key insights:

  • Inner circles cannot mention outer circle names — no classes, functions, variables, or data formats from outside
  • Data crossing a boundary must be in the form most convenient for the inner circle, never dictated by the outer
  • Dependency Inversion (interfaces defined inward, implemented outward) is the mechanism that enforces the rule
  • The number of circles is not fixed — four is typical; the rule stays the same
  • Frameworks are details, not architecture — they belong in the outermost circle

Code applications:

ContextPatternExample
Layer directionInner circles define interfaces; outer implementUserRepository interface in Use Cases; PostgresUserRepository in Adapters
Data crossingDTOs cross boundaries, not ORM entitiesUse Case returns UserResponse DTO, not an ActiveRecord model
Dependency directionImport arrows always point inwardController imports Use Case; Use Case never imports Controller

See: references/dependency-rule.md

2. Entities and Use Cases

Core concept: Entities encapsulate enterprise-wide business rules — rules that would exist even without software. Use Cases contain application-specific rules that orchestrate the flow of data to and from Entities.

Why it works: Separating what the business does (Entities) from how the application orchestrates it (Use Cases) lets you reuse Entities across applications and change application behavior without altering core business rules.

Key insights:

  • Entities are not database rows — they are objects or pure functions encapsulating critical business rules
  • Use Cases accept Request Models and return Response Models — never framework objects
  • Each Use Case is a single application operation (CreateOrder, ApproveExpense)
  • The Interactor pattern: a Use Case class implements an input boundary interface and calls an output boundary interface
  • Changes to a Use Case should never affect an Entity; Entity changes may ripple to Use Cases

Code applications:

ContextPatternExample
Entity designCritical business rules, zero framework dependenciesOrder.calculateTotal() applies tax rules; knows nothing about HTTP
Request/ResponseSimple data structures cross the boundaryCreateOrderRequest { items, customerId } — no ORM models
Single responsibilityOne Use Case per operationPlaceOrder, CancelOrder, RefundOrder as separate classes
InteractorImplements Input Port, calls Output PortPlaceOrderInteractor implements PlaceOrderInput

See: [references/entities-use-cases.md](references/enti

// source originale publique
wondelai/skills
/clean-architecture/SKILL.md
Licence : MIT License
Projet indépendant, non affilié à Anthropic. Ce skill reste la propriété de son auteur original.
// installer ce skill
Collez cette commande dans votre terminal à la racine de votre projet :
mkdir -p .claude/commands && curl -o ".claude/commands/SKILL.md" "https://raw.githubusercontent.com/wondelai/skills/main/clean-architecture/SKILL.md"
Ensuite dans Claude Code, tapez /SKILL pour l'activer.
open_in_newVoir la source originale
// sauvegarder
Sauvegarde disponible après connexion.
loginSe connecter pour sauvegarder
// informations
Créateurwondelai
Étoiles 1.7k
LicenceMIT License
Mis à jour17 juin 2026
Format.md
AccèsGratuit
// similaires

Skills Architecture logicielle

Voir toutarrow_forward