event-sourcing

event-sourcing is a skill for Claude Code, Codex from G1Joshi/Agent-Skills. It costs 48 tokens per session (1,270 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 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,270 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.00048 $0.01270
Opus 5.5 $0.00019 $0.00508
Sonnet 5.5 $0.00010 $0.00254
Haiku 4.5 $0.00005 $0.00127

Measured 25d ago against content hash ea3bda1424de, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 25d 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 · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 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

  • Complete Audit & Compliance Trails: Financial ledgers, healthcare records, and legal systems where historical state cannot be overwritten.
  • Temporal Queries & Time Travel: Reconstructing the exact state of an entity as of any specific timestamp in history.
  • Complex Domain Debugging: Replaying production incident events in local environments to pinpoint exact logic flaws.
  • High-Velocity Append-Only Ingestion: Maximizing write throughput by appending immutable events without updates or delete locks.

Quick Start

// Append-only domain event structure and aggregate reconstruction
interface DomainEvent {
  eventId: string;
  aggregateId: string;
  type: string;
  payload: Record<string, any>;
  timestamp: number;
}

class OrderAggregate {
  public id: string = "";
  public status: "PENDING" | "PAID" | "SHIPPED" = "PENDING";

  apply(event: DomainEvent): void {
    switch (event.type) {
      case "ORDER_CREATED":
        this.id = event.aggregateId;
        this.status = "PENDING";
        break;
      case "ORDER_PAID":
        this.status = "PAID";
        break;
      case "ORDER_SHIPPED":
        this.status = "SHIPPED";
        break;
    }
  }

  static reconstruct(events: DomainEvent[]): OrderAggregate {
    const aggregate = new OrderAggregate();
    for (const event of events) {
      aggregate.apply(event);
    }
    return aggregate;
  }
}

Core Concepts

Immutable Event Stream Architecture

State is derived purely by folding historical events sequentially over an initial empty state:

Stream: Account-42
Event 1: AccountOpened(initialDeposit: 100)  -> Balance = 100
Event 2: MoneyDeposited(amount: 50)          -> Balance = 150
Event 3: MoneyWithdrawn(amount: 30)          -> Balance = 120 (Current State)

State Reconstruction via Aggregate Replay

Read the full file on GitHub · 177 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. 25d ago Changed ea3bda1424de
  2. 1mo ago Changed · +110 lines · +33 tokens per session 2253736414ea
  3. 1mo 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 (15 stars, last pushed 26d ago), licensed MIT. It adds 48 tokens to every session and 1,270 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

deprecation-and-migration

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset…

addyosmani/agent-skills · 69 tokens

awesome-database-audit

Read-only audit of a database layer: schema anti-patterns, query and index fit, integrity, concurrency, migrations, tenancy, with a verdict. Use when asked to review a schema, migrations or data model.

khasky/awesome-agent-skills · 49 tokens

data-engineering

Guides data pipeline design, ETL/ELT workflows, schema evolution, and data quality assurance. Use when building data pipelines, designing data warehouses, migrating schemas, or ensuring data integrity across systems. Use when you need reliable, testable, and observable data flows.

borhen68/SkillEngine · 59 tokens

context-engineering

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

addyosmani/agent-skills · 43 tokens

doubt-driven-development

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high…

addyosmani/agent-skills · 96 tokens

performance-optimization

Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.

addyosmani/agent-skills · 59 tokens