hart-agency-backend

Coordinate event-sourced Express backend changes across commands, endpoints, and registry wiring.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/rafaeelricco/Hartopsprototype --skill hart-agency-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hart-agency-backend
Source: https://github.com/rafaeelricco/Hartopsprototype/tree/main/.claude/skills/hart-agency-backend
Command: npx skills add https://github.com/rafaeelricco/Hartopsprototype --skill hart-agency-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Hart Agency’s event-sourced Express backend has multiple runtime registration points (events, projections, endpoint wiring) that TypeScript may not catch, causing failures only when code runs.

Core Features & Use Cases

  • Endpoint-first backend changes: guide updates to commands/queries and the central api.ts + index.ts implementation registry so frontend and mobile stay in sync.
  • Correct event-sourcing workflow: help implement aggregates, creation/transformation events, and the withEventStore generator pattern without async-in-generator mistakes.
  • Projection and reaction safety: ensure projection repositories and Ambar consumers are registered and that reactions handle at-least-once delivery risks (idempotency/marker events).
  • Auth-guard correctness: enforce proper resolve vs authorize split and correct use of privileges and actor-type narrowing.

Quick Start

Update the Hart Agency backend endpoint and related event/projection wiring for my request touching app/backend/src by following the conventions and checklist in this skill.

Frequently Asked Questions about hart-agency-backend

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

FAQPage Schema
How do I add a new endpoint to an event-sourced Express backend without breaking TypeScript compilation?

To add an endpoint to an event-sourced Express backend, update commands and queries alongside the central api.ts and index.ts implementation registry. Maintaining correct API and types import boundaries keeps frontend and mobile TypeScript compilation intact during backend changes.

How does the withEventStore generator pattern work for event-sourcing aggregates?

The withEventStore generator pattern processes creation and transformation events synchronously. You must avoid async-in-generator mistakes by using deterministic ids and synchronous generator usage to ensure event-sourced aggregates execute safely without runtime failures.

What is the best way to wire projection consumers and Ambar reactions in an event-sourced system?

Wiring projection consumers and Ambar reactions requires registering projection repositories and Ambar consumers correctly. Reactions must handle at-least-once delivery risks by implementing idempotency or marker events to prevent duplicate processing.

Why does my TypeScript backend fail at runtime when adding new events and projections?

Runtime failures happen because TypeScript cannot catch multiple runtime registration points for events, projections, and endpoint wiring. Exhaustive event handling using accept([...]) and proper registry wiring are required to prevent failures only visible when code runs.

How do I implement auth guards correctly in an Express backend with CQRS?

Implementing auth guards in a CQRS backend requires enforcing a proper resolve versus authorize split. You must use correct privileges and actor-type narrowing to ensure authorization logic safely separates from query and command resolution.

Does this backend coordination approach support refactoring domain logic safely?

Yes, refactoring domain logic is supported by aligning commands, queries, endpoints, events, projections, and reactions. Reviewing code for runtime-only gotchas and following deterministic id conventions ensures safe changes across the event-sourced Express backend.