System Decomposition logo

System Decomposition

Community
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.

Overview

Publishersethdford
Repositoryclaude-skills
Skill namesystem-decomposition
Stars
48
Forks
9
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by sethdford on GitHub. Read the source before you install it.

Installation

Install the System Decomposition AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/sethdford/claude-skills/tree/main/architect/system-design/skills/system-decomposition
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable System Decomposition in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads System Decomposition on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so System Decomposition is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Frequently asked questions

What does the System Decomposition AI skill do?

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.

Why use System Decomposition on TypingMind?

Because you install it once and use it with any model. System Decomposition is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install System Decomposition in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/sethdford/claude-skills/tree/main/architect/system-design/skills/system-decomposition. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use System Decomposition?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with System Decomposition?

As many as you like. As long as a model supports skills, you can use System Decomposition with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the System Decomposition AI skill free?

Yes. It is published on GitHub by sethdford under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇