Token导航 LogoToken导航

Agent Skill · 研究检索

bookforge-enterprise-base-pattern-catalog(Bookforge 企业基础图案目录)

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

bookforge-enterprise-base-pattern-catalog 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为调用外部服务;许可证为 MIT-0,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 27,644。

总安装 3,359周安装 150GitHub Stars 公开资料未说明下载 909核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:bookforge-enterprise-base-pattern-catalog(Bookforge 企业基础图案目录)
来源仓库:https://github.com/quochungto/bookforge-enterprise-base-pattern-catalog
安装命令:
openclaw skills install bookforge-enterprise-base-pattern-catalog
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install bookforge-enterprise-base-pattern-catalog

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

提供 Fowler 企业基础模式的参考目录与应用指引。适用于需要网关、缓存和代理等基础设施的场景。PEAA 第18章11种模式的快速查阅与对比工具。每个模式包含适用场景和反模式警示说明。

bookforge-enterprise-base-pattern-catalog 属于研究检索类 Skill,可作为该场景下的辅助能力补充。建议结合具体业务需求筛选,避免盲目套用。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install bookforge-enterprise-base-pattern-catalog;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

bookforge-enterprise-base-pattern-catalog 怎么安装?

在终端执行 openclaw skills install bookforge-enterprise-base-pattern-catalog。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

bookforge-enterprise-base-pattern-catalog 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

bookforge-enterprise-base-pattern-catalog 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

bookforge-enterprise-base-pattern-catalog 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

bookforge-enterprise-base-pattern-catalog 用的人多吗?

公开数据是累计安装 3,359 次,近一周安装 150 次,下载 909 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

bookforge-enterprise-base-pattern-catalog 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
bookforge-enterprise-base-pattern-catalog

Bookforge 企业基础图案目录 · 本页

3,359—调用外部服务MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
enterprise-base-pattern-catalog
description
Reference catalog for Fowler's 11 enterprise base patterns from Chapter 18 of PEAA. Use when another skill or user says 'we need a Gateway here', 'this should be a Value Object', 'replace nulls with a Special Case', 'use a Service Stub for testing', or 'separate this interface from its implementation'. Covers all 11 base patterns: Gateway pattern (wrapping external systems), Mapper pattern (decoupling subsystems), Layer Supertype (shared base class per layer), Separated Interface (dependency inversion packaging), Registry (service locator), Value Object (value-identity immutable objects), Money pattern (monetary arithmetic, no floats, allocate-by-ratio), Special Case / Null Object (replace null checks), Plugin pattern (runtime-bound implementation), Service Stub (test double for external services), Record Set (generic tabular data structure). Identifies which pattern fits a described problem, provides canonical definition and modern language parallels, distinguishes Gateway (generic external-access wrapper) from Table Data Gateway (data-access pattern), flags Registry vs DI container tradeoff, and produces a short design note with implementation sketch. Also routes to the appropriate family selector when the problem is not a base pattern.
version
1.0.0
homepage
https://github.com/bookforge-ai/bookforge-skills/tree/main/books/patterns-of-enterprise-application-architecture/skills/enterprise-base-pattern-catalog
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
[18]
domain
software-architecture
tags
depends-on
[]
execution
tier
1
mode
plan-only
inputs
description
A pattern name ('what is Special Case?'), a problem description ('I have null checks everywhere for missing customers'), or a cross-skill invocation ('we need a Gateway for the FedEx API here')
description
Optional — the relevant file or snippet helps produce a language-specific implementation sketch
tools-required
tools-optional
mcps-required
[]
environment
Works offline and without a codebase. A codebase helps tailor the implementation sketch to the team's language and conventions.
discovery
goal
Identify the correct PEAA base pattern for a described problem and produce a concise design note with definition, rationale, and implementation sketch
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

Enterprise Base Pattern Catalog

The 11 base patterns in Chapter 18 of *Patterns of Enterprise Application Architecture* are cross-cutting utility patterns that appear everywhere in enterprise application design. They are not architectural patterns (like Data Mapper or Front Controller) — they are the building blocks those patterns are built from. Every other PEAA skill references at least one of these.

This skill is a lookup-and-guide: identify the pattern by name or by problem description, then get the canonical definition, when to apply it, a modern language sketch, and any critical cautions.


When to Use

Use this skill when:

  • Another PEAA skill says "introduce a Gateway here" or "this is a Value Object" and you need the definition.
  • You're describing a cross-cutting utility problem: wrapping an external API, replacing null checks, making monetary arithmetic correct, isolating tests from external services, or breaking a package dependency cycle.
  • You want to name a pattern you already know exists but can't recall precisely.
  • You want the modern equivalent of a 2002-era base pattern.

NOT for: choosing among data-source patterns, domain logic patterns, web presentation patterns, concurrency patterns, or session state patterns. For those, see the dedicated selector skills in this set.


Context and Input Gathering

Accept either:

  1. A pattern name: "What is Registry?", "Explain Special Case", "When do I use Separated Interface?"
  2. A problem description: "I have floats for monetary amounts", "null checks for missing customers everywhere", "I want to swap a real tax service with a stub in tests"
  3. A cross-skill invocation: "We need a Gateway for the Stripe API — what does that look like?"

If a codebase is available, read the relevant file to produce a language-specific sketch. If not, use a stack-agnostic pseudocode sketch.

Sufficiency check: The pattern name or problem description alone is sufficient to proceed. No codebase required.


Process

Step 1 — Identify the Pattern

Match the input against the quick-lookup table. Accept either exact name or problem-description.

WHY: The 11 base patterns have overlapping surface descriptions (Gateway, Mapper, and Adapter all "wrap" something). Disambiguation prevents recommending the wrong pattern.

If a pattern name is given: look it up directly.

If a problem description is given: match against these trigger signatures:

Problem signaturePattern
"Wrap a 3rd-party / external API / resource behind a clean interface"Gateway
"Decouple two subsystems so neither knows about the other"Mapper
"Many classes in the same layer share common behavior"Layer Supertype
"Break a dependency cycle between packages / layers"Separated Interface
"Global finder / locator for widely-needed objects"Registry
"Equality should be based on value, not reference; small immutable object"Value Object
"Monetary amounts — avoid rounding errors, multi-currency, allocation"Money
"Null checks for the same condition scattered in many places"Special Case
"Swap implementation at configuration time (test vs production)"Plugin
"External service is unavailable / slow — need to test without it"Service Stub
"Generic tabular in-memory data structure for data-aware UI tools"Record Set

If multiple patterns could apply: list them with selection criteria (see Gateway vs Mapper below).

If no base pattern fits: route to the appropriate selector. Examples:

  • Data access architecture question → data-source-pattern-selector
  • Domain logic organization → domain-logic-pattern-selector
  • Web layer structure → web-presentation-pattern-selector
  • Concurrency → offline-concurrency-strategy-selector

WHY: Routing prevents this skill from giving partial answers on topics covered better by other skills in the set.


Step 2 — Deliver the Pattern Response

For the identified pattern, produce:

  1. One-sentence definition (the PEAA intent statement).
  2. Why it exists — the problem without the pattern.
  3. When to apply — specific conditions and contra-indicators.
  4. Critical cautions — the most common mis-application.
  5. Modern language parallel — what this looks like in the user's stack today.
  6. Implementation sketch — 10-20 lines in the user's language (or pseudocode if language is unknown).

WHY: Each component serves a different reader. The definition serves recall; the "why it exists" serves understanding; the cautions prevent misuse; the modern parallel prevents dismissing the pattern as obsolete.

Always include these cautions by pattern:

  • Gateway: Distinguish from Table Data Gateway. Not the same thing.
  • Mapper: Use only when BOTH subsystems must be unaware. Otherwise use Gateway (much simpler).
  • Separated Interface: Fowler explicitly warns against applying to every class. Only use to break a specific dependency or support multiple independent implementations.
  • Registry: Global data. Guilty until proven innocent. Prefer DI container in modern systems.
  • Value Object: Must be immutable. Aliasing bugs from mutable Value Objects are subtle.
  • Money: Never use floats. Use the allocate-by-ratio algorithm for splitting sums — simple rounding loses or gains pennies.
  • Special Case: Optional<T> is not equivalent — it makes nullability explicit but doesn't eliminate branching at every call site.
  • Service Stub: Keep stubs simple. Complexity defeats the purpose.

Step 3 — Produce the Design Note Artifact

Output a short design note (a markdown block) suitable for pasting into a code review comment, ADR, or design doc:

## Pattern: [Pattern Name]

**Applied to:** [the specific component in the user's system]

**Why this pattern:** [one sentence connecting the problem to the pattern's intent]

**Implementation shape:**
[10-20 line code sketch in the user's language]

**Cautions:**
- [most relevant caution for this usage]

WHY: A concrete artifact makes the guidance actionable. Without a sketch, the recommendation remains abstract. The cautions prevent the most common misapplication of the pattern in this specific context.


Step 4 — Surface Adjacent Patterns (Optional)

If another base pattern complements or must be used alongside the primary recommendation:

  • Gateway → mention Service Stub and Plugin (the testing triad).
  • Plugin → mention Separated Interface (Plugin requires it).
  • Service Stub → mention Gateway (stub replaces a Gateway, not raw code).
  • Separated Interface → mention Plugin (for runtime wiring).
  • Value Object → mention Money (if the value object involves monetary amounts).

WHY: The base patterns form a triad (Gateway + Plugin + Service Stub) and a pair (Value Object + Money). Mentioning them together prevents the user from applying one pattern while missing the pattern it depends on.


Inputs

  • Pattern name or problem description (required)
  • Language/stack (optional — used to tailor the implementation sketch)
  • Relevant code file or snippet (optional — used to make the design note concrete)

Outputs

  1. Pattern identification — which of the 11 base patterns matches
  2. Definition and rationale — intent, why it exists, when to apply
  3. Critical cautions — most important mis-application to avoid
  4. Modern parallel — how the pattern appears in the user's language/framework today
  5. Design note artifact — markdown block with implementation sketch and cautions

Key Principles

1. Gateway and Table Data Gateway are not the same. Table Data Gateway (Chapter 10) is a specific data-access pattern that accesses one database table and returns Record Sets. The generic Gateway (Chapter 18) is a broader pattern for wrapping any external resource. Every Table Data Gateway IS a Gateway, but not all Gateways are Table Data Gateways. Using "Gateway" to mean "database gateway that returns rows" is the most common PEAA vocabulary error.

WHY: Confusion between the two leads engineers to reject the generic Gateway pattern when they already know Table Data Gateway — or to misapply the pattern to a data-access context where Table Data Gateway is the correct choice.

2. Money pattern means no floats, ever. double and float are binary floating-point types. They cannot exactly represent most decimal fractions. 0.1 + 0.1 + 0.1 != 0.3 in IEEE 754. For monetary arithmetic, use integer cents (long) or fixed-point decimal (BigDecimal, decimal, Decimal). The Money pattern wraps these with currency-awareness and safe allocation.

WHY: Float-based monetary arithmetic silently accumulates rounding errors. These errors surface as penny discrepancies in financial reports, which have compliance and audit consequences.

3. Special Case chains, while Optional terminates. When you replace a null customer with a NullCustomer Special Case, nullCustomer.contract can return a NullContract (another Special Case) rather than null. This chain propagates polymorphism through the domain model without any null checks anywhere. Optional<T> requires the caller to handle the empty case at each .get() — it shifts the null-check burden rather than eliminating it.

WHY: The entire value of Special Case is eliminating branching. Understanding the chain behavior is essential to implementing Special Case correctly.

4. Registry is service-locator style — prefer DI injection in modern systems. Fowler himself says Registry is "global data, guilty until proven innocent" and to use it only as a last resort. Modern DI containers (Spring, .NET DI, Guice) push dependencies into constructors at wiring time, making dependencies explicit, testable, and auditable. Registry is appropriate in a narrow set of cases: deeply nested utility code that cannot be wired via constructor, or lightweight applications without a DI framework.

WHY: Registry is commonly cargo-culted from older codebases into modern ones where DI would be simpler and safer. Flagging the tradeoff prevents this.

5. Separated Interface has a cost — only use it to break specific dependencies. Each Separated Interface requires a factory with its own interface and implementation. Fowler explicitly warns against applying this to every class. For most classes, put the interface and implementation together. Separate them only when (a) you need to break a layer dependency cycle, (b) you need multiple independent implementations, or (c) you're working across team boundaries.

WHY: The pattern's benefit is targeted dependency management. Applied universally, it doubles the boilerplate without adding clarity.


Examples

Scenario 1: Wrapping a 3rd-Party Shipping API

Trigger: "We integrate with FedEx via their proprietary SDK. Every service class that needs shipping rates calls the SDK directly. I want to hide it behind a clean interface."

Process:

  1. Identify: external resource with awkward API → Gateway pattern.
  2. Check for confusion: is this a data-access gateway? No — it's a shipping service → generic Gateway (not Table Data Gateway).
  3. Recommend: create ShippingRateGateway interface + FedExShippingRateGateway implementation. The interface reflects your application's needs, not FedEx's full SDK.
  4. Surface adjacents: design the Gateway to be replaceable with a Service Stub for testing. Use Plugin or DI to wire the implementation.

Output (design note):

## Pattern: Gateway

**Applied to:** FedEx shipping rate integration

**Why this pattern:** The FedEx SDK has a complex, proprietary API. Wrapping it in a
Gateway isolates all SDK coupling in one class, enables unit testing via a stub, and
makes future provider changes (FedEx → UPS) a single-class swap.

**Implementation shape (TypeScript):**
interface ShippingRateGateway {
  getRates(origin: Address, destination: Address, weight: kg): ShippingRate[];
}

class FedExShippingRateGateway implements ShippingRateGateway {
  getRates(origin, destination, weight) {
    // translate to FedEx SDK call + translate response
  }
}

class StubShippingRateGateway implements ShippingRateGateway {
  getRates() { return [{ carrier: "FedEx", service: "Ground", price: Money.dollars(12.50) }]; }
}

**Cautions:**
- This is a generic Gateway (Chapter 18), not a Table Data Gateway (Chapter 10).
  Table Data Gateway is for database table access specifically.

Scenario 2: Money Stored as Floats

Trigger: "Our invoice totals sometimes show $0.01 discrepancies. We store monetary amounts as double in the database and in our Java domain objects."

Process:

  1. Identify: monetary arithmetic with float → Money pattern.
  2. Root cause: IEEE 754 floating-point cannot represent decimal fractions exactly.
  3. Recommend: introduce a Money class with long (cents) + Currency field. Replace all double/float money fields.
  4. Allocation warning: if they split amounts (tax splits, discount allocation), flag Foemmel's Conundrum — simple rounding can gain or lose pennies. Use the allocate(ratios[]) method.

Output:

## Pattern: Money

**Applied to:** Invoice total calculation

**Why this pattern:** `double` cannot represent most decimal fractions exactly in
IEEE 754. $0.01 discrepancies are the direct result. Money pattern wraps amount
(stored as integer cents) + Currency and enforces safe arithmetic.

**Implementation shape (Java):**
public record Money(long cents, Currency currency) {
    public Money add(Money other) {
        assertSameCurrency(other);
        return new Money(cents + other.cents, currency);
    }
    public Money[] allocate(int[] ratios) { /* use ratio algorithm, not rounding */ }
}

**Cautions:**
- Never use double/float for monetary amounts.
- For allocation (70/30 splits): use allocate-by-ratio, not simple rounding.
  Rounding 5 cents 70/30 loses or gains a penny. The ratio algorithm distributes
  remainders one cent at a time.

Scenario 3: Null Checks for Missing Customer

Trigger: "When a customer hasn't been identified yet (occupant utility account), we return null from findCustomer(). Now we have null checks in 12 places, all doing the same fallback: name='Unknown', balance=0, lastBill=null."

Process:

  1. Identify: repeated null checks with same fallback behavior → Special Case pattern.
  2. Distinguish: Null Object (GoF) is Special Case specialized for null. This is the right pattern.
  3. Recommend: create UnknownCustomer extends Customer with default implementations. Change findCustomer() to return UnknownCustomer() instead of null. Remove the 12 null checks.
  4. Chain note: unknownCustomer.lastBill should return a NullBill Special Case, not null.

Output:

## Pattern: Special Case (Null Object variant)

**Applied to:** findCustomer() returning null for unidentified occupant accounts

**Why this pattern:** 12 identical null-check blocks are code duplication. Special Case
eliminates the branching by making the missing case a valid polymorphic subtype.

**Implementation shape (Python):**
class UnknownCustomer(Customer):
    @property
    def name(self) -> str: return "Unknown"
    @property
    def balance(self) -> Decimal: return Decimal("0")
    @property
    def last_bill(self) -> Bill: return NullBill()

def find_customer(id: str) -> Customer:
    result = db.find_customer(id)
    return result if result else UnknownCustomer()

**Cautions:**
- last_bill should return NullBill(), not None — chain the Special Case pattern.
- Optional[Customer] shifts branching to call sites, not eliminating it.
  Special Case removes branching entirely.

References

  • references/base-patterns-cheatsheet.md — per-pattern deep-dive: full definitions, implementation sketches, modern parallels, and Fowler's cautions for all 11 patterns.

Related PEAA skills that invoke base patterns:

  • data-source-pattern-selector — recommends Gateway (wrapping data sources) and Mapper.
  • domain-logic-pattern-selector — recommends Service Stub for testing domain logic, Value Object, Special Case.
  • object-relational-structural-mapping-guide — covers Embedded Value (persistence strategy for Value Object, Money).
  • distribution-boundary-designer — recommends Separated Interface for distribution boundaries.
  • web-presentation-pattern-selector — references Plugin for theme/environment-based view selection.

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-data-source-pattern-selector
  • clawhub install bookforge-domain-logic-pattern-selector
  • clawhub install bookforge-distribution-boundary-designer
  • clawhub install bookforge-object-relational-structural-mapping-guide

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

平台分布

OpenClaw

81.38%
按下载量换算740

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

继续浏览同类 Skills