From parvez
A rulebook + bootstrap + guard for building software with Clean / Hexagonal (Ports-and-Adapters) Architecture, in any language (.NET, TypeScript/Node, Java/Kotlin, Go, Python). Use this when starting a new project and you want to lay out the layers correctly, when structuring or refactoring code into Domain / Application / Infrastructure / Presentation, when deciding "where does this code go?", when adding a dependency or project reference and unsure if it inverts the architecture, or when the user asks "set up clean architecture", "how should I structure this", "is this the right layer", "did I break the dependency rule", "bootstrap a hexagonal project". Ships a config-driven layering guard so the boundaries are enforced, not just hoped for.
How this skill is triggered — by the user, by Claude, or both
Slash command
/parvez:clean-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Clean / Hexagonal / Ports-and-Adapters architectures all share one core idea - **the
Clean / Hexagonal / Ports-and-Adapters architectures all share one core idea - the Dependency Rule - and most teams get the folders right but let the dependencies rot. This skill gives you the rule, a way to bootstrap the layout in your stack, and a guard that mechanically enforces the boundaries (because nothing else will).
┌───────────────────────── Presentation / API ─────────────────────────┐
│ controllers, CLI, HTTP, gRPC, UI - thin; translate transport <-> use │
│ ┌───────────────────── Infrastructure / Adapters ────────────────┐ │
│ │ DB, ORM, external APIs, queues, file system, framework glue │ │
│ │ ┌──────────────── Application / Use Cases ─────────────────┐ │ │
│ │ │ orchestrates domain to fulfil a use case; defines PORTS │ │ │
│ │ │ ┌──────────────── Domain / Entities ────────────────┐ │ │ │
│ │ │ │ business rules, entities, value objects - PURE │ │ │ │
│ │ │ └────────────────────────────────────────────────┘ │ │ │
│ │ └──────────────────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────┘
source-code dependencies only ever point INWARD ───────────────────────────►
IUserRepository, IClock, IEmailSender) it needs. Depends only on Domain.Inversion is the trick: an inner layer needs a database, but it can't depend on the database. So it defines a port (interface) and an outer adapter implements it; the dependency now points inward (adapter -> port). This is the whole game.
using/import of a framework in Domain -> wrong; move it out or invert it.Pick your stack in references/bootstrap-by-stack.md - it gives the concrete folder/
project layout and, crucially, how to make the dependency direction enforceable in
that ecosystem (project references in .NET, module boundaries / ESLint in TS, Gradle
modules in Java, internal packages in Go). Start with the inner layers and the ports;
wire concrete adapters at a single composition root.
Folder discipline decays under deadline pressure, and these violations never fail a build or a test - they're architectural. Add the guard:
assets/clean-arch.json to your repo root and edit it: declare each layer's
source paths and the imports/namespaces forbidden in that layer.pwsh -File scripts/check-layering.ps1 -Config clean-arch.json
It scans each layer for forbidden imports (language-agnostic) and, for .NET, can
verify the .csproj reference DAG. Non-zero exit on a hard violation.See references/dependency-rule.md for the deep dive: ports vs adapters, mapping at
boundaries, the common violations and how to fix each by inverting instead of bending the
rule.
Clean Architecture is a means, not a trophy. For a tiny CRUD app it can be overkill - the layers earn their keep when business rules are non-trivial and you want them independent of frameworks and testable in isolation. Apply the dependency rule strictly where it pays; don't add ceremony where it doesn't.
Provides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub parvez-ahammed/claude-skills --plugin parvez