event-sourcing

event-sourcing is a skill for Claude Code, Codex from G1Joshi/Agent-Skills. It costs 15 tokens per session (531 once invoked), scanned A, original, MIT.

A way to store application history as a sequence of events, such as an order being created, paid for, and delivered, instead of storing only the latest state.

In plain words
What is it for?
Use it when you need an audit trail, historical views of data, or a record of the user's intent behind each change.
Why use it?
It preserves how the current state was reached. That makes detailed audits and questions about the system at an earlier time possible.

Skill for Claude CodeCodex

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

Good fit Use it when you need an audit trail, historical views of data, or a record of the user's intent behind each change.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/g1joshi/agent-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 G1Joshi/Agent-Skills --skill event-sourcing
Clone the repo
git clone --depth 1 https://github.com/G1Joshi/Agent-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/g1joshi/agent-skills/event-sourcing/github.svg)](https://agentmods.dev/skills/g1joshi/agent-skills/event-sourcing)
Your own site
<a href="https://agentmods.dev/skills/g1joshi/agent-skills/event-sourcing"><img src="https://agentmods.dev/badge/skills/g1joshi/agent-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/g1joshi/agent-skills/event-sourcing"><img src="https://agentmods.dev/badge/skills/g1joshi/agent-skills/event-sourcing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 531 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.00015 $0.00531
Opus 5 $0.00008 $0.00266
Sonnet 5 $0.00003 $0.00106
Haiku 4.5 $0.00002 $0.00053

Measured 10d ago against content hash 26808294b0a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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/architecture/event-sourcing/SKILL.md · 67 lines

How it starts

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

Event Sourcing

Event Sourcing ensures that all changes to application state are stored as a sequence of events. We don't just store the current state; we store "what happened".

When to Use

  • Audit Logs: When you need to know exactly how you got to the current state (Banking, Legal).
  • Temporal Queries: "What did the system look like last Tuesday?".
  • Intent Capture: distinguishing between "Correction" vs "Update".

Quick Start (Conceptual)

Traditional (State Stored): Order { id: 1, status: 'Shipped' } -> Update to 'Delivered' -> Order { id: 1, status: 'Delivered' } (History lost)

Event Sourcing (Events Stored):

  1. OrderCreated(id=1)
  2. PaymentReceived(id=1)
  3. OrderShipped(id=1)
  4. OrderDelivered(id=1)

To get current state: Replay (1) + (2) + (3) + (4).

Core Concepts

Event Store

A database optimized for appending immutable events (e.g., EventStoreDB).

Snapshots

To avoid replay performance issues for long histories (10,000 events), save a "Snapshot" every 100 events. Replay = Snapshot + subsequent events.

Projections

Code that listens to events and builds a read-optimized view (The "R" in CQRS).

Best Practices

Do:

  • Keep Events Immutable. You can never change the past. To fix an error, append a "CorrectionEvent".
  • Version your Events carefully (Upcasting) to handle schema changes over years.

Don't:

  • Don't put logic in the Event Store. It's just a log.
  • Don't query the Event Stream for complex searches (Use a Projection/Read Model).

Troubleshooting

Error Cause Solution
Slow Replay Too many events for an aggregate. Implement Snapshots or check Aggregate boundaries.
Schema Evolution Old events don't match new code. Implement "Upcasters" to transform old events on the fly.

Read the full file on GitHub · 67 lines

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. 10d ago First seen · 67 lines · 15 tokens per session scan A 26808294b0a8

Subscribe to this mod's changes

event-sourcing is a skill published in the GitHub repository G1Joshi/Agent-Skills (12 stars, last pushed 7mo ago), licensed MIT. It adds 15 tokens to every session and 531 once invoked, about $0.0001 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-30.