← ClaudeAtlas

labrodev-actionlisted

Use when creating, reviewing, or refactoring write-side domain classes in a Labrodev Laravel project: Actions (e.g. BookingCreate, BookingUpdate, BookingRemove), domain Services, or {Model}Rule classes — including guard ordering, domain exceptions on failed gates, DB::transaction wrapping, and UUID assignment. Staged multi-step workflows live in labrodev-pipeline.
labrodev/laravel-playbook · ★ 0 · AI & Automation · score 73
Install: claude install-skill labrodev/laravel-playbook
# Actions, Services, Rules (write side) Part of the Labrodev playbook. **The law for this component lives in the always-on `labrodev-action` guideline** (musts, must-nots); the per-file checklist is `rules/actions.md`. This skill holds the craft: anatomy, canonical templates, and edge cases. This skill owns the **write side** of a domain: Actions (business use cases that mutate state), Services (reusable domain logic), and domain Rules (pure can-I checks). Staged multi-step workflows (Pipelines, Payloads, orchestrating Services) → see the labrodev-pipeline skill. ## Where gates run (two levels, one owner each) 1. **Policy level — the can-trio.** `{Model}Rule::canCreate` / `canUpdate` / `canRemove` are called from the corresponding Policy methods (`create()`, `update()`, `remove()`), so an ineligible request is rejected with 403 **before** the Action ever runs → see the labrodev-authorization skill. Actions never re-run these checks. 2. **Action level — domain invariants the Policy cannot see.** Conditions that depend on submitted input or cross-record state at write time (an overlapping period, a plan limit against the requested quantity) are guarded inside the Action, delegated to a `{Model}Rule` method, and **throw a dedicated domain exception** on failure: ```php if (! BookingRule::periodIsAvailable(bookingData: $bookingData)) { throw BookingPeriodUnavailableException::make(bookingData: $bookingData); } ``` Never `ValidationException` — that cl