scaffold-update-operation

Scaffold an UPDATE operation appending Domain Events to an event-sourced stream.

15|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/aalmada/BookStore --skill scaffold-update-operation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-update-operation
Source: https://github.com/aalmada/BookStore/tree/main/.claude/skills/scaffold-update-operation
Command: npx skills add https://github.com/aalmada/BookStore --skill scaffold-update-operation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a blueprint to add an UPDATE operation for appending to an event-sourced stream in a backend, enabling PUT or PATCH style updates on existing resources.

Core Features & Use Cases

  • Domain Event: Define a new {Resource}Updated or similar event to capture state changes.
  • Command & Endpoint: Create a corresponding {Verb}{Resource} command and a scaffolded endpoint that uses the [Aggregate] pattern to load and apply updates.
  • Read Model Projections: Update projections to reflect the new state after the update event.

Quick Start

Use this guide to scaffold the Update operation by creating Domain Event, Command, Endpoint templates, and wiring them into existing resources.

Frequently Asked Questions about scaffold-update-operation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an update operation to an event-sourced backend?

To add an update operation to an event-sourced backend, you define a Domain Event, create a corresponding Command, scaffold an endpoint, and update read-model projections. This appends state changes to the event stream deterministically using the Aggregate pattern.

What is the best way to implement PUT or PATCH updates using event sourcing?

Implementing PUT or PATCH updates using event sourcing requires appending a Domain Event to the stream rather than mutating state directly. You load the current state via an Aggregate, apply the change as a pure function, and project the new event to update read models.

How do domain events and commands work together in an event-sourced update?

In an event-sourced update, a Command represents the intent to change state, such as a PUT or PATCH request. The backend processes this Command, applies it to the loaded Aggregate, and appends a corresponding Domain Event to the event stream to capture the actual state change.

Can I use this scaffold for read-model projections after an event stream update?

Yes, this scaffold includes updating read-model projections. After the update Domain Event is appended to the event stream, the blueprint guides you through wiring the necessary projection updates so the read models reflect the new resource state.

Does this event sourcing update blueprint enforce deterministic state changes?

Yes, the blueprint enforces deterministic state changes by using a pure-function style. It leverages the Aggregate pattern to load existing state and apply updates, ensuring that appending to the event stream yields consistent and predictable outcomes.