arch-health

arch-health is a command for Claude Code from gonzalezpazmonica/pm-workspace. It costs 16 tokens per session (784 once invoked), scanned A, a copy of arch-health, MIT.

A command that checks the health of a software architecture using rules and measurements. It looks for issues such as circular dependencies, excessive coupling, oversized files, and departures from documented architecture decisions.

In plain words
What is it for?
Use it to run a full architecture report or focus on drift detection or coupling metrics, using defined architecture fitness rules when available.
Why use it?
It helps detect architecture drift: gradual changes that cause the codebase to move away from its agreed design. Finding these problems early makes structural issues easier to address.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: agent in frontmatter.

Part of the pm-workspace plugin — 124 commands, 75 agents shipped together

Good fit Use it to run a full architecture report or focus on drift detection or coupling metrics, using defined architecture fitness rules when available.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/gonzalezpazmonica/pm-workspace/arch-health
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.

Clone the repo
git clone --depth 1 https://github.com/gonzalezpazmonica/pm-workspace

Made for: Claude Code.

Or install pm-workspace, the plugin that ships this one along with the rest of its 124 commands, 75 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 arch-health

README.md
[![agentmods](https://agentmods.dev/badge/commands/gonzalezpazmonica/pm-workspace/arch-health/github.svg)](https://agentmods.dev/commands/gonzalezpazmonica/pm-workspace/arch-health)
Your own site
<a href="https://agentmods.dev/commands/gonzalezpazmonica/pm-workspace/arch-health"><img src="https://agentmods.dev/badge/commands/gonzalezpazmonica/pm-workspace/arch-health/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.

agentmods 80×15 button for arch-health

Your own site · 80×15
<a href="https://agentmods.dev/commands/gonzalezpazmonica/pm-workspace/arch-health"><img src="https://agentmods.dev/badge/commands/gonzalezpazmonica/pm-workspace/arch-health.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 784 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.1 $0.00016 $0.00784
Opus 5 $0.00008 $0.00392
Sonnet 5 $0.00003 $0.00157
Haiku 4.5 $0.00002 $0.00078

Measured 9d ago against content hash 4fbb98f2f9e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

arch-health 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 9d 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.

Origin

This is a copy

100% identical to arch-health — 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.

.claude/commands/arch-health.md · 113 lines

How it starts

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

/arch-health

🦉 Savia mide la salud de tu arquitectura con métricas objetivas.


Cargar perfil de usuario

Grupo: Architecture & Debt — cargar:

  • identity.md — nombre, rol
  • projects.md — proyecto target
  • preferences.md — detail_level

Subcomandos

  • /arch-health — informe completo de salud arquitectónica
  • /arch-health --drift — solo detección de drift
  • /arch-health --coupling — solo métricas de acoplamiento

Flujo

Paso 1 — Ejecutar fitness functions

Ejecutar las reglas definidas por /arch-fitness (si existen):

Fitness Function Qué mide
Layer independence ¿Las capas respetan sus dependencias?
No circular deps ¿Hay dependencias circulares?
Naming conventions ¿Los nombres siguen las convenciones?
File size limits ¿Hay ficheros excesivamente grandes?
Import limits ¿Hay ficheros con demasiados imports?

Paso 2 — Detectar drift arquitectónico

Comparar estado actual vs. ADRs activos:

  1. ¿Se están respetando las decisiones documentadas?
  2. ¿Hay nuevos patrones no documentados emergiendo?
  3. ¿Hay violaciones de las convenciones del lenguaje?

Paso 3 — Calcular métricas de acoplamiento

Métrica Cálculo
Afferent Coupling (Ca) Módulos que dependen de este
Efferent Coupling (Ce) Módulos de los que este depende
Instability Ce / (Ca + Ce) — 0=estable, 1=inestable
Abstractness Interfaces / Total clases
Distance |A + I - 1| — 0=zona óptima

Paso 4 — Generar informe

🦉 Architecture Health — {proyecto}

📊 Health Score: {N}/100 {🟢|🟡|🔴}

✅ Fitness Functions: {passed}/{total} PASS
  🟢 Layer independence — PASS
  🔴 No circular deps — FAIL (A→B→C→A)
  🟢 Naming conventions — PASS

🔄 Drift Detection:
  ⚠️ ADR-003 (Use Repository Pattern): 2 violaciones
  ✅ ADR-005 (CQRS): Respetado

📐 Coupling:
  Top acoplados: {módulo} (Ce=12), {módulo} (Ce=9)
  Inestables: {módulo} (I=0.9), {módulo} (I=0.8)

💡 Recomendaciones:
  1. Romper dependencia circular A→B→C→A
  2. Reducir coupling de {módulo} extrayendo interfaz

Read the full file on GitHub · 113 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. 9d ago First seen · 113 lines · 16 tokens per session scan A 4fbb98f2f9e0

Subscribe to this mod's changes

arch-health is a command published in the GitHub repository gonzalezpazmonica/pm-workspace (49 stars, last pushed 6d ago), licensed MIT. It adds 16 tokens to every session and 784 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to arch-health, differing in 0 lines, and is treated as a copy.