yonatankarp/software-design-skills

ddd-bounded-context

Use when drawing or auditing model boundaries — phrases like "bounded context", "where do we draw the line between X and Y", "this model is getting muddled", "should this be one service or two", "the same word means different things in different places".

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/yonatankarp/software-design-skills --skill ddd-bounded-context

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

One-line summary

A bounded context is the explicit boundary within which a single model — and the ubiquitous language that names it — is consistent and complete.

When to use this skill

  • The same noun means two different things in different parts of the system ("customer" in sales vs "customer" in support).
  • A model is growing tangled and individual changes ripple in unexpected directions.
  • Team boundaries don't match code boundaries.
  • The team is debating "should this be its own service?".

When NOT to use this skill

  • Within-context refactoring — delegate to tactical pattern skills.
  • Questions about how contexts relate to each other → route to ddd-context-mapping.
  • Allocating modeling effort across the business → route to ddd-subdomain-classification.

Core content

A bounded context is conceptual, not deployment-bound. It is the scope within which a model holds together. It can be a module, a package, a microservice, or a whole system — what matters is that inside the boundary, every term has one meaning and every rule is consistent.

Signals that a boundary is needed.

  • The same word means two different things in two different parts of the system.
  • Two rules of the model contradict each other depending on which area of code is running.
  • Two teams keep stepping on each other's changes to "the same" model.
  • The UI for one user group looks nothing like the UI for another, but they hit the same domain code.

Context vs microservice. A bounded context is a model boundary; a microservice is a deployment boundary. They often coincide but don't have to. A single service can host two contexts (kept clean by module boundaries). Two services can implement the same context (rare, usually a mistake).

Naming the boundary. Give each context a name that reflects its business purpose: Sales, Billing, Shipping, Identity. Avoid technical names (Backend, Core). The name should make sense to a domain expert.

Decision heuristics

  • Prefer fewer, larger contexts at the start of a project. Splitting is cheap; merging is expensive.
  • Split when terms collide irreconcilably, when teams need autonomy, or when the model rules contradict.
  • Do not assume one bounded context per microservice. The mapping is decided by the model, not the deployment topology.

Anti-patterns

  • Declaring a bounded context per database table — performative, no model boundary actually drawn.
  • Ignoring boundaries until the model breaks — by which point the cleanup is a major project.
  • Treating "bounded context" as a synonym for "microservice".
  • Drawing a boundary without naming the ubiquitous language inside it.

See also

  • ddd-ubiquitous-language — what lives inside the boundary.
  • ddd-context-mapping — how contexts relate to each other.
  • ddd-subdomain-classification — which contexts deserve the most effort.

References

  • Evans, Domain-Driven Design (2003), Ch. 14 (Maintaining Model Integrity).

Verwandte Aufgaben

aus demselben Repository

Weitere Skills

Alle Skills
yonatankarp
Community

arch-adr

Use when recording an architectural decision so future maintainers know why — phrases like "ADR", "architecture decision record", "why did we pick X", "lightweight architecture documentation", "decision log", "should this be an ADR", "tribal knowledge", "we chose this two years ago and now nobody remembers why". Defines the ADR as a short, structured document capturing what was decided, why, alternatives considered, and consequences — written at the time of the decision and kept in the repo.

Installationen
2
GitHub Stars
1
Aktualisiert
19. Mai
yonatankarp
Community

arch-fitness-functions

Use when enforcing architectural characteristics through automation — phrases like "architecture fitness function", "evolutionary architecture", "architecture tests", "ArchUnit", "dependency rules in CI", "automated architecture checks", "guardrails", "drift detection". Defines fitness functions as automated checks that verify architectural characteristics on every change, catching drift before it accumulates.

Installationen
2
GitHub Stars
1
Aktualisiert
19. Mai
yonatankarp
Community

arch-microservices

Use when designing or reviewing a microservices architecture — phrases like "microservices", "should we split this service", "service boundaries", "bounded context per service", "API gateway", "backend for frontend", "BFF", "service mesh", "microservices vs monolith", "database per service", "data ownership". Defines microservices as independently deployable services aligned with business capabilities — and the discipline of resisting the style until the monolith proves inadequate.

Installationen
2
GitHub Stars
1
Aktualisiert
19. Mai
yonatankarp
Community

arch-strangler-fig

Use when migrating a legacy system incrementally — phrases like "strangler fig", "strangler pattern", "incremental migration", "monolith to microservices", "rewrite without big bang", "replace legacy in place", "facade in front of the legacy system", "anticorruption layer". Defines Fowler's Strangler Fig as the migration discipline of gradually replacing legacy functionality behind a stable facade, never doing a big-bang rewrite.

Installationen
2
GitHub Stars
1
Aktualisiert
19. Mai