Logo von Modular Design Principles

Modular Design Principles

OrganisationBeliebt
tech-leads-club
modular-design-principles

Technology-agnostic guidance for modular systems: bounded contexts, clear boundaries, composability, state isolation, explicit contracts, failure containment, scaffolding workflows, split/merge criteria, sub-units inside a context, and compliance review signals. Use when designing or reviewing module structure, service boundaries, package layout, cross-cutting dependencies, "how should we split this?", modularity assessments, coupling between domains, greenfield context design, or architecture discussions without assuming a specific framework, language, or repository layout. Do NOT use for executing the full Patterns 1–5 repo decomposition pipeline or per-pattern inventories (use modular-decomposition), phased extraction roadmaps as the main deliverable (use decomposition-planning-roadmap), or end-to-end legacy migration strategy (use legacy-migration-planner).

Übersicht

Herausgebertech-leads-club
Repositoryagent-skills
Skill-Namemodular-design-principles
Sterne
6.3K
Forks
530
Mitgelieferte Dateien
1
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 1

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von tech-leads-club auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Modular Design Principles in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(architecture)/modular-design-principles
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.

In TypingMind verwenden

Aktivieren Sie Modular Design Principles in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Modular Design Principles automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Modular Design Principles nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Modular Design Principles

Use this skill when reasoning about structure and boundaries in any codebase. It intentionally avoids framework names, folder conventions, and tooling — map principles to your stack locally.

What to load

TaskWhere
Principles table + violations + workflows (this file)SKILL.md
Per-principle definition, agent rules, abstract examplesreferences/principles.md

Layered mental model

  • Composition roots (applications, hosts, runners): wire modules together; keep orchestration thin.
  • Modules / bounded contexts: cohesive units of behavior and data ownership; each should be understandable and testable on its own.
  • Shared kernels (use sparingly): only stable, truly cross-cutting concepts; resist turning them into a grab-bag of “everything everyone needs.”

How you physically lay this out (mono repo, multi repo, packages, libraries) is a delivery choice, not the definition of modularity. The principles below still apply.


The ten principles

#PrincipleIntent
1Well-defined boundariesA small, stable public surface; everything else is internal. Consumers depend on contracts, not internals.
2ComposabilityModules can be used alone or combined without special knowledge of each other’s internals.
3IndependenceNo hidden shared mutable state across boundaries; each module should be testable in isolation (with fakes or test doubles at the edges).
4Individual scaleResources (compute, storage, rate limits, batch size) can be tuned per module where it matters, without rewriting others.
5Explicit communicationCross-module interaction uses documented contracts (APIs, events, messages, shared types) — not incidental coupling.
6ReplaceabilityDependencies on other modules are expressed through interfaces or protocols so implementations can change.
7Deployment independenceModules do not assume they share a process, host, or release cadence unless that is an explicit architectural decision.
8State isolationEach module owns its persistent state and naming; no silent sharing of the same logical data store or ambiguous global names across boundaries.
9ObservabilityEach module can be diagnosed on its own: logs, metrics, traces, health — attributable to the unit that emitted them.
10Fail independenceFailures are contained (timeouts, bulkheads, circuit breaking, idempotency) so one module’s outage does not blindly cascade.

Principle 8 is often the hardest: ambiguous ownership of data or names is a frequent source of “works until it doesn’t” integration bugs.

For depth (rules for agents + abstract examples per principle), load references/principles.md.


Typical violations (stated abstractly)

  1. Colliding concepts — the same name or schema for different things in different modules, or duplicate “global” definitions that diverge over time.
  2. Reach-through persistence — one module reading or writing another module’s tables, buckets, or documents without going through an agreed contract.
  3. Centralized data ownership — a single persistence layer that registers and exposes all stores for all modules, encouraging hidden coupling.
  4. Logic at the edge — business rules in transport adapters (HTTP handlers, UI, CLI) instead of domain/application code.
  5. Edge talking to storage directly — adapters depending on low-level persistence APIs instead of use cases or application services.
  6. Unscoped transactions — writes that span boundaries without clear transaction ownership and failure semantics.
  7. Leaky exports — repositories, internal services, or implementation types exposed as the module’s public API.
  8. Facades that aren’t thin — “public” entry points that embed querying, mapping, or policy instead of delegating to the right layer inside the module.

Creating a bounded context (workflow)

Use when introducing a new cohesive area of the system (greenfield module or extracted domain).

  1. Scope and language — Name the context; list core nouns/verbs (ubiquitous language). Reject vague names that collide with other contexts.
  2. Responsibilities — What decisions happen only here? What is explicitly out of scope?
  3. State ownership — Which facts are authoritative in this context? Where are they stored conceptually (even if storage tech is undecided)?
  4. Public contract — Operations and/or events other contexts may use. Version or evolve this contract intentionally.
  5. Integrations — For each neighbor: sync call, async message, shared read model, or batch sync? Document consistency (immediate, eventual) and failure behavior.
  6. Invariants and lifecycles — What must always be true inside this boundary? What starts/completes a lifecycle?
  7. Isolation check — Can you test core behavior without spinning up unrelated contexts (fakes at ports)?
  8. Observability — How will you trace a request or job through this context with clear identifiers?

Cross-module interaction (while designing): prefer the minimal contract; define timeouts, retries, idempotency for async; avoid “temporary” direct store access as a shortcut.


When to split or merge

Default: fewer boundaries until real pain appears — “flat is often better” than premature fragmentation. Splitting adds coordination, versioning, and operational cost.

Six-criteria test (favor split when several are true)

#CriterionQuestion
1LanguageDo the sub-areas use different vocabulary or conflicting definitions of the same word?
2Rate of changeDo parts change on different cadences or for unrelated reasons (most edits touch one side)?
3Scale / SLODo parts need different throughput, latency, or availability targets?
4ConsistencyDo they need different transaction boundaries (cannot share one atomic write model cleanly)?
5OwnershipWould different teams or clear ownership lines reduce conflict and review churn?
6Pain signalIs there observable integration pain: ripple effects, fear of change, unclear who owns a bug?

Cohesion / coupling (qualitative). Favor high cohesion inside a module and low, explicit coupling between modules. If the only motivation is “files got big” or “folder aesthetics,” merge or wait.

When to merge or not split yet

  • Boundaries are artificial (same language, same lifecycle, constant cross-calls).
  • Splitting would duplicate logic or data without a clear single writer rule.
  • Team is not ready to own contracts, versioning, and ops for extra units.

Decision prompts (short)

  • Would separation reduce accidental coupling more than it increases coordination cost?
  • Is there a natural ubiquitous language boundary, or only a technical seam?

Sub-units inside a bounded context

Sometimes one outer boundary is right, but inside it there are named sub-areas (subdomains, feature areas). Principles still apply within the context.

Ownership

  • Each sub-unit should own its slice of model and persistence concerns where possible — avoid one mega registration layer that wires every store and repository for every sub-unit in one place (encourages reach-through and hidden coupling).

Cross-sub-unit access

  • Prefer internal application APIs or thin internal facades (same context, explicit surface) over peers importing each other’s storage types directly.
  • For async flows, prefer enriched payloads so handlers do not chat across sub-units for data that could travel with the event/command.

Shared kernel inside the context

  • Small, stable shared types or enums can live in a narrow shared area — but resist a growing “utils” dump that becomes the real coupling point.

Anti-pattern: A single “persistence” or “data” sub-module that becomes the only place that knows about all tables/documents for all sub-units, and everyone else reaches through it — same problems as cross-context reach-through, inside the boundary.


Architecture compliance pass

Use for reviews or audits without assuming tooling. Treat items as signals, not proof — confirm with domain experts.

Dependency and API signals

  • Inbound vs outbound: Dependencies should align with your chosen architecture (e.g. domain at the center, adapters outside). Inward leaks of infrastructure types into core logic are a smell.
  • Public surface: Can you list exported operations/events/types without including storage or internal services? If not, boundaries are leaky.
  • Neighbor imports: Types or clients from module A used in module B — are they only contract types, or persistence/implementation types?

Persistence and data signals

  • Reach-through: References to another context’s physical data (schema, collection, bucket name) outside an agreed contract.
  • Naming collisions: Same logical name for different things, or shared global IDs without a documented mapping rule.
  • Transaction ownership: Writes that span contexts without a clear saga, outbox, or single-owner rule and documented failure cases.

Operational signals

  • Blame: Incidents where “we don’t know which module owns this row/behavior” → ownership or observability gap.
  • Cascades: One dependency’s slowdown or failure takes down unrelated user journeys → missing timeouts, bulkheads, or degradation paths.

Severity heuristic (for reporting)

TierMeaning
P0Data corruption risk, security boundary violation, or cross-context persistence with no contract
P1Unclear ownership, leaky public API, missing failure semantics at boundaries
P2Observability gaps, composability smells, tech debt that increases future coupling

Maturity note: Scoring is qualitative unless the team defines numeric gates. Use trends: fewer P0/P1 over time, clearer contracts.


Quick checklist (before proposing structure)

  • Public API is minimal; internals are not exported casually.
  • Names and storage ownership are unambiguous per module.
  • No cross-module persistence shortcuts without an explicit contract.
  • Business rules sit behind a clear application/domain layer, not only in adapters.
  • Cross-module calls have explicit failure and timeout behavior.
  • Observability can answer “which module failed and why?” without spelunking.
  • If the context has sub-units: each has clear ownership; no monolithic “registers everything” persistence grab-bag.

Relationship to stack-specific skills

When a project has concrete conventions (framework modules, DI, repository patterns, folder layout, codegen, CI checks), prefer those documents for how to implement. Use this skill for why boundaries exist and what good modular design optimizes for — so stack-specific advice stays aligned with the same principles.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Modular Design Principles?

Technology-agnostic guidance for modular systems: bounded contexts, clear boundaries, composability, state isolation, explicit contracts, failure containment, scaffolding workflows, split/merge criteria, sub-units inside a context, and compliance review signals. Use when designing or reviewing module structure, service boundaries, package layout, cross-cutting dependencies, "how should we split this?", modularity assessments, coupling between domains, greenfield context design, or architecture discussions without assuming a specific framework, language, or repository layout. Do NOT use for...

Warum Modular Design Principles in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Modular Design Principles besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Modular Design Principles in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(architecture)/modular-design-principles ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Modular Design Principles nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Modular Design Principles verwenden?

So viele Sie möchten. In TypingMind können Sie Modular Design Principles mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Modular Design Principles kostenlos?

Der Skill wird von tech-leads-club auf GitHub veröffentlicht. Prüfen Sie im Repository, ob dort Lizenzbedingungen angegeben sind. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇