CCM
/Skills
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Claude Code Marketplaces

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Clean Architecture

wondelai/skills
2.3k installs1.2k stars
Summary

Gives Claude a systematic framework for evaluating software architecture against the Dependency Rule: dependencies point inward from frameworks to use cases to entities. Uses a 0-10 scoring system to assess designs and recommend improvements. Covers the full stack from concentric layer organization to practical patterns like repository interfaces, DTOs crossing boundaries, and keeping frameworks in the outermost circle. Useful when you're reviewing module boundaries, debating where business logic belongs, or trying to decouple from a specific database or web framework. The structured approach works well for architecture reviews, though you'll still need judgment about when strict layering is worth the abstraction cost.

Install to Claude Code

npx -y skills add wondelai/skills --skill clean-architecture --agent claude-code

Installs into .claude/skills of the current project.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Files
SKILL.mdView on GitHub

Clean Architecture Framework

A disciplined approach to structuring software so that business rules remain independent of frameworks, databases, and delivery mechanisms. Apply these principles when designing system architecture, reviewing module boundaries, or advising on dependency management.

Core Principle

Source code dependencies must point inward — toward higher-level policies. Nothing in an inner circle can know anything about an outer circle. This single rule produces systems that are testable and independent of frameworks, UI, database, and any external agency. Business rules are what matter; databases, web frameworks, and delivery mechanisms are details — when details depend on policies, you can defer decisions, swap implementations, and test business logic in isolation.

Scoring

Goal: 10/10. Rate any architecture 0-10 against the principles below. Report the current score and the specific improvements needed to reach 10/10.

1. Dependency Rule and Concentric Circles

Core concept: Organize the architecture as concentric circles — Entities (enterprise business rules) innermost, then Use Cases (application business rules), then Interface Adapters, with Frameworks and Drivers outermost. Source code dependencies always point inward.

Why it works: When high-level policies don't depend on low-level details, you can swap the database, web framework, or API style without touching business logic — the system becomes resilient to the most volatile parts of the stack.

Key insights:

  • Inner circles cannot mention outer circle names — no classes, functions, variables, or data formats from outside
  • Data crossing a boundary must be in the form most convenient for the inner circle, never dictated by the outer
  • Dependency Inversion (interfaces defined inward, implemented outward) is the mechanism that enforces the rule
  • The number of circles is not fixed — four is typical; the rule stays the same
  • Frameworks are details, not architecture — they belong in the outermost circle

Code applications:

ContextPatternExample
Layer directionInner circles define interfaces; outer implementUserRepository interface in Use Cases; PostgresUserRepository in Adapters
Data crossingDTOs cross boundaries, not ORM entitiesUse Case returns UserResponse DTO, not an ActiveRecord model
Dependency directionImport arrows always point inwardController imports Use Case; Use Case never imports Controller

See: references/dependency-rule.md

2. Entities and Use Cases

Core concept: Entities encapsulate enterprise-wide business rules — rules that would exist even without software. Use Cases contain application-specific rules that orchestrate the flow of data to and from Entities.

Why it works: Separating what the business does (Entities) from how the application orchestrates it (Use Cases) lets you reuse Entities across applications and change application behavior without altering core business rules.

Key insights:

  • Entities are not database rows — they are objects or pure functions encapsulating critical business rules
  • Use Cases accept Request Models and return Response Models — never framework objects
  • Each Use Case is a single application operation (CreateOrder, ApproveExpense)
  • The Interactor pattern: a Use Case class implements an input boundary interface and calls an output boundary interface
  • Changes to a Use Case should never affect an Entity; Entity changes may ripple to Use Cases

Code applications:

ContextPatternExample
Entity designCritical business rules, zero framework dependenciesOrder.calculateTotal() applies tax rules; knows nothing about HTTP
Request/ResponseSimple data structures cross the boundaryCreateOrderRequest { items, customerId } — no ORM models
Single responsibilityOne Use Case per operationPlaceOrder, CancelOrder, RefundOrder as separate classes
InteractorImplements Input Port, calls Output PortPlaceOrderInteractor implements PlaceOrderInput

See: references/entities-use-cases.md

3. Interface Adapters and Frameworks

Core concept: Interface Adapters convert data between the form convenient for Use Cases/Entities and the form required by external agencies. Frameworks and Drivers are the outermost layer — glue code to the outside world.

Why it works: When the web framework, ORM, or message queue is confined to the outer circles, replacing any of them is a localized change. The database is a detail; the web is a detail; details should be plugins to your business rules, not the skeleton of the application.

Key insights:

  • Controllers translate HTTP into Use Case input; Presenters translate Use Case output into view models
  • Gateways implement repository interfaces defined by Use Cases — the inner circle defines the contract, the outer fulfills it
  • Business rules never know whether data lives in SQL, NoSQL, or flat files, or that delivery is HTTP
  • Treat frameworks with suspicion — they want you to couple to them; keep them at arm's length

Code applications:

ContextPatternExample
ControllerDelivery mechanism → Use Case inputOrderController.create(req) builds CreateOrderRequest, calls Interactor
PresenterUse Case output → view modelOrderPresenter.present(response) formats for JSON/HTML
GatewayRepository interface implemented per DBSqlOrderRepository implements OrderRepository
Framework boundaryFramework calls inward, never the reverseExpress route handler calls Controller; Controller never imports Express

See: references/adapters-frameworks.md

4. Component Principles

Core concept: Components are the units of deployment. Three cohesion principles govern what goes inside a component; three coupling principles govern relationships between components.

Why it works: Poorly composed components create ripple effects where one change forces redeployment of unrelated code; the principles keep changes localized and releases independent.

Key insights:

  • REP (Reuse/Release Equivalence): classes in a component must be versionable and releasable as a unit
  • CCP (Common Closure): classes that change for the same reason at the same time belong together — SRP for components
  • CRP (Common Reuse): don't force users to depend on classes they don't use
  • ADP (Acyclic Dependencies): the component graph must have no cycles — break them with DIP or a new component
  • SDP (Stable Dependencies): depend in the direction of stability
  • SAP (Stable Abstractions): stable components should be abstract; unstable ones concrete

Code applications:

ContextPatternExample
Component groupingGroup classes that change together (CCP)All order-related Use Cases in one component
Breaking cyclesApply DIP to invert a dependency edgeExtract an interface into a new component to break the cycle
Stability metricsInstability I = Ce / (Ca + Ce)Many incoming, no outgoing deps → I near 0 (stable)

See: references/component-principles.md

5. SOLID Principles

Core concept: Five class-and-module-level principles — Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, Dependency Inversion — the mid-level building blocks that make the Dependency Rule possible.

Why it works: Each principle addresses a specific way dependencies go wrong, preventing the rigidity, fragility, and immobility that turn codebases into legacy nightmares.

Key insights:

  • SRP: a module has one reason to change — it serves one actor (not "does one thing")
  • OCP: extend behavior by adding new code, not modifying existing code — strategy and plugin patterns
  • LSP: subtypes must be usable through the base interface without the client knowing — violated by unexpected exceptions or ignored methods
  • ISP: clients should not depend on methods they don't use — fat interfaces create needless coupling
  • DIP: high-level modules and low-level modules both depend on abstractions defined by the high-level module

Code applications:

ContextPatternExample
SRP violationClass serves multiple actorsEmployee handles pay (CFO), reporting (COO), persistence (CTO)
OCP via strategyNew behavior through new classesAdd ExpressShipping implementing ShippingStrategy; Order untouched
LSP violationSubtype changes expected behaviorSquare extends Rectangle breaks the setWidth()/setHeight() contract
ISP applicationSplit fat interfaces into role interfacesPrinter, Scanner, Fax instead of one MultiFunctionDevice
DIP wiringHigh-level defines interface; low-level implementsOrderService depends on PaymentGateway, not StripeClient

See: references/solid-principles.md

6. Boundaries and Boundary Anatomy

Core concept: A boundary is a line between things that matter and things that are details, implemented through polymorphism: dependencies cross pointing inward while control flow may cross either way.

Why it works: Every boundary buys the option to defer a decision or swap an implementation; strategic boundary placement determines whether a system is a joy or a pain to maintain over years.

Key insights:

  • Full boundaries use reciprocal interfaces on both sides; partial boundaries use a simpler strategy or facade
  • Humble Object pattern: split boundary code into a hard-to-test part (close to the boundary) and an easy-to-test part (the logic)
  • Services are not automatically architectural boundaries — a microservice with a fat shared data model is a monolith with network calls
  • Tests are the most isolated component: they depend inward, nothing depends on them
  • Premature boundaries are expensive, but so are missing ones — draw them at points of likely volatility

Code applications:

ContextPatternExample
Full vs. partial boundaryReciprocal ports, or a lone strategyUse Case defines PlaceOrderInput/PlaceOrderOutput; simpler cases take a ShippingStrategy
Humble ObjectSeparate testable logic from infrastructurePresenterLogic (testable) produces ViewModel; View (humble) renders it
Main as pluginComposition root assembles the systemmain() wires all concrete implementations and starts the app

See: references/boundaries.md

Common Mistakes

MistakeWhy It FailsFix
ORM leaking into business logicEntities couple to the schema; DB changes rewrite business rulesSeparate domain entities from persistence models; map at the adapter layer
Business rules in controllersUntestable without HTTP; duplicated across endpointsMove logic into Use Case Interactors; controllers only translate and delegate
Framework-first architectureFramework dictates structure; swapping means a rewriteTreat the framework as a plugin; structure code by business capability
Circular component dependenciesChanges ripple unpredictably; no independent releasesApply DIP or extract a shared abstraction component
One giant Use Case per featureBloated thousand-line orchestratorsSplit into focused single-operation Use Cases
Skipping boundaries "because it's simple"Coupling accumulates silently until the cost is enormousDraw boundaries proactively at points of likely volatility
Microservices as automatic good architectureA distributed monolith is worse than a clean monolithApply the Dependency Rule within and across services; services are deployment boundaries, not architectural ones

Quick Diagnostic

QuestionIf NoAction
Can you test business rules without DB, web server, or framework?Rules coupled to infrastructureExtract entities and use cases behind interfaces; mock outer layers
Do all source dependencies point inward?Dependency Rule violatedIntroduce boundary interfaces; invert the offending dependency
Can you swap the database without touching business logic?Persistence leaking inwardRepository pattern; isolate persistence in adapters
Are Use Cases independent of delivery mechanism?Use Cases know HTTP/CLI/queuesUse plain DTOs in Use Case signatures
Is the framework confined to the outermost circle?Framework is your architectureWrap framework calls behind interfaces; push to the edges
Is the component graph cycle-free?Circular dependencies existApply ADP: DIP or new components to break every cycle
Does Main (composition root) wire all dependencies?Concrete classes instantiated in inner circlesMove construction to Main; use DI or factories

Reference Files

  • dependency-rule.md: The Dependency Rule explained, concentric circles, data crossing boundaries, keeping the inner circle pure
  • entities-use-cases.md: Enterprise Business Rules, Application Business Rules, the Interactor pattern, request/response models
  • adapters-frameworks.md: Interface adapters, frameworks as details, database as a detail, plugin architecture
  • component-principles.md: REP, CCP, CRP, ADP, SDP, SAP — component cohesion and coupling
  • solid-principles.md: SRP, OCP, LSP, ISP, DIP with code examples and common violations
  • boundaries.md: Boundary anatomy, Humble Object pattern, partial boundaries, Main as a plugin, test boundaries

Further Reading

Based on Robert C. Martin's definitive guide to software architecture:

  • "Clean Architecture: A Craftsman's Guide to Software Structure and Design" by Robert C. Martin

About the Author

Robert C. Martin ("Uncle Bob") is a software engineer programming since 1970, a founding signatory of the Agile Manifesto, and the author of Clean Code, The Clean Coder, Clean Architecture, and Clean Agile. His SOLID principles are foundational vocabulary in object-oriented design, and his work argues that architecture is about managing dependencies and keeping business rules independent of infrastructure details.

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Categories
Code Review & Quality
First SeenMay 16, 2026
View on GitHub

Recommended

More Code Review & Quality →
thermo-nuclear-code-quality-review

cursor/plugins

Run an extremely strict maintainability review for abstraction quality, giant files, and spaghetti-condition growth.
2.1k
clojure-review

metabase/metabase

Review Clojure and ClojureScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing Clojure/ClojureScript code.
45.8k
typescript-review

metabase/metabase

Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.
45.8k
checking-code-quality

telagod/code-abyss

Checks code quality metrics including complexity, duplication, naming conventions, and function length. Use when running quality gates, reviewing code smells, or checking lint rules. Automatically triggered on complex modules or post-refactor.
224
review-and-refactor

github/awesome-copilot

Automated code review and refactoring against project-specific coding guidelines and instructions.
10k
34.3k
ponytail-review

DietrichGebert/ponytail

Code review focused exclusively on over-engineering. Finds what to delete: reinvented standard library, unneeded dependencies, speculative abstractions, dead flexibility. One line per finding: location, what to cut, what replaces it. Complements correctness-focused review, this one only hunts complexity.
326
19.3k