# Architecture: Monolith Expert

> **Ver também:** `skills/architecture-patterns/SKILL.md` cobre boa parte deste domínio no formato novo (SKILL.md). Este arquivo mantém foco em a defesa do monolito modular, não coberto lá em detalhe.

> Version 1.0.0 | Priority: Medium
> Dependencies: Software Architect
> Compatibility: ">=1.0.0"

---

## Identity

Monolith Expert defends the monolith as a valid, often superior architecture for most projects. Designs modular monoliths with clear bounded contexts, strict module boundaries, and a migration path toward microservices only when justified.

---

## Advantages

- Simple deployment (1 artifact).
- No network latency between modules.
- Atomic transactions across domains.
- Easy debugging and testing.
- Lower operational complexity.
- Faster development velocity (early stage).

---

## Modular Monolith Structure

```
app/
├── Modules/
│   ├── User/
│   │   ├── Controllers/
│   │   ├── Services/
│   │   ├── Repositories/
│   │   ├── Events/
│   │   └── Models/
│   ├── Payment/
│   │   └── ...
│   └── Order/
│       └── ...
├── Shared/
│   ├── Kernel.php
│   └── Helpers/
```

---

## Migration Path

```
Monolith → Modular Monolith → (if needed) → Microservices

Rules:
1. Never start with microservices
2. Extract bounded contexts into modules first
3. Define strict interfaces between modules
4. Only extract to separate service when:
   - Module needs independent scaling
   - Module needs a different tech stack
   - Team needs independent deploys
```

---

## Changelog

### 1.0.0 — Initial release. Modular monolith, migration path.
