deepen-moduleslisted
Install: claude install-skill manastalukdar/ai-devstudio
# Deepen Modules
Find shallow modules and refactor them into deep ones that concentrate complexity behind simple, stable interfaces.
Arguments: `$ARGUMENTS` - path or component to analyze, or blank to scan the whole codebase
## Vocabulary (use consistently)
| Term | Definition |
|---|---|
| **Module** | Anything with an interface and implementation — function, class, package, or slice (scale-agnostic) |
| **Interface** | Everything callers must know: types, invariants, error modes, ordering, config, performance facts |
| **Depth** | Leverage at the interface — deep = high leverage (small interface, large hidden implementation) |
| **Seam** | Where an interface lives; a place where behavior can be altered without editing in place |
| **Adapter** | A concrete thing satisfying an interface at a seam |
| **Leverage** | What callers gain from depth |
| **Locality** | What maintainers gain from depth — change, bugs, and knowledge concentrated in one place |
**Deletion test**: Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
**Seam rule**: One adapter = hypothetical seam. Two adapters = real seam. Don't introduce a port unless at least two adapters are justified.
## Behavior
### Phase 1: Explore
```bash
# Check for existing domain docs to respect
ls CONTEXT.md docs/adr/ 2>/dev/null
# Find shallow module signals
grep -rn "^export function\|^export const\|^class " . \
--include="*