arch

A command for reviewing a codebase’s architecture and planning refactoring. It examines structure, dependencies, module boundaries, and architectural patterns, with an optional audit mode for creating refactoring tasks.

In plain words
What is it for?
Use it to review a selected area or run an architecture audit. It can prioritize issues by severity and outline a migration path, with audit mode creating tasks for identified problems.
Why use it?
It helps reveal circular dependencies, layer violations, and accumulated technical debt before they make the system harder to change.

Command

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/srstomp/pokayokay/arch
Clone the repo
git clone --depth 1 https://github.com/srstomp/pokayokay
Per session 6 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,105 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.00006 $0.01105
Opus 5 $0.00003 $0.00553
Sonnet 5 $0.00001 $0.00221
Haiku 4.5 $0.00001 $0.00111

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

Security

Grade A, and why

arch 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 2d 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.

plugins/pokayokay/commands/arch.md · 159 lines

How it starts

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

Architecture Review Workflow

Review architecture of: $ARGUMENTS

Mode Detection

Parse $ARGUMENTS to determine mode:

  • --audit flag present → Architecture audit mode (creates tasks for issues)
  • No flag → Review/planning mode (default behavior)

Steps

1. Analyze Structure

  • Directory organization
  • Module boundaries
  • Layer separation

2. Map Dependencies

  • Import relationships
  • Circular dependencies
  • External dependencies

3. Evaluate Patterns

  • Consistency across codebase
  • Adherence to conventions
  • Code organization

4. Identify Issues

Severity levels:

  • Critical: Blocking or causing bugs
  • Major: Technical debt accumulating
  • Minor: Style/consistency issues
  • Info: Suggestions for improvement

5. Plan Refactoring

  • Prioritize by impact
  • Define migration path
  • Estimate effort

6. Create Tasks

npx @stevestomp/ohno-cli create "Refactor [area]" -t chore

Audit Mode (--audit flag)

When --audit is specified, switch to architecture audit mode that automatically creates tasks:

Audit Steps

  1. Scan Architecture Analyze codebase for:
  • Circular dependencies
  • Layer violations (UI importing from data layer directly)
  • God classes/modules (too many responsibilities)
  • Orphaned code (unreachable/dead code)
  • Security architecture issues
  1. Classify Issues
Issue Type Description Priority Task Type
Security flaw Auth bypass, insecure patterns P0 bug
Circular dependency Blocking clean builds/tests P1 chore
Layer violation Breaks separation of concerns P1 chore
Feature blocker Architecture blocking feature dev P1 chore
God module >500 lines, many responsibilities P2 chore
Dead code Unreachable, unused exports P3 chore
Inconsistency Naming, patterns, conventions P3 chore
  1. Calculate Impact For each issue, assess:
  • Blast radius: How many modules affected?
  • Change risk: How risky is the fix?
  • Blocking: Is this blocking other work?

Read the full file on GitHub · 159 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. 2d ago First seen · 159 lines · 6 tokens per session scan A ba8598651355

Subscribe to this mod's changes

arch is a command published in the GitHub repository srstomp/pokayokay (9 stars, last pushed 1mo ago), licensed MIT. It adds 6 tokens to every session and 1,105 once invoked, about $0.0000 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.