Developer pack
Claude Skill

Codebase Architecture Reviewer

Finds shallow modules and proposes deepening refactors — small interfaces hiding real behavior — for a more testable, navigable codebase.

What it does

Walks the codebase for architectural friction and surfaces deepening opportunities: places where a module's interface is nearly as complex as its implementation, where understanding one concept means bouncing between many tiny files, or where pure functions were extracted for testability but the real bugs hide in how they're called. Presents candidates with before/after and a recommendation strength — it diagnoses, it doesn't rewrite blindly.

When to use

  • The codebase feels hard to change or hard to test through its current interfaces
  • You want refactoring opportunities ranked, not a blanket rewrite
  • Consolidating tightly-coupled modules that leak across their seams

When not to use

  • You already know the specific refactor — use the refactor planner for the steps
  • A greenfield project with no architecture to review yet

Install

Download the .zip, then unzip into your Claude skills folder.

mkdir -p ~/.claude/skills
unzip ~/Downloads/codebase-architecture-reviewer.zip -d ~/.claude/skills/

# Restart Claude Code session.
# Skill is now available — Claude will use it when relevant.

SKILL.md

SKILL.md
---
name: codebase-architecture-reviewer
description: Use when improving architecture or finding refactoring opportunities — consolidating tightly-coupled modules, making a codebase more testable. Triggers on "improve architecture", "refactoring opportunities", "shallow modules", "make this more testable", "architecture review".
---

# Codebase Architecture Reviewer

Surface architectural friction and propose **deepening** refactors — turning shallow modules into deep ones. A deep module hides a lot of behavior behind a small interface; a shallow one has an interface nearly as complex as its implementation, so it earns nothing. Aim: testability and navigability.

## Use the vocabulary precisely

Consistent language is the point — don't drift into vague words like "component," "service," or "boundary."

- **Module** — anything with an interface and an implementation (function, class, package).
- **Interface** — everything a caller must know to use it: types, invariants, error modes, ordering, config. Not just the signature.
- **Depth** — leverage at the interface: lots of behavior behind a small surface. Deep = high leverage; shallow = low.
- **Seam** — where an interface lives; a place behavior can change without editing in place. One adapter is a *hypothetical* seam; two adapters make it a *real* one.

## The deletion test

For anything you suspect is shallow: imagine deleting it. If complexity simply vanishes, it was a pass-through adding indirection for nothing. If complexity reappears, duplicated across its callers, it was earning its keep. "Concentrates complexity when deleted" is the signal of a module worth having.

## Process

1. **Explore for friction** — read the area, including any domain glossary and architecture decisions already recorded. Note where understanding one concept means hopping across many tiny modules; where interfaces are as complex as implementations; where functions were extracted only for testability but the real bugs live in how they're called.
2. **Present candidates** — for each: the files involved, the friction, a plain-English deepening, the benefit in terms of leverage and locality, and a before/after sketch. Tag each with a recommendation strength (strong / worth exploring / speculative).
3. **Stop before redesigning.** Don't propose detailed new interfaces yet — present the candidates and let the user pick which to pursue.

## Respect existing decisions

If a candidate contradicts a recorded architecture decision (an ADR), only raise it when the friction is real enough to justify reopening that decision — and mark it clearly. Don't re-litigate settled calls.

## Anti-patterns

- Drifting from the precise vocabulary into mushy "boundaries" and "services"
- Proposing a rewrite instead of ranked, testable candidates
- Extracting pure functions for testability while the real coupling stays put
- Designing the new interfaces before the user has chosen what to tackle

Example prompts

Once installed, try these prompts in Claude:

  • Review our payments module for architecture friction — where are the shallow modules and what would deepening them look like?
  • This codebase is hard to test. Find the seams that aren't real seams and propose where to consolidate.