Learn-skills.dev cohesion-coupling-review
Review a proposed change for high cohesion/low coupling; recommends the smallest boundary-safe refactor (ownership, minimal public surface, no reach-in imports).
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/7spade/black-tortoise/cohesion-coupling-review" ~/.claude/skills/neversight-learn-skills-dev-cohesion-coupling-review && rm -rf "$T"
manifest:
data/skills-md/7spade/black-tortoise/cohesion-coupling-review/SKILL.mdsource content
High Cohesion / Low Coupling (Review Skill)
Use when
- A change touches multiple folders/layers/capabilities.
- You’re tempted to import a file from another capability.
- “Shared” is being considered for convenience.
Checklist (fast)
- Ownership: which capability/bounded context owns the rule/data?
- Cohesion: is the logic colocated with its change reason?
- Coupling: are dependencies narrow (ports/events) rather than concrete imports?
- Public surface: can exports be reduced to the minimal stable interface?
- Import hygiene: any deep imports into another capability/layer?
- Promotion: does it truly qualify for
(2+ contexts, no business policy)?shared
Smallest fixes (preferred order)
- Move code to the owner (increase cohesion).
- Introduce/adjust a port or event (reduce coupling).
- Narrow exports / add an explicit entry point (stabilize interface).
- Only then consider
(if it meets promotion rules).shared
References
.github/instructions/06-cohesion-coupling-copilot-instructions.md.github/instructions/05-design-principles-copilot-instructions.mdscripts/dependency-cruiser.js