Architecture Patterns
KartikLabhshetwar/better-shot
Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.
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.
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns adopt-pattern --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ 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-srcUse ~/.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/
Install the "adopt-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-pattern into .claude/skills/adopt-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopt-pattern", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-patternType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns adopt-pattern --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/pattern-skills/skills/adopt-pattern .agents/skills/adopt-pattern && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "adopt-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-pattern into .agents/skills/adopt-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopt-pattern", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns adopt-pattern --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/pattern-skills/skills/adopt-pattern .cursor/skills/adopt-pattern && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "adopt-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-pattern into .cursor/skills/adopt-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopt-pattern", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Totoro-jam/battle-tested-patterns.git --path plugins/pattern-skills/skills/adopt-pattern--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns adopt-pattern --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/pattern-skills/skills/adopt-pattern .gemini/skills/adopt-pattern && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "adopt-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-pattern into .gemini/skills/adopt-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopt-pattern", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Totoro-jam/battle-tested-patterns adopt-patternInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/pattern-skills/skills/adopt-pattern .github/skills/adopt-pattern && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "adopt-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-pattern into .github/skills/adopt-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopt-pattern", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Totoro-jam/battle-tested-patterns --skill adopt-pattern -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns adopt-pattern --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/pattern-skills/skills/adopt-pattern .opencode/skills/adopt-pattern && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "adopt-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/plugins/pattern-skills/skills/adopt-pattern into .opencode/skills/adopt-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopt-pattern", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
adopt-patternMatches 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.
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.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 660e0e9. It shows what the files ask for, not the result of running them.
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.
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.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
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.
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.
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.
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.
.claude/skills/adopt-pattern/SKILL.md (or your agent's skills folder).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:
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).
Work the four steps in order. Do not skip the fit-gate.
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.
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.
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.Do not fetch all 46 docs. Fetch the 1–3 you are actually deciding between.
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.
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.
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.
| Pattern | Reach for it when | Level | Doc URL |
|---|---|---|---|
| Bitmask | flags in one int — Pack multiple boolean flags into a single integer and manipulate them with bitwise operators for constant-time set operations. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/bitmask/index.md |
| Min Heap | priority 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. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/min-heap/index.md |
| Ring Buffer | fixed-size FIFO — A fixed-size buffer that wraps around using modular arithmetic, enabling constant-time enqueue and dequeue without memory allocation. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/ring-buffer/index.md |
| Trie | prefix search — Store strings in a tree where each edge represents a character — shared prefixes share nodes, enabling O(k) lookup by key length. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/trie/index.md |
| Skip List | probabilistic order — A probabilistic sorted data structure with O(log n) search, insert, and delete — simpler to implement than balanced trees with comparable performance. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/skip-list/index.md |
| Bloom Filter | set membership — Test set membership in O(k) time with zero false negatives — at the cost of a tunable false positive rate. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/bloom-filter/index.md |
| LRU Cache | eviction 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. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/lru-cache/index.md |
| B+ Tree | disk-optimized index — Self-balancing tree with high branching factor — internal nodes guide, leaf nodes store, all leaves linked for efficient range scans. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/b-plus-tree/index.md |
| Tagged Union | type-safe dispatch — Store a type tag alongside a value union so one variable safely holds different types, dispatching behavior via the tag. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/tagged-union/index.md |
| Merkle Tree | integrity 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. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/merkle-tree/index.md |
| Merge Iterator | k-way merge — Combine K sorted streams into one sorted output using a min-heap — the universal "unified view" over multiple data sources. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/merge-iterator/index.md |
| Pattern | Reach for it when | Level | Doc URL |
|---|---|---|---|
| Semaphore | bounded access — Limit the number of concurrent operations by maintaining a counter — acquire before work, release after, block when the limit is reached. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/semaphore/index.md |
| Actor Model | message passing — Each actor has a mailbox and processes messages sequentially — no shared state, no locks, just message passing for safe concurrency. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/actor-model/index.md |
| Work Stealing | load balance — Idle threads steal tasks from busy threads' queues — balancing load dynamically without central coordination. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/work-stealing/index.md |
| MVCC | snapshot isolation — Keep multiple timestamped versions of each value so readers never block writers — each transaction sees a consistent snapshot without locks. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/mvcc/index.md |
| Cooperative Scheduling | yield control — Break long-running work into small chunks, yielding control back to the host between each chunk to keep the system responsive. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/cooperative-scheduling/index.md |
| Double Buffering | atomic swap — Maintain two copies of state and atomically swap between them so readers always see a consistent snapshot. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/double-buffering/index.md |
| Backpressure | flow control — Slow down producers when consumers can't keep up — use bounded buffers and demand signals to prevent resource exhaustion. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/backpressure/index.md |
| Event Loop | I/O multiplexing — A single-threaded loop that multiplexes I/O via epoll/kqueue, dispatching ready events to callbacks — thousands of connections without threads. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/event-loop/index.md |
| Logical Clock | event ordering — A monotonically increasing counter that orders events without wall-clock time — enabling consistent snapshots and staleness detection. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/logical-clock/index.md |
| Pattern | Reach for it when | Level | Doc URL |
|---|---|---|---|
| Circuit Breaker | fault tolerance — Stop calling a failing service by tracking errors and tripping open — fail fast instead of piling up timeouts. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/circuit-breaker/index.md |
| Rate Limiter | throttle — Protect services from overload by draining tokens from a bucket that refills at a fixed rate — reject requests when empty. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/rate-limiter/index.md |
| Retry Backoff | resilience — When an operation fails, retry it with progressively longer delays plus random jitter to avoid thundering herd. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/retry-backoff/index.md |
| Write-Ahead Log | durability — Log every mutation to durable storage before applying it — replay the log to recover from crashes without data loss. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/write-ahead-log/index.md |
| Batch Processing | throughput — Accumulate individual operations and execute them together as a group, amortizing per-operation overhead across the batch. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/batch-processing/index.md |
| Consistent Hashing | distribution — Distribute keys across nodes on a virtual ring so that adding or removing a node only remaps ~1/n of the keys. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/consistent-hashing/index.md |
| Dependency Graph | ordering — Model dependencies as a directed acyclic graph and topologically sort to determine a valid execution order — detecting cycles before they deadlock. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/dependency-graph/index.md |
| Middleware Chain | pipeline — Compose handlers where each wraps the next — pre-process, call next, post-process — forming a bidirectional pipeline. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/middleware-chain/index.md |
| Registry | self-register — Components register themselves into a global lookup table by name — consumers discover implementations at runtime without hardcoded dependencies. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/registry/index.md |
| Dirty Flag | deferred recompute — Mark objects as "dirty" on mutation, defer expensive recomputation until the value is actually needed, then clear the flag. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/dirty-flag/index.md |
| LSM Tree | write-optimized store — Buffer writes in memory, flush to sorted files on disk, merge files in background — trading read amplification for fast writes. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/lsm-tree/index.md |
| Checkpointing | snapshot recovery — Periodically snapshot consistent state so recovery replays only from the checkpoint — not from the beginning of time. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/checkpointing/index.md |
| Pattern | Reach for it when | Level | Doc URL |
|---|---|---|---|
| Object Pool | reuse instances — Pre-allocate a set of reusable objects to avoid the cost of repeated allocation and garbage collection on hot paths. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/object-pool/index.md |
| Flyweight | share immutables — Share identical immutable objects instead of creating duplicates, trading a lookup cost for massive memory savings when many instances have the same value. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/flyweight/index.md |
| Arena Allocator | bump alloc — Allocate objects by bumping a pointer in a pre-allocated region — free everything at once when the region is no longer needed. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/arena-allocator/index.md |
| Free List | O(1) alloc/free — Maintain a linked list of freed slots so allocation and deallocation are O(1) — reuse memory without calling the system allocator. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/free-list/index.md |
| Copy-on-Write | defer copy — Share data by reference until someone modifies it — only then make a private copy, saving memory and allocation cost for read-heavy workloads. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/copy-on-write/index.md |
| Reference Counting | auto-cleanup — Track owners via atomic counter, auto-cleanup at zero — deterministic resource lifetime without garbage collection. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/reference-counting/index.md |
| Tombstone | deferred deletion — Mark deleted entries with a tombstone marker instead of removing them — a background process reclaims space later. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/tombstone/index.md |
| Interning | deduplicate values — Deduplicate immutable values through a canonical lookup table — O(1) equality by pointer comparison instead of O(n) content comparison. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/interning/index.md |
| Pattern | Reach for it when | Level | Doc URL |
|---|---|---|---|
| State Machine | transitions — Model an entity's lifecycle as a set of states with explicit transitions, making impossible states unrepresentable and every state change auditable. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/state-machine/index.md |
| Observer | pub/sub — Decouple producers from consumers by letting objects subscribe to events and get notified when something happens, without the source knowing who's listening. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/observer/index.md |
| Iterator | lazy eval — Process sequences one element at a time without materializing the entire collection, enabling composable transformations with zero intermediate allocations. | beginner | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/iterator/index.md |
| Diff / Patch | minimal edits — Compare two sequences to compute the minimal set of operations (insert, delete, move) needed to transform one into the other. | intermediate | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/diff-patch/index.md |
| Vtable | manual polymorphism — Group function pointers into a struct to achieve runtime polymorphism — the manual foundation behind interfaces, traits, and virtual methods. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/vtable/index.md |
| Visitor | tree traversal dispatch — Decouple tree traversal from operations by dispatching to type-specific callbacks — enabling new operations without modifying the tree. | advanced | https://github.com/Totoro-jam/battle-tested-patterns/blob/main/docs/patterns/visitor/index.md |
<!-- CATALOG:END -->
When NOT to Use first.Related Patterns — the better tool is often one row away.Developer: "Downloads are hammering the API — I want to cap it at 5 in flight."
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.acquire()/release() with their existing
error/cleanup handling so a failed download always releases its permit.© 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
Just SKILL.md in plugins/pattern-skills/skills/adopt-pattern of Totoro-jam/battle-tested-patterns.
Open the folder on GitHubat commit 660e0e9
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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Adopt a Design Pattern this skillTotoro-jam/battle-tested-patterns | 343 | — | ~4.9k | Automated safety check: Pass | MIT | |
| Architecture PatternsKartikLabhshetwar/better-shot | 2.4k | 2 repos | ~1.4k | Automated safety check: Pass | Custom licence | |
| Java Architecture Reviewdecebals/claude-code-java | 750 | 1 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Brooks Audithyhmrright/brooks-lint | 1.5k | 1 repos | ~537 | Automated safety check: Pass | MIT | |
| Akka.Hosting Actor PatternsAaronontheweb/dotnet-skills | 1.2k | 1 repos | ~5k | Automated safety check: Pass | MIT | |
| Patterns of Enterprise Application Architectureciembor/agent-rules-books | 2.9k | — | ~228 | Automated safety check: Pass | MIT |
KartikLabhshetwar/better-shot
Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.
decebals/claude-code-java
Reviews a Java project's architecture at the macro level: package structure, module boundaries, dependency direction and layering.
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.
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.
ciembor/agent-rules-books
Apply Martin Fowler-inspired enterprise architecture rules when choosing layers, service layers, transaction scripts, domain models, repositories, mappers, or…
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…
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.
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.
Totoro-jam/battle-tested-patterns
Verify all production proof source links in pattern documents.
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.
Categories
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.