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/new-patternnpx skills add Totoro-jam/battle-tested-patterns --skill new-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/new-pattern)<a href="https://agentmods.dev/skills/totoro-jam/battle-tested-patterns/new-pattern"><img src="https://agentmods.dev/badge/skills/totoro-jam/battle-tested-patterns/new-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.1 | $0.00039 | $0.01504 |
| Opus 5 | $0.00019 | $0.00752 |
| Sonnet 5 | $0.00008 | $0.00301 |
| Haiku 4.5 | $0.00004 | $0.00150 |
Grade A, and why
new-pattern scanned grade A with 1 finding 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 6d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
3. Verify with `curl -sI <url> | head -1` — must return HTTP 200 How it starts
The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Create a New Pattern
You are creating a new pattern for battle-tested-patterns. Follow each step in order. Do NOT skip source verification. Reference SOP 01 for the full checklist.
Step 1: Topic Validation
Ask these questions before proceeding:
- What is the pattern name?
- Can you name ≥ 2 production projects that use it (with source links)?
- Is it cross-language (not specific to one language/framework)?
- Is it a code-level technique (not purely architectural)?
- Does it NOT duplicate an existing pattern in
docs/patterns/?
If any answer is "no", stop and explain why this pattern doesn't fit.
Step 2: Source Code Location
For each production project:
- Search the project repo for the exact usage
- Get the GitHub URL with line numbers:
https://github.com/{org}/{repo}/blob/main/{path}#L{start}-L{end} - Verify with
curl -sI <url> | head -1— must return HTTP 200 - Read the code to confirm your understanding
- Write a Production Proof description specific enough to learn WITHOUT clicking the link
CRITICAL: Never fabricate a URL. If you cannot verify a link, write <!-- TODO: verify source link --> instead.
Step 3: Write the Document
Create docs/patterns/<pattern-name>/index.md with ALL required sections:
# Pattern: [Name]
## One Liner ← ≤ 30 English words, capture WHY not just WHAT
## Core Idea ← concept + diagram (choose best representation for this pattern)
## Production Proof ← table with ≥ 2 verified URLs, descriptions show HOW not just WHAT
## Implementation ← TypeScript (required) + ≥ 1 other language in ::: code-group
## Exercises ← table with basic + intermediate exercise links
## When to Use ← ≥ 3 concrete scenarios
## When NOT to Use ← ≥ 2 concrete alternatives
## More Production Uses ← bullet list with repo links
## Challenge Questions ← 3-4 scenario Q&A using ::: details syntax
Diagram Guidelines
- Choose the representation that best matches the pattern's nature:
- Ring/circular → for hash rings, ring buffers
- Timeline → for temporal patterns (WAL, MVCC, retry)
- State diagram → for state machines, circuit breakers (use mermaid)
- Tree → for tries, heaps, B-trees
- Box-and-arrow → for data structures (LRU, skip list)
- ASCII
textblocks: every box border must be vertically aligned - ZH docs: CJK characters = 2 display columns; compensate with fewer spaces
- Verify alignment in a monospace font before committing
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.
- 6d ago First seen · 135 lines · 39 tokens per session scan A 2a63544ca241
new-pattern is a skill published in the GitHub repository Totoro-jam/battle-tested-patterns (340 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,504 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
comms-context
Fetch on-call and discussion context from Slack threads and PagerDuty incidents — participants, timeline, and status. Auto-loads on Slack permalinks or PagerDuty incident references. Keywords — Slack, thread, PagerDuty, on-call.
principle-communication
Caveman output mode — ultra-terse brief replies with fewer tokens. Strips filler, hedging, pleasantries. Three levels — caveman lite (default), caveman full, ultra caveman / max caveman (maximum compression). Persists until normal mode. Auto-load when the user requests terser output, says "be brief", "less tokens"…
java-clean-comments
Enforces comment and Javadoc hygiene in Java — no commented-out code, no author or ticket metadata, no comments restating the code, and Javadoc that documents contracts rather than repeating signatures. Use when writing or reviewing Java comments and Javadoc, and when the code shows commented-out blocks, TODO or FIXME…
py-clean-comments
Use when writing, fixing, editing, or reviewing Python comments and docstrings. Enforces Clean Code principles—no metadata, no redundancy, no commented-out code. Also trigger on: commented-out code blocks, TODO/FIXME banners, author/ticket/date metadata in comments, docstrings that no longer match the code, redundant…
ts-clean-comments
Use when writing, fixing, editing, or reviewing TypeScript comments and TSDoc. Enforces Clean Code principles—no metadata, no redundancy, no commented-out code. Also trigger on: commented-out code blocks, TODO/FIXME banners, author/ticket/date metadata in comments or TSDoc, TSDoc that no longer matches the code…
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…