component-boundary-identifier
Installation
SKILL.md
Component Boundary Identifier
A good component boundary has high cohesion inside, low coupling across. Finding boundaries is a graph clustering problem: build the dependency graph, find cuts that minimize cross-cut edges.
Build the dependency graph
Nodes are units (functions, classes, or files — pick a granularity). Edges are dependencies:
| Edge type | Weight hint | Why |
|---|---|---|
| Direct call (A calls B) | High | Runtime coupling — A breaks if B's API changes |
| Import / include | Medium | Compile-time coupling |
| Shared data type | Medium | Schema coupling — both break if the type changes |
| Shared database table | High | Data coupling — hardest to split |
| Shared config key | Low | Easy to duplicate |
| Co-change (git log) | Medium | Empirical — these have changed together |
Weight edges by coupling strength. A function call once at startup is weaker than one in a hot loop.