discover-patterns

discover-patterns is a skill for Claude Code, Codex from paultyng/skill-issue. It costs 35 tokens per session (1,304 once invoked), scanned A, original, MIT.

A workflow for examining a codebase and documenting its recurring architecture and implementation patterns. Patterns are repeated ways the project organizes code, configuration, errors, testing, and other concerns.

In plain words
What is it for?
Use it to explore selected files or the full codebase, classify the technologies used, identify recurring patterns, and prepare documentation or input for conformance checks.
Why use it?
It makes unwritten project conventions visible so developers can understand the codebase and check whether new code follows its existing approach.

Skill for Claude CodeCodex

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/paultyng/skill-issue/discover-patterns
Any agent
npx skills add paultyng/skill-issue --skill discover-patterns
Clone the repo
git clone --depth 1 https://github.com/paultyng/skill-issue

Made for: Claude Code, Codex.

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 discover-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/paultyng/skill-issue/discover-patterns.svg)](https://agentmods.dev/skills/paultyng/skill-issue/discover-patterns)
Your own site
<a href="https://agentmods.dev/skills/paultyng/skill-issue/discover-patterns"><img src="https://agentmods.dev/badge/skills/paultyng/skill-issue/discover-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,304 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 $0.00035 $0.01304
Opus 5 $0.00017 $0.00652
Sonnet 5 $0.00007 $0.00261
Haiku 4.5 $0.00003 $0.00130

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

Security

Grade A, and why

discover-patterns 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 5d 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.

skills/discover-patterns/SKILL.md · 132 lines

How it starts

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

Discover Patterns

Analyze a codebase to discover and document its implicit architectural and implementation patterns.

Workflow

1. Scope and explore

  • Confirm scope with the user: full codebase (default), specific packages/directories, or specific concern.
  • Explore the scoped code using parallel explore subagents. Read source files, test files, config files, and build files.
  • Classify files by type: has_go, has_proto, has_ts, has_infra, etc.

2. Identify candidate patterns (Opus)

Launch up to 4 concurrent subagents (subagent_type="generalPurpose", model: opus per subagent-model-routing — architecture-level pattern recognition requires deep reasoning across the codebase), each covering a group of pattern categories from the taxonomy. Each subagent reads all relevant files and identifies candidate patterns with a signature the counting stage can apply mechanically.

Subagent Categories Requires
Structure & Layering STRUCT Any source files
Error Handling & Observability ERR, OBS Any source files
Config & DI CFG, DI Any source files
Testing TEST Any source + test files
Transport XPORT HTTP/gRPC code present

Each subagent receives:

For each candidate pattern, record:

  • Name: short descriptive name
  • Description: what the pattern is and how it works
  • Search signature: a concrete way to find further occurrences. A grep regex, file glob, AST predicate (e.g. "calls to context.Background() outside main.go"), or symbol pattern. Must be specific enough that the counting stage applies it mechanically.
  • Seed exemplars: 1-2 file:line references the discovery subagent already saw

This stage does NOT compute confidence or gather exhaustive exemplars. Step 2.5 handles that.

2.5. Count occurrences per pattern (Haiku fan-out)

Read the full file on GitHub · 132 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 132 lines · 35 tokens per session scan A 0d9fdae96fc4

Subscribe to this mod's changes

discover-patterns is a skill published in the GitHub repository paultyng/skill-issue (9 stars, last pushed 24d ago), licensed MIT. It adds 35 tokens to every session and 1,304 once invoked, about $0.0002 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-31.