# Application Architecture Standard

> Defines structural rules for Laravel architecture, layering, and code organization

- Skill: `bottelet/application-architecture-standard` (Agent Skill)
- Install (CLI): `npx skillmds@latest add bottelet/application-architecture-standard`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bottelet/application-architecture-standard/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bottelet (https://skillmd.com/u/bottelet)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bottelet/application-architecture-standard

---


# Purpose

Single source of truth for application structure and architectural boundaries.

---

# 1. Layering Rules

## Presentation Layer
- Controllers
- Form Requests (validation only)

No business logic allowed.

## Application Layer
- Services
- DTOs
- Transformers

Holds all business logic orchestration.

## Domain Layer
- Models
Represents state and invariants only.

## Infrastructure Layer
- API clients
- External services

Must be replaceable and contain no business logic.

---

## 2. Service Rules

- Business logic lives in services.
- Services must remain framework-agnostic except for Laravel infrastructure (Eloquent, DB transactions, HTTP client, logging).
- No view/UI concerns inside services.
- DTOs are used for structured data transfer where transformation, validation, or reuse is required.
- They are optional for internal service calls when validated arrays are sufficient.

---

# 3. Dependency Rules

- Constructor injection only
- No service locators
- No hidden dependencies

---

# 4. Architecture Integrity

- No cross-layer leakage
- Strict separation of concerns
- Refactoring must preserve behavior

