System Decompositionのロゴ

System Decomposition

コミュニティ
sethdford
system-decomposition

Break complex systems into bounded contexts with DDD. Map business capabilities to service boundaries, define ubiquitous language, assess cohesion/coupling. Use when refactoring monoliths or designing new architectures.

概要

公開者sethdford
リポジトリclaude-skills
スキル名system-decomposition
スター
48
フォーク
9
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

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

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

スキルの指示

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

System Decomposition

Systematically decompose complex systems using Domain-Driven Design: identify business capabilities, define bounded contexts, evaluate cohesion/coupling, design integration patterns.

Context

You are decomposing a system into services or modules. Your role is to:

  • Map business capabilities (not technical layers)
  • Define bounded contexts with explicit boundaries
  • Establish ubiquitous language (shared vocabulary per context)
  • Assess cohesion (focus) and coupling (dependencies)
  • Design integration patterns (sync API vs async events)

Good decomposition follows business domains, not technology layers. Anti-pattern: UserService, OrderService, PaymentService (implementation detail names) instead of Auth Realm, Commerce Hub, Payment Platform (domain names).

Domain Context

Based on Eric Evans' Domain-Driven Design and Sam Newman's Building Microservices:

  • Bounded Context: Explicit boundary around business capability. Each context has its own domain model.
  • Ubiquitous Language: Shared vocabulary within context (Order, Customer, Invoice). Prevents translation errors.
  • Aggregate: Entity cluster within context. Single consistency boundary. Example: Order + OrderItems as one aggregate.
  • Integration: How contexts communicate (Sync via API, Async via events, Shared database)
  • Cohesion: Does everything in the context serve one purpose?
  • Coupling: How many other services must it call?

When to Use This Skill

  • Breaking monolith into services
  • Designing new system architecture
  • Refactoring tight coupling
  • Aligning engineering teams to services
  • Preparing for independent scaling/deployment

Prerequisites

  • Understand business domains and pain points
  • Know current system architecture (if refactoring)
  • Have stakeholders available to discuss domain
  • Can draw diagrams (whiteboard, miro, draw.io)

Instructions (Detailed)

1. Identify Business Capabilities

Ask: "What does the business do?"

Example (E-commerce):

  • Authentication (who are you?)
  • Commerce (what do you want?)
  • Payment (how much does it cost?)
  • Fulfillment (ship it)
  • Analytics (understand customers)
  • Support (help customers)

Each capability can become a bounded context.

2. Define Bounded Contexts

For each capability, establish boundary with explicit name and responsibilities.

Example:

Auth Realm (Authentication)
- User registration, login, session management
- Produces: authenticated identity tokens
- Language: User, Credential, Session, Auth Token

Commerce Hub (Order Processing)
- Order creation, cart management, inventory
- Consumes: Auth tokens
- Produces: Order events
- Language: Order, Customer, Product, Cart, OrderItem

Payment Platform (Payment Processing)
- Payment processing, refunds, accounting
- Consumes: Order events
- Produces: Payment status events
- Language: Payment, Invoice, Transaction, Settlement

3. Map Ubiquitous Language

Define key terms within each context:

Auth Realm:
- "User" = identity with credentials
- "Session" = authenticated connection

Commerce Hub:
- "Order" = customer purchase request
- "Customer" = entity that places orders (different from Auth's User)

Payment Platform:
- "Invoice" = billable entity (different from Order)
- "Settlement" = final accounting status

Contexts use same words differently. Clear boundaries prevent confusion.

4. Assess Cohesion & Coupling

Cohesion (within context):

  • Do all functions serve one purpose? (high = good)
  • Would we change them for the same business reason? (yes = high cohesion)

Coupling (between contexts):

  • How many services must this call to complete a request?
  • Sync vs Async: Sync = tight coupling, Async = loose coupling
  • Target: Cohesion >80%, Coupling <3 sync calls/request

5. Design Integration Patterns

Synchronous (API call):

  • Used for immediate results
  • Tightly coupled
  • Simple debugging
  • Example: User creates order → Commerce Hub calls Payment Platform → charge card immediately

Asynchronous (event):

  • Fire-and-forget
  • Loosely coupled
  • Difficult debugging
  • Example: Order created → event published → Payment Platform subscribes and processes later

6. Create Context Diagram

Boxes = Contexts, Arrows = Synchronous calls, Events = Asynchronous communication.

┌──────────────┐        ┌──────────────┐        ┌──────────────┐
│  Auth Realm  │        │Commerce Hub  │        │   Payment    │
│              │        │              │        │  Platform    │
│ - Register   │──API───│ - Order      │───API──│ - Process    │
│ - Login      │        │   creation   │        │   payment    │
│ - Session    │        │ - Inventory  │        │ - Refund     │
└──────────────┘        │              │        └──────────────┘
                        │ Order Created│
                        │ Event ────────────────┐
                        └──────────────┘        │
                                        Event Handler
                                        (async payment)

7. Verify Against Anti-Patterns

  • Distributed monolith: Services so tightly coupled they act as one → redraw boundaries
  • Service per table: Data-driven decomposition (wrong) instead of domain-driven (right)
  • Chatty services: Need >10 calls to complete request → larger bounded contexts
  • God context: One service does everything → split into multiple contexts

Output Format

When decomposing, deliver:

  1. Business Capabilities: What the system does
  2. Bounded Contexts: Explicit boundaries with names
  3. Context Diagram: Visual showing contexts and integration
  4. Ubiquitous Language: Key terms per context
  5. Integration Patterns: Sync/Async by integration point
  6. Cohesion/Coupling Assessment: Scores for each context
  7. Deployment Plan: How to implement decomposition

Worked Example

Monolith: Single "UserService" handling everything (100K lines)

Issues:

  • Changes to UI tier require payment code changes
  • Teams can't deploy independently
  • Database contention

Decomposition:

Bounded Contexts:
1. Auth Realm: Registration, login, profiles
2. Commerce Hub: Orders, cart, inventory
3. Payment Platform: Payments, invoicing, settlements
4. Analytics: User behavior, metrics

Cohesion Scores:

  • Auth Realm: 95% (all about identity)
  • Commerce Hub: 85% (order-related, but inventory is borderline)
  • Payment Platform: 90% (all about money)

Coupling Analysis:

  • Commerce → Payment (sync): Payment::charge(amount)
  • Order Created → Analytics (async): Event subscriber

Integration:

Commerce Hub: POST /payment/charge with Order details
Response: Payment ID + status
On failure: Rollback order

Analytics: Subscribes to "OrderCreated" event
No coupling: Order doesn't wait for analytics

Decision Framework

  • One large context or many small?: Start coarse; split when pain emerges
  • Sync or Async?: Sync if needs immediate response (payment); Async if fire-and-forget (notifications)
  • Shared data or separate databases?: Separate per context (independence); shared only for atomic transactions
  • Communication overhead?: If sync calls >3 per request, reconsider boundaries

Anti-Patterns

  • Premature Microservices: Break before understanding domains
  • Technology-Driven: "Python team" vs "Python-for-ML domain"
  • Ignoring Coupling: Services talk to every other service
  • No Ubiquitous Language: Same word means different things

Quality Checklist

  • Each context has single business responsibility
  • Contexts named after domain (not tech: "Auth Realm" not "UserService")
  • Ubiquitous language documented per context
  • Cohesion >80% for each context
  • Coupling <3 sync calls per request
  • Integration patterns clear (sync/async)
  • Deployment independence verified
  • Teams can own individual contexts

Further Reading

  • Eric Evans, Domain-Driven Design (2003) — Foundational
  • Sam Newman, Building Microservices (2nd ed., 2021) — Practical decomposition
  • Dora et al., Accelerate — Impact of decomposition on deployment frequency

よくある質問

AIスキル「System Decomposition」では何ができますか?

Break complex systems into bounded contexts with DDD. Map business capabilities to service boundaries, define ubiquitous language, assess cohesion/coupling. Use when refactoring monoliths or designing new architectures.

TypingMindでSystem Decompositionを使うメリットは何ですか?

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

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

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/sethdford/claude-skills/tree/main/architect/system-design/skills/system-decompositionを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

System Decompositionを使えるAIモデルはどれですか?

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

System Decompositionは何個のAIモデルで使えますか?

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

AIスキル「System Decomposition」は無料ですか?

はい。sethdfordがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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