Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
日本語の概要は準備中です。原文の説明を表示しています。
Event Sourcing knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Event Sourcing architecture audits.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Quick reference for Event Sourcing architecture patterns and PHP implementation guidelines.
Traditional Storage: Event Sourcing:
┌─────────────────┐ ┌─────────────────┐
│ Current State │ │ Event Stream │
│ ───────────── │ │ ───────────── │
│ Order #123 │ │ 1. OrderCreated│
│ Status: Paid │ │ 2. ItemAdded │
│ Total: $150 │ │ 3. ItemAdded │
└─────────────────┘ │ 4. OrderPaid │
↓ └────────┬────────┘
Direct update │
▼
┌─────────────────┐
│ Current State │
│ (Rebuilt from │
│ events) │
└─────────────────┘
Rule: Store events, derive state. Never modify events.
| Concept | Description |
|---|---|
| Event | Immutable record of something that happened |
| Event Store | Append-only storage for events |
| Event Stream | Ordered sequence of events for one aggregate |
| Aggregate | Consistency boundary, rebuilt from events |
| Projection | Read model built by processing events |
| Snapshot | Cached aggregate state for performance |
| Violation | Where to Look | Severity |
|---|---|---|
| Mutable event | Event with setters | Critical |
| Direct state mutation | Aggregate bypassing events | Critical |
| Missing event data | Event without full state info | Critical |
| Event with logic | Event doing calculations | Warning |
| Non-idempotent projection | Projection with side effects | Warning |
| Missing metadata | Event without timestamp/IDs | Warning |
final readonly class OrderConfirmedEvent
{
public function __construct(
public string $orderId,
public int $totalCents,
public string $currency,
public DateTimeImmutable $confirmedAt,
public EventMetadata $metadata
) {}
}
final readonly class EventMetadata
{
public function __construct(
public string $eventId,
public DateTimeImmutable $occurredAt,
public ?string $causationId = null,
public ?string $correlationId = null,
public int $version = 1
) {}
}
final class Order extends EventSourcedAggregate
{
private OrderStatus $status;
private Money $total;
public static function create(OrderId $id, CustomerId $customerId): self
{
$order = new self($id);
$order->recordThat(new OrderCreatedEvent(
orderId: $id->value,
customerId: $customerId->value,
createdAt: new DateTimeImmutable()
));
return $order;
}
public function confirm(): void
{
if ($this->status !== OrderStatus::Draft) {
throw new InvalidStateException();
}
$this->recordThat(new OrderConfirmedEvent(
orderId: $this->id->value,
totalCents: $this->total->cents(),
currency: $this->total->currency(),
confirmedAt: new DateTimeImmutable()
));
}
protected function applyOrderCreatedEvent(OrderCreatedEvent $event): void
{
$this->status = OrderStatus::Draft;
$this->total = Money::zero('USD');
}
protected function applyOrderConfirmedEvent(OrderConfirmedEvent $event): void
{
$this->status = OrderStatus::Confirmed;
}
}
final class OrderListProjection
{
public function __construct(
private Connection $connection
) {}
public function applyOrderCreatedEvent(OrderCreatedEvent $event): void
{
$this->connection->insert('order_list', [
'id' => $event->orderId,
'customer_id' => $event->customerId,
'status' => 'draft',
'created_at' => $event->createdAt->format('Y-m-d H:i:s'),
]);
}
public function applyOrderConfirmedEvent(OrderConfirmedEvent $event): void
{
$this->connection->update('order_list', [
'status' => 'confirmed',
'total_cents' => $event->totalCents,
'confirmed_at' => $event->confirmedAt->format('Y-m-d H:i:s'),
], ['id' => $event->orderId]);
}
}
For detailed information, load these reference files:
references/event-store-patterns.md — Event persistence, streams, concurrencyreferences/projection-patterns.md — Read model projectionsreferences/snapshot-patterns.md — Performance optimization with snapshotsreferences/versioning-patterns.md — Event schema evolutionreferences/antipatterns.md — Common violations with detection patternsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
日本語の概要は準備中です。原文の説明を表示しています。
在每次回复中使用固定前缀并列出本次实际参考的指令/文件,便于校验是否遵循上下文与规则。
日本語の概要は準備中です。原文の説明を表示しています。
Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
日本語の概要は準備中です。原文の説明を表示しています。
Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.
日本語の概要は準備中です。原文の説明を表示しています。
Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.
日本語の概要は準備中です。原文の説明を表示しています。
[00] META. Orchestrate skills into dynamic chains for complex tasks. Analyzes the task, discovers available skills, builds an optimal chain, explains why each skill is needed, and executes step-by-step with user confirmation. Use for any complex task requiring multiple thinking/research/analysis steps. Triggers on "plan this", "how to approach", "what's the strategy", "build a plan", or any multi-step problem requiring skill orchestration.
日本語の概要は準備中です。原文の説明を表示しています。