Audit module coupling, cohesion, hidden dependencies, and design smells. Use when conducting architecture reviews, evaluating design decisions, or identifying structural tech debt.
From omen-developmentnpx claudepluginhub panbanda/omen --plugin omen-developmentThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides implementation of event-driven hooks in Claude Code plugins using prompt-based validation and bash commands for PreToolUse, Stop, and session events.
Analyze the structural health of a codebase by examining coupling, cohesion, hidden dependencies, and design patterns.
Omen CLI must be installed and available in PATH.
Run the dependency graph analysis:
omen -f json graph
Look for:
Run the smells analysis:
omen -f json smells
Detects cyclic dependencies, hub modules, unstable dependencies, and central connectors using Tarjan's SCC algorithm.
Run the cohesion analysis for CK metrics:
omen -f json cohesion
Metrics to watch:
Run the temporal coupling analysis:
omen -f json temporal
Files that always change together but don't have explicit imports indicate:
Run the ownership analysis:
omen -f json ownership
Look for:
Common issues to identify:
| Smell | Detection | Impact |
|---|---|---|
| Circular Dependency | A -> B -> C -> A in graph | Hard to test, modify |
| God Module | > 50% of code depends on it | Single point of failure |
| Shotgun Surgery | High temporal coupling | Changes ripple everywhere |
| Feature Envy | Low cohesion in classes | Wrong abstraction boundaries |
| Knowledge Silo | Bus factor = 1 | Team risk |
Present architecture review as:
# Architecture Review
## Module Dependency Analysis
### Dependency Graph
[Mermaid diagram from graph analysis]
### Issues Detected
#### Circular Dependencies
- `auth/` <-> `user/` <-> `session/`
- Impact: Cannot deploy or test independently
- Fix: Extract shared interface to `contracts/`
#### God Modules
- `core/` - 75% of modules depend on this
- Impact: Changes here affect everything
- Fix: Split into focused submodules
## Cohesion Analysis
### Low Cohesion Classes (LCOM > 0.7)
| Class | LCOM | WMC | Recommendation |
|-------|------|-----|----------------|
| UserService | 0.85 | 45 | Split into UserAuth, UserProfile |
| DataProcessor | 0.78 | 38 | Extract strategies for each type |
### High Coupling (CBO > 10)
- `api/handlers.go` - CBO: 15
- Depends on too many internal modules
- Consider facade pattern
## Hidden Dependencies
### Temporal Coupling (> 0.8)
- `config/settings.go` <-> `cache/redis.go` (0.92)
- No import relationship
- Likely shares configuration assumptions
- Fix: Explicit configuration injection
## Ownership Distribution
### Knowledge Silos
- `legacy/` - Single owner (bob), no recent contributions
- Risk: Bob leaves, no one knows this code
- Fix: Pair programming, documentation
### Fragmented Ownership
- `core/` - 8 contributors, none > 20%
- Risk: No clear decision maker
- Fix: Assign primary maintainer
## Recommendations
### Immediate Actions
1. Break circular dependency in auth/user/session
2. Document legacy/ module before Bob's vacation
### Medium Term
1. Split core/ into focused modules
2. Add explicit dependency injection for config
### Long Term
1. Establish module ownership model
2. Create architecture decision records (ADRs)