clean-architecture

clean-architecture is a skill for Claude Code, Codex from sutchan/Agent-Skills-Hub. It costs 147 tokens per session (3,331 once invoked), scanned A, a copy of clean-architecture, MIT.

A way to organize software so business rules stay separate from frameworks, databases, and user interfaces. Dependencies point toward the core rules, making them easier to test and change.

In plain words
What is it for?
Use it to design architecture layers, decide where business logic belongs, review module boundaries, and manage dependencies.
Why use it?
It prevents technical details from controlling the main logic of an application. This reduces the cost of replacing a database, framework, or delivery method.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design architecture layers, decide where business logic belongs, review module boundaries, and manage dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sutchan/agent-skills-hub/clean-architecture
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sutchan/Agent-Skills-Hub --skill clean-architecture
Clone the repo
git clone --depth 1 https://github.com/sutchan/Agent-Skills-Hub

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clean-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/clean-architecture/github.svg)](https://agentmods.dev/skills/sutchan/agent-skills-hub/clean-architecture)
Your own site
<a href="https://agentmods.dev/skills/sutchan/agent-skills-hub/clean-architecture"><img src="https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/clean-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clean-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/sutchan/agent-skills-hub/clean-architecture"><img src="https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/clean-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,331 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00147 $0.03331
Opus 5 $0.00073 $0.01665
Sonnet 5 $0.00029 $0.00666
Haiku 4.5 $0.00015 $0.00333

Measured 11d ago against content hash fc9fe201ae04, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

clean-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to clean-architecture — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/clean-architecture/SKILL.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section 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. Score one point for each of the seven Quick Diagnostic rows the architecture satisfies (0-7), then map to a 0-10 band: 6-7 satisfied = 9-10 (Dependency Rule holds, business logic is framework- and DB-independent); 4-5 = 6-8 (core is testable but some details leak inward); 2-3 = 3-5 (framework or persistence dictates structure); 0-1 = 0-2 (no boundaries — business rules live in controllers and ORM models). Report the score, the failed diagnostic rows, and the specific inversion needed to fix each.

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

Read the full file on GitHub · 197 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 197 lines · 147 tokens per session scan A fc9fe201ae04

Subscribe to this mod's changes

clean-architecture is a skill published in the GitHub repository sutchan/Agent-Skills-Hub (2 stars, last pushed yesterday), licensed MIT. It adds 147 tokens to every session and 3,331 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to clean-architecture, differing in 0 lines, and is treated as a copy.