dykyi-roman/awesome-claude-code/eda-knowledge

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Event-Driven Architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for EDA audits including messaging, pub/sub, and saga patterns.

Install

npx vskill@latest install dykyi-roman/awesome-claude-code/eda-knowledge

SKILL.md

Event-Driven Architecture Knowledge Base

Quick reference for Event-Driven Architecture (EDA) patterns and PHP implementation guidelines.

Core Principles

Event-Driven Architecture Overview
┌─────────────────────────────────────────────────────────────────────────┐
│ EVENT-DRIVEN ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Producer │────▶│ Message Broker │────▶│ Consumer │ │
│ │ │ │ (RabbitMQ/Kafka)│ │ │ │
│ └──────────┘ └──────────────────┘ └──────────────────┘ │
│ │ │ │ │
│ │ │ │ │
│ Publishes Routes/Stores Subscribes │
│ Events Messages to Events │
│ │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ Event Types: │
│ • Domain Events - Business facts (OrderPlaced, PaymentReceived) │
│ • Integration Events - Cross-boundary communication │
│ • System Events - Infrastructure notifications │
│ │
│ Patterns: │
│ • Pub/Sub - Many subscribers per event │
│ • Message Queue - One consumer per message │
│ • Event Sourcing - Store all events as source of truth │
│ • Saga/Process Manager - Coordinate distributed transactions │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Key Concepts
ConceptDescription
EventImmutable fact that something happened
ProducerPublishes events to broker
ConsumerSubscribes to and processes events
Message BrokerRoutes events between producers and consumers
Topic/ExchangeEvent routing mechanism
QueueStores messages for consumers
Eventual ConsistencySystem state converges over time

Quick Checklists

Event Design Checklist
  • [ ] Events are immutable
  • [ ] Events use past tense (OrderPlaced, not PlaceOrder)
  • [ ] Events contain necessary data (no fetching needed)
  • [ ] Events have unique IDs and timestamps
  • [ ] Events include correlation/causation IDs
  • [ ] Events are versioned for schema evolution
Producer Checklist
  • [ ] Publishes events after state change
  • [ ] Uses transactional outbox for reliability
  • [ ] Events are serializable (JSON/Protobuf)
  • [ ] Handles publish failures gracefully
  • [ ] No business logic dependent on consumers
Consumer Checklist
  • [ ] Idempotent processing
  • [ ] Handles out-of-order events
  • [ ] Implements retry with backoff
  • [ ] Dead letter queue for failures
  • [ ] No side effects until processing complete

PHP 8.4 Event-Driven Patterns

Domain Event
php
<?php
declare(strict_types=1);
namespace Domain\Order\Event;
use Domain\Shared\Event\DomainEvent;
final readonly class OrderPlaced implements DomainEvent
{
public function __construct(
public string $eventId,
public string $orderId,
public string $customerId,
public int $totalCents,
public \DateTimeImmutable $occurredAt,
public ?string $correlationId = null,
public ?string $causationId = null
) {}
public function eventName(): string
{
return 'order.placed';
}
public function aggregateId(): string
{
return $this->orderId;
}
public function toArray(): array
{
return [
'event_id' => $this->eventId,
'order_id' => $this->orderId,
'customer_id' => $this->customerId,
'total_cents' => $this->totalCents,
'occurred_at' => $this->occurredAt->format('c'),
'correlation_id' => $this->correlationId,
'causation_id' => $this->causationId,
];
}
}
Event Publisher Interface
php
<?php
declare(strict_types=1);
namespace Application\Shared\Port\Output;
use Domain\Shared\Event\DomainEvent;
interface EventPublisherInterface
{
public function publish(DomainEvent $event): void;
/** @param array<DomainEvent> $events */
public function publishAll(array $events): void;
}
Event Consumer/Handler
php
<?php
declare(strict_types=1);
namespace Application\Order\EventHandler;
use Application\Shared\Port\Output\EventHandlerInterface;
use Domain\Order\Event\OrderPlaced;
final readonly class SendOrderConfirmationEmail implements EventHandlerInterface
{
public function __construct(
private EmailServiceInterface $emailService,
private CustomerRepositoryInterface $customers
) {}
public function __invoke(OrderPlaced $event): void
{
$customer = $this->customers->findById($event->customerId);
$this->emailService->send(
to: $customer->email(),
template: 'order-confirmation',
data: [
'order_id' => $event->orderId,
'total' => $event->totalCents / 100,
]
);
}
public static function subscribedTo(): string
{
return OrderPlaced::class;
}
}
RabbitMQ Publisher (Infrastructure)
php
<?php
declare(strict_types=1);
namespace Infrastructure\Messaging\RabbitMQ;
use Application\Shared\Port\Output\EventPublisherInterface;
use Domain\Shared\Event\DomainEvent;
use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Message\AMQPMessage;
final readonly class RabbitMQEventPublisher implements EventPublisherInterface
{
public function __construct(
private AMQPChannel $channel,
private string $exchangeName
) {}
public function publish(DomainEvent $event): void
{
$message = new AMQPMessage(
json_encode($event->toArray()),
[
'content_type' => 'application/json',
'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT,
'message_id' => $event->eventId,
'timestamp' => $event->occurredAt->getTimestamp(),
]
);
$this->channel->basic_publish(
$message,
$this->exchangeName,
$event->eventName()
);
}
public function publishAll(array $events): void
{
foreach ($events as $event) {
$this->publish($event);
}
}
}

Common Violations Quick Reference

ViolationWhere to LookSeverity
Synchronous calls disguised as eventsConsumer calls HTTP APICritical
Missing idempotencyNo deduplication checkCritical
Tight coupling via eventsEvent contains entity referencesWarning
Fire and forgetNo error handling on publishWarning
Blocking consumerSlow processing without asyncWarning

Detection Patterns

bash
# Find event classes
Glob: **/Event/**/*Event.php
Glob: **/Events/**/*.php
# Check for event publishers
Grep: "EventPublisher|EventDispatcher|publish\(" --glob "**/*.php"
# Find event handlers/consumers
Grep: "implements.*EventHandler|implements.*Consumer" --glob "**/*.php"
# Check for message broker usage
Grep: "AMQPChannel|RabbitMQ|Kafka" --glob "**/Infrastructure/**/*.php"
# Find potential issues
Grep: "new.*Event\(" --glob "**/Controller/**/*.php" # Events in controllers
Grep: "->findById|->save" --glob "**/EventHandler/**/*.php" # Sync calls in handlers

References

For detailed information, load these reference files:

  • references/event-patterns.md — Event types, structure, publishing patterns
  • references/messaging-patterns.md — Message broker patterns, queues, topics
  • references/saga-patterns.md — Distributed transactions, choreography, orchestration
  • references/antipatterns.md — Common violations with detection patterns

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
96
Repository forks
25
7-day trend score
23

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dykyi-roman/awesome-claude-code/eda-knowledge/badge)](https://verified-skill.com/skills/dykyi-roman/awesome-claude-code/eda-knowledge)

Something wrong with this skill or its page? Tell us.