From clean-code-codex
Enforces architectural boundary rules (ARCH-1 through ARCH-6). Loaded by the conductor for review, refactor, and new-service operations. Detects layer violations, circular imports, and missing public API declarations. Architecture boundaries are language-agnostic — no language reference files needed.
How this skill is triggered — by the user, by Claude, or both
Slash command
/clean-code-codex:arch-checkopusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Precedence in the overall system: SEC → TDD → **ARCH/TYPE** → quality BLOCK.
Precedence in the overall system: SEC → TDD → ARCH/TYPE → quality BLOCK.
┌─────────────────────────────────────────────────────────────┐
│ │
│ DOMAIN ◀──────── APPLICATION ◀──────── INFRA │
│ (entities, (use cases, (DB, HTTP, │
│ value objects, ports, DTOs) adapters, │
│ domain events) frameworks) │
│ │
│ ✅ Allowed: inner ← outer (outer depends on inner) │
│ ❌ Blocked: inner → outer (domain must NEVER import │
│ application or infra) │
│ │
│ ❌ Blocked: CIRCULAR IMPORTS at any level │
│ │
└─────────────────────────────────────────────────────────────┘
Canonical layer indicators (adapt to project conventions):
| Layer | Common paths |
|---|---|
| domain | domain/, entities/, models/, core/ |
| application | application/, app/, usecases/, services/ |
| infra | infra/, infrastructure/, adapters/, db/ |
Severity: BLOCK | Languages: * | Source: CCC
What it prohibits: A domain-layer module importing from the application or infrastructure layer. The domain is the innermost ring and must be dependency-free of outer layers.
Detection:
agent_action:
ARCH-1 (BLOCK): Domain module imports from outer layer.Severity: BLOCK | Languages: * | Source: CCC
What it prohibits: Module A importing module B when module B (directly or transitively) imports module A.
Detection:
agent_action:
ARCH-2 (BLOCK): Circular import detected.# WAIVER: ARCH-2 block exists in the file and is unexpired,
list this under ⚠️ Waivers, not ViolationsSeverity: WARN | Languages: * | Source: CCC
What it prohibits: Module in feature A directly importing an internal (non-public) module from feature B. Features must communicate through their public API surface only.
Detection:
features/, modules/,
or packages/ — adapt to project layout)internal/, _internal/, or any path segment
conventionally marking non-public membersagent_action:
ARCH-3 (WARN): Feature A imports internal module of Feature B.__init__.py, mod.rs, etc.)Severity: BLOCK | Languages: * | Source: CCC
What it prohibits: An infrastructure concern (ORM model, HTTP framework decorator, database session, third-party SDK type) appearing in domain or application layer code.
Detection:
sqlalchemy, mongoose, axios, express, framework decorators)agent_action:
ARCH-4 (BLOCK): Infrastructure type leaks into domain/application layer.Severity: WARN | Languages: * | Source: CCC
What it prohibits: A change to module A requiring changes to more than 2 downstream modules. Cascade depth > 2 indicates excessive coupling.
Detection:
agent_action:
ARCH-5 (WARN): Change cascades to N downstream modules (limit: 2).Severity: INFO | Languages: * | Source: CCC
What it requires: Every module/package boundary MUST have an explicit public
API declaration (barrel file, __init__.py, mod.rs with pub use, Go package
doc, etc.) that lists the exported symbols.
Detection:
agent_action:
ARCH-6 (INFO): Module lacks explicit public API declaration.index.ts / __init__.py / mod.rs / Go package-level doc
exporting only the intended public symbolsReport schema: see skills/conductor/shared-contracts.md.
npx claudepluginhub mikecubed/clean-code-codex --plugin clean-code-codexValidates architectural layer boundaries and detects dependency violations using configurable constraint rules. Provides hard enforcement for pull request approval and refactoring.
Enforces architectural rules (layer responsibilities, dependency direction, structure) when generating or reviewing code. Supports clean/hexagonal/onion/monolith architectures via loaded rule sets.
Maps module dependencies, checks layering integrity, and flags structural decay across a codebase. Includes onboarding mode for codebase tours.