Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问clear审计通过

event-driven-architecture事件驱动架构

Agent Skill

event-driven-architecture 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,747

周安装

70

GitHub Stars

15

下载量

566
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:event-driven-architecture(事件驱动架构)
来源仓库:https://github.com/nickcrew/claude-ctx-plugin
仓库路径:skills/event-driven-architecture
安装命令:
npx skills add https://github.com/nickcrew/claude-ctx-plugin --skill event-driven-architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/nickcrew/claude-ctx-plugin --skill event-driven-architecture

简介

event-driven-architecture 提供事件驱动系统的专家级指导,涵盖事件溯源、CQRS 和消息代理等模式,适合在 Codex、Claude、Cursor、Gemini CLI 中设计高可用分布式系统时使用。

  • 它强调异步通信、最终一致性和弹性扩展等特性,适用于大规模应用场景。
  • 使用时应在实现跨服务协调、管理复杂工作流或处理实时数据管道时参考此技能。
  • 安装前应确认团队具备相关基础设施经验,如 Kafka 或 RabbitMQ 等消息中间件。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Event-Driven Architecture Patterns

Expert guidance for designing, implementing, and operating event-driven systems with proven patterns for event sourcing, CQRS, message brokers, saga coordination, and eventual consistency management.

When to Use This Skill

  • Designing systems with asynchronous, decoupled communication
  • Implementing event sourcing and CQRS patterns
  • Building systems requiring eventual consistency and high scalability
  • Managing distributed transactions across microservices
  • Processing real-time event streams and data pipelines
  • Implementing publish-subscribe or message queue architectures
  • Designing reactive systems with complex event flows

Core Principles

1. Events as First-Class Citizens

Events represent immutable facts that have occurred in the system. Use past tense naming (OrderCreated, PaymentProcessed) and include all necessary context.

2. Eventual Consistency

Systems achieve consistency over time rather than immediately. Trade strong consistency for higher availability and scalability.

3. Loose Coupling

Services communicate through events without direct dependencies, enabling independent evolution and deployment.

4. Asynchronous Communication

Operations don't block waiting for responses, improving system responsiveness and resilience.

5. Event-Driven Thinking

Design around what happened (events) rather than what to do (commands).

Quick Reference

TopicLoad reference
Event structure, types, and characteristicsskills/event-driven-architecture/references/event-fundamentals.md
Event sourcing pattern and implementationskills/event-driven-architecture/references/event-sourcing.md
CQRS pattern with read/write separationskills/event-driven-architecture/references/cqrs.md
Message brokers (RabbitMQ, Kafka, SQS/SNS)skills/event-driven-architecture/references/message-brokers.md
Saga pattern for distributed transactionsskills/event-driven-architecture/references/saga-pattern.md
Choreography vs orchestration patternsskills/event-driven-architecture/references/choreography-orchestration.md
Eventual consistency and conflict resolutionskills/event-driven-architecture/references/eventual-consistency.md
Best practices, anti-patterns, testingskills/event-driven-architecture/references/best-practices.md

Workflow

1. Design Phase

  • Identify Events: What business facts need to be captured?
  • Define Boundaries: Which events are domain vs integration events?
  • Choose Patterns: Event sourcing? CQRS? Sagas? Choreography or orchestration?
  • Select Technology: Kafka for high throughput? RabbitMQ for routing? AWS managed services?

2. Implementation Phase

  • Event Schema: Define versioned event structures with correlation IDs
  • Event Store: Implement append-only storage with optimistic concurrency
  • Projections: Create read models from events for query optimization
  • Handlers: Ensure idempotent, at-least-once delivery handling
  • Sagas: Implement compensating transactions for failures

3. Operation Phase

  • Monitoring: Track event lag, processing time, failure rates
  • Replay: Build capability to replay events for debugging/recovery
  • Versioning: Support multiple event schema versions simultaneously
  • Scaling: Partition by aggregate ID, scale consumers horizontally
  • Testing: Test handlers in isolation with contract testing

Common Mistakes

Event Design Errors

  • ❌ Using commands instead of events (CreateOrder vs OrderCreated)
  • ❌ Mutable events or missing versioning
  • ❌ Events without correlation/causation IDs
  • ✓ Immutable, past-tense, self-contained events

Consistency Issues

  • ❌ Assuming immediate consistency across services
  • ❌ Not handling duplicate event delivery
  • ❌ Missing idempotency in handlers
  • ✓ Design for eventual consistency, idempotent handlers

Architecture Mistakes

  • ❌ Synchronous event chains (waiting for responses)
  • ❌ Events coupled to specific service implementations
  • ❌ No compensation strategy for sagas
  • ✓ Async fire-and-forget, domain-focused events, compensating transactions

Operational Gaps

  • ❌ No event replay capability
  • ❌ Missing monitoring for event lag
  • ❌ No schema registry or version management
  • ✓ Replay-ready, monitored, schema-managed events

Pattern Selection Guide

Use Event Sourcing When:

  • Need complete audit trail of all changes
  • Temporal queries required ("state at time T")
  • Multiple projections from same events
  • Event replay for debugging/recovery

Use CQRS When:

  • High read:write ratio (10:1+)
  • Complex query requirements
  • Need to scale reads independently
  • Different databases for read/write optimal

Use Sagas When:

  • Distributed transactions across services
  • Need atomicity without 2PC
  • Complex multi-step workflows
  • Compensation logic required

Choose Choreography When:

  • Simple workflows (2-4 steps)
  • High service autonomy desired
  • Event-driven culture established
  • No complex dependencies

Choose Orchestration When:

  • Complex workflows (5+ steps)
  • Sequential dependencies
  • Need centralized visibility
  • Business logic in workflow

Resources

  • Books: "Designing Event-Driven Systems" (Stopford), "Versioning in an Event Sourced System" (Young)
  • Sites: eventuate.io, event-driven.io, Martin Fowler's event sourcing articles
  • Tools: Kafka, EventStoreDB, RabbitMQ, Axon Framework, MassTransit
  • Patterns: Event Sourcing, CQRS, Saga, Outbox, CDC, Event Streaming

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.69%
按下载量换算157

windsurf

23.43%
按下载量换算133

Antigravity

17.1%
按下载量换算97

Gemini CLI

12.84%
按下载量换算73

kilo

7.73%
按下载量换算44

trae

3.13%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills