apply-pattern

apply-pattern is a skill for Claude Code, Codex from adamthewilliam/grepika. It costs 65 tokens per session (1,416 once invoked), scanned B, original, MIT.

A workflow for applying reusable software-architecture blueprints to a project. It can list saved blueprints and patterns, search for a pattern, or apply one to the current codebase.

In plain words
What is it for?
Use it to list available blueprints, inspect their patterns, search for a named pattern, or implement a selected pattern in the current project.
Why use it?
It helps developers reuse design approaches discovered in other codebases instead of starting architectural decisions from scratch. The workflow also provides a consistent way to find and apply those patterns.

Skill for Claude CodeCodex

Part of the grepika plugin — 9 skills, 3 commands, 2 agents 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/adamthewilliam/grepika/apply-pattern
Any agent
npx skills add adamthewilliam/grepika --skill apply-pattern
Clone the repo
git clone --depth 1 https://github.com/adamthewilliam/grepika

Made for: Claude Code, Codex.

Or install grepika, the plugin that ships this one along with the rest of its 9 skills, 3 commands, 2 agents.

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 apply-pattern

README.md
[![agentmods](https://agentmods.dev/badge/skills/adamthewilliam/grepika/apply-pattern.svg)](https://agentmods.dev/skills/adamthewilliam/grepika/apply-pattern)
Your own site
<a href="https://agentmods.dev/skills/adamthewilliam/grepika/apply-pattern"><img src="https://agentmods.dev/badge/skills/adamthewilliam/grepika/apply-pattern.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,416 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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 $0.00065 $0.01416
Opus 5 $0.00032 $0.00708
Sonnet 5 $0.00013 $0.00283
Haiku 4.5 $0.00006 $0.00142

Measured 3d ago against content hash 7c9a08d39fec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

apply-pattern scanned grade B 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 3d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

head -10 ~/.claude/blueprints/*/blueprint.md
plugins/grepika/skills/apply-pattern/SKILL.md · 186 lines

How it starts

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

Apply Pattern — Blueprint-Guided Implementation

You help developers apply architectural patterns from previously studied codebases to their current project.

Input

Arguments: $ARGUMENTS

Argument Parsing

Determine the action from the arguments:

  1. --list → List all available blueprints
  2. <source> (single word, no colon) → List patterns in that blueprint
  3. <source>:<pattern> → Apply a specific pattern to the current project
  4. <pattern> (contains hyphen, no colon) → Search all blueprints for this pattern name

If no arguments provided, run --list.

Pre-check

If any grepika tool returns "No active workspace", call mcp__grepika__add_workspace with the project root first.

Action: List Blueprints (--list)

Use Bash to list available blueprints:

ls -1 ~/.claude/blueprints/ 2>/dev/null || echo "No blueprints found. Use /study to extract patterns from a codebase first."

For each blueprint found, use Bash to extract the frontmatter:

head -10 ~/.claude/blueprints/*/blueprint.md

Output:

## Available Blueprints

| Source | Patterns | Studied | Focus |
|--------|----------|---------|-------|
| [name] | [count] | [date] | [focus] |

Use `/apply-pattern <source>` to see patterns, or `/apply-pattern <source>:<pattern>` to apply one.

Action: List Patterns (<source>)

Use Read to read ~/.claude/blueprints/<source>/blueprint.md.

Extract all ## Pattern: <name> headings and their Load-bearing and Category fields.

Output:

## Patterns in [source]

| # | Pattern | Load-bearing | Category |
|---|---------|-------------|----------|
| 1 | [name] | yes/no | [category] |

### Build Order
[from the blueprint's Build Order section]

Use `/apply-pattern [source]:[pattern-name]` to apply a pattern.

Action: Apply Pattern (<source>:<pattern>)

This is the core workflow.

Step 1: Read the Pattern

Use Read to read ~/.claude/blueprints/<source>/blueprint.md.

Find the section starting with ## Pattern: <pattern> and ending at the next ## Pattern: or end of file. Extract:

  • What / Why / Key Files / Implementation / Adapt When

Read the full file on GitHub · 186 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. 3d ago First seen · 186 lines · 65 tokens per session scan B 7c9a08d39fec

Subscribe to this mod's changes

apply-pattern is a skill published in the GitHub repository adamthewilliam/grepika (134 stars, last pushed 21d ago), licensed MIT. It adds 65 tokens to every session and 1,416 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens