Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

code-coupling-analysis

verified

Analyze code coupling using Vlad Khononov's Balanced Coupling framework. Generates interactive HTML reports with D3.js dependency graphs. Use when analyzing architecture health, identifying risky dependencies, or preparing for refactoring decisions. Language-agnostic design.

View on GitHub

Marketplace

kazuph-dotfiles

kazuph/dotfiles

Plugin

kazuph-dotfiles

development

Repository

kazuph/dotfiles
15stars

plugins/kazuph-dotfiles/skills/code-coupling-analysis/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/kazuph/dotfiles/blob/main/plugins/kazuph-dotfiles/skills/code-coupling-analysis/SKILL.md -a claude-code --skill code-coupling-analysis

Installation paths:

Claude
.claude/skills/code-coupling-analysis/
Powered by add-skill CLI

Instructions

# Coupling Analysis Skill

Analyze code coupling across three dimensions and generate actionable HTML reports.

## Framework: Balanced Coupling (Vlad Khononov)

Three key dimensions determine coupling risk:

### 1. Integration Strength (How tightly modules connect)
| Level | Score | Detection Pattern |
|-------|-------|-------------------|
| Intrusive | 1.00 | Direct property access, internal state manipulation |
| Functional | 0.75 | Function/component usage, hooks, methods |
| Model | 0.50 | Data type imports, interfaces used as data |
| Contract | 0.25 | Pure interface/type imports |

### 2. Distance (Where dependencies live)
| Level | Score | Detection Pattern |
|-------|-------|-------------------|
| Same Module | 0.25 | Same directory (`./Component`) |
| Sibling Module | 0.50 | Sibling directory (`../utils`) |
| Distant Module | 0.75 | Different top-level (`@/contexts`, `~/lib`) |
| External | 1.00 | External packages (`react`, `lodash`) |

### 3. Volatility (Change frequency from Git history)
| Level | Score | Changes (6 months) |
|-------|-------|-------------------|
| Low | 0.00 | 0-2 changes |
| Medium | 0.50 | 3-10 changes |
| High | 1.00 | 11+ changes |

### Balance Score Formula
```
balance = (strength × volatility) × 0.6 + |strength - (1 - distance)| × 0.4
```

**Interpretation:**
- 0.0 - 0.2: Well balanced (ideal)
- 0.2 - 0.4: Acceptable
- 0.4 - 0.6: Needs attention
- 0.6+: Risky, consider refactoring

## Execution Steps

### Step 1: Identify Target Directory and Language

Determine the primary language by checking for:
- `tsconfig.json` or `*.ts`/`*.tsx` → TypeScript
- `pyproject.toml` or `*.py` → Python
- `go.mod` or `*.go` → Go
- `Cargo.toml` or `*.rs` → Rust
- `package.json` with `*.js`/`*.jsx` → JavaScript

### Step 2: Gather File List

```bash
# TypeScript/JavaScript
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) \
  -not -path "*/node_modules/*" \
  -not -path "*/.git/*" \
  -not -name "*.d.ts" \
  -not -nam

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
5621 chars