claude/skills/code-coupling-analysis/SKILL.md
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.
npx skillsauth add kazuph/dotfiles code-coupling-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze code coupling across three dimensions and generate actionable HTML reports.
Three key dimensions determine coupling risk:
| 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 |
| 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) |
| Level | Score | Changes (6 months) | |-------|-------|-------------------| | Low | 0.00 | 0-2 changes | | Medium | 0.50 | 3-10 changes | | High | 1.00 | 11+ changes |
balance = (strength × volatility) × 0.6 + |strength - (1 - distance)| × 0.4
Interpretation:
Determine the primary language by checking for:
tsconfig.json or *.ts/*.tsx → TypeScriptpyproject.toml or *.py → Pythongo.mod or *.go → GoCargo.toml or *.rs → Rustpackage.json with *.js/*.jsx → JavaScript# 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 -name "*.stories.*" \
-not -name "*.test.*" \
-not -name "*.spec.*"
# Python
find . -type f -name "*.py" \
-not -path "*/.venv/*" \
-not -path "*/venv/*" \
-not -path "*/__pycache__/*" \
-not -name "*_test.py" \
-not -name "test_*.py"
# Go
find . -type f -name "*.go" \
-not -path "*/vendor/*" \
-not -name "*_test.go"
For each source file, extract imports using language-specific patterns:
TypeScript/JavaScript:
import\s+(?:(?:\{[^}]+\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"]([^'"]+)['"]
Python:
(?:from\s+(\S+)\s+import|import\s+(\S+))
Go:
import\s+(?:\w+\s+)?["']([^"']+)["']
# Get change count for each file (last 6 months)
git log --since="6 months ago" --name-only --pretty=format: -- "*.ts" "*.tsx" | \
grep -v '^$' | sort | uniq -c | sort -rn
For each import relationship:
The report MUST include these sections:
Left Column:
Risky Couplings (score ≥ 0.4) with:
Well-Balanced Couplings (score < 0.2) with:
Right Column:
Every metric MUST include explanatory text:
BAD (raw numbers only):
Average Strength: 0.74
GOOD (with context):
Average Strength: 0.74
→ Component usage is central (Functional level)
→ Most dependencies are function/hook calls, not loose contracts
Save the HTML report to:
<project-root>/coupling-analysis.html
Or if analyzing a specific package:
<package-dir>/coupling-analysis.html
For AuthContext-like patterns (high volatility + many dependents):
⚠️ Warning: AuthContextは16回変更されており、12以上のファイルから依存されています。
変更のたびに広範囲に影響が及ぶリスクがあります。
💡 Action:
- 認証状態(isAuthenticated)と認証操作(signIn/signOut)を分離検討
- 状態のみのuseAuthStateと操作のみのuseAuthActionsに分割
- カスタムフックで必要な部分だけを公開
tools
X (Twitter) API read-only CLI. Bookmarks retrieval, tweet search, engagement analytics (likes/RT aggregation), mentions, user lookup. Use when: reading X bookmarks, searching tweets, aggregating likes/retweets, checking mentions, looking up users. Triggers: bookmark, bookmarks, X search, Twitter search, likes count, RT count, engagement, tweet analytics.
testing
単体テスト方針の要約。Kiro流で使うときは本文を必ず参照・展開する。
tools
Send prompts to other AI CLIs (Codex, Claude Code) running in sibling tmux panes and receive results back. Use this skill when the user asks to send a question or task to Codex or another Claude Code instance in a tmux pane. Handles pane discovery, CLI startup if needed, prompt delivery with proper Enter timing, delivery verification, and result return via tmux send-keys.
data-ai
TAKT ピースエンジン。Agent Team を使ったマルチエージェントオーケストレーション。ピースYAMLワークフローに従ってマルチエージェントを実行する。