CtrlK
BlogDocsLog inGet started
Tessl Logo

pantheon-ai/design-principles

Strategic architecture, tactical design, and testable code principles (SOLID, Clean Architecture, Design Patterns, Testable Design)

97

Quality

97%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

comp-screaming-architecture.mdclean-architecture/references/

title:
Structure Should Scream the Domain Not the Framework
impact:
HIGH
impactDescription:
enables understanding at a glance, reveals intent
tags:
comp, screaming-architecture, structure, domain

Structure Should Scream the Domain Not the Framework

The folder structure should communicate what the system does, not what framework it uses. Looking at the top-level directories should reveal the business domain.

Incorrect (framework-oriented structure):

src/
├── controllers/
│   ├── UserController.ts
│   ├── OrderController.ts
│   └── ProductController.ts
├── services/
│   ├── UserService.ts
│   ├── OrderService.ts
│   └── ProductService.ts
├── repositories/
│   ├── UserRepository.ts
│   ├── OrderRepository.ts
│   └── ProductRepository.ts
├── models/
│   ├── User.ts
│   ├── Order.ts
│   └── Product.ts
└── utils/
    └── helpers.ts

# This screams "MVC framework" not "e-commerce system"

Correct (domain-oriented structure):

src/
├── ordering/
│   ├── domain/
│   │   ├── Order.ts
│   │   ├── OrderLine.ts
│   │   └── OrderStatus.ts
│   ├── application/
│   │   ├── PlaceOrderUseCase.ts
│   │   ├── CancelOrderUseCase.ts
│   │   └── ports/
│   │       ├── OrderRepository.ts
│   │       └── PaymentGateway.ts
│   └── infrastructure/
│       ├── PostgresOrderRepository.ts
│       └── StripePaymentGateway.ts
├── inventory/
│   ├── domain/
│   ├── application/
│   └── infrastructure/
├── customers/
│   ├── domain/
│   ├── application/
│   └── infrastructure/
└── shared/
    └── kernel/
        ├── Money.ts
        └── EntityId.ts

# This screams "e-commerce with ordering, inventory, customers"

Benefits:

  • New developers understand the domain immediately
  • Related code lives together, enabling focused changes
  • Frameworks become implementation details, not organizing principles

Reference: Screaming Architecture

clean-architecture

SKILL.md

tile.json