From kw-plugin
Review codebase architecture for deepening opportunities — modules where the interface is nearly as complex as the implementation. Uses depth-as-leverage model and the deletion test. Use when the codebase feels tangled, after a burst of fast development, or when asked to review architecture.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kw-plugin:architecture-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Surface architectural friction and propose refactors that turn shallow modules
Surface architectural friction and propose refactors that turn shallow modules into deep ones. A deep module has a small interface hiding a lot of behavior. A shallow module has an interface nearly as complex as its implementation — the abstraction isn't earning its keep.
Use these terms exactly. Do not drift to synonyms.
| Term | Definition |
|---|---|
| Module | Anything with an interface + implementation: function, class, package, file, slice |
| Interface | Everything a caller must know: types, invariants, error modes, ordering constraints, config |
| Implementation | The code inside the module |
| Depth | Leverage at the interface. Deep = small interface, lots of behavior. Shallow = interface nearly as complex as implementation |
| Seam | Where the interface lives; the point where behavior can be altered without editing the module's internals |
| Adapter | A concrete thing that satisfies an interface at a seam |
| Leverage | What callers get from depth — how much behavior they can exercise per unit of interface they must learn |
| Locality | What maintainers get from depth — change, bugs, and knowledge concentrated in one place |
Do not use: "component" (too vague), "service" (implies network), "API" (overloaded), "boundary" (use "seam").
For any module you suspect is shallow, ask:
Would deleting this module concentrate complexity into a meaningful new abstraction, or just move the same code somewhere else?
When proposing a deepened module, classify its dependencies:
| Dependency Type | Testing Approach |
|---|---|
| Pure computation (no I/O) | Test directly, no mocking needed |
| Local stand-in available (PGLite, in-memory FS, test DB) | Use the stand-in in tests |
| Network boundary | Define a port at the seam, inject transport as an adapter |
Present findings as a numbered list of deepening opportunities, ranked by leverage (highest first).
For each opportunity:
### [N]. [Module or area name]
**Files:** `path/to/file.ts`, `path/to/other.ts`
**Problem:** [What's shallow and why — be specific]
**Deletion test:** [What happens if you delete it? Concentrates or relocates?]
**Proposed deepening:** [How to make the interface smaller or the behavior richer]
**Leverage gain:** [What callers or maintainers get from this change]
**Risk:** [What could go wrong, dependencies that might break]
**Recommendation strength:** Strong / Moderate / Worth discussing
Do NOT propose interfaces or start coding. Present the candidates and ask which to explore. When the user picks one:
Only write code after the design conversation resolves.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub kwiggen/claude-code-plugin --plugin kw-plugin