analyze-coupling-cohesion

Installation
SKILL.md

Coupling & Cohesion Analyzer

Overview

This skill analyzes PHP codebases for coupling and cohesion metrics, helping identify architectural issues like unstable dependencies, low cohesion classes, and tightly coupled modules.

Metrics Reference

Metric Formula Target Description
Ca (Afferent) Incoming deps - Classes depending ON this
Ce (Efferent) Outgoing deps < 10 Classes this DEPENDS on
Instability (I) Ce / (Ca + Ce) 0.0-1.0 0=stable, 1=unstable
Abstractness (A) Abstract / Total 0.0-1.0 Ratio of interfaces
Distance (D) |A + I - 1| < 0.3 Distance from main sequence
LCOM Methods not sharing fields < 0.5 Lack of cohesion

Detection Patterns

Related skills
Installs
4
GitHub Stars
71
First Seen
Mar 17, 2026