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.
git clone --depth 1 https://github.com/gonzalezpazmonica/saviaWrote 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.
[](https://agentmods.dev/commands/gonzalezpazmonica/savia/code-patterns)<a href="https://agentmods.dev/commands/gonzalezpazmonica/savia/code-patterns"><img src="https://agentmods.dev/badge/commands/gonzalezpazmonica/savia/code-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/gonzalezpazmonica/savia/code-patterns"><img src="https://agentmods.dev/badge/commands/gonzalezpazmonica/savia/code-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00017 | $0.00620 |
| Opus 5.5 | $0.00007 | $0.00248 |
| Sonnet 5.5 | $0.00003 | $0.00124 |
| Haiku 4.5 | $0.00002 | $0.00062 |
Grade A, and why
code-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 1mo 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.
This is a copy
100% identical to code-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/code-patterns
🦉 Savia documenta los patterns de tu proyecto con ejemplos reales de tu código.
Cargar perfil de usuario
Grupo: Architecture & Debt — cargar:
identity.md— nombre, rolprojects.md— proyecto targetpreferences.md— detail_level
Subcomandos
/code-patterns— catálogo completo de patterns detectados/code-patterns {pattern}— detalle de un pattern específico/code-patterns --new— patterns más recientes del sprint
Flujo
Paso 1 — Detectar patterns en el código
Analizar el código del proyecto buscando:
| Categoría | Patterns a detectar |
|---|---|
| Arquitecturales | Repository, Service, Controller, CQRS, Mediator |
| Creacionales | Factory, Builder, Singleton, DI registration |
| Estructurales | Adapter, Decorator, Facade, Proxy |
| Comportamiento | Strategy, Observer, Command, Chain |
| Resiliencia | Retry, Circuit Breaker, Fallback, Timeout |
| Testing | AAA, Builder, Mother, Fixture |
Paso 2 — Extraer ejemplos reales
Para cada pattern detectado:
- Encontrar la mejor implementación en el código del equipo
- Extraer snippet representativo (máximo 20 líneas)
- Identificar fichero y autor
Paso 3 — Generar catálogo
🦉 Code Patterns — {proyecto}
📊 Patterns detectados: {N}
### Repository Pattern
Usado en: {N} ficheros
Ejemplo: `src/Repositories/UserRepository.cs`
{snippet de 10-15 líneas}
Convención del equipo: {descripción breve}
### Service Pattern
Usado en: {N} ficheros
Ejemplo: ...
Paso 4 — Identificar patterns ausentes
Comparar con patterns recomendados para la arquitectura detectada. Si faltan patterns esperados → sugerir adopción.
Modo agente (role: "Agent")
status: ok
action: code_patterns
project: sala-reservas
patterns_found: 12
categories:
architectural: 4
creational: 2
structural: 3
behavioral: 2
testing: 1
missing_recommended: 2
Restricciones
- NUNCA incluir snippets de más de 20 líneas
- NUNCA criticar código — solo documentar patterns
- Usar ejemplos del propio código, no ejemplos genéricos
- Respetar autoría — indicar quién escribió cada ejemplo
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.
- 1mo ago First seen · 108 lines · 17 tokens per session scan A 31fa02d82088
code-patterns is a command published in the GitHub repository gonzalezpazmonica/savia (50 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 620 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to code-patterns, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
delegate-review
Run OCR in delegation mode — OCR handles file selection and rules, the host agent performs the actual review.
commit
Please summarize your current changes, generate a commit message in English, then add and commit. Never include any AI tool or model as a Co-Author in commit messages. No Co-Authored-By lines referencing AI assistants.
plannotator-review
Open interactive code review for current changes, another directory, or a PR URL; --base / --diff-type pin the session's opening diff (session-only, git-only).
code-patterns
Catálogo de patterns del proyecto con ejemplos del propio código del equipo.
branch-review
Review a branch before merge.
review
Make a review quiz page from what is due and what you just learned.