Generating Documentation
ancoleman/ai-design-components
Generate comprehensive technical documentation including API docs (OpenAPI/Swagger), code documentation (TypeDoc/Sphinx), documentation sites (Docusaurus/MkDocs), Architecture Decision Records…
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.
$ npx skills add Totoro-jam/battle-tested-patterns --skill new-pattern -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns new-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/.claude/skills/new-pattern .claude/skills/new-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 "new-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/.claude/skills/new-pattern into .claude/skills/new-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-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/.claude/skills/new-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 new-pattern -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns new-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/.claude/skills/new-pattern .agents/skills/new-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 "new-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/.claude/skills/new-pattern into .agents/skills/new-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-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 new-pattern -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns new-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/.claude/skills/new-pattern .cursor/skills/new-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 "new-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/.claude/skills/new-pattern into .cursor/skills/new-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-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 .claude/skills/new-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 new-pattern -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Totoro-jam/battle-tested-patterns new-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/.claude/skills/new-pattern .gemini/skills/new-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 "new-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/.claude/skills/new-pattern into .gemini/skills/new-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-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 new-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 new-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/.claude/skills/new-pattern .github/skills/new-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 "new-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/.claude/skills/new-pattern into .github/skills/new-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-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 new-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 new-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/.claude/skills/new-pattern .opencode/skills/new-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 "new-pattern" agent skill from https://github.com/Totoro-jam/battle-tested-patterns/tree/main/.claude/skills/new-pattern into .opencode/skills/new-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-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.
new-patternStep-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.
The skill guides the agent through every step of contributing one pattern to the battle-tested-patterns project, and forbids skipping source verification. It starts by asking five questions: the pattern name, at least 2 production projects that use it with source links, whether it works across languages, whether it is a code-level technique rather than purely architectural, and whether docs/patterns/ already holds a duplicate. Any no answer stops the work with an explanation.
Sources come next. For each production project the agent finds the exact usage, builds a GitHub URL with line numbers, checks that it returns HTTP 200 with curl, and writes a Production Proof specific enough to learn from without clicking. A link that cannot be verified is never invented. The document goes in docs/patterns/ under the pattern name as index.md, opening with a one-liner of at most 30 English words and a core idea with a diagram suited to the pattern.
Implementation requires an idiomatic TypeScript version plus at least one of Rust, Go or Python, checked with `pnpm verify-code`. Exercises are created under exercises/typescript, and the docs are bilingual, with notes on keeping ASCII diagrams aligned in the Chinese version. The excerpt is cut off after the exercises step.
11 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.
Shell commands in SKILL.md call:
pnpmgitcurlFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
github.comFrom 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.
New Pattern Authoring Workflow loads about 1.5k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 641 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). 641 words, ~1,520 tokens.
.claude/skills/new-pattern/SKILL.md (or your agent's skills folder).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.
Ask these questions before proceeding:
docs/patterns/?If any answer is "no", stop and explain why this pattern doesn't fit.
For each production project:
https://github.com/{org}/{repo}/blob/main/{path}#L{start}-L{end}curl -sI <url> | head -1 — must return HTTP 200CRITICAL: Never fabricate a URL. If you cannot verify a link, write <!-- TODO: verify source link --> instead.
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 syntaxtext blocks: every box border must be vertically alignedIn the ::: code-group block:
anyimport blocks — the verify-code script auto-detects importsfn main() or use pub struct/pub fnpnpm verify-codeCreate in exercises/typescript/<pattern>/:
01-basic.test.ts — basic pattern mechanics (required)02-intermediate.test.ts — real-world application scenario (required)// TODO: implement markers// ─── Tests (do not modify below this line) ───────────────────────pnpm test:exercises AND pnpm typecheckAdd ## Challenge Questions at the end of the EN doc:
::: details Q1: [question] ... ::: syntax| in table cells, use × instead of * for multiplication## 挑战题, translate Q&A to Chinese (keep technical terms and code in English)Create docs/zh/patterns/<pattern-name>/index.md:
All of these must be updated:
docs/.vitepress/config.ts — BOTH English and Chinese sidebardocs/index.md — English homepage pattern tabledocs/zh/index.md — Chinese homepage pattern tableREADME.md — pattern table + cheat sheet tableREADME.zh-CN.md — pattern table + cheat sheet tabledocs/by-project/*.md — add to ALL relevant project pages (React, Linux, Go, Redis, etc.)docs/by-project/more-projects.md — add if project not covered by specific pagesdocs/zh/by-project/*.md — sync Chinese versionsREADME.md cheat sheet — add to correct category tableREADME.zh-CN.md cheat sheet — sync Chinese versiondocs/guide/pattern-connections.md + ZH — update if pattern fits a system case studyRun ALL checks before committing:
pnpm check # All checks (lint + typecheck + test + verify-code + verify-mermaid + check:content)
pnpm build # VitePress buildsAfter build, verify all new pages are reachable:
ls docs/.vitepress/dist/patterns/<name>/index.html — EN page existsls docs/.vitepress/dist/zh/patterns/<name>/index.html — ZH page existsfeat: add <pattern-name> patterngit tag -a v1.X.0 -m "description" + git push origin v1.X.0© 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 .claude/skills/new-pattern of Totoro-jam/battle-tested-patterns.
Open the folder on GitHubat commit 660e0e9
New Pattern Authoring Workflow 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 |
|---|---|---|---|---|---|---|
| New Pattern Authoring Workflow this skillTotoro-jam/battle-tested-patterns | 344 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Generating Documentationancoleman/ai-design-components | 526 | — | ~3k | Automated safety check: Pass | MIT | |
| Design Patternswaybarrios/opencode-power-pack | 533 | — | ~2.2k | Automated safety check: Pass | MIT | |
| Writing Code CommentsPostHog/posthog | 40k | — | ~1.6k | Automated safety check: Pass | Custom licence | |
| Pnpm Engineteambit/bit | 18k | — | ~1.9k | Automated safety check: Pass | Custom licence | |
| Testing Changespnpm/pnpm | 37k | — | ~1.1k | Automated safety check: Pass | MIT |
ancoleman/ai-design-components
Generate comprehensive technical documentation including API docs (OpenAPI/Swagger), code documentation (TypeDoc/Sphinx), documentation sites (Docusaurus/MkDocs), Architecture Decision Records…
waybarrios/opencode-power-pack
Agents should invoke this skill when choosing patterns, designing traits/interfaces/components, deciding abstraction boundaries, evaluating dependency injection/callbacks, or comparing…
PostHog/posthog
Gates whether a code comment should exist and forces the ones that stay to explain why, not what.
teambit/bit
Work on the pnpm Rust engine (@pnpm/napi, the pacquet crates) that bit install runs through.
pnpm/pnpm
Run the tests that cover a change in the pnpm repository, in the Rust workspace (pnpm/, pnpr/) or the TypeScript CLI (pnpm11/), and recognize the cases where a scoped run passes without testing…
kucherenko/jscpd
Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.
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.
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
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.
Works with
Categories
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. The skill guides the agent through every step of contributing one pattern to the battle-tested-patterns project, and forbids skipping source verification. It starts by asking five questions: the pattern name, at least 2 production projects that use it with source links, whether it works across languages, whether it is a code-level technique rather than purely architectural, and whether docs/patterns/ already holds a duplicate.
New Pattern Authoring Workflow fits situations like: contributing a new programming pattern to the battle-tested-patterns repository; checking that a proposed pattern has real production sources before writing it up; writing a pattern doc with TypeScript and a second language implementation.
Run `npx skills add Totoro-jam/battle-tested-patterns --skill new-pattern -a claude-code`. Or copy the skill folder (.claude/skills/new-pattern in Totoro-jam/battle-tested-patterns) into .claude/skills/new-pattern in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Totoro-jam/battle-tested-patterns --skill new-pattern -a codex`. Or copy the skill folder (.claude/skills/new-pattern in Totoro-jam/battle-tested-patterns) into .agents/skills/new-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 new-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/new-pattern, .gemini/skills/new-pattern, .github/skills/new-pattern and .opencode/skills/new-pattern in your project.
Going by SKILL.md and its folder, New Pattern Authoring Workflow needs the command-line tools its instructions call (pnpm, git and curl). Our summary lists: A checkout of the battle-tested-patterns repository; pnpm for the verify-code script; curl for checking source links.
SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. 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.
New Pattern Authoring Workflow is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.5k tokens (SKILL.md is roughly 6.1k 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 New Pattern Authoring Workflow: Generating Documentation (ancoleman/ai-design-components, 526 stars), Design Patterns (waybarrios/opencode-power-pack, 533 stars), Writing Code Comments (PostHog/posthog, 40k stars) and Pnpm Engine (teambit/bit, 18k 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 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.