eventing-hub
Eventing Hub Master Guide
Intent
Describe event contracts, persistence/publish order, and consumer safety for the shared EventBus described in src/app/eventing/AGENTS.md and .github/instructions/20-ddd-event-sourcing-copilot-instructions.md.
Event Schema
- Declare events with a Type, Payload, Metadata, and Semantics structure; keep payloads immutable and document any allowed mutations in the metadata.
- Use a
correlationIdto tie related events, and assign acausationIdthat points to the triggering event (null only for root events). - Emit only typed events from the Aggregates/Application services; do not publish raw DTOs or Firebase objects.
Append → Publish → React
- Persist every outcome (Append) before invoking the
EventBuspublish step; never wrap append/publish inPromise.allor parallel flows to avoid causality gaps. - After the append promise resolves, publish the event and let downstream stores/projections react via the global
EventBussingleton. - Reactions should be limited to simple projections or side effects; long-running work belongs to dedicated use cases handled by the Application layer.
Causality Tracking & Immutability
- Maintain causation/correlation IDs for every published event; log them for tracing and include them in metadata for audit tooling.
- Treat emitted events as read-only facts; consumers may inspect but must never mutate payload or metadata objects.
- Use
Object.freeze()or deep copies when broadcasting to ensure immutability guarantees reach all subscribers.
More from 7spade/black-tortoise
material-design-3
Material Design 3 (Material You) design system knowledge for modern web and Angular applications. Use when implementing Material Design 3 theming, components, typography, color systems, dynamic color, accessibility patterns, or migrating from Material Design 2. Covers design tokens, theming APIs, and Material You principles.
68architecture-ddd
Domain-Driven Design patterns, layer boundaries (Presentation → Application → Domain ← Infrastructure), tactical patterns (entities, value objects, aggregates, repositories), and event-driven flow guidance. Use when designing new features, refactoring across layers, or enforcing DDD architectural boundaries.
13webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
12cohesion-coupling-review
Review a proposed change for high cohesion/low coupling; recommends the smallest boundary-safe refactor (ownership, minimal public surface, no reach-in imports). Use when reviewing code for coupling issues, cross-boundary imports, or excessive dependencies.
10angular-material-cdk-animations
Angular Material + CDK + @angular/animations usage patterns aligned with zoneless + signals-first UI and M3 tokens. Use when implementing Material Design 3 components, accessibility features, animations, overlays, drag-drop, virtual scrolling, or custom UI components using CDK utilities.
10angular-fire
Best practices and code patterns for @angular/fire version 20+, integrating Firestore and Auth with Signals and DDD architecture. Use when implementing Firebase integration, Firestore repositories, or AngularFire Auth in the infrastructure layer.
10