Surface opportunities to deepen a codebase. Finds modules that are shallow (thin pass-throughs, anemic types, missing domain modeling) and proposes how to make them deep (rich domain types, co-located behavior, testable seams). Outputs a visual HTML report and then runs an interactive grilling loop that pressure-tests each opportunity. Use when the codebase feels "flat", domain logic leaks into controllers/UI, types carry no behavior, or AI agents struggle to navigate the module boundaries. Integrates with domain-modeling, codebase-design, and ADR workflows.
How this skill is triggered — by the user, by Claude, or both
Slash command
/architecture-deepener:architecture-deepenerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Turn shallow modules into deep ones. Make the codebase navigable for humans and AI agents alike.
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.
npx claudepluginhub andersonlimahw/lemon-ai-hub --plugin architecture-deepenerScans a codebase for architectural friction, finds 'shallow' modules ripe for deepening, produces an HTML report with before/after visuals, and then interrogates the chosen candidate.
Finds architecture deepening opportunities—refactors that consolidate tightly-coupled modules and improve testability and AI-navigability—using domain language from CONTEXT.md and ADRs.
Finds architectural friction and proposes refactoring opportunities that make a codebase more testable and AI-navigable. Informed by domain language in CONTEXT.md and ADRs.