Agent skill

Pattern Conformance Audit

by Totoro-jam in 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.

MITAuto-check passedDevelopment

Install Pattern Conformance Audit

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

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

GitHub CLI
$ gh skill install Totoro-jam/battle-tested-patterns audit-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/audit-pattern .claude/skills/audit-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
audit-pattern
GitHub stars
344
Token cost
~1.6k tokens
SKILL.md length
651 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 4 steps: Inventory → Conformance — fetch the doc, never grade… → Gap analysis — classify the deviation → …
  • Checking whether the patterns a codebase claims to implement are implemented correctly
  • SKILL.md covers Overview, When to use, Workflow and Verdict scale, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The audit grades what the code actually does, not what it calls itself. The agent inventories the catalog patterns the codebase implements by shape, since a class named RateLimiter might be another pattern and a circuit breaker might have no label at all. For each candidate it fetches the canonical doc page, reads the core idea, when not to use it and the production reference, then reads the implementation and grades it against the headline invariant.

The most useful finding is the mislabel: a semaphore that is really a mutex, or an MVCC that keeps a single version, because those claims lead developers to expect guarantees the code does not give. Verdicts separate faithful implementations, ones that meet the intent another way, ones a framework enables without providing, and ones that are really a different pattern. The skill also reports catalog patterns that are absent. Its companion adopt-pattern adds new patterns, and general code review without a pattern claim is out of scope.

When your agent uses it

  • Checking whether the patterns a codebase claims to implement are implemented correctly
  • Answering whether a class called a semaphore or MVCC store is really that pattern
  • Running a periodic conformance check after a release to catch drift

Example prompts

  • “Audit our rate limiter and circuit breaker implementations against the canonical patterns.”
  • “Is the class we call Semaphore really a semaphore, or just a mutex?”
  • “Run a pattern conformance check on the services folder after this release.”
  • “Do we implement write-ahead logging correctly in the storage layer?”

Requirements

  • Network access to fetch the pattern catalog's doc pages

Workflow steps

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

  1. Inventory
  2. Conformance — fetch the doc, never grade from memory
  3. Gap analysis — classify the deviation
  4. Evidence — cite code + doc

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

Pattern Conformance Audit loads about 1.6k tokens when it runs. Until then it costs about 183 tokens; SKILL.md has 651 words of instructions outside code blocks.

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

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). 651 words, ~1,561 tokens.

Download SKILL.mdSave it as .claude/skills/audit-pattern/SKILL.md (or your agent's skills folder).
name
audit-pattern
description
Use when reviewing or auditing an existing codebase against production-proven implementation patterns — checking whether the patterns it already implements (actor model, rate limiter, circuit breaker, LRU cache, write-ahead log, semaphore, ...) actually honor the canonical invariants, whether any are mislabeled (a "semaphore" that is really a mutex; an "MVCC" that keeps one version), whether any diverge from the reference, and which catalog patterns are absent. Triggers on "audit our architecture against best practices", "do we implement X correctly", "are our patterns right", "pattern conformance", "is this really a <pattern>?". This grades patterns already present; its companion adopt-pattern adds new ones.

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.

3. Gap analysis — classify the deviation

Assign a verdict (scale below). The judgment is distinguishing faithful from divergent from mislabeled:

  • Meets the invariant faithfully → ✅
  • Meets the intent a different way (different algorithm/model) → 🟡
  • The developer/framework enables it but does not provide it → 🔵
  • It is actually a different catalog pattern → 🔁 (the mislabel — flag loudly)
  • Not present → ⚪ (absence is N/A, not a failure, unless the pattern is clearly needed)
4. Evidence — cite code + doc

Every verdict cites a file:line in the codebase and the doc invariant it was graded against. A verdict without a citation is an opinion, not an audit.

Show full SKILL.md (255 more words)Show less

Verdict scale

SymbolMeaning
✅Faithful — honors the doc's headline invariant.
🟡Intent met, model/algorithm diverges from the reference.
🔵Enabled, not provided — the developer brings it.
🔁Mislabeled — it is actually a different catalog pattern.
⚪Absent / N-A — not present (only a gap if the pattern is needed).

Scorecard format (the output)

Produce one table, optionally grouped by catalog category:

PatternVerdictEvidence & note
namesympath:line — one-line check against the doc's invariant

Then 2–4 headline findings, leading with the mislabels (🔁) and real gaps — those are what the audit is for. Faithful rows are reassurance, not the point.

Common mistakes

  • Grading from memory instead of fetching the doc — invents invariants. Fetch every candidate's doc page.
  • Accepting the code's own label — you will rubber-stamp a mutex called "Semaphore." Grade against the doc, not the class name.
  • Treating absence as a bug — a pattern not present is ⚪/N-A unless the codebase clearly needs it.
  • Verdicts without file:line — an audit is evidence, not vibes.
  • Auditing all 46 — grade only the patterns the codebase engages.

Example (compressed)

Auditing an HTTP/MCP framework:

PatternVerdictEvidence & note
Actor Model✅in-memory-runtime.ts:144,156 — per-identity serialized turns; handler gets a clone, rollback on throw.
Semaphore🔁redis-actor-runtime.ts:18 — the lease is SET NX (count=1) = mutex; the doc routes max=1 → mutex.
MVCC🟡in-memory-runtime.ts:113 — lease-free reads never block writers, but only one version is kept (snapshot read, not multi-version).
Circuit Breaker⚪Absent across all packages — a real gap for an outbound-heavy framework.

Headline: two over-claims (Semaphore→mutex, MVCC→single-version) that would mislead a developer expecting counting-semaphore or multi-version guarantees; one genuine gap (no circuit breaker).

© 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/audit-pattern of Totoro-jam/battle-tested-patterns.

Open the folder on GitHubat commit 660e0e9

Compare with similar skills

Pattern Conformance Audit 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.

Pattern Conformance Audit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pattern Conformance Audit this skillTotoro-jam/battle-tested-patterns344—~1.6kAutomated safety check: PassMIT
Brooks Audithyhmrright/brooks-lint1.5k1 repos~537Automated safety check: PassMIT
Component Design PrinciplesdavidYichengWei/agentic-engineering-framework158—~1kAutomated safety check: PassMIT
Backend Code Reviewlanggenius/dify158k—~676Automated safety check: PassCustom licence
Code Review Skillawesome-skills/code-review-skill2.1k—~2.8kAutomated safety check: NotesMIT
Architecture PatternsKartikLabhshetwar/better-shot2.4k2 repos~1.4kAutomated safety check: PassCustom licence

Similar skills

  • 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
  • Component Design Principles

    davidYichengWei/agentic-engineering-framework

    Chinese-language checklists for component-level design: class and module structure, public interfaces, data models, concurrency and error handling.

    158 GitHub stars~1k tokensUpdated 6 mo ago
    DevelopmentAuto-check passed
  • Backend Code Review

    langgenius/dify

    Reviews backend code under api/ for concrete, reproducible defects, routes to rule packs for architecture, schema, repositories and SQLAlchemy, and ranks findings from P0 to P3.

    158k GitHub stars~676 tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review Skill

    awesome-skills/code-review-skill

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, Java 8, PHP, Ruby, Rails, Python, Django, FastAPI, Go, C/.NET, Kotlin, Swift, Dart…

    2.1k GitHub stars~2.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • 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
  • Reviews a pull request against the Pascal editor's architectural rules: package boundaries, registry-driven node composition, hook hygiene and selector performance.

    25k GitHub stars~7.5k tokensUpdated today
    DevelopmentAuto-check passed

More from Totoro-jam/battle-tested-patterns

  • Adopt a Design Pattern

    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.

    344 GitHub stars~4.9k 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.

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

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

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

Categories

Questions about Pattern Conformance Audit

What does Pattern Conformance Audit do?

Audits a codebase's existing patterns, such as rate limiters, circuit breakers and caches, against canonical invariants and flags mislabeled or divergent ones. The audit grades what the code actually does, not what it calls itself. The agent inventories the catalog patterns the codebase implements by shape, since a class named RateLimiter might be another pattern and a circuit breaker might have no label at all.

When should I use Pattern Conformance Audit?

Pattern Conformance Audit fits situations like: checking whether the patterns a codebase claims to implement are implemented correctly; answering whether a class called a semaphore or MVCC store is really that pattern; running a periodic conformance check after a release to catch drift.

How do I install Pattern Conformance Audit in Claude Code?

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

How do I install Pattern Conformance Audit in Codex?

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

Can I use Pattern Conformance Audit 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 audit-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/audit-pattern, .gemini/skills/audit-pattern, .github/skills/audit-pattern and .opencode/skills/audit-pattern in your project.

What does Pattern Conformance Audit need to run?

SKILL.md names no scripts, command-line tools or credentials: Pattern Conformance Audit is instructions for the agent only. Our summary lists: Network access to fetch the pattern catalog's doc pages.

Does Pattern Conformance Audit 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 Pattern Conformance Audit 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 Pattern Conformance Audit use?

Pattern Conformance Audit 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 Pattern Conformance Audit use?

About 1.6k tokens (SKILL.md is roughly 6.2k 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 Pattern Conformance Audit?

Skills that share tags, products or a category with Pattern Conformance Audit: Brooks Audit (hyhmrright/brooks-lint, 1.5k stars), Component Design Principles (davidYichengWei/agentic-engineering-framework, 158 stars), Backend Code Review (langgenius/dify, 158k stars) and Code Review Skill (awesome-skills/code-review-skill, 2.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pattern Conformance Audit?

Totoro-jam (a GitHub user) maintains it in Totoro-jam/battle-tested-patterns, which has 344 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.