← ClaudeAtlas

laravel-spatie-event-sourcinglisted

Use this skill any time a user works with Laravel and event sourcing together — whether setting up spatie/laravel-event-sourcing for the first time, designing a new event-sourced domain (aggregates, events, projectors, reactors), generating code for bounded contexts, or debugging issues with AggregateRoot, StoredEvent, or projectors. Trigger on: "event sourcing" + "Laravel", spatie ES references, requests to model domain lifecycles as events, or questions about aggregate roots and projectors in PHP/Laravel. Do NOT use for: refactoring existing CRUD into ES, Laravel's built-in Event::dispatch system, CQRS without event sourcing, or non-spatie packages.
albertoarena/claude-laravel-event-sourcing · ★ 6 · Web & Frontend · score 73
Install: claude install-skill albertoarena/claude-laravel-event-sourcing
# Laravel Spatie Event Sourcing — Skill Generate event-sourced domain code for Laravel using `spatie/laravel-event-sourcing`, following a two-gate workflow: **Design first, then implement with tests**. ## Quick reference - `references/design-heuristics.md` — Event naming, aggregate boundaries, projector/reactor rules, anti-patterns - `references/adr-template.md` — ADR template for Gate 1 - `references/tdd-patterns.md` — Pest and PHPUnit test patterns - `references/commands-pattern.md` — Command + handler patterns (plain and bus-dispatched) - `references/spatie-api-cheatsheet.md` — Key Spatie ES classes and methods - `assets/templates/*.stub` — Code generation stubs ## Project bootstrap (one-time, automatic) On first invocation in a project, run `scripts/verify-setup.sh` from this skill's directory. It checks: 0. PHP 8.2+ is installed (required by `spatie/laravel-event-sourcing` v7) 1. `spatie/laravel-event-sourcing` is in `composer.json` 2. The `stored_events` and `snapshots` tables exist (migrations have run) 3. `config/event-sourcing.php` has been published 4. A test framework is installed (Pest preferred, PHPUnit fallback) If anything is missing, print the single command that fixes it and **stop**. Do not auto-install packages or run migrations on behalf of the user — they need to confirm first. If everything passes, check for `.claude/event-sourcing.md` in the project root. If it doesn't exist, ask the user **one** configuration question: > "I'll create a project