event-sourcing

event-sourcing is a skill for Claude Code, Codex from garrettw/php-arch-skills. It costs 86 tokens per session (2,639 once invoked), scanned A, original, MPL-2.0.

A PHP development guide for Event Sourcing, a way to record every change as an event and rebuild current data from that history.

In plain words
What is it for?
It supports work with event stores, aggregates, projections, snapshots, event replay, temporal queries, CQRS, and PHP Event Sourcing libraries.
Why use it?
It helps decide when the extra complexity is justified and how to handle complete history, past-state queries, or replaying changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It supports work with event stores, aggregates, projections, snapshots, event replay, temporal queries, CQRS, and PHP Event Sourcing libraries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/garrettw/php-arch-skills/event-sourcing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add garrettw/php-arch-skills --skill event-sourcing
Clone the repo
git clone --depth 1 https://github.com/garrettw/php-arch-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for event-sourcing

README.md
[![agentmods](https://agentmods.dev/badge/skills/garrettw/php-arch-skills/event-sourcing/github.svg)](https://agentmods.dev/skills/garrettw/php-arch-skills/event-sourcing)
Your own site
<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/event-sourcing"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/event-sourcing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for event-sourcing

Your own site · 80×15
<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/event-sourcing"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/event-sourcing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00086 $0.02639
Opus 5 $0.00043 $0.01319
Sonnet 5 $0.00017 $0.00528
Haiku 4.5 $0.00009 $0.00264

Measured 9d ago against content hash fa305501ec85, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

event-sourcing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/event-sourcing/SKILL.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Event Sourcing for PHP Applications

Event Sourcing is a state-management pattern where every change to application state is captured as an immutable sequence of events. The event log is the single source of truth; current state is derived by replaying events.

Event Sourcing is not: event-driven development, microservices, CQRS, or eventual consistency. Those are related but separate concerns that may coexist with Event Sourcing.

Event Sourcing naturally enables CQRS because the write model is the event stream and projections are the read models. But CQRS is optional.

When to Use Event Sourcing (and When NOT to)

Event Sourcing adds significant complexity. Use it only when you need its specific capabilities.

Use Event Sourcing For Use CRUD / Domain Events For
Audit requirements (complete history of every change) Simple audit logs or domain events
Temporal queries (state at any point in time) Current-state-only queries
Event replay for debugging or parallel testing Standard integration tests
Retrocactive corrections (fix past events and replay) Direct data corrections
Parallel models / multiple read projections from one stream Single read model
High scalability with event-driven architecture Standard request/response

Start without Event Sourcing. Introduce it only when you have a concrete need for audit trails, temporal queries, or replay. Most systems do not need it.

Core Concepts

Read the full file on GitHub · 148 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 148 lines · 86 tokens per session scan A fa305501ec85

Subscribe to this mod's changes

event-sourcing is a skill published in the GitHub repository garrettw/php-arch-skills (12 stars, last pushed 1mo ago), licensed MPL-2.0. It adds 86 tokens to every session and 2,639 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

laravel

Laravel mastery skill. Eloquent ORM, service container, queues, events, Sanctum/Passport auth, Pest testing. Triggers on: /godmode:laravel, "laravel app", "eloquent", "artisan", "blade".

arbazkhan971/godmode · 52 tokens

bun-api

Bun runtime API reference for TypeScript scripts. Covers Bun.serve() HTTP/HTTP/2 server with routes and WebSockets, fetch() transport options, Bun.file(), Bun.write(), Bun.$() shell, Bun.spawn(), Bun.Glob, Bun.env, bun:sqlite, Bun.sql() for PostgreSQL/MySQL via DATABASEURL, Bun.s3 for S3-compatible storage, Bun.redis…

dmythro/agent-skills · 250 tokens

bitrix-console-commands

Covers Bitrix CLI tools — php bitrix/bitrix.php, generators make:module/make:controller/make:tablet/make:entity/make:service/make:event/make:eventhandler/make:message/make:messagehandler/make:component/make:request, kernel commands (orm:annotate, messenger:consume, translate:index, update:, dev:locator-codes…

bxmaximum/bitrix-framework-skills · 155 tokens

bitrix-http-client

Covers Bitrix\Main\Web\HttpClient HTTP client — legacy mode and PSR-18 (sendRequest), async Promise, proxies/timeouts, httpclientoptions, main.HttpClient logger, SSRF, redirects, and GeoIp\Manager lookups. Applied in external API integrations, webhooks, async calls and geolocation. Key terms — HttpClient, PSR-18…

bxmaximum/bitrix-framework-skills · 96 tokens

bitrix-request-response

HttpRequest/HttpResponse, Json/AjaxJson/Redirect, Uri, UuidGenerator. Use instead of $GET/$POST and raw headers.

bxmaximum/bitrix-framework-skills · 36 tokens

bitrix-components

Bitrix components: class.php, templates, cache, SEF, Controllerable AJAX. Use when building or editing components.

bxmaximum/bitrix-framework-skills · 29 tokens