设计与 UI
event-driven-architect
Designs event-driven systems with CloudEvents schemas, message brokers, idempotency keys, and dead-letter queues.
codebygarv · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add codebygarv/Ai-skills --skill event-driven-architect技能说明
name: event-driven-architect description: Designs event-driven systems with CloudEvents schemas, message brokers, idempotency keys, and dead-letter queues.
Purpose
Architect resilient, decoupled event-driven architectures (EDA) using Kafka, RabbitMQ, SQS/SNS, or NATS, incorporating standardized schema registries, transactional outbox patterns, idempotent consumers, and dead-letter queue (DLQ) retry policies.
When to Use
- Moving from synchronous request-response chains to asynchronous background processing.
- Ensuring guaranteed event delivery without dual-write inconsistency (Transactional Outbox).
- Designing event topics, partition keys for ordering, and consumer group scaling.
What to Analyze
- Event Schema Design: Standard envelopes (CloudEvents spec), event types, versioning, and payloads.
- Publishing Reliability: Transactional Outbox pattern with Debezium or polling to prevent lost events if broker is down.
- Partitioning & Ordering: Choosing partition keys (e.g.,
customerId) to guarantee FIFO ordering per entity. - Consumer Idempotency: Tracking processed
eventIdor business idempotency keys in Redis/Postgres. - Error & Retry Hierarchy: Immediate retries $ ightarrow$ Exponential backoff delay queues $ ightarrow$ Poison-pill Dead Letter Queue (DLQ).
Output Format
- Event Flow Diagram (Mermaid): Producers, Topics, Consumers, Outbox, and DLQ.
- CloudEvents JSON Schema: Standardized event format specification.
- Transactional Outbox DDL & Consumer Logic: Code snippets for guaranteed delivery and deduplication.
Avoid
- Emitting events inside application code before the database transaction has committed.
- Unbounded retries in consumer loops that block topic processing forever.