events-patterns

Design Rails event-driven architectures with typed domain event records.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/LaunchPadLab/ai-bank --skill events-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: events-patterns
Source: https://github.com/LaunchPadLab/ai-bank/tree/main/claude/skills/events-patterns
Command: npx skills add https://github.com/LaunchPadLab/ai-bank --skill events-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you design event-driven Rails systems that treat events as rich domain records while reliably powering activity feeds, webhook delivery, client tracking, and audit trails.

Core Features & Use Cases

  • Domain event records over generic tracking: create typed models (e.g., CardMoved, CommentAdded) with associations and callbacks that trigger side effects.
  • Polymorphic activity feeds: store activities that reference the real event records and render descriptions/icons via subject delegation.
  • Webhook delivery pipeline: persist webhook endpoints and deliveries, sign payloads with HMAC-SHA256, and process delivery asynchronously with retries.
  • Client-side interaction tracking: capture page views and user actions via Stimulus and store flexible metadata in JSONB.
  • Immutable audit trails (event sourcing pattern): record attribute diffs as immutable change payloads for compliance-friendly history.
  • Event aggregation for reporting: compute summaries (counts, top boards/users, daily breakdowns) from persisted event/activity records.

Quick Start

Use the events-patterns skill to implement a Rails pattern where actions like moving a card create a typed CardMoved event that automatically generates an activity feed entry and enqueues signed webhook deliveries.

Frequently Asked Questions about events-patterns

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

FAQPage Schema
How do I model domain events in Rails for activity feeds and audit trails?

Model domain events in Rails by creating typed records like CardMoved that trigger side effects and power activity feeds. This pattern uses polymorphic associations and JSONB metadata to capture flexible event data cleanly.

What is the best way to implement webhook delivery with retries in a Rails application?

Implement webhook delivery by persisting endpoints and deliveries, signing payloads with HMAC-SHA256, and processing delivery asynchronously using background jobs. This pipeline ensures reliable webhook processing with automatic retries.

How do I track user interactions client-side and store them as JSONB metadata in Rails?

Track user interactions by capturing page views and actions via Stimulus controllers, then store flexible metadata in JSONB columns. This approach allows Rails applications to capture client-side activity efficiently.

Can I use Sidekiq for asynchronous webhook processing with signed payloads?

Yes, you can use Sidekiq for asynchronous webhook processing with signed payloads. The pattern enqueues HMAC-SHA256 signed deliveries as background jobs, enabling reliable processing and retries without blocking the main thread.

How does event sourcing work for building immutable audit trails in Rails?

Event sourcing for immutable audit trails works by recording attribute diffs as immutable change payloads in Rails. This compliance-friendly history pattern ensures that all business activity changes are permanently persisted and queryable.

When should I use typed domain event records instead of generic tracking tables?

Use typed domain event records instead of generic tracking when you need specific associations, callbacks for side effects, and polymorphic feed rendering. Typed models provide richer context and behavior than generic tracking tables.