audit-pattern

audit-pattern is a skill for Claude Code from Totoro-jam/battle-tested-patterns. It costs 149 tokens per session (1,391 once invoked), scanned A, original, MIT.

A review workflow for checking whether familiar software design patterns, such as rate limiters or caches, are correctly implemented in an existing codebase. It compares the code with the rules that define each pattern.

In plain words
What is it for?
Auditing implemented patterns, checking their required rules, identifying incorrect labels, and reviewing changes after a release.
Why use it?
It can reveal when code is labelled as one pattern but does not provide that pattern's expected behaviour or guarantees.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the pattern-skills plugin — 2 skills shipped together

Install

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.

agentmods
npx agentmods add skills/totoro-jam/battle-tested-patterns/audit-pattern
Any agent
npx skills add Totoro-jam/battle-tested-patterns --skill audit-pattern
Clone the repo
git clone --depth 1 https://github.com/Totoro-jam/battle-tested-patterns

Made for: Claude Code.

Or install pattern-skills, the plugin that ships this one along with the rest of its 2 skills.

Wrote 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.

agentmods badge for audit-pattern

README.md
[![agentmods](https://agentmods.dev/badge/skills/totoro-jam/battle-tested-patterns/audit-pattern.svg)](https://agentmods.dev/skills/totoro-jam/battle-tested-patterns/audit-pattern)
Your own site
<a href="https://agentmods.dev/skills/totoro-jam/battle-tested-patterns/audit-pattern"><img src="https://agentmods.dev/badge/skills/totoro-jam/battle-tested-patterns/audit-pattern.svg" alt="Measured on agentmods" height="20"></a>
Per session 149 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,391 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00149 $0.01391
Opus 5 $0.00075 $0.00696
Sonnet 5 $0.00030 $0.00278
Haiku 4.5 $0.00015 $0.00139

Measured 6d ago against content hash b80cc7b8ce9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

audit-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 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.

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.

plugins/pattern-skills/skills/audit-pattern/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Audit Patterns

Overview

Grade a codebase against the Battle-Tested Patterns catalog: for each pattern it implements, fetch the canonical doc page and check the implementation against that doc's invariants — not against the name the codebase gave it. The most valuable output of an audit is not a score; it is the mislabel — code called a "semaphore" that is actually a mutex, an "MVCC" that keeps a single version. Those are the claims that mislead developers into expecting guarantees the code does not provide.

Companion skill: Inventory using the adopt-pattern skill's catalog, or the pattern docs at https://github.com/Totoro-jam/battle-tested-patterns/tree/main/docs/patterns. This skill is the inverse of adopt-pattern: that one runs the catalog forward (add a pattern); this one runs it backward (grade patterns already there).

When to use

  • A reviewer asks whether a codebase's patterns are implemented correctly.
  • Someone asks "is this really a <pattern>?" or "do we honor X's invariants?".
  • A periodic conformance check after a release, to catch new mislabels/drift.

When NOT to use: adding a new pattern (use adopt-pattern), or general code review with no pattern claim in play.

Workflow

1. Inventory

List the catalog patterns the codebase implements. Match by shape, not name — a class named RateLimiter may be a different pattern, and a circuit breaker may exist unnamed. Hunt by shape: retry/backoff loops, lock or lease primitives, caches with eviction, state enums with transition switches, ring/circular buffers, breaker/trip counters, subscriber lists. Record the file(s) for each candidate. Only inventory patterns the codebase actually engages; do not pad the audit with absent ones.

2. Conformance — fetch the doc, never grade from memory

For each candidate, fetch the canonical doc page and read Core Idea (the invariant), When NOT to Use, and Production Proof (the reference shape). Then read the actual implementation. Grade against the doc's headline invariant.

Read the full file on GitHub · 122 lines

Changes

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.

  1. 6d ago First seen · 122 lines · 149 tokens per session scan A b80cc7b8ce9b

Subscribe to this mod's changes

audit-pattern is a skill published in the GitHub repository Totoro-jam/battle-tested-patterns (340 stars, last pushed yesterday), licensed MIT. It adds 149 tokens to every session and 1,391 once invoked, about $0.0007 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.

Related

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…

FilippoDeSilva/skills · 80 tokens

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.

JanDeDobbeleer/oh-my-posh · 47 tokens

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-llm/ax · 54 tokens

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-llm/ax · 44 tokens

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.

ax-llm/ax · 45 tokens

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…

gomlx/gomlx · 143 tokens