Architecture Event Drivenのロゴ

Architecture Event Driven

コミュニティ
j4flmao
architecture-event-driven

Use this skill when the user says 'event-driven architecture', 'EDA', 'pub/sub between services', 'domain events', 'Kafka vs RabbitMQ vs SQS', 'dual write', 'transactional outbox', 'event schema', 'eventual consistency', 'choreography'. Designs asynchronous service integration: event vs command semantics, broker choice, delivery guarantees, outbox/inbox, ordering and partitioning, schema evolution, and tracing. Do NOT use for: implementation recipes inside one backend stack (backend/universal/event-driven, backend/universal/transactional-outbox), event sourcing as a persistence model (backend/universal/event-sourcing), or stream analytics (data/streaming).

概要

公開者j4flmao
リポジトリagent-skills
スキル名architecture-event-driven
スター
41
フォーク
6
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    j4flmaoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Architecture Event Driven」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-driven
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/architecture/event-driven .claude/skills/architecture-event-driven
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでArchitecture Event Drivenを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にArchitecture Event Drivenを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Architecture Event Drivenは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Event-Driven Architecture

Purpose

In EDA, services publish facts ("OrderPlaced") and other services react, so producers do not depend on consumers being available or even known. The price is eventual consistency, harder debugging, and the need for reliable publishing and idempotent consumption. This skill covers the architectural decisions that make EDA correct, not just decoupled.

Agent Protocol

Trigger

"event-driven", "EDA", "domain events", "pub/sub", "message broker choice", "dual-write problem", "outbox", "at-least-once", "event ordering", "event versioning", "choreography".

Input Context

  • Business flows and which steps must be synchronous for the user.
  • Throughput, ordering needs (per entity?), retention/replay needs.
  • Existing infra (Kafka, RabbitMQ, cloud queues) and team experience.
  • Consistency requirements and failure tolerance.

Output Artifact

Event catalog, broker/topology choice, delivery and idempotency design, schema/versioning policy, observability plan.

Response Format

Event: {Name}(past tense) v{n}  Producer: {service}  Consumers: {services}
Key (ordering): {aggregate id}  Topic/queue: {name}  Retention: {duration}
Publish: outbox -> {relay: CDC|poller}  Delivery: at-least-once
Consumer: idempotent via {inbox table|natural upsert}; DLQ: {name}
Schema: {Avro|Protobuf|JSON Schema} compatibility={BACKWARD}

Completion Criteria

  • Each message classified as event (fact) or command (request).
  • No dual writes: outbox or CDC for publishing.
  • Consumers idempotent; DLQ and retry policy defined.
  • Ordering key chosen per aggregate where order matters.
  • Trace context propagated in message headers.

Events vs Commands vs Queries

KindMeaningAddressed toCan be rejected?Transport
Event"OrderPlaced" happenedAnyone interestedNo (it is a fact)Topic / pub-sub
Command"ReserveStock" pleaseOne ownerYesQueue or RPC
Query"What is the stock?"One ownern/aSync RPC

Event payload style: thin events (id + type; consumers call back for details) couple consumers to the producer API at read time; fat/event-carried state transfer (include the relevant data) lets consumers build local read models. Prefer fat events for integration, scoped to what consumers need.

Broker Choice

BrokerModelStrengthsWatch out
Kafka (or Redpanda)Partitioned replicated logReplay, high throughput, per-partition order, many consumer groupsOps complexity; ordering only within a partition
RabbitMQQueues with exchanges/routingFlexible routing, per-message acks, prioritiesReplay limited (streams feature helps)
AWS SNS + SQSFan-out topic → queuesManaged, simpleStandard queues unordered; FIFO queues have lower throughput
Google Pub/Sub, Azure Service Bus/Event HubsManaged pub/sub / logManaged scalingProvider-specific semantics
NATS JetStreamStreams + consumersLightweight, low latencySmaller ecosystem

Reliable Publishing: Transactional Outbox

Writing to the database and the broker separately can lose or invent events when one write fails. Write the event to an outbox table in the same transaction as the state change, then relay it.

sql
CREATE TABLE outbox (
  id            BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  event_id      UUID NOT NULL UNIQUE,          -- consumers dedupe on this
  aggregate_id  TEXT NOT NULL,                 -- becomes the message key
  event_type    TEXT NOT NULL,
  payload       JSONB NOT NULL,
  created_at    TIMESTAMPTZ NOT NULL DEFAULT now(),
  published_at  TIMESTAMPTZ
);

BEGIN;
INSERT INTO orders (id, customer_id, total_cents) VALUES ($1, $2, $3);
INSERT INTO outbox (event_id, aggregate_id, event_type, payload)
VALUES ($4, $1, 'OrderPlaced.v1', $5);
COMMIT;

Relay options:

  • CDC (Debezium reading the WAL, with its outbox event router): low latency, no polling load.
  • Poller: SELECT ... WHERE published_at IS NULL ORDER BY id LIMIT 100 FOR UPDATE SKIP LOCKED, publish, then mark published. Simple; a crash between publish and mark causes a duplicate, which consumers must tolerate.

Either way delivery is at-least-once, never exactly-once end to end.

Idempotent Consumers (Inbox)

python
def handle(message, conn) -> None:
    event_id = message.headers["event_id"]
    with conn.transaction():
        inserted = conn.execute(
            "INSERT INTO inbox (event_id, received_at) VALUES (%s, now()) ON CONFLICT DO NOTHING",
            (event_id,),
        ).rowcount
        if inserted == 0:
            return                      # duplicate: already processed
        apply_business_change(conn, message.value)
    # commit offset / ack only after the transaction commits

Retry transient failures with bounded backoff; route poison messages to a dead-letter queue with the error attached; alert on DLQ depth.

Ordering and Partitioning

  • Order is only guaranteed within a partition/queue; use the aggregate id as the key so all events for one order land in order.
  • Consumers must not assume global order across aggregates.
  • Carry a per-aggregate version/sequence number so consumers can detect gaps or stale events.

Schema and Versioning

  • Use a schema registry (Avro/Protobuf/JSON Schema) with compatibility checks in CI.
  • Additive changes only (new optional fields); breaking change = new event type/version (OrderPlaced.v2), dual-publish during migration.
  • Standard envelope: CloudEvents attributes (id, source, type, specversion, time, subject) plus W3C traceparent header.

Observability

Propagate trace context through message headers (OpenTelemetry messaging conventions) so one trace links the HTTP request, the outbox relay, and every consumer. Track consumer lag, DLQ depth, and end-to-end latency (event time → processed time).

Hazards

HazardMitigation
Event pinball (chains across many services)Distributed tracing; prefer an orchestrated saga for multi-step business processes
Eventual consistency surprises in UIOptimistic UI, read-your-writes from the owning service, status polling or push
Consumer coupling to producer internalsPublish integration events, not table-row changes
Unbounded retries blocking a partitionRetry topics / DLQ with backoff
Lost events from dual writesOutbox or CDC only

Checklist

  • Event catalog with owners, keys, schemas, consumers.
  • Outbox/CDC publishing; no direct broker write inside business transactions.
  • Inbox or natural idempotency on every consumer.
  • DLQ + alerting; replay procedure documented.
  • Schema registry and compatibility gate.
  • Tracing headers and lag dashboards.

References

  • CQRS & Event Sourcing — read models and event-sourced aggregates.
  • Richardson, "Microservices Patterns" — transactional outbox, saga.
  • Debezium documentation: outbox event router; CloudEvents specification (CNCF).

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Architecture Event Driven」では何ができますか?

Use this skill when the user says 'event-driven architecture', 'EDA', 'pub/sub between services', 'domain events', 'Kafka vs RabbitMQ vs SQS', 'dual write', 'transactional outbox', 'event schema', 'eventual consistency', 'choreography'. Designs asynchronous service integration: event vs command semantics, broker choice, delivery guarantees, outbox/inbox, ordering and partitioning, schema evolution, and tracing. Do NOT use for: implementation recipes inside one backend stack (backend/universal/event-driven, backend/universal/transactional-outbox), event sourcing as a persistence model (backe...

TypingMindでArchitecture Event Drivenを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Architecture Event Drivenはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにArchitecture Event Drivenをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-drivenを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Architecture Event Drivenを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Architecture Event Drivenで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもArchitecture Event Drivenを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Architecture Event Driven」は無料ですか?

はい。j4flmaoがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇