Agent skill

Event Sourcing

by citypaul in citypaul/.dotfiles

Event sourcing patterns for functional TypeScript — persist state as an append-only log of past events and rebuild it by folding them.

Custom licenceAuto-check passedBackend & APIs

Install Event Sourcing

skills CLI
$ npx skills add citypaul/.dotfiles --skill event-sourcing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install citypaul/.dotfiles event-sourcing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/citypaul/.dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude/.claude/skills/event-sourcing .claude/skills/event-sourcing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
event-sourcing
GitHub stars
740
Token cost
~7.8k tokens
SKILL.md length
3,101 words
Files
10
Skills in repo
44
Repo updated
First seen
Licence
Custom licence

At a glance

Event sourcing patterns for functional TypeScript — persist state as an append-only log of past events and rebuild it by folding them.

  • Works in 4 steps: Events are the source of truth. They are… → State is a left fold of events. There is… → The stream is the consistency boundary.… → …
  • Implementing a Decider write model
  • SKILL.md covers When to Use Event Sourcing, Core Mental Model, The Decider Is the Write Model and The Command Handler Loop, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Event Sourcing is an agent skill from citypaul/.dotfiles. Event sourcing patterns for functional TypeScript — persist state as an append-only log of past events and rebuild it by folding them. Use when implementing a Decider write model, an event store, projections and read models, event versioning, or snapshots. Builds on the Decider from domain-driven-design and the ports/adapters from hexagonal-architecture. Do NOT reach for it on CRUD, or when an audit log or the outbox pattern already suffices.

Its SKILL.md is about 7.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files (for example `resources/decider-and-rehydration.md`, `resources/event-store.md` and `resources/event-versioning.md`).

It sits in Backend & APIs, covering Event-driven systems and Domain-driven design. It works with TypeScript.

When your agent uses it

  • Implementing a Decider write model
  • Projections and read models
  • Event versioning

Example prompts

  • “/event-sourcing”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Events are the source of truth. They are immutable facts, named in the past tense, that record what happened and why. You never UPDATE or…
  2. State is a left fold of events. There is no stored "current state". You rebuild it on demand by folding the evolve function over the…
  3. The stream is the consistency boundary. One aggregate instance maps to exactly one stream (e.g. account-4f3c…). All invariants for that…
  4. Read models are disposable derivations. Because state is fold(events), any read-optimised view is just a different fold. You can delete a…

What it can do on your machine

Read from SKILL.md and the folder at commit cd4028d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Event Sourcing loads about 7.8k tokens when it runs. Until then it costs about 115 tokens; SKILL.md has 3,101 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~115
When it runs · the whole SKILL.md, loaded when a task matches
~7.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 3,101 words (~7,807 tokens).

“Event sourcing stores every change to application state as an immutable, append-only sequence of past-tense domain events. The current state is never stored directly — it is a left fold of the events: state = events.reduce(evolve, initialState). The event log…”

— opening of SKILL.md by citypaul, Custom licence
name
event-sourcing

Read the full SKILL.md on GitHub

Files

SKILL.md and 9 other files in claude/.claude/skills/event-sourcing of citypaul/.dotfiles.

  • SKILL.md
  • resources/decider-and-rehydration.md
  • resources/event-store.md
  • resources/event-versioning.md
  • resources/modelling-events.md
  • resources/production-concerns.md
  • resources/projections-and-read-models.md
  • resources/references.md
  • resources/testing-event-sourced-systems.md
  • resources/when-to-use-event-sourcing.md

Open the folder on GitHubat commit cd4028d

Compare with similar skills

Event Sourcing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Event Sourcing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Event Sourcing this skillcitypaul/.dotfiles740—~7.8kAutomated safety check: PassCustom licence
Evolutionary Modular Architecturetech-leads-club/agent-skills7k—~3.7kAutomated safety check: PassCC-BY-4.0
Dynamic Consistency BoundariesAxonIQ/AxonFramework3.6k—~1.9kAutomated safety check: PassApache-2.0
NestJS Modular Monolith Architecttech-leads-club/agent-skills7k—~3.9kAutomated safety check: PassCC-BY-4.0
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
Migration PathAxonIQ/AxonFramework3.6k—~594Automated safety check: PassApache-2.0

Similar skills

  • Evolutionary Modular Architecture

    tech-leads-club/agent-skills

    Guides design of modular-monolith platforms with DDD, flat-by-aggregate modules, anti-corruption layers, outbox events and resilience, plus an architecture document with SVG diagrams.

    7k GitHub stars~3.7k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Dynamic Consistency Boundaries

    AxonIQ/AxonFramework

    Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them.

    3.6k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • NestJS Modular Monolith Architect

    tech-leads-club/agent-skills

    Designs scalable NestJS modular monoliths with domain-driven design, Clean Architecture layers and optional CQRS, defining bounded contexts and strict module boundaries.

    7k GitHub stars~3.9k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Migration Path

    AxonIQ/AxonFramework

    Create a new Axon Framework 4→5 migration path documentation page.

    3.6k GitHub stars~594 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Microservices Architect

    Jeffallan/claude-skills

    Designs distributed systems: bounded-context service boundaries, sync and async communication, data ownership, resilience, tracing and rollout strategy.

    12k GitHub stars~1.8k tokensUpdated 7 days ago
    Backend & APIsAuto-check passed

More from citypaul/.dotfiles

All 44 skills in this repo
  • Find Skills

    citypaul/.dotfiles

    Discover and, with authorization, install agent skills from the open skills ecosystem.

    740 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Render Code Shape

    citypaul/.dotfiles

    Render the shape of code — module boundaries, the types that cross them, signatures, and a cited call graph — for code that already exists or a change about to be built.

    740 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Structure Codebase

    citypaul/.dotfiles

    Design, audit, and evolve physical source and package structures that expose real architectural boundaries while keeping related behavior together.

    740 GitHub stars~4.4k tokensUpdated 2 days ago
    Auto-check passed
  • Test Design Reviewer

    citypaul/.dotfiles

    Review test quality using Dave Farley's eight properties of good tests.

    740 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed
  • Characterisation Tests

    citypaul/.dotfiles

    A skill your agent uses when modifying existing code that lacks tests and you need to document its actual current behavior before making changes -- the legacy code dilemma where you need tests to…

    740 GitHub stars~3.6k tokensUpdated 2 days ago
    Auto-check passed
  • CI Debugging

    citypaul/.dotfiles

    Systematic CI/CD failure diagnosis using hypothesis-first investigation, local reproduction, and environment delta analysis.

    740 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check: notes

Works with

Questions about Event Sourcing

What does Event Sourcing do?

Event sourcing patterns for functional TypeScript — persist state as an append-only log of past events and rebuild it by folding them. dotfiles. Event sourcing patterns for functional TypeScript — persist state as an append-only log of past events and rebuild it by folding them.

When should I use Event Sourcing?

Event Sourcing fits situations like: implementing a Decider write model; projections and read models; event versioning.

How do I install Event Sourcing in Claude Code?

Run `npx skills add citypaul/.dotfiles --skill event-sourcing -a claude-code`. Or copy the skill folder (claude/.claude/skills/event-sourcing in citypaul/.dotfiles) into .claude/skills/event-sourcing in your project. Claude Code loads it when a task matches its description.

How do I install Event Sourcing in Codex?

Run `npx skills add citypaul/.dotfiles --skill event-sourcing -a codex`. Or copy the skill folder (claude/.claude/skills/event-sourcing in citypaul/.dotfiles) into .agents/skills/event-sourcing in your project. Codex loads it when a task matches its description.

Can I use Event Sourcing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add citypaul/.dotfiles --skill event-sourcing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/event-sourcing, .gemini/skills/event-sourcing, .github/skills/event-sourcing and .opencode/skills/event-sourcing in your project.

What does Event Sourcing need to run?

SKILL.md names no scripts, command-line tools or credentials: Event Sourcing is instructions for the agent only.

Does Event Sourcing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Event Sourcing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Event Sourcing use?

Event Sourcing has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Event Sourcing use?

About 7.8k tokens (SKILL.md is roughly 31k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Event Sourcing?

Skills that share tags, products or a category with Event Sourcing: Evolutionary Modular Architecture (tech-leads-club/agent-skills, 7k stars), Dynamic Consistency Boundaries (AxonIQ/AxonFramework, 3.6k stars), NestJS Modular Monolith Architect (tech-leads-club/agent-skills, 7k stars) and AWS Serverless Eda (zxkane/aws-skills, 367 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Event Sourcing?

citypaul (a GitHub user) maintains it in citypaul/.dotfiles, which has 740 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 9, 2026.

Source: citypaul/.dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.