laravel-spatie-event-sourcinglisted
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