arch-check

arch-check is a command for coding agents from mtvrkan/senior-dev-kit. It costs 16 tokens per session (1,428 once invoked), scanned A, original, MIT.

A command that checks whether a project still follows one consistent software structure. It looks for broken boundaries, reversed dependency direction, mixed design patterns, and mismatched interfaces.

In plain words
What is it for?
Use it to audit where modules belong, how they depend on one another, whether interfaces still match, and whether the project’s documented architecture matches the files on disk.
Why use it?
As a codebase grows, small changes can make different parts follow conflicting rules. This helps find structural drift without reviewing whether the code itself works correctly.

Command

Part of the senior-dev-kit plugin — 25 skills, 6 commands, 9 agents, 1 hook 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 commands/mtvrkan/senior-dev-kit/arch-check
Clone the repo
git clone --depth 1 https://github.com/mtvrkan/senior-dev-kit

Or install senior-dev-kit, the plugin that ships this one along with the rest of its 25 skills, 6 commands, 9 agents, 1 hook.

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-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/mtvrkan/senior-dev-kit/arch-check.svg)](https://agentmods.dev/commands/mtvrkan/senior-dev-kit/arch-check)
Your own site
<a href="https://agentmods.dev/commands/mtvrkan/senior-dev-kit/arch-check"><img src="https://agentmods.dev/badge/commands/mtvrkan/senior-dev-kit/arch-check.svg" alt="Measured on agentmods" 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 1,428 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.00016 $0.01428
Opus 5 $0.00008 $0.00714
Sonnet 5 $0.00003 $0.00286
Haiku 4.5 $0.00002 $0.00143

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

Security

Grade A, and why

arch-check 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 4d 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.

commands/arch-check.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-check

Audit the structure of what was actually built: $ARGUMENTS

The third audit command, alongside /design-check and /seo-check, and the same contract: it does not review correctness — /code-review does that — it answers one question: is this still one architecture, or several that grew into each other? Read agent_docs/architecture.md first; the pattern table, the dependency-direction rules, the coupling signals and the FWD: vocabulary are all defined there and in rules/001-conventions.md rather than restated here.

Architecture degrades the way design does: not in one bad decision, but in fifty small ones taken without reference to a recorded choice. So this command starts where /design-check starts — with what the project claimed.

Step 1 — Find the claim. Look for the architecture recorded in the project's CLAUDE.md, PROJECT-CONTRACTS.md, or .claude/codebase-overview.md. Nothing recorded on a project with a non-trivial src/ is itself a finding: the pattern is re-derived from folder shape by every session, and two sessions that read the same folders differently produce two architectures. Derive the de facto pattern from disk so the rest of the audit has something to measure against.

Step 2 — One architecture, not two. Layered (controllers/ + services/ + repositories/) and vertical-slice (features/x/…) both present is the mixed case rules/001-conventions.md flags. Report which directories are on which side, so the decision the user faces is "which one wins here", not "you have both".

Step 3 — Dependency direction. Every violation with file:line: repository importing a service, domain importing a framework, shared kernel importing a feature, packages/* importing apps/*, a cross-app import in a monorepo. These are the failures that make a codebase expensive later and cost nothing to see now.

Step 4 — Boundary crossings. Feature A reaching into feature B's internals rather than its public API; a service calling another service's repository; DB or ORM access in a controller or route handler; business logic in a UI component; HTTP types (req/res) below the controller.

Step 5 — Cycles and barrels. Circular imports (madge --circular src/ for TS/JS, pylint --enable=cyclic-import for Python — run the one the project's stack supports, and say so if neither is available rather than reporting zero). Barrel files anywhere but a module root, and any export * at all.

Step 6 — Size as a symptom, not a rule. Files over the project's own convention (the kit's default is 300 lines) are worth reporting only with what they do: a 400-line file with one responsibility is fine, and a 200-line file with five is not. Report responsibility count, with the line count as context.

Step 7 — Contract drift. Compare PROJECT-CONTRACTS.md (if present) with what exists: an endpoint that ships and was never recorded, a type renamed in one layer only, a route with no navigation entry. rules/001-conventions.md's HOLISTIC CONSISTENCY table is the list of layers a change is supposed to reach; this step finds the ones it did not.

Step 8 — The seams that hide risk. Where transactions begin and end, where errors convert from exceptions to a result type (rules/200-api.md), where auth is enforced, where retries live. Each should be at one layer, named. A boundary enforced in two places disagrees eventually; a boundary enforced in none is the incident.

Step 9 — Reconcile the debt ledger. Read .claude/TECH-DEBT.md (the FWD:/OBS: ledger from rules/001-conventions.md). Three questions per row: does the condition still exist, is it now one of this audit's findings, and has it been quietly fixed? Delete rows whose condition is gone, add the findings above that are not yet recorded, and report the count of each. A ledger nobody reconciles becomes a file people stop reading, which is the same failure as never writing it.

Output format:

ARCHITECTURE AUDIT
==================

CLAIMED:  [pattern from CLAUDE.md / PROJECT-CONTRACTS.md / codebase-overview.md | NONE — never recorded]
DE FACTO: [what the tree actually implements]

MIXED PATTERNS:
  ⚠ [pattern A] in [dirs] · [pattern B] in [dirs] — [which is the majority]

DIRECTION VIOLATIONS: [n]
  ✗ [file:line] — [importer] → [imported] — [rule broken]

BOUNDARIES: [n]
  ✗ [file:line] — [crossing]

CYCLES: [n — tool used | tool unavailable, not measured]
  ✗ [A → B → A]

SIZE: [file — n lines, m responsibilities]

CONTRACT DRIFT: [n]
  ✗ [what exists in code but not in PROJECT-CONTRACTS.md, or vice versa]

SEAMS: transactions [layer] · error boundary [layer] · authz [layer] · retries [layer]
  ✗ [seam enforced in two places | enforced nowhere]

LEDGER: [n] rows · [n] added · [n] closed (condition gone) · [n] still open

VERDICT: [Coherent / Drifting / Two architectures wearing one name]

TOP FIXES (highest structural return first):
  1. [most impactful]
  2. [second]
  3. [third]

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. 4d ago First seen · 113 lines · 16 tokens per session scan A b0b227812eff

Subscribe to this mod's changes

arch-check is a command published in the GitHub repository mtvrkan/senior-dev-kit (5 stars, last pushed 4d ago), licensed MIT. It adds 16 tokens to every session and 1,428 once invoked, about $0.0001 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.