Agent skill

Adopt a Design Pattern

by Totoro-jam in Totoro-jam/battle-tested-patterns

Matches a coding problem to one of 46 documented systems patterns, checks that it really fits, then adapts it into your codebase with a test for its invariant.

MITAuto-check passedDevelopment

Install Adopt a Design Pattern

skills CLI
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Totoro-jam/battle-tested-patterns adopt-pattern --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/pattern-skills/skills/adopt-pattern .claude/skills/adopt-pattern && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
adopt-pattern
GitHub stars
343
Token cost
~4.9k tokens
SKILL.md length
2,001 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Matches a coding problem to one of 46 documented systems patterns, checks that it really fits, then adapts it into your codebase with a test for its invariant.

  • Works in 4 steps: Match → Fit-gate → Adapt → …
  • Asking for a named pattern such as a circuit breaker or ring buffer in your code
  • SKILL.md covers Overview, When to use, Workflow and Pattern catalog, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill works from a catalog of 46 patterns such as ring buffer, circuit breaker, LRU cache, rate limiter, trie and bloom filter. Each pattern has a source doc with When to Use, When NOT to Use and Related Patterns sections, a table of production source links and multi-language implementations, and the agent fetches those pages instead of relying on memory.

A four-step workflow runs in order. Match maps your named pattern or described problem to two or three candidates. A fit-gate reads only those docs and steers you toward a better pattern if the When NOT to Use section describes your case, or says plainly that nothing fits. Adapt turns the doc's implementation for your language into code in your repository, and a final verify step leaves behind a regression test for the pattern's invariant.

When your agent uses it

  • Asking for a named pattern such as a circuit breaker or ring buffer in your code
  • Describing a problem like cascading failures or request throttling and wanting the matching pattern
  • Comparing two related patterns to decide which one fits

Example prompts

  • “Add a circuit breaker around our payment gateway client.”
  • “I need a fixed-size buffer that overwrites the oldest entry; which pattern fits?”
  • “Should I use a rate limiter or a semaphore to throttle outgoing API calls?”

Requirements

  • Network access to fetch the pattern docs from GitHub

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Match
  2. Fit-gate
  3. Adapt
  4. Verify — leave a durable invariant test

What it can do on your machine

Read from SKILL.md and the folder at commit 660e0e9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Adopt a Design Pattern loads about 4.9k tokens when it runs. Until then it costs about 187 tokens; SKILL.md has 2,001 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~187
When it runs · the whole SKILL.md, loaded when a task matches
~4.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Totoro-jam/battle-tested-patterns at commit 660e0e9, republished under its MIT licence (© Totoro-jam). 2,001 words, ~4,910 tokens.

Download SKILL.mdSave it as .claude/skills/adopt-pattern/SKILL.md (or your agent's skills folder).
name
adopt-pattern
description
Use when a developer wants to apply a low-level, systems, or concurrency design pattern in their own code, drawing on the Battle-Tested Patterns catalog of 46 production-proven patterns. Triggers three ways: they name a pattern (ring buffer, circuit breaker, actor model, LRU cache, rate limiter, trie, bloom filter, WAL, semaphore, ...); they describe a problem one solves without naming it (fixed-size buffer that overwrites the oldest entry, cascading failures across services, throttling requests, deduplicating identical strings, ordering events without wall-clock time, snapshot isolation, prefix search, set membership without storing every key, ...); or they ask which pattern fits a problem or how two related patterns differ.

Adopt a Pattern

Overview

The Battle-Tested Patterns catalog documents 46 patterns, each in a GitHub source doc (URLs in the catalog below) with a When to Use / When NOT to Use / Related Patterns decision guide, a Production Proof table of real source links, and a multi-language Implementation. Those doc pages are the source of truth — fetch the relevant one rather than relying on memory. This skill routes a developer's problem to the right pattern and then drives a disciplined adoption into their codebase; it does not reproduce the pattern content here.

Two principles do the work:

  1. A pattern is only worth adopting if it fits — the common failure is reaching for a named pattern that doesn't match the problem; the fit-gate catches that before any code is written.
  2. A pattern adopted without a durable test for its invariant is not done — a correct-looking implementation that leaves no regression test lets the invariant rot on the next edit. The verify step leaves that test behind.

When to use

  • A developer names a pattern and wants it in their code.
  • A developer describes a problem (see the catalog cues) without naming a pattern.
  • A developer asks "which pattern fits?" or "X vs Y — which?".

When NOT to use: general feature work with no pattern in play, or a problem no catalog entry matches (say so plainly rather than forcing a fit).

Workflow

Work the four steps in order. Do not skip the fit-gate.

1. Match

Map the problem to candidate patterns using the catalog below. If the developer named a pattern, still confirm it against the cue. If a problem matches several (e.g. "throttle requests" → Rate Limiter, Semaphore, Backpressure), keep 2–3 candidates for the fit-gate.

2. Fit-gate

Fetch only the candidate patterns' doc pages (the Doc URL in the catalog) and focus on When to Use, When NOT to Use, and Related Patterns.

  • If the pattern fits, continue to step 3.
  • If When NOT to Use describes the developer's situation, stop and steer to the better-fit pattern named in Related Patterns. Explain why in one or two sentences.
  • If nothing fits, say so. Do not adopt a pattern to satisfy the request.

Do not fetch all 46 docs. Fetch the 1–3 you are actually deciding between.

3. Adapt

Read the chosen doc's Implementation (in the developer's language) and skim Production Proof for how real systems shape it. Then write it into their codebase — match their naming, types, error handling, and module boundaries.

  • Adapt, do not copy-paste. The reference impl is a teaching version; production code needs the project's conventions and edge-case handling.
  • Carry over the invariants the doc calls out (e.g. a ring buffer's overwrite-on- full rule, a circuit breaker's half-open probe). Those are the point.
4. Verify — leave a durable invariant test

This is where adoption is won or lost: a capable agent will usually pick the right pattern and implement it correctly, then "confirm it works" with a throwaway check and move on — leaving nothing that protects the invariant on the next edit.

Write a focused test as a committed file in the developer's own project and runner that exercises the pattern's defining behavior — use the doc's Exercises and Challenge Questions as a checklist of cases (the boundary conditions, not the happy path). Run it. An inline or throwaway check does not count. A pattern adopted without a durable test for its invariant is not done.

Pattern catalog

Each row links to the pattern's doc source on GitHub — fetch it during the fit-gate. (Maintainers: this block is generated; see the skill's source repo.)

<!-- CATALOG:START -->

46 patterns. Match the developer's problem to a row, then fetch only that pattern's doc URL.

🧠 Data Structures
PatternReach for it whenLevelDoc URL
Bitmaskflags in one int — Pack multiple boolean flags into a single integer and manipulate them with bitwise operators for constant-time set operations.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/bitmask/index.md
Min Heappriority queue — A binary tree stored in an array where the smallest element is always at the root, enabling O(1) peek and O(log n) insert/remove.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/min-heap/index.md
Ring Bufferfixed-size FIFO — A fixed-size buffer that wraps around using modular arithmetic, enabling constant-time enqueue and dequeue without memory allocation.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/ring-buffer/index.md
Trieprefix search — Store strings in a tree where each edge represents a character — shared prefixes share nodes, enabling O(k) lookup by key length.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/trie/index.md
Skip Listprobabilistic order — A probabilistic sorted data structure with O(log n) search, insert, and delete — simpler to implement than balanced trees with comparable performance.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/skip-list/index.md
Bloom Filterset membership — Test set membership in O(k) time with zero false negatives — at the cost of a tunable false positive rate.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/bloom-filter/index.md
LRU Cacheeviction policy — Evict the least recently used entry when the cache is full — O(1) get and put using a hash map plus a doubly linked list.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/lru-cache/index.md
B+ Treedisk-optimized index — Self-balancing tree with high branching factor — internal nodes guide, leaf nodes store, all leaves linked for efficient range scans.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/b-plus-tree/index.md
Tagged Uniontype-safe dispatch — Store a type tag alongside a value union so one variable safely holds different types, dispatching behavior via the tag.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/tagged-union/index.md
Merkle Treeintegrity proof — Hash leaves, then hash pairs upward to a root — verify any leaf's integrity in O(log n) without re-hashing the entire dataset.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/merkle-tree/index.md
Merge Iteratork-way merge — Combine K sorted streams into one sorted output using a min-heap — the universal "unified view" over multiple data sources.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/merge-iterator/index.md
⚡ Concurrency
PatternReach for it whenLevelDoc URL
Semaphorebounded access — Limit the number of concurrent operations by maintaining a counter — acquire before work, release after, block when the limit is reached.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/semaphore/index.md
Actor Modelmessage passing — Each actor has a mailbox and processes messages sequentially — no shared state, no locks, just message passing for safe concurrency.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/actor-model/index.md
Work Stealingload balance — Idle threads steal tasks from busy threads' queues — balancing load dynamically without central coordination.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/work-stealing/index.md
MVCCsnapshot isolation — Keep multiple timestamped versions of each value so readers never block writers — each transaction sees a consistent snapshot without locks.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/mvcc/index.md
Cooperative Schedulingyield control — Break long-running work into small chunks, yielding control back to the host between each chunk to keep the system responsive.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/cooperative-scheduling/index.md
Double Bufferingatomic swap — Maintain two copies of state and atomically swap between them so readers always see a consistent snapshot.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/double-buffering/index.md
Backpressureflow control — Slow down producers when consumers can't keep up — use bounded buffers and demand signals to prevent resource exhaustion.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/backpressure/index.md
Event LoopI/O multiplexing — A single-threaded loop that multiplexes I/O via epoll/kqueue, dispatching ready events to callbacks — thousands of connections without threads.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/event-loop/index.md
Logical Clockevent ordering — A monotonically increasing counter that orders events without wall-clock time — enabling consistent snapshots and staleness detection.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/logical-clock/index.md
Show full SKILL.md (869 more words)Show less
🏗️ Systems
PatternReach for it whenLevelDoc URL
Circuit Breakerfault tolerance — Stop calling a failing service by tracking errors and tripping open — fail fast instead of piling up timeouts.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/circuit-breaker/index.md
Rate Limiterthrottle — Protect services from overload by draining tokens from a bucket that refills at a fixed rate — reject requests when empty.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/rate-limiter/index.md
Retry Backoffresilience — When an operation fails, retry it with progressively longer delays plus random jitter to avoid thundering herd.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/retry-backoff/index.md
Write-Ahead Logdurability — Log every mutation to durable storage before applying it — replay the log to recover from crashes without data loss.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/write-ahead-log/index.md
Batch Processingthroughput — Accumulate individual operations and execute them together as a group, amortizing per-operation overhead across the batch.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/batch-processing/index.md
Consistent Hashingdistribution — Distribute keys across nodes on a virtual ring so that adding or removing a node only remaps ~1/n of the keys.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/consistent-hashing/index.md
Dependency Graphordering — Model dependencies as a directed acyclic graph and topologically sort to determine a valid execution order — detecting cycles before they deadlock.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/dependency-graph/index.md
Middleware Chainpipeline — Compose handlers where each wraps the next — pre-process, call next, post-process — forming a bidirectional pipeline.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/middleware-chain/index.md
Registryself-register — Components register themselves into a global lookup table by name — consumers discover implementations at runtime without hardcoded dependencies.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/registry/index.md
Dirty Flagdeferred recompute — Mark objects as "dirty" on mutation, defer expensive recomputation until the value is actually needed, then clear the flag.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/dirty-flag/index.md
LSM Treewrite-optimized store — Buffer writes in memory, flush to sorted files on disk, merge files in background — trading read amplification for fast writes.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/lsm-tree/index.md
Checkpointingsnapshot recovery — Periodically snapshot consistent state so recovery replays only from the checkpoint — not from the beginning of time.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/checkpointing/index.md
♻️ Memory
PatternReach for it whenLevelDoc URL
Object Poolreuse instances — Pre-allocate a set of reusable objects to avoid the cost of repeated allocation and garbage collection on hot paths.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/object-pool/index.md
Flyweightshare immutables — Share identical immutable objects instead of creating duplicates, trading a lookup cost for massive memory savings when many instances have the same value.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/flyweight/index.md
Arena Allocatorbump alloc — Allocate objects by bumping a pointer in a pre-allocated region — free everything at once when the region is no longer needed.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/arena-allocator/index.md
Free ListO(1) alloc/free — Maintain a linked list of freed slots so allocation and deallocation are O(1) — reuse memory without calling the system allocator.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/free-list/index.md
Copy-on-Writedefer copy — Share data by reference until someone modifies it — only then make a private copy, saving memory and allocation cost for read-heavy workloads.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/copy-on-write/index.md
Reference Countingauto-cleanup — Track owners via atomic counter, auto-cleanup at zero — deterministic resource lifetime without garbage collection.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/reference-counting/index.md
Tombstonedeferred deletion — Mark deleted entries with a tombstone marker instead of removing them — a background process reclaims space later.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/tombstone/index.md
Interningdeduplicate values — Deduplicate immutable values through a canonical lookup table — O(1) equality by pointer comparison instead of O(n) content comparison.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/interning/index.md
🔄 Behavioral
PatternReach for it whenLevelDoc URL
State Machinetransitions — Model an entity's lifecycle as a set of states with explicit transitions, making impossible states unrepresentable and every state change auditable.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/state-machine/index.md
Observerpub/sub — Decouple producers from consumers by letting objects subscribe to events and get notified when something happens, without the source knowing who's listening.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/observer/index.md
Iteratorlazy eval — Process sequences one element at a time without materializing the entire collection, enabling composable transformations with zero intermediate allocations.beginnerhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/iterator/index.md
Diff / Patchminimal edits — Compare two sequences to compute the minimal set of operations (insert, delete, move) needed to transform one into the other.intermediatehttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/diff-patch/index.md
Vtablemanual polymorphism — Group function pointers into a struct to achieve runtime polymorphism — the manual foundation behind interfaces, traits, and virtual methods.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/vtable/index.md
Visitortree traversal dispatch — Decouple tree traversal from operations by dispatching to type-specific callbacks — enabling new operations without modifying the tree.advancedhttps://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/visitor/index.md
<!-- CATALOG:END -->

Common mistakes

  • Skipping the fit-gate because the developer named a pattern. Named ≠ correct — confirm against When NOT to Use first.
  • Copy-pasting the reference implementation verbatim. It teaches the shape; it is not drop-in production code.
  • Loading many pattern docs at once. Match from the catalog cues, then open only the 1–3 candidates.
  • Choosing by familiarity ("I know LRU") instead of fit. Check Related Patterns — the better tool is often one row away.
  • Declaring done without a test for the pattern's invariant.

Example

Developer: "Downloads are hammering the API — I want to cap it at 5 in flight."

  1. Match — "cap concurrent access" → candidates: Semaphore, Rate Limiter, Backpressure.
  2. Fit-gate — the Semaphore doc's When to Use directly lists "control access to a fixed number of resources" and "limit concurrent network requests" — a concurrency cap, which is what the developer asked for. Rate Limiter's When to Use governs rate over time (API rate limiting, traffic shaping), a different axis. → Semaphore.
  3. Adapt — port the doc's TypeScript semaphore into their download module, wrapping the fetch call in acquire()/release() with their existing error/cleanup handling so a failed download always releases its permit.
  4. Verify — test that with the cap at 5 and 20 queued downloads, no more than 5 run concurrently and all 20 eventually complete.

© Totoro-jam, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/pattern-skills/skills/adopt-pattern of Totoro-jam/battle-tested-patterns.

Open the folder on GitHubat commit 660e0e9

Compare with similar skills

Adopt a Design Pattern next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Adopt a Design Pattern compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Adopt a Design Pattern this skillTotoro-jam/battle-tested-patterns343—~4.9kAutomated safety check: PassMIT
Architecture PatternsKartikLabhshetwar/better-shot2.4k2 repos~1.4kAutomated safety check: PassCustom licence
Java Architecture Reviewdecebals/claude-code-java7501 repos~2.2kAutomated safety check: PassMIT
Brooks Audithyhmrright/brooks-lint1.5k1 repos~537Automated safety check: PassMIT
Akka.Hosting Actor PatternsAaronontheweb/dotnet-skills1.2k1 repos~5kAutomated safety check: PassMIT
Patterns of Enterprise Application Architectureciembor/agent-rules-books2.9k—~228Automated safety check: PassMIT

Similar skills

  • Architecture Patterns

    KartikLabhshetwar/better-shot

    Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.

    2.4k GitHub starsUsed in 2 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Java Architecture Review

    decebals/claude-code-java

    Reviews a Java project's architecture at the macro level: package structure, module boundaries, dependency direction and layering.

    750 GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Brooks Audit

    hyhmrright/brooks-lint

    Architecture audit that maps module dependencies, checks layering integrity, and flags structural decay across a codebase, drawing on twelve classic engineering books.

    1.5k GitHub starsUsed in 1 repo~537 tokens
    DevelopmentAuto-check passed
  • Akka.Hosting Actor Patterns

    Aaronontheweb/dotnet-skills

    Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.

    1.2k GitHub starsUsed in 1 repo~5k tokens
    DevelopmentAuto-check passed
  • Apply Martin Fowler-inspired enterprise architecture rules when choosing layers, service layers, transaction scripts, domain models, repositories, mappers, or…

    2.9k GitHub stars~228 tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • Py Rig

    mudrii/hermesd

    A skill your agent uses when building, reviewing, or refactoring Python code that requires strong maintainability discipline: SRP, DRY, OCP, explicit dependency injection, TDD/ATDD workflow, strict…

    119 GitHub stars~6.3k tokensUpdated 6 days ago
    DevelopmentAuto-check passed

More from Totoro-jam/battle-tested-patterns

  • Pattern Conformance Audit

    Totoro-jam/battle-tested-patterns

    Audits a codebase's existing patterns, such as rate limiters, circuit breakers and caches, against canonical invariants and flags mislabeled or divergent ones.

    343 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • New Pattern Authoring Workflow

    Totoro-jam/battle-tested-patterns

    Step-by-step workflow for adding a new pattern to the battle-tested-patterns repo: validate the topic, verify sources, write the doc, code and exercises.

    343 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Verify Source

    Totoro-jam/battle-tested-patterns

    Verify all production proof source links in pattern documents.

    343 GitHub stars~930 tokensUpdated 1 mo ago
    Auto-check passed
  • Failure Diagnosis Loop

    Totoro-jam/battle-tested-patterns

    Walks the agent through a fixed loop for failing tests and build errors: reproduce, isolate, hypothesize, instrument, fix, verify, then add a regression test.

    343 GitHub stars~319 tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Adopt a Design Pattern

What does Adopt a Design Pattern do?

Matches a coding problem to one of 46 documented systems patterns, checks that it really fits, then adapts it into your codebase with a test for its invariant. The skill works from a catalog of 46 patterns such as ring buffer, circuit breaker, LRU cache, rate limiter, trie and bloom filter. Each pattern has a source doc with When to Use, When NOT to Use and Related Patterns sections, a table of production source links and multi-language implementations, and the agent fetches those pages instead of relying on memory.

When should I use Adopt a Design Pattern?

Adopt a Design Pattern fits situations like: asking for a named pattern such as a circuit breaker or ring buffer in your code; describing a problem like cascading failures or request throttling and wanting the matching pattern; comparing two related patterns to decide which one fits.

How do I install Adopt a Design Pattern in Claude Code?

Run `npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a claude-code`. Or copy the skill folder (plugins/pattern-skills/skills/adopt-pattern in Totoro-jam/battle-tested-patterns) into .claude/skills/adopt-pattern in your project. Claude Code loads it when a task matches its description.

How do I install Adopt a Design Pattern in Codex?

Run `npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a codex`. Or copy the skill folder (plugins/pattern-skills/skills/adopt-pattern in Totoro-jam/battle-tested-patterns) into .agents/skills/adopt-pattern in your project. Codex loads it when a task matches its description.

Can I use Adopt a Design Pattern in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adopt-pattern, .gemini/skills/adopt-pattern, .github/skills/adopt-pattern and .opencode/skills/adopt-pattern in your project.

What does Adopt a Design Pattern need to run?

SKILL.md names no scripts, command-line tools or credentials: Adopt a Design Pattern is instructions for the agent only. Our summary lists: Network access to fetch the pattern docs from GitHub.

Does Adopt a Design Pattern access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Adopt a Design Pattern safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Adopt a Design Pattern use?

Adopt a Design Pattern is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Adopt a Design Pattern use?

About 4.9k tokens (SKILL.md is roughly 20k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Adopt a Design Pattern?

Skills that share tags, products or a category with Adopt a Design Pattern: Architecture Patterns (KartikLabhshetwar/better-shot, 2.4k stars), Java Architecture Review (decebals/claude-code-java, 750 stars), Brooks Audit (hyhmrright/brooks-lint, 1.5k stars) and Akka.Hosting Actor Patterns (Aaronontheweb/dotnet-skills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Adopt a Design Pattern?

Totoro-jam (a GitHub user) maintains it in Totoro-jam/battle-tested-patterns, which has 343 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 4, 2026.

Source: Totoro-jam/battle-tested-patterns on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.