Architecture & API Design
Compatible with Cursor, Claude Code, Cline, Roo Code, Antigravity

Event-Driven Architecture & Message Ordering Hardening

Review Kafka, RabbitMQ, or SQS/SNS event architectures for exactly-once semantics, out-of-order delivery, and DLQs.

KafkaEvent-DrivenRabbitMQSQSArchitectureBackend
Skill Objective

Design and harden event-driven messaging pipelines (Kafka, SQS FIFO, RabbitMQ) with idempotent consumer handlers, dead-letter queues, and partition key strategies.

Execution Workflow Procedure

Ordered steps the coding agent executes when performing this skill.

1

Design Partition Keys & Ordering

Assign high-cardinality partition keys (e.g. tenant_id, order_id) to guarantee in-order message delivery without hot partitions.

2

Implement Idempotent Consumer Logic

Wrap message processing in database transactions that verify idempotency keys against a processed_events table.

3

Configure DLQ & Poison Pill Handling

Route non-retryable deserialization failures directly to a Dead-Letter Queue while retrying transient network errors with exponential backoff.

Agent Safety Guardrails & Anti-Hallucination Rules

  • DO NOT assume message brokers provide exactly-once processing; always implement idempotent consumers.
  • DO NOT block an entire partition queue on unhandled deserialization errors.

Expected Output Format

Event envelope schema, idempotency design, and consumer implementation.

📨 Event Envelope Schema: Standard envelope with metadata and version.
🛠️ Hardened Consumer Code: Idempotent consumer handler with DLQ.

Domain Verification Checks

Idempotent Handling: Verifies idempotency check in local DB transaction.
Partition Uniformity: Prevents consumer lag from hot partition keys.
DLQ Routing: Isolates poison pills from active topic streams.

Example Agent Invocations

"Review this Kafka consumer pipeline for message ordering and duplicate processing risks."
"Design an idempotent AWS SQS FIFO message handler for payment processing events."

Install / Configure This Skill

# Place in .cursorrules or create .cursor/rules/event-driven-architecture-hardening.mdc
# Trigger: Whenever you perform event-driven architecture & message ordering hardening

---
name: event-driven-architecture-hardening
description: Harden event-driven systems with partition key ordering, idempotent consumers, and Dead-Letter Queue routing.
version: 1.0.0
compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity]
---

# Event-Driven Architecture & Message Ordering Hardening

## Objective
Build resilient asynchronous event pipelines with partition ordering, idempotent consumers, and automatic dead-letter queue routing.

## Workflow
1. **Partition Strategy**: Use high-cardinality entity keys for consistent partition hashing.
2. **Idempotency Check**: Validate event IDs in a local transaction before executing side effects.
3. **Error Isolation**: Route poison pills to DLQ while retrying transient failures with backoff.
Complementary Agent Prompt

Need a quick one-time prompt for chat?

Try the Event-Driven Architecture & Message Ordering Review — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.

View Prompt

SprintKit Workflow Integrations

Complementary tools and checklists to pair with this agent workflow.

Related Agent Skills

Explore related procedural workflows in this discipline.

All Skills

Monolith Decomposition into DDD Bounded Contexts

Deconstruct monoliths or complex systems into bounded contexts with clear domain events and data ownership.

MicroservicesDDDArchitecture+1
3 workflow stepsView skill

Backward-Compatible RESTful API Design & OpenAPI Spec

Design or review RESTful API contracts for idempotency, pagination, error models, and non-breaking versioning.

APIRESTOpenAPI+2
4 workflow stepsView skill

Technical Design Document (RFC / ADR) Generation

Generate thorough, engineering-ready Request for Comments (RFC) and Architecture Decision Records (ADRs).

ArchitectureRFCADR+2
4 workflow stepsView skill