# Craft Domain Structure

> Crafting Domain Structure. Mini-Laravel-app per domain.

- Skill: `attac-t/craft-domain-structure` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add attac-t/craft-domain-structure`
- Raw SKILL.md: https://api.skillmd.com/api/skills/attac-t/craft-domain-structure/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: attac-t (https://skillmd.com/u/attac-t)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/attac-t/craft-domain-structure

---


# Skill: Craft Domain Structure

> "Each domain is a mini-Laravel app with its own internal structure."

## The Standard

1. **Consistent Structure**: Every domain follows the same internal layout.
2. **Actions First**: Actions are the primary entry point to domain logic.
3. **Models Close**: Model, states, query builder—co-located.
4. **Events Explicit**: Domain events in `Events/`, not generic Laravel events.

## The Anti-Patterns

| ❌ Don't                   | ✅ Do                         | Why                         |
|---------------------------|------------------------------|-----------------------------|
| Flat domain folder        | Organized subfolders         | Findable, scalable          |
| Inconsistent structure    | Same layout everywhere       | Predictable                 |
| Services folder           | Actions folder               | Clear naming                |
| Global events             | Domain-specific events       | Bounded context             |

## Real-World Examples

See [examples.md](examples.md).

