Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器clawhub未标认证来源可访问clear审计通过

bookforge-distribution-boundary-designerBookforge 发行边界设计师

Agent Skill

bookforge-distribution-boundary-designer 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,096

周安装

129

GitHub Stars

公开资料未说明

下载量

1,032
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bookforge-distribution-boundary-designer(Bookforge 发行边界设计师)
来源仓库:https://github.com/quochungto/bookforge-distribution-boundary-designer
安装命令:
openclaw skills install bookforge-distribution-boundary-designer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install bookforge-distribution-boundary-designer

简介

为企业系统设计服务边界划分与分布式策略。

  • 适用于中台化改造和系统拆分架构决策场景。
  • 结合业务领域划分和技术约束确定服务粒度。
  • 推荐 Remote Facade 等模式隐藏分布式复杂性。
  • 输出包含领域划分图和通信协议选型建议。bookforge-distribution-boundary-designer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
distribution-boundary-designer
description
Distribution design for enterprise systems: decide whether to distribute, where to draw the service boundary, and how to implement it with Remote Facade and Data Transfer Object (DTO). Use when deciding microservices vs monolith, evaluating process boundaries, extracting services, designing remote APIs, choosing coarse-grained API shape, preventing distribution-by-class anti-pattern, applying Fowler's First Law of Distributed Object Design, designing service extraction strategy, determining when distribution is warranted vs cargo-culting microservices, implementing Remote Facade pattern, designing DTOs independent from domain objects, choosing between gRPC vs REST vs message queue vs GraphQL for service boundary, monolith decomposition, service boundary design, remote API design, distribution strategy, when to distribute, process boundary decision, coarse-grained interface design.
version
1.0.0
homepage
https://github.com/bookforge-ai/bookforge-skills/tree/main/books/patterns-of-enterprise-application-architecture/skills/distribution-boundary-designer
metadata
{"openclaw":{"emoji":"🔀","homepage":"https://github.com/bookforge-ai/bookforge-skills"}}
status
draft
source-books
title
Patterns of Enterprise Application Architecture
authors
["Martin Fowler", "David Rice", "Matthew Foemmel", "Edward Hieatt", "Robert Mee", "Randy Stafford"]
chapters
[7, 15]
domain
software-architecture
tags
depends-on
[]
execution
tier
2
mode
hybrid
inputs
description
System topology description: current architecture (monolith / modular monolith / cluster / microservices), motivation for distribution, team structure, deployment independence needs, scaling needs, and any security zone or vendor integration requirements.
description
Optional: existing codebase or architecture diagrams to identify existing remote boundaries, chatty interfaces, or domain logic in remote shells.
tools-required
tools-optional
mcps-required
[]
environment
Architecture design or refactor session. Works offline. Codebase helpful for detecting existing anti-patterns but not required — skill operates on description alone.
discovery
goal
Decide whether to distribute a system (or parts of it), identify legitimate boundaries if distribution is warranted, and design Remote Facade + DTO contracts at each boundary.
tasks
audience
roles
experience
intermediate
when_to_use
triggers
prerequisites
[]
not_for
environment
codebase_required
false
codebase_helpful
true
works_offline
true
quality
scores
with_skill
null
baseline
null
delta
null
tested_at
null
eval_count
null
assertion_count
13
iterations_needed
null

Distribution Boundary Designer

Guides you through the decision of whether to distribute a system across processes or machines, where to draw the boundary if distribution is needed, and how to implement the boundary using the Remote Facade and Data Transfer Object patterns. Grounded in Fowler's First Law of Distributed Object Design and the pattern pair that makes distribution workable when it cannot be avoided.

When to Use

Use this skill when your team is considering breaking a monolith into services, extracting a subsystem as a remote service, reviewing whether a microservices architecture is appropriate, or designing the interface at an existing remote boundary. Also use it when an existing remote API shows signs of the distribution-by-class anti-pattern (too many fine-grained calls per operation), or when domain logic has leaked into remote shells.

Prerequisites: a description of the system's purpose, team structure, deployment needs, and any known scaling or security zone requirements. A codebase or architecture diagram is helpful for detecting existing boundary problems.

Context & Input Gathering

Gather these before proceeding:

Required:

  • What does the system do? What are its major subsystems?
  • What is the stated motivation for distribution? ("scalability," "team independence," "vendor integration," "security zones," etc.)
  • Are there currently separate deployment units? If yes, which ones and why?

Helpful:

  • How many teams? Do different teams need to deploy independently?
  • Are there subsystems with dramatically different scaling needs (e.g., search scales 100x vs catalog)?
  • Are there security zone requirements (DMZ vs internal network)?
  • Are there vendor package integrations that run in their own process?
  • Is the codebase available? Grep for remote stubs, service clients, or proto/schema files to detect existing boundary shape.

Defaults if not provided:

  • Assume a single team if not stated — leans toward not distributing
  • Assume uniform scaling if not stated — leans toward not distributing
  • Assume no security zone requirement if not stated

Sufficiency check: If the only stated motivation is "we want microservices," "clean architecture," or "team size," the filter step will almost certainly return "do not distribute." Be explicit about this.

Process

Step 1 — Apply the First Law Filter

WHY: The single most common architecture mistake is distributing a system that does not need it. Fowler names this explicitly: "Don't distribute your objects." Distribution incurs latency, partial failure, marshaling cost, and interface rigidity — costs that are paid on every call, forever. Every process boundary is a tax.

Check each of Fowler's seven legitimate distribution reasons. The system should distribute ONLY if at least one applies:

ReasonCheck
Different client machines (desktop vs server, browser vs app server)Does the client run on a different physical machine?
Application server ↔ database process boundaryStandard; SQL is designed for this.
Web server and app server must be separate processesVendor constraint, security zone, or scaling forces?
Independent scaling requirementsDoes a hot subsystem need to scale at a dramatically different rate?
External vendor / purchased package softwareDoes a package run in its own process with a coarse-grained interface?
Security zone boundary (DMZ, internal network)Is a firewall or network zone required between subsystems?
Different hardware or OS requirementsDoes a subsystem require specialized hardware or a different OS?

IF none apply → Recommend modular monolith: keep the application in one process, divide it into packages/modules with clear interfaces. Name this explicitly. Do not proceed to boundary design.

IF one or more apply → Identify only the subsystem pairs that cross a legitimate boundary. Every other subsystem pair should remain in-process.

Step 2 — Identify Coarse-Grained Boundaries (per subsystem, not per class)

WHY: The distribution-by-class anti-pattern (one remote component per domain class) multiplies call counts and destroys performance. A remote boundary should span a subsystem — a coherent cluster of domain classes that collaborates internally and exposes a small number of use-case-shaped operations externally.

For each legitimate boundary identified in Step 1:

  • Name the subsystem on each side (e.g., "order processing" and "payment processor")
  • Identify the operations that cross the boundary — framed as user-intent operations ("place order," "authorize payment"), not as CRUD methods on individual entities
  • Estimate call frequency: how many times is this boundary crossed per user interaction? If more than ~5, the boundary may be too fine-grained.

Signal that a boundary is too fine-grained: "GetCustomer() then GetOrders() then GetLineItems() then GetProducts()..." — four separate calls to display a single order screen. This should be one call: GetOrderSummary(orderId).

Step 3 — Design Remote Facade Methods

WHY: A Remote Facade is a thin coordination shell — its only job is to translate coarse-grained remote calls into sequences of fine-grained domain object calls. All domain logic lives in the fine-grained domain objects, not in the facade. A facade with domain logic becomes a second domain layer that is harder to test, harder to evolve, and violates the principle that the application should be runnable entirely in-process without the remote shells.

For each boundary, design the Remote Facade:

  1. Methods are use-case-shaped: GetOrderSummary(orderId), SubmitPaymentAuthorization(authDTO), not GetOrder(), GetCustomer(), UpdateOrderStatus()
  2. Each method does one useful unit of work: A single remote call should accomplish a meaningful operation, not just fetch one property
  3. Facade has no conditional domain logic: No if (order.status == SHIPPED) applyLateCharge() in the facade. That belongs in domain objects.
  4. Facade can have multiple methods corresponding to different client use cases: Different screens may call different facade methods that ultimately touch the same domain objects — this is correct
  5. Facade granularity: Prefer fewer, larger facades over many small ones. A moderate application might have one; a large application, half a dozen.
  6. Security and transactions are appropriate in the facade: The facade is a natural boundary for access control and transaction demarcation (start transaction → call domain objects → commit). This is not domain logic.

Step 4 — Design DTOs Per Use Case

WHY: A DTO is a data carrier designed for the wire, not for the domain. Auto-deriving DTOs from domain classes couples the wire format to the domain model — any domain refactoring forces a wire format change, which may require client updates. DTOs designed around use cases are stable because use cases change less often than domain internals.

For each Remote Facade method, design the corresponding DTO(s):

  1. Shape the DTO around what the client interaction needs — not around the domain class structure. Collapse related objects: embed artist name in AlbumDTO rather than passing a separate ArtistDTO with a separate call.
  2. Fields are primitives, strings, dates, or nested DTOs — no domain object references. The DTO must be serializable independently of the domain model.
  3. Use a separate Assembler to move data between domain objects and DTOs. The assembler keeps the domain model independent of wire format.
  4. Consider separate request and response DTOs if the shapes diverge significantly. Use a single DTO if they are similar.
  5. Err on the side of sending too much data rather than requiring a second call: "it's better to err on the side of sending too much data than have to make multiple calls."
  6. Modern naming: Fowler's DTO = what the J2EE community called "Value Object." Today: gRPC proto messages, JSON response schemas, GraphQL types, OpenAPI schemas, Avro records.

Step 5 — Audit for Anti-Patterns

WHY: The three most common mistakes at distribution boundaries are predictable and detectable in advance.

Check each boundary against these anti-patterns:

Anti-PatternSignalRemedy
Distribution by classOne remote component per domain class; dozens of remote calls per user interactionConsolidate to subsystem-level Remote Facades with use-case methods
Domain logic in Remote FacadeConditional logic, business rules, or workflow coordination in the facadeMove logic to domain objects or a non-remote Service Layer; reduce facade to thin delegation
Chatty fine-grained remote interfaceN calls per screen/operation where N > ~3; individual property getters exposed remotelyRedesign as coarse-grained bulk accessor / command method
DTO-domain couplingDTO fields map 1:1 to domain class fields; DTO imports domain classesIntroduce Assembler; redesign DTOs around use-case needs
Distribution without legitimate reasonMotivation is trend, architecture taste, or "clean code"Recommend modular monolith; document the test that should be passed before re-evaluating

Step 6 — Select Interface Style

WHY: The interface style determines coupling tolerance, latency profile, and async capability. Fowler's 2002 guidance was RPC vs XML/HTTP; the modern decision space is richer.

StyleBest forTrade-offs
gRPC (binary, proto)Internal service-to-service, high throughput, same-platformTight schema coupling; not browser-native
REST / JSONExternal APIs, browser clients, cross-platform, public APIsLooser coupling; HTTP overhead; no streaming by default
Message queue (Kafka, SQS, RabbitMQ)Fire-and-forget, event-driven, high latency tolerance, decoupled producers/consumersAsync only; harder to test; eventual consistency
GraphQLMulti-client (mobile + web) with varying field needs; avoiding over-fetchQuery complexity; N+1 risk server-side; schema governance overhead

Fowler's principle still holds: use the simplest mechanism that works. If both sides share a platform, use gRPC or its modern equivalent. Use REST/JSON when interoperability across platforms or external access matters. Use message queues when decoupling and async throughput matter more than latency.

Step 7 — Produce Distribution Design Record

WHY: The decision must be documented so future architects understand WHY the boundary exists and what test should be passed before adding more. Distribution decisions are expensive to reverse.

Produce a distribution design record containing:

  • Current topology: monolith / modular monolith / partial services
  • Legitimate distribution reasons identified (Step 1) and which subsystem pair each applies to
  • Non-distribution alternatives considered (modular monolith, package separation)
  • Proposed boundaries: subsystem pair, direction of calls, call frequency estimate
  • Remote Facade spec: for each facade — class name, method signatures, WHY each method is shaped this way
  • DTO spec: for each DTO — fields, which domain objects it aggregates, assembler location
  • Interface style selected with rationale
  • Anti-pattern audit result: pass / fail per anti-pattern, with remediation notes if any failed

Inputs

  • System description (purpose, subsystems, team structure, deployment needs)
  • Stated motivation for distribution
  • Optional: codebase, architecture diagrams, existing proto/schema files
  • Optional: scaling metrics or capacity constraints

Outputs

Distribution Design Record (distribution-design-record.md) containing:

# Distribution Design Record: [System Name]

## Summary Decision
[Distribute / Do Not Distribute — one sentence]

## First Law Filter Results
| Reason | Applies? | Notes |
|--------|----------|-------|
| ...    | Yes/No   | ...   |

## Recommended Topology
[Modular monolith / specific service boundaries]

## Boundaries (if distributing)
### Boundary: [Subsystem A] ↔ [Subsystem B]
- Legitimate reason: [reason from filter]
- Interface style: [gRPC / REST / queue / GraphQL]
- Remote Facade: [FacadeClass]
  - [method(params) → ReturnDTO] — [WHY this use-case shape]
- DTOs:
  - [DTOName]: fields=[...], aggregates=[domain objects], assembled by=[AssemblerClass]

## Anti-Pattern Audit
| Anti-Pattern | Result | Notes |
|--------------|--------|-------|
| Distribution by class | Pass/Fail | ... |
| Domain logic in facade | Pass/Fail | ... |
| Chatty interface | Pass/Fail | ... |
| DTO-domain coupling | Pass/Fail | ... |
| Distribution without reason | Pass/Fail | ... |

## Non-Distribution Alternatives Considered
[What modular monolith structure was evaluated and why distribution was preferred]

Key Principles

1. The First Law is a default, not a suggestion. Distribute only when you have a concrete, operational reason from Fowler's list. "We want microservices" is not a reason. "The payment processor must be PCI-compliant in a separate security zone" is a reason. The default is always in-process.

WHY: Remote calls are orders of magnitude slower than in-process calls. Every process boundary is a permanent tax on every call that crosses it. The cumulative cost of unjustified distribution dwarfs the cost of an in-process module boundary.

2. Boundaries are per subsystem, not per class. A Remote Facade corresponds to a subsystem (a cluster of collaborating domain objects), not to an individual class. If every domain class has a remote interface, the boundary design is broken.

WHY: Each fine-grained call to a remote class pays the full inter-process latency cost. A subsystem-level facade batches those calls into one network round-trip per use case.

3. Facades contain no domain logic — none. A Remote Facade is a translation layer: coarse-grained interface → fine-grained domain object calls. Any conditional logic, business rules, or workflow coordination in the facade must be moved to domain objects or a non-remote Service Layer.

WHY: A facade with domain logic becomes a hidden second domain layer. The application can no longer be tested or run in-process without the remote shell, because the logic lives there. This creates a testing and evolution trap.

4. DTOs are designed for the interaction, not the domain. Each DTO is shaped around a specific client use case — what data that client needs to display or send in a single interaction. DTOs are not auto-generated mirrors of domain classes.

WHY: Domain classes change frequently as business rules evolve. DTOs change when the client interaction changes. Coupling these two change rates together means every domain refactoring potentially breaks clients across the wire.

5. The modular monolith is always on the table. When a team says "we need microservices for separation of concerns," the correct counter-offer is: separate your packages/modules/bounded contexts within a single process. You get team ownership, clear interfaces, and independent evolution without network cost.

WHY: The costs of distribution (latency, partial failure, operational complexity, debugging difficulty) are real and ongoing. The benefits of a modular monolith (same testability, same team ownership, same interface discipline) are available without those costs.

6. Send more data per call rather than fewer. When designing DTOs and facade methods, err toward aggregating more data in one call rather than planning a second call. Over-fetching slightly is far cheaper than a second round-trip.

WHY: Remote call latency is fixed overhead per call. Bandwidth is cheap. If a client might need the order's line items after getting the order header, include the line items in the initial DTO.

Examples

Example 1 — Reject Distribution for a Two-Team LOB App

Scenario: A 12-person engineering team across two squads is building an internal CRM. Engineering lead proposes microservices "for clean boundaries between the sales squad (contacts, deals) and the support squad (tickets, SLAs)."

Trigger: "Should we use microservices for our two-squad CRM?"

Process:

  1. Apply First Law Filter:

- Client-server divide: Yes (browser client + server). But this is the standard web-app boundary, not an argument for internal microservices. - Independent scaling: No — contacts/deals and tickets/SLAs have similar load profiles. - Different security zones: No. - Vendor package: No. - Independent deployment: "Nice to have" but not operationally required. - Result: No legitimate reason for internal service distribution.

  1. Recommend modular monolith: define a contacts-deals package and a tickets-slas package with explicit module boundaries, shared domain types, and clear internal APIs. Each squad owns their package.
  2. Note: the existing web-app boundary (browser ↔ app server) is the natural Remote Facade. A single CRMService facade handles screen-level operations for both squads.
  3. Anti-pattern audit: distribution-by-class risk = not applicable (not distributing). Domain logic in facade = not applicable.

Output: Distribution Design Record stating "Do not distribute internally." Modular monolith with squad-owned packages. One Remote Facade for the browser-server boundary.


Example 2 — Extract Payments as a Distributed Boundary

Scenario: E-commerce platform. Payments team requires PCI-DSS compliance in an isolated network zone. The search subsystem handles 50x the load of the product catalog at peak.

Trigger: "We need to separate payments for PCI compliance and search for scaling. How do we design those boundaries?"

Process:

  1. Apply First Law Filter:

- Security zone (PCI): Yes — payments must live in an isolated environment. Legitimate. - Independent scaling (search): Yes — 50x load differential is a real scaling reason. - All other subsystems: No legitimate reason.

  1. Two boundaries identified: Catalog ↔ Payments, Catalog ↔ Search. Everything else (orders, inventory, user) stays in the monolith.
  2. Design Payments Remote Facade (PaymentService):

- AuthorizePayment(orderId, paymentMethodDTO) → PaymentResultDTO - CapturePayment(authorizationId) → CaptureResultDTO - RefundPayment(paymentId, amount) → RefundResultDTO - NOT: GetCard(), UpdateCard(), GetAuthorization() — these are fine-grained domain calls

  1. Design DTOs: PaymentMethodDTO (cardToken, billingAddress, amount), PaymentResultDTO (authorizationId, status, errorCode). Assembled from domain card/billing objects. Not coupled to domain class structure.
  2. Design Search Remote Facade (SearchService):

- SearchProducts(query, filters, pagination) → ProductSearchResultDTO - SuggestProducts(partialQuery) → SuggestionDTO[]

  1. Interface style: Payments = gRPC (internal, same platform, high reliability needed). Search = REST/JSON (browser clients query search directly; must be cross-platform).
  2. Anti-pattern audit: no distribution-by-class, facades are thin, DTOs are use-case-shaped.

Output: Distribution Design Record with two boundaries (PCI, scaling), facade specs, DTO specs, interface styles.


Example 3 — Fix Legacy Chatty Distributed Objects

Scenario: Legacy J2EE system from 2005. Every entity bean (Customer, Order, OrderLine, Product, Address) is a separate remote EJB. Displaying an order summary screen makes 15-20 remote calls. Performance is unacceptable.

Trigger: "Our EJB app is painfully slow. Each screen makes dozens of remote calls. How do we fix this?"

Process:

  1. First Law Filter: Application server is separate from DB (legitimate). The internal EJB-to-EJB calls are the problem — distribution by class applied to the domain model.
  2. Diagnosis: Classic distribution-by-class anti-pattern. The EJBs mirror the domain class structure. Every property getter is a remote call.
  3. Remediation:

- Keep domain objects as plain in-process Java objects (POJOs) — remove remote interfaces from Customer, Order, OrderLine, Product. - Introduce a single OrderService Remote Facade with use-case methods: GetOrderSummary(orderId) → OrderSummaryDTO, UpdateOrderStatus(orderId, statusDTO). - OrderSummaryDTO aggregates order header + customer name + line items + product names in one call. - Assembler populates the DTO from the fine-grained domain objects.

  1. Interface style: Keep as EJB session bean Remote Facade (same platform) or migrate to gRPC for modern replacement.
  2. Expected result: 15-20 calls → 1-2 calls per screen interaction.

Output: Refactoring plan with identified chatty calls, new facade spec, DTO design, migration sequence.

References

License

This skill is licensed under CC-BY-SA-4.0. Source: BookForge — Patterns of Enterprise Application Architecture by Martin Fowler, David Rice, Matthew Foemmel, Edward Hieatt, Robert Mee, Randy Stafford.

Related BookForge Skills

Install related skills from ClawhHub:

  • clawhub install bookforge-enterprise-architecture-pattern-stack-selector
  • clawhub install bookforge-domain-logic-pattern-selector

Or install the full book set from GitHub: bookforge-skills

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

75.36%
按下载量换算778

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills