hexarch
Installation
SKILL.md
Hexagonal Architecture Audit
Scan a repository for hexagonal architecture violations. Language-agnostic. Detects wrong-direction dependencies, misplaced business logic, missing ports, and leaky abstractions. Auto-fixes mechanical violations, reports structural ones.
Phase 1: Layer Discovery
Identify the project's hexagonal layers before scanning.
-
Read project docs first. Check
CLAUDE.md,AGENTS.md, and architecture docs in the repo for explicit layer definitions. These are authoritative — use them over auto-detection. -
Auto-detect if no docs. Scan directory names for known patterns:
| Layer | Common directory names |
|---|---|
| Domain/core | domain, core, model, models, entities |
| Ports | ports, interfaces, boundaries |
| Adapters/infra | adapters, infrastructure, infra, driven, driving |
| Application | application, usecase, usecases, use_cases, services |
| Entry points | cmd, entrypoints, api, cli, ui, web |