Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/totoro-jam/battle-tested-patterns/adopt-patternnpx skills add Totoro-jam/battle-tested-patterns --skill adopt-patterngit clone --depth 1 https://github.com/Totoro-jam/battle-tested-patternsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/totoro-jam/battle-tested-patterns/adopt-pattern)<a href="https://agentmods.dev/skills/totoro-jam/battle-tested-patterns/adopt-pattern"><img src="https://agentmods.dev/badge/skills/totoro-jam/battle-tested-patterns/adopt-pattern.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00151 | $0.04544 |
| Opus 5 | $0.00076 | $0.02272 |
| Sonnet 5 | $0.00030 | $0.00909 |
| Haiku 4.5 | $0.00015 | $0.00454 |
Grade A, and why
adopt-pattern scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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:
- 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.
- 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 Usedescribes the developer's situation, stop and steer to the better-fit pattern named inRelated Patterns. Explain why in one or two sentences. - If nothing fits, say so. Do not adopt a pattern to satisfy the request.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 205 lines · 151 tokens per session scan A 5b78bea4ecad
adopt-pattern is a skill published in the GitHub repository Totoro-jam/battle-tested-patterns (340 stars, last pushed today), licensed MIT. It adds 151 tokens to every session and 4,544 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
golang
Idiomatic Golang design patterns — functional options, constructors, error flow and cascading, resource management and lifecycle, graceful shutdown, resilience, architecture, dependency injection, data handling, streaming, and more. Apply when explicitly choosing between architectural patterns, implementing functional…
oh-my-posh
Install, configure, or troubleshoot Oh My Posh/ohmyposh: shell init, themes, segments, Nerd Font icons, and prompt setup on PowerShell, zsh, bash, or fish.
ax-go-gen
Use when writing Go code with github.com/ax-llm/ax/packages/go for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.
ax-go-llm
Use when writing Go code with github.com/ax-llm/ax/packages/go for using the generated Ax package, factory functions, package docs, examples, and API reference.
ax-go-audio
Use when writing Go code with github.com/ax-llm/ax/packages/go for audio input/output, OpenAI Responses audio mapping, realtime event folding, and generated package audio examples.
golang-gomlx
Machine learning models training and inference using GoMLX for Go. It provides an abstraction to create vectorized computation graphs, that can then be JIT-compiled (Just-In-Time) and executed very fast, with backends using XLA (for CPU/CUDA/TPU), Go and others. Includes a reach set of vector (tensors) operations on…