/omniagents-design-patterns:systemfrom omniagents-design-patterns
Use 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.
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.
Strict-typed Python 3.13+ patterns for shapes that span services,
processes, regions, or operators: reliability (timeout, retry, circuit
breaker, bulkhead), communication (pub/sub, API gateway, BFF, service
mesh), distributed coordination (saga, leader election, Raft, CRDTs),
data architecture (CQRS, event sourcing, sharding, replication),
scaling (cache, load balancing, autoscaling), the growth ladder (what
saturates at each order of magnitude, split by write and read path),
cloud topology (sidecar, ambassador, strangler fig, cell-based),
system-level anti-patterns.
For in-service concerns (class boundaries, domain modelling, in-process
concurrency, code smells), load the software skill from this plugin
instead.
Surface these non-negotiables when proposed code violates them. Point at the exact reference rather than re-arguing from first principles.
Protocol over ABC, PEP 695
generics (class Foo[T]:), PEP 604 unions (X | Y), list[int] not
List[int], Self for fluent returns, Final for constants, @override
where applicable, and no Any leakage. Use the annotation-evaluation policy
in the conventions section below; omit from __future__ import annotations
only when runtime introspection genuinely requires evaluated annotations.
Code blocks in this catalogue are written to target mypy --strict and
pyright --strict.*Service mutators are an anti-pattern. Behaviour lives on the
entity; orchestration lives in the service.NewType, smart constructors, frozen=True, Final. The
type checker does the work.Every Python block in this catalogue binds itself to these rules. They are inlined here so the system-patterns skill remains correct even when no other skill is loaded.
mypy --strict and
pyright --strict: PEP 695 generics (class Foo[T]:), PEP 604 unions
(X | Y), list[int] not List[int], Self for fluent returns, Final
for constants, and @override on subclass methods.Protocol for structural extension contracts
unless explicit registration, shared default behavior, or runtime subclass
checks require an ABC.Any leaks. Bare Any is forbidden outside I/O boundaries. Boundary
adapters may carry one cast only with an inline reason comment naming the
vendor docs reference.# type: ignore requires an error code and an inline
reason: # type: ignore[arg-type] # third-party stub missing field X. Bare
# type: ignore is forbidden.T type parameters. Prefer KeyT, ValueT, ItemT,
ReturnT, InputT, and OutputT; never bare T, K, or V. Use PEP
695 syntax such as class Registry[KeyT, ValueT]:, not
Generic[KeyT, ValueT].@dataclass(frozen=True, slots=True) for in-process domain types.Annotated[T, Field(...)]; bare Field() as a
default is forbidden. Boundary models add
model_config = ConfigDict(frozen=True, extra="forbid") to reject unknown
fields and prevent post-construction mutation.The python:typings skill in the sister python plugin holds the full
canonical examples and rationale behind each rule. If both plugins are
installed, you can load it via the Skill tool when you need the deep reference,
but this catalogue does not require it to be loaded to be correct.
| File | Read when… |
|---|---|
reliability.md | A call crosses a process / network / disk / queue boundary: Timeout, Retry + Exponential Backoff + Full Jitter, Circuit Breaker, Bulkhead, Rate Limiting (Token Bucket / Leaky Bucket / GCRA), Adaptive Concurrency Limits (Netflix-style), Idempotency Keys (Stripe-style), Dead-Letter Queue, Hedged Requests (Dean & Barroso), Fallback / Graceful Degradation, Health Checks (liveness vs readiness vs startup), Heartbeat, Backpressure. Includes a stacking-order guide. |
communication.md | Designing the channel between services: Request/Reply (REST vs gRPC vs GraphQL with type-safety triage), Pub/Sub (Kafka / RabbitMQ / Redis Streams / SNS-SQS / GCP Pub/Sub with delivery-semantics table), Event-Driven Architecture (thin vs fat events), API Gateway (and the "smart pipes / dumb endpoints" anti-pattern), Backend-for-Frontend, Service Mesh, Webhooks (HMAC + replay window), Long Polling / SSE / WebSockets, Async Request-Reply (202 + Location + Retry-After), Claim Check. |
distributed.md | Coordinating across nodes: Saga (orchestration vs choreography), Two-Phase Commit (and why it's almost always wrong), Raft pseudocode + Paxos overview, Leader Election (lease-based with renewable TTL), Distributed Lock with fencing (the Kleppmann–Antirez exchange), Heartbeat / phi-accrual failure detector, Vector Clocks / Lamport Timestamps, CRDTs (G-Counter, PN-Counter, OR-Set, LWW-Register), Quorum Reads/Writes (N/R/W), Gossip Protocols. |
data.md | Shaping persistent state: CQRS (lightweight vs full), Event Sourcing (replay, snapshot, projection), Outbox (FOR UPDATE SKIP LOCKED), Inbox (consumer-side dedup), Materialized View, Database per Service (with migration steps from a shared DB), Sharding (range / hash with consistent hashing + vnodes / directory / geographic), Replication (single-leader / multi-leader / leaderless / semi-sync), Storage Engine (B-tree vs LSM by the RUM trade), Eventual Consistency (read-your-writes, monotonic reads, causal), Read Repair / Anti-entropy, Change Data Capture (Debezium-style), Soft Delete / Tombstones. |
scaling.md | Performance and scale: Cache-Aside (with single-flight stampede protection), Read-Through, Write-Through, Write-Behind, Refresh-Ahead (XFetch probabilistic), CDN / Edge (stale-while-revalidate, surrogate keys), Vertical vs Horizontal Scaling (the "scale-up first" pragmatic argument), Auto-scaling (reactive / predictive / scheduled, KEDA-style queue-age triggers), Load Balancing (round-robin / least-conn / consistent-hash / power-of-two-choices / EWMA), Connection Pooling (HikariCP / PgBouncer math), Backpressure-aware Scaling. |
growth.md | The question arrives as a load number, a capacity review, or "what breaks next": the load-indexed ladder. Anchors-not-triggers table (how payload size, working set, and write mix move every threshold), USE-method saturation-signal table, Little's Law sizing sketch, then Rungs 0–4 — one box; connections and unindexed reads (pooler / cache-aside + replicas); fsync-bound commits, replication lag, one cache node (durable log + batched appliers / sharded cache + read shards); write amplification and viral keys (LSM tables / in-process L1); coordination and blast radius (cells, multi-leader). Each rung: what breaks · signal · write move · read move · contracts it creates · stop sign · links to the entry holding the sketch. Anti-ladder failures and a capacity review checklist. |
cloud.md | Topology decisions: Sidecar, Ambassador (and the Sidecar-vs-Ambassador direction split), Adapter (system-level), Anti-Corruption Layer (system-level, one-way DDD translation), Strangler Fig (route-table proxy), Choreography vs Orchestration, Service Discovery (server-side LB vs client-side Consul/Eureka), Configuration as Service (LaunchDarkly / Unleash), Async Request-Reply, Claim Check (S3 + queue), Compensating Transaction, Throttling Gateway, Bulkheading at Infra Level (cells / AZs), Cell-Based Architecture (AWS-style with jump-consistent hashing). |
anti-patterns.md | Distributed-architecture review: Distributed Monolith, Chatty Interfaces (N+1 RPC + chained sync calls), Two-Phase Commit Abuse, Shared Database, Death Star Architecture, Premature Microservices Adoption, Synchronous Cross-Service Calls (when async fits), Sticky Sessions Everywhere, Hot Path DB Locking, Single Point of Failure, Cascading Failures, Retry Storms (with the 243× amplification math), Naive Caching, Lift-and-Shift, Vendor Lock-in by Default, Observability as Afterthought, Configuration Drift, Time Bombs, Big Bang Migrations. Each entry includes a real production incident (Knight Capital, S3 us-east-1, CrowdStrike, Healthcare.gov) where the anti-pattern fired. |
Read only the reference relevant to the current decision — every file has a Table of Contents at the top; jump to the specific anchor.
growth.md first; each rung routes to the axis file that
holds the sketchreliability.mdcommunication.mddistributed.mddata.mdscaling.mdcloud.mdanti-patterns.mdIntent · When to reach for it ·
Sketch (strict-typed Python, plus another language where
idiomatic) · Type-safety notes · When NOT to use · Real-world examples · Anti-pattern variant · References. Skim Intent
and When NOT to use before reading the full sketch.Protocol, Self, override, Final, PEP 604/695.
Don't re-derive ABC-heavy Java-style translations. Don't sprinkle
Any to make types "easier" — the sketch already shows the
type-clean form.Anchor on the heading exactly as written in the file — for example
reliability.md#circuit-breaker, data.md#event-sourcing,
cloud.md#strangler-fig, growth.md#what-every-rung-adds. Anchors are
kebab-case slugs of the heading text.
software skill
from this plugin for those.api-design
skill from this plugin; it grounds each choice in Google's AIPs.If a question lands outside this scope, say so rather than bending one of the references to fit. If a question lands inside the scope but the answer isn't in the references, that's a signal the catalogue should be extended — flag it and propose the addition rather than improvising silently.
What SKILL.md sets; muted values are Claude Code's defaults
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./codebase-designUse 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?"./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.Other plugins' skills for the same job