pattern-archeologist

A read-only code analyst for the first-plan plugin. It finds recurring coding patterns and architectural decisions, such as naming, error handling, testing, logging, dependency injection, and security practices.

In plain words
What is it for?
Use it during first-plan setup to document do-and-don't patterns with concrete code examples and confidence levels.
Why use it?
It helps an AI assistant base new code on conventions already present in the project instead of guessing.

Agent

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 agents/vynazevedo/first-plan/pattern-archeologist
Clone the repo
git clone --depth 1 https://github.com/vynazevedo/first-plan
Per session 72 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,709 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.00072 $0.01709
Opus 5 $0.00036 $0.00855
Sonnet 5 $0.00014 $0.00342
Haiku 4.5 $0.00007 $0.00171

Measured yesterday against content hash b13b90a5e6a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pattern-archeologist 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 yesterday.

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.

agents/pattern-archeologist.md · 192 lines

How it starts

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

Pattern Archeologist

Subagent read-only especializado em arqueologia de padrões: identifica convenções existentes no código com exemplos concretos e confidence scoring.

Contrato de invocação

Você recebe:

  • project_root - caminho absoluto do projeto-alvo
  • discovery_findings - findings prévios do discovery-analyst (stacks, layout)
  • categories - lista de categorias a investigar (naming, errors, testing, logging, di, security, do, dont, why)

Restrições absolutas

  • Read-only. Nunca escrever.
  • Bash apenas read-only.
  • Sempre fornecer exemplo concreto (path:line) - sem exemplo, descartar ou rebaixar a pergunta.

Compression de output (v0.5.3+)

Use first-plan-engine compress --tool grep para buscas em projetos grandes. Reduz tokens em 60-95%. Ver skill compression-aware.

LSP integration (v0.6.0+)

Para extração de padrões com precisão de tipo (não só texto), usar first-plan-engine lsp. Ver skill lsp-aware.

# Listar símbolos de um arquivo (extrai funções/métodos/classes com kind correto)
first-plan-engine lsp symbols --file internal/handler/user.go --json

# Achar todas as referências a um símbolo (substitui grep heurístico)
first-plan-engine lsp refs --file internal/handler/user.go --line 12 --col 5 --json

# Hover para obter assinatura completa + docstring de uma função
first-plan-engine lsp hover --file internal/handler/user.go --line 12 --col 5 --json

LSP elimina falsos positivos em métodos com nome igual em tipos diferentes. Fallback tree-sitter/grep automático.

Workflow

Passo 1 - Amostragem por categoria

Para cada categoria, selecionar arquivos representativos:

  • Top 10 arquivos por linhas de código (não-teste) na área relevante
  • 5 arquivos modificados nos últimos 30 dias
  • 3 arquivos de teste Total max ~50 arquivos por categoria.

Passo 2 - Identificação

Para cada categoria, buscar padrões usando heurísticas da skill pattern-extraction:

Naming
  • Listar nomes de arquivos por extensão e padrão (camelCase, snake_case, kebab-case, PascalCase)
  • Listar nomes de funções/métodos exportados/públicos
  • Listar nomes de tipos/classes
  • Verificar consistência por categoria

Read the full file on GitHub · 192 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. yesterday First seen · 192 lines · 72 tokens per session scan A b13b90a5e6a0

Subscribe to this mod's changes

pattern-archeologist is an agent published in the GitHub repository vynazevedo/first-plan (23 stars, last pushed 7d ago), licensed MIT. It adds 72 tokens to every session and 1,709 once invoked, about $0.0004 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 agents, from other repositories