Skip to content

clean-architecture skill

Reviews the architecture around a domain or a CRUD codebase against rules with fixed severities: dependency rule, ports and adapters, application layer, SOLID. It also steers new use cases in an existing codebase away from the anti-patterns of the code next to them, and tells you which ones it met.

Models know clean architecture and SOLID, and on plain CRUD code they find SOLID problems unaided. They miss the application-layer ones: in tests without the skill, no review flagged application code depending on database error codes or a domain decision taken in a service that queries the store, and every report had a different shape and severity scale. Asked to implement a feature next to handlers that open their own transactions, check permissions inline and switch on a type, every run copied them and said nothing. With the skill, every review found all twelve planted defects in one report shape, and implementation runs avoided the anti-patterns and listed each one with the improvement to make.

Ask in your own words; Claude Code picks the skill:

review the architecture of this repository and suggest how to improve it
implement the "renew a loan" use case described in docs/renewals.md
check the Lending module for layering and SOLID problems

On first use it creates the project’s tailoring file and offers a line for AGENTS.md that keeps the skill in reach for implementation work. Reviews run in the clean-architecture-reviewer agent, independent of whoever wrote the code; on code with a domain model the ddd-reviewer review is offered too, and a general architecture review runs both.

  • Tailoring file: .eng-skills/clean-architecture.md, or the path the project’s AGENTS.md / CLAUDE.md gives: stack, layout, modules, whether the code has a domain model, and the forms the project chose for its pipeline, unit of work and ports. Waivers live in ADRs, not here.
  • Review report: a findings table with severity, rule ID, path:line and fix; a mentoring note per finding (why it matters here, the next step); the strengths to keep; the cases a project ADR waives; the decisions needed; what was read.
  • Implementation: the code, and a closing House patterns met table: each anti-pattern met, what the new code did instead, and the improvement suggested for the existing code.
  • ADRs: decisions and waivers, offered to the adr skill as proposed.

A model of Sonnet class or above.

  • Not for the domain model itself (aggregates, bounded contexts, events between aggregates): ddd-architect.
  • It does not write ADRs itself (the adr skill does), hunt for bugs, or review style.
  • Pattern contracts give .NET shapes only; other stacks follow the contracts.
  • When the codebase has no pipeline or unit of work, it does not build one unasked: it keeps the new code clean where it can and reports the gap.