# High Cohesion The degree to which elements within a module belong together. A highly cohesive module has a single, well-defined purpose where every element contributes to that purpose. The internal counterpart to [[Loose Coupling]]. ## Low vs high cohesion - **Low cohesion**: a module that handles logging, database access, and email sending. Changing any one concern risks the others - **High cohesion**: a module that handles only email sending. Every function inside it relates to that purpose ## The coupling-cohesion relationship High cohesion and loose coupling reinforce each other. When a module does one thing well (cohesion), it has fewer reasons to depend on other modules (coupling). Splitting a low-cohesion module into focused parts naturally reduces coupling. ## In AI skills A skill with high cohesion does one thing and everything inside it serves that purpose. A skill with low cohesion bundles unrelated responsibilities (e.g., a "weekly planning" skill that also does context gathering, drift detection, task scheduling, and dashboard rendering). Signs of low cohesion in AI skills: - Skill file over 200 lines - Multiple unrelated `##` sections - "And also does X" in the description - Multiple distinct phases that could run independently The fix: decompose into focused skills and compose them ([[Atomicity]], [[AI Skill Composability]]). ## References - ## Related - [[Loose Coupling]] - [[SOLID Principles]] - [[Atomicity]] - [[Separation of Concerns]] - [[Software Design Patterns for AI Skills and Agents]]