build-automation

Implements Wolverine and Marten automation handlers from event-modeling slice.json definitions.

1|1|Updated Jul 19, 2026
One-click install
npx skills add https://github.com/Powerworks/K9DatingApp --skill build-automation-powerworks
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: build-automation
Source: https://github.com/Powerworks/K9DatingApp/tree/main/.claude/skills/build-automation
Command: npx skills add https://github.com/Powerworks/K9DatingApp --skill build-automation-powerworks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Event-driven backends need automation handlers that react to domain or integration events, decide whether to act, and append events or mutate documents — but writing them by hand risks missed trigger registrations, non-idempotent handlers, and state-management mistakes that silently break downstream consumers. ## Core Features & Use Cases - Automation Handler Generation: Builds a Wolverine handler triggered by an event (never an HTTP route) from a slice.json definition, covering both same-module domain events via Marten forwarding and cross-module integration events via RabbitMQ. - State Computation Guidance: Creates per-invocation [AutomationName]State types replayed through AggregateStreamAsync for event-sourced modules, or direct document loads for document-store modules, enforcing ADR-019's no-persisted-snapshot rule. - Idempotency and Test-First Discipline: Requires tests before the handler, covering the act case, the not-yet case, and redelivery idempotency, plus trigger registration checks in Program.cs or the module's IntegrationEventQueueName. - Use Case: Given a slice.json describing "when a mutual match is detected, notify both owners", generate a DetectMutualMatchHandler that replays stream state, appends the match event, and returns a MatchCreatedV1 integration event through the durable outbox. ## Quick Start Ask the AI to build the automation slice defined in build-kit-dotnet/.slices/{Context}/{slicename}/slice.json using the build-automation skill.

Frequently Asked Questions about build-automation

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

FAQPage Schema
How do I build an event-driven automation handler with Wolverine and Marten?▼

Read the slice.json for the trigger event and intended outcome, then create a static class ending in Handler with a Handle method taking the trigger event and IDocumentSession. Register the trigger via Marten's SubscribeToEvent or the module's IntegrationEventQueueName, and write tests before the handler.

What is the difference between a state-change slice and an automation slice?▼

A state-change slice handles a command from an HTTP request and appends its direct result event. An automation slice is triggered by an event, never a route, and reacts by appending further events, mutating documents, or cascading integration events to other modules.

How do I consume integration events from another module with RabbitMQ?▼

The consuming module must declare IntegrationEventQueueName on its module class so a durable queue binds to the shared exchange. Without it, published events are silently dropped with no error, leaving downstream read models empty.

Why is my Wolverine handler never invoked?▼

Wolverine discovery requires the class name to end in Handler; a correctly written Handle method in a differently named class is silently ignored. Also confirm the trigger event is registered via SubscribeToEvent or the module's integration event queue.

Should automation state be persisted as a Marten projection?▼

No. Per ADR-019, automation state is computed live per invocation using AggregateStreamAsync, which replays the event stream through Apply methods. Persisting or sharing a snapshot state type across handlers is explicitly prohibited and checked by architecture tests.

How do I make an automation handler idempotent?▼

Delivery is at-least-once, so check the target's current state before acting and return early when the effect is already applied. For cascading handlers, return null when there is no consequence so no duplicate integration event is published.