跳到正文
Skillpedia
API 与服务器(后端)7.1k · #13506

evolutionary-modular-architecture

它能做什么

这个技能指导 AI 设计一个作为单一应用、但具有严格内部边界的平台。内容涵盖领域设计、保护代码不受外部供应商影响,以及处理故障。适合从零构建新后端、并希望避免过早采用微服务的团队。

适用场景

  • ✓当你从零开始设计一个新平台或后端时。
  • ✓当你需要连接外部供应商,又不希望代码与其绑定时。
  • ✓当你在单一应用、模块化单体和微服务之间做选择时。

技能链接

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/evolutionary-modular-architecture/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/evolutionary-modular-architecture/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我设计新平台的架构,保持它为一个应用,但内部边界要清晰。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能为拆分系统为限界上下文、在外部系统周围添加保护层,以及使用可安全失败的事件和重试机制,设定了规则。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Evolutionary Modular Architecture

Design and build platforms as an evolutionary modular monolith: strong logical boundaries from day one (DDD bounded contexts, flat-by-aggregate modules, an Anti-Corruption Layer around every external system, event-driven communication, resilience by default) while keeping physical boundaries (separate deploys, separate databases) as a later, optional step. Start simple, evolve granularity only when the product and the team justify it — never reverse-engineer microservices from hype.

When to use this skill

  • Designing a new platform, backend, or service from scratch.
  • Defining bounded contexts and a context map for a domain.
  • Deciding how to organize a module's folders and files.
  • Choosing between monolith, modular monolith, and microservices.
  • Integrating with (or decoupling from) an external vendor: ERP, ticketing, storage, payment, AI, identity, durable-workflow engine.
  • Making external/inter-module calls resilient.
  • Adding real-time server-to-client updates.
  • Picking a modern (2026) full-stack TypeScript stack.

When NOT to use it

  • Simple CRUD with a handful of endpoints — framework defaults are enough.
  • Deep, NestJS-specific implementation detail — prefer nestjs-modular-monolith.
  • Reviewing or refactoring a single domain model for anemia — prefer tactical-ddd.

The one rule that governs everything

Separate the logical boundary (always strong) from the physical boundary (evolutionary). Modules, contracts, state ownership, and the Anti-Corruption Layer are non-negotiable from day one. Whether a module is its own deploy or its own database is an operational decision made later — never a structural prerequisite. This is what lets the system start as one deploy and grow without a rewrite.

A useful mental image: the house has well-divided rooms (modules). Inside each room things sit out in the open, grouped by what they are for (flat-by-aggregate) — not buried in nested drawers (technical-layer folders). The floor plan (boundaries) is what matters most.


Core model (load the matching reference when you go deep)

Topic What it covers Reference
Principles 10 modular (P1–P10) + 9 structural (P11–P19) + conflict hierarchy references/principles.md
DDD Strategic (subdomains, context map, integration patterns) + tactical (rich aggregates, intensity by subdomain) references/ddd.md
Module internals Flat-by-aggregate, suffixes, depth, flat vs subdomain test, scaffolding references/flat-by-aggregate.md
Communication Ports & Adapters / ACL, events + transactional outbox, SSE real-time references/acl-and-communication.md
Resilience Backoff + full jitter, circuit breaker, retry budget, idempotency, bulkhead, timeouts references/resilience.md
Stack 2026 Frontend, backend, data, observability, durable workflow, decisions references/stack-2026.md
Architecture doc Building the elegant, self-contained HTML architecture document with SVG diagrams references/architecture-doc.md + assets/architecture-template.html
Validation Deterministic checks for structure and module boundaries scripts/validate-structure.mjs, scripts/validate-boundaries.mjs

Do not load all references at once. Read a reference only when the current phase needs it (the workflow below states when).


Workflow

Use this whether you are designing a new system or reviewing an existing one. Move through phases in order; each has an exit criterion. State assumptions explicitly; if the domain is unclear, ask before guessing.

Phase 0 — Frame the scope

Confirm: is this a new platform, a new module in an existing one, or a review? Confirm the runtime/stack constraints (default target is the 2026 TypeScript stack — see references/stack-2026.md). Default to one deploy (modular monolith) unless a hard constraint says otherwise.

Exit: scope and constraints written down.

Phase 1 — Domain discovery (DDD strategic)

Read references/ddd.md. Identify subdomains from the business language, classify each as Core, Supporting, or Generic, and find the ubiquitous language of each. Do not group by technical layer. If multiple bounded-context interpretations exist, present them — do not pick silently.

Exit: a list of candidate bounded contexts, each classified, with one-line responsibility and key aggregates.

Phase 2 — Boundaries & context map

Dr

常见问题

它总是推荐微服务吗?

不会。它从简单开始,只有在产品和团队确有需要时才增加独立服务。

它涵盖实时更新吗?

涵盖。该技能包括从服务器向客户端推送实时更新的做法。

它适合只有几个接口的简单应用吗?

不适合。简单应用更适合使用框架的默认设置。

详情

作者的原始描述

Guides design and implementation of evolutionary modular-monolith platforms with DDD (strategic + tactical), flat-by-aggregate organization, an Anti-Corruption Layer for vendor independence, a transactional outbox for events, smart resilience (backoff with jitter, circuit breakers, idempotency), and a polished architecture HTML document with elegant SVG diagrams. Use when designing a platform or backend, defining bounded contexts, organizing modules and folders, choosing monolith vs microservices, decoupling from an external service (ERP, storage, AI), making calls resilient, adding real-time

repo: tech-leads-club/agent-skills

热度

GitHub 星标
7.1k
排名
#13506
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能