← ClaudeAtlas

designing-deep-moduleslisted

Guides designing, reviewing, and refactoring modules for depth — maximizing functionality hidden behind minimal interfaces. Analyzes module boundaries, identifies shallow modules and classitis, applies deep module heuristics (pull complexity downward, define errors out of existence, design for the common case), and produces refactoring plans. Covers information hiding, leaky abstractions, and abstraction boundaries based on Ousterhout's A Philosophy of Software Design. Use when designing module interfaces, reviewing code for shallow abstractions, refactoring pass-through layers, evaluating API surface area, reducing interface complexity, or applying deep module principles at any scale (functions, classes, packages, services, APIs).
msewell/agent-stuff · ★ 0 · Code & Development · score 70
Install: claude install-skill msewell/agent-stuff
# Deep Module Design A **deep module** hides substantial complexity behind a small, simple interface. A **shallow module** exposes an interface nearly as complex as its implementation. "Module" means any abstraction boundary: function, class, package, service, or API. Every module has: - **Cost**: its interface — parameters, methods, exceptions, configuration, preconditions, side effects, imported types - **Benefit**: the functionality hidden behind that interface A module justifies its existence only when benefit substantially exceeds cost. ## Workflow: Designing a new module 1. Identify the design decision the module will hide (storage format, protocol, business rule, algorithm). 2. Design the interface for the 90% common case first — zero unnecessary parameters, zero ceremony. 3. Verify the interface is expressed in terms of what the module *does*, not how it does it. 4. Pull complexity downward: if a decision can be made internally with reasonable defaults, make it internally. 5. Define errors out of existence: if the module can satisfy the caller's intent without surfacing an error, do so. 6. Add escape hatches for the 10% case only where genuinely needed, without complicating the common path. 7. Verify: articulate what significant decision the module hides. If you cannot, it may be too shallow. ## Workflow: Reviewing existing code for depth 1. Identify module clusters with these shallow signals: - Long call chains (4+ layers before real work happens) - Mir