Surfaces opportunities to deepen a codebase by identifying shallow modules and proposing how to make them deep. Outputs an HTML report and runs an interactive grilling loop.
Ships in architecture-deepener. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turn shallow modules into deep ones. Make the codebase navigable for humans and AI agents alike.
Based on improve-codebase-architecture by Matt Pocock (https://github.com/mattpocock/skills).
A shallow module has a broad interface relative to the complexity it hides. It passes data through, delegates immediately, or carries no domain knowledge. It is a wiring artifact, not an abstraction.
A deep module has a narrow interface over a large implementation. It hides a hard decision behind a small surface, co-locates behavior with the data it owns, and gives callers something meaningful to say.
SHALLOW DEEP
┌──────────────────────┐ ┌──────────┐
│ interface (wide) │ │ interface│
│ - validate() │ │ - run() │
│ - transform() │ └────┬─────┘
│ - persist() │ │
│ - notify() │ ▼
└──────────────────────┘ ┌──────────┐
implementation (thin) │ complex │
- return this.repo.save(x) │ impl that│
│ truly │
│ hides X │
└──────────┘
Deepening is not about adding code. It is about moving behavior to where the data lives, so the rest of the system can stay shallow.
/architecture-deepener — analyze cwd, write report, start grilling
/architecture-deepener --dir src/domain — scope to a directory
/architecture-deepener --report-only — skip grilling, just emit HTML
/architecture-deepener --grill src/checkout — skip exploration, grill a known module
Goal: build an evidence-backed map of shallowness across the target scope.
.gitignore). Override with --dir.return this.x.foo(...args)).string, number, bare arrays used where a value object would carry meaning and invariants.deep, balanced, shallow, anemic, leaky.Exit criteria: every module tagged, top 5-10 opportunities ranked with one-line rationale each.
Goal: produce a single self-contained architecture-deepener-report.html that a human can scan in 60 seconds and an agent can cite.
Write the file with the native Write tool. The report MUST contain:
<svg> diagram for the top 1-2 opportunities showing behavior moving from a controller/wiring layer into the domain module.domain-modeling, codebase-design, and ADR workflows (see below).Based on improve-codebase-architecture by Matt Pocock (https://github.com/mattpocock/skills).Keep it dependency-free: inline <style>, no external scripts, no network calls. It must render by opening the file directly.
Goal: pressure-test each top opportunity before anyone writes code. Do not trust the first proposal.
For each ranked opportunity, run this loop (max 3 rounds per item, then move on):
rejected: <reason> in the report and move on. A kill is a successful outcome.After all top items are processed, emit a final action list:
PROMOTE items: module, invariant gained, smallest first step, estimated effort.REJECTED items: module, one-line reason.DEFERRED items: module, what needs to become true first (an ADR, a missing type, a test).| Signal | Shallow | Deep |
|---|---|---|
| Exports | Many, ad-hoc | Few, cohesive |
| Function bodies | return this.x.foo(...) | Encodes a domain rule |
| Types | Shape-only interfaces | Types with behavior / invariants |
| Where rules live | Controller / UI / CLI | Domain module |
| Tests | Need full stack to test | Unit-testable in isolation |
| AI navigation | "Where is the rule for X?" → 5 hops | Symptom → module in 1 hop |
| Change ripple | One rule change → N files | One rule change → 1 file |
PROMOTE item that changes a cross-cutting invariant or layering boundary gets a short ADR (Architecture Decision Record) capturing the before/after and the grilling answers. Do not let an invariant move silently.S. If the honest answer is L, say so and defer.| Artifact | Path | Phase |
|---|---|---|
| Raw findings map | in-memory / context store | 1 |
| Visual report | architecture-deepener-report.html (project root, or --out <path>) | 2 |
| Action list | appended to the report + echoed to chat | 3 |
Based on improve-codebase-architecture by Matt Pocock (https://github.com/mattpocock/skills). The shallow/deep framing and the pressure-test-before-refactor discipline are adapted from that work.
What SKILL.md sets; muted values are Claude Code's defaults
/architecture-deepener:architecture-deepenerfrom architecture-deepener
npx claudepluginhub andersonlimahw/lemon-ai-hub --plugin architecture-deepenerOther plugins' skills for the same job