/omniagents-design-patterns:codebase-designfrom omniagents-design-patterns
Use when designing or improving a module's interface, judging whether a wrapper or layer earns its keep, deciding where a seam belongs, or making code testable through its interface. Supplies the interface-depth vocabulary — deep vs shallow modules, information hiding, the deletion test, seams, design it twice. The depth lens that complements the pattern catalogue: it answers "is this interface earning its complexity?", not "which pattern?".
Ships in omniagents-design-patterns. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The software and system skills in this plugin are a catalogue — they
answer which shape to reach for. This skill answers a different question about
any shape you pick: is the interface earning its complexity? A module's
interface is the cost every caller pays; its hidden behaviour is the benefit. A
deep module returns a lot of behaviour for a small interface; a shallow
one exposes almost as much as it hides.
Reach for it when designing a new boundary, deciding whether a wrapper or layer should exist, placing a seam, or making code testable through its interface rather than its internals.
Surface these when a proposed boundary violates them; name the principle rather than arguing from taste.
Protocol is justified only when
a second implementation exists — production plus a test fake that isolates a
heavy dependency counts. One implementation behind an interface is indirection
without variation (see ../software/anti-patterns.md,
speculative generality).Precise terms; the other skills and the design-review hunt reference them.
Shallow — forwards one-to-one, hides nothing:
class UserStore:
def __init__(self, session: Session) -> None:
self._session = session
def get(self, user_id: int) -> User | None:
return self._session.get(User, user_id) # 1:1 forward
The caller still has to know the session's exception set, that None means
"missing", and the transaction boundary. The wrapper added a hop and hid none of
it.
Deep — one interface point hides a round-trip, a bounded retry, a timeout, parsing, and error mapping into a domain type:
class PricingClient:
"""Resolve a quote. Hides transport, retry budget, timeout, and parsing."""
def quote(self, sku: str, *, region: str) -> Money:
# round-trip + bounded retry + timeout + parse + map errors → Money
...
The whole interface is quote(sku, *, region) -> Money; everything else is
hidden from every call site.
The fastest way to grade a boundary: mentally inline the module into its callers and watch what complexity does.
Depth is not line count: a 20-line module can pass, a 2-line wrapper can fail.
Protocol) with a production adapter and a test fake. Drive the port.| File | Read when… |
|---|---|
references/deepening.md | Merging shallow, interdependent modules into one deeper module: deciding whether the dependency between them can be substituted in-process or must stay behind a seam, and re-testing at the new interface. |
references/design-it-twice.md | Choosing a module's interface: generating two or three genuinely different designs, each optimizing a different axis, then picking by depth, locality, and seam placement. |
references/deepening.md.
Choosing among interface shapes → references/design-it-twice.md.software skill from this plugin (via the
Skill tool); this skill only judges whether the chosen shape earns its
interface.system skill from this plugin.reviewer:design-review skill turns the deletion
test into its Shallow Wrapper hunt; use it when reviewing rather than
designing.The deep-module framing, information hiding, and "design it twice" are from John Ousterhout, A Philosophy of Software Design (2nd ed.). This skill is an omniagents house adaptation of those ideas — original prose and strict-typed Python 3.13+ examples; no third-party text is reproduced.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gao-hongnan/omniagents --plugin omniagents-design-patterns4 skills in this plugin
/api-designUse when designing, reviewing, or implementing a REST or gRPC API contract: resource names and hierarchy, standard vs custom methods, request/response fields, pagination, filtering, partial updates and field masks, long-running operations, error models and status codes, idempotency, etags, soft delete, batch methods, versioning, or breaking changes, where choices should follow Google's API Improvement Proposals (AIPs) or API Design Guide./softwareUse when designing or reviewing Python code shape inside one service: module/class boundaries, GoF patterns, DDD, functional Result/Option/ADT shapes, in-process concurrency, package architecture, code smells, anti-patterns, refactors, "what pattern?", "where should X live?", or "how should I model this?". For cross-service or distributed concerns, use the system skill instead./systemUse when designing or reviewing cross-service, cross-process, regional, or operator-facing system shape: timeouts, retries, circuit breakers, bulkheads, rate limits, idempotency, DLQs, REST/gRPC/GraphQL/pub-sub, service mesh, webhooks, Saga, Raft/Paxos, distributed locks, CQRS, event sourcing, outbox, sharding, replication, caching, autoscaling, sidecars, strangler migrations, distributed monoliths, cascading failures, retry storms, shared databases, capacity planning, or what breaks at the next 10× load.