skills/clean-architecture/SKILL.md
Clean Architecture principles and best practices from Robert C. Martin's book. This skill should be used when designing software systems, reviewing code structure, or refactoring applications to achieve better separation of concerns. Triggers on tasks involving layers, boundaries, dependency direction, entities, use cases, or system architecture.
npx skillsauth add petekp/claude-skills clean-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive guide to Clean Architecture principles for designing maintainable, testable software systems. Based on Robert C. Martin's "Clean Architecture: A Craftsman's Guide to Software Structure and Design." Contains 42 rules across 8 categories, prioritized by architectural impact.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Dependency Direction | CRITICAL | dep- |
| 2 | Entity Design | CRITICAL | entity- |
| 3 | Use Case Isolation | HIGH | usecase- |
| 4 | Component Cohesion | HIGH | comp- |
| 5 | Boundary Definition | MEDIUM-HIGH | bound- |
| 6 | Interface Adapters | MEDIUM | adapt- |
| 7 | Framework Isolation | MEDIUM | frame- |
| 8 | Testing Architecture | LOW-MEDIUM | test- |
dep-inward-only - Source dependencies point inward onlydep-interface-ownership - Interfaces belong to clients not implementersdep-no-framework-imports - Avoid framework imports in inner layersdep-data-crossing-boundaries - Use simple data structures across boundariesdep-acyclic-dependencies - Eliminate cyclic dependencies between componentsdep-stable-abstractions - Depend on stable abstractions not volatile concretionsentity-pure-business-rules - Entities contain only enterprise business rulesentity-no-persistence-awareness - Entities must not know how they are persistedentity-encapsulate-invariants - Encapsulate business invariants within entitiesentity-value-objects - Use value objects for domain conceptsentity-rich-not-anemic - Build rich domain models not anemic data structuresusecase-single-responsibility - Each use case has one reason to changeusecase-input-output-ports - Define input and output ports for use casesusecase-orchestrates-not-implements - Use cases orchestrate entities not implement business rulesusecase-no-presentation-logic - Use cases must not contain presentation logicusecase-explicit-dependencies - Declare all dependencies explicitly in constructorusecase-transaction-boundary - Use case defines the transaction boundarycomp-screaming-architecture - Structure should scream the domain not the frameworkcomp-common-closure - Group classes that change togethercomp-common-reuse - Avoid forcing clients to depend on unused codecomp-reuse-release-equivalence - Release components as cohesive unitscomp-stable-dependencies - Depend in the direction of stabilitybound-humble-object - Use humble objects at architectural boundariesbound-partial-boundaries - Use partial boundaries when full separation is prematurebound-boundary-cost-awareness - Weigh boundary cost against ignorance costbound-main-component - Treat main as a plugin to the applicationbound-defer-decisions - Defer framework and database decisionsbound-service-internal-architecture - Services must have internal clean architectureadapt-controller-thin - Keep controllers thinadapt-presenter-formats - Presenters format data for the viewadapt-gateway-abstraction - Gateways hide external system detailsadapt-mapper-translation - Use mappers to translate between layersadapt-anti-corruption-layer - Build anti-corruption layers for external systemsframe-domain-purity - Domain layer has zero framework dependenciesframe-orm-in-infrastructure - Keep ORM usage in infrastructure layerframe-web-in-infrastructure - Web framework concerns stay in interface layerframe-di-container-edge - Dependency injection containers live at the edgeframe-logging-abstraction - Abstract logging behind domain interfacestest-tests-are-architecture - Tests are part of the system architecturetest-testable-design - Design for testability from the starttest-layer-isolation - Test each layer in isolationtest-boundary-verification - Verify architectural boundaries with testsRead individual reference files for detailed explanations and code examples:
| File | Description | |------|-------------| | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |
tools
Comprehensively manually test the Circuit plugin's user-facing surface in either Claude Code or Codex. Use this skill whenever the user asks to "manually test Circuit", "QA the Circuit plugin", "exercise the Circuit surface", "run the Circuit checklist", "smoke test Circuit", "find regressions in Circuit", "test the Claude Circuit plugin", "test the Codex Circuit plugin", or when preparing a Circuit release for marketplace publication. Argument is the host package to test — `claude` or `codex`. Produces a Markdown report with per-command pass/fail, exploratory findings ranked by severity, run-folder evidence links, and a concise terminal summary. Use even if the user does not say the word "test" — phrases like "go through every Circuit command" or "make sure Circuit still works end-to-end" should also trigger.
development
Turn the prompt supplied with this skill into a concise, auditable Codex Goal or explain why a Goal is not the right fit. Use when the user asks to draft, formulate, rewrite, tighten, or create a `/goal` from a plain-language task, especially for multi-step work that needs a durable objective, evidence-based completion, constraints, iteration policy, and a default adversarial review loop.
development
Give the human a fast, plain-English catch-up on what changed in the project: what the agents did, why, and what decisions need their input. Use this whenever the user asks to "catch me up", "what changed", "where are we", "recap", "brief me", "give me the rundown", "what did you do", "summarize the session", "fill me in", or otherwise signals they have been away and want to get back up to speed quickly. Built for someone steering several agent-driven projects at once who does not read the code closely but needs to grasp the core ideas, the choices made, and the open decisions well enough to steer. Trigger even if they do not use these exact words: any request to get oriented on recent progress should use this skill.
tools
Expert Unix and macOS systems engineer for shell scripting, system administration, command-line tools, launchd, Homebrew, networking, and low-level system tasks. Use when the user asks about Unix commands, shell scripts, macOS system configuration, process management, or troubleshooting system issues.