event-sourcing
Skill0 starsChanged 6 days agoMITView on GitHub
Use when designing a system where state-change history matters — audit, replay, temporal queries, debugging, or telemetry provenance. Record every change as an immutable domain event and derive state from the log; guard external side effects during replay.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- conjurer-rich/skillstheir own version, first seen Oct 25, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- eralmansouri/skillstheir own version, first seen Oct 6, 2026
- garrettw/php-arch-skillstheir own version, first seen Jul 17, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- G1Joshi/Agent-Skills★ 15same name
- garrettw/php-arch-skills★ 13same name
- eralmansouri/skills★ 9same name
- conjurer-rich/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository108 other files it gives its agents.
- adaptive-estimationSkill
- adaptive-loop-budgetingSkill
- adopt-and-deleteSkill
- adversarial-reviewSkill
- agent-drives-uiSkill
- agentic-coding-loopSkill
- agent-otel-trajectorySkill
- agents-as-iac-modulesSkill
- ascii-ui-mockupsSkill
- authoring-html-emailSkill
- authoring-skills-vs-mcpSkill
- batched-ssh-enumerationSkill
- c4-architectureSkill
- challenge-the-premiseSkill
- codegraph-bootstrapSkill
- codegraph-worktree-startupSkill
- colocated-pod-tolerationsSkill
- command-creatorSkill
- complexity-budgetsSkill
- connector-readinessSkill
- context-anchored-patchingSkill
- continuous-issue-resolutionSkill
- credential-proxySkill
- criticality-tiered-reportingSkill
- data-connector-buildingSkill
- declarative-firstSkill
- disk-pressure-forensicsSkill
- early-return-over-elseSkill
- email-triageSkill
- enums-codify-behaviorSkill
- ephemeral-workspace-lifecycleSkill
- evidence-claim-boundariesSkill
- exhaustive-matchSkill
- feature-coverage-not-just-line-coverageSkill
- full-disk-forensicsSkill
- gate-before-pushSkill
- github-pr-shepherdingSkill
- graceful-shutdown-stateful-agentsSkill
- grounded-generationSkill
- iac-incident-responseSkill
- iac-not-ad-hocSkill
- instrumented-service-scaffoldSkill
- interface-over-conditionalsSkill
- knowledge-routingSkill
- lean-on-oss-standardsSkill
- live-money-disciplineSkill
- live-state-verificationSkill
- loop-governance-and-learningSkill
- low-level-executor-task-specSkill
- map-dispatch-over-conditionalsSkill
- merge-conflict-disciplineSkill
- mermaid-diagramsSkill
- oke-arc-runners-opentofuSkill
- orchestrate-agySkill
- orchestrate-claudeSkill
- orchestrate-codexSkill
- orchestrate-geminiSkill
- otel-emit-at-willSkill
- parameter-designSkill
- parse-dont-validateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Events are append-only facts: Never edit or delete one. Correct a mistake with a compensating event, the way accountants correct a ledger.
- Distinctive: line 41
Prefer plain state storage in those cases.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Event Sourcing
Most systems store only current state, so every update destroys the history of how it got there. Event sourcing inverts that: capture every change to application state as an event object, append it to an immutable log, and make that log the system of record. Current state becomes a derivation — you can throw it away and rebuild it by replaying the events. When history, auditability, or "what did the system believe at time T?" matters, store the events, not just the outcome.
Building blocks
- Command — a request to change state. It may be rejected; it is not a fact.
- Domain event — an immutable, past-tense fact recorded once a change happens (
order-placed,quota-exceeded). Events are the only way state changes enter the system: process an update by creating an event object and running it through the same processing logic on live handling and on replay. Name events in domain terms, carry enough data to reprocess them, and timestamp both occurrence and recording. - Projection (working copy) — any state derived from the log: the current-state view, a report table, a cache. Projections are disposable and rebuildable; consumers read projections and never need to understand the raw log.
What the log buys you
- Complete rebuild — discard corrupted or redesigned state and re-derive it from the log.
- Temporal query — determine the state as of any past moment by replaying events up to it.
- Replay debugging — reproduce an incident by replaying the exact event sequence into a test copy; fix the handler, replay again.
- Audit — the log is the audit trail, not a bolted-on shadow of it.
Rules that keep it sound
- Events are append-only facts. Never edit or delete one. Correct a mistake with a compensating event, the way accountants correct a ledger.
- Guard external side effects during replay. Replaying
payment-authorizedmust not charge the card twice or resend the email. Route all external interactions through gateways that know replay mode and suppress outbound calls while reprocessing. If a side effect cannot be guarded, that flow is a poor fit for replay — say so explicitly. - Version your event schemas. The log is forever; handlers must read old event shapes. Without schema/versioning discipline, replay rots.
- Don't confuse it with messaging. Event sourcing is a persistence pattern. It is not asynchronous messaging, and a mere event notification ("something changed, come ask me") is not event sourcing — the test is whether the event log alone can rebuild state.
Telemetry and instrumentation
Counters and gauges tell you the latest value; an event log tells you how it got there. When instrumenting a system where provenance matters — quota consumption, budget spend, fleet membership, config drift — emit the state changes as events with enough data to re-derive the running state, and treat dashboards as projections. Then "why is this number wrong?" becomes a replay, not archaeology.
When NOT to use it
- Simple CRUD where history has no consumer.
- High write volume with no replay, audit, or temporal-query need — you pay log-forever costs for nothing.
- External side effects that cannot be gated behind replay-aware gateways.
- Teams without schema-versioning discipline; an unversionable log is a liability.
Prefer plain state storage in those cases; you can still log domain events for analytics without making the log the system of record.
DONE means
State changes are recorded as immutable, replayable domain events; current state is demonstrably rebuildable from the log alone; replay is side-effect-safe via gateways or replay-mode guards; and event schemas are versioned. Verified by actually rebuilding a projection from the log, not by "we write events".
Sources: Martin Fowler — Event Sourcing (https://martinfowler.com/eaaDev/EventSourcing.html), Domain Event (https://martinfowler.com/eaaDev/DomainEvent.html), What do you mean by "Event-Driven"? (https://martinfowler.com/articles/201701-event-driven.html), Event Collaboration (https://martinfowler.com/eaaDev/EventCollaboration.html).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

