clean-architecture

clean-architecture is a skill for Claude Code, Codex from Plazmodium/odin-workflow. It costs 17 tokens per session (1,025 once invoked), scanned A, original, MIT.

Software design guidance that keeps business rules separate from databases, user interfaces, and frameworks by arranging code into clear layers.

In plain words
What is it for?
Organising entities, use cases, interfaces, repositories, external services, web routes, and the code that connects these parts.
Why use it?
It reduces the risk that changing a database or framework will force changes throughout the business logic.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

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.

agentmods
npx agentmods add skills/plazmodium/odin-workflow/clean-architecture
Any agent
npx skills add Plazmodium/odin-workflow --skill clean-architecture
Clone the repo
git clone --depth 1 https://github.com/Plazmodium/odin-workflow

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/plazmodium/odin-workflow/clean-architecture.svg)](https://agentmods.dev/skills/plazmodium/odin-workflow/clean-architecture)
Your own site
<a href="https://agentmods.dev/skills/plazmodium/odin-workflow/clean-architecture"><img src="https://agentmods.dev/badge/skills/plazmodium/odin-workflow/clean-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,025 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00017 $0.01025
Opus 5 $0.00009 $0.00513
Sonnet 5 $0.00003 $0.00205
Haiku 4.5 $0.00002 $0.00103

Measured 5d ago against content hash a266c67ae511, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 5d 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.

agents/skills/architecture/clean-architecture/SKILL.md · 142 lines

How it starts

The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clean Architecture

Overview

Clean Architecture separates code into concentric layers with the Dependency Rule: source code dependencies always point inward. Business logic never depends on frameworks, databases, or UI.

Layer Structure

src/
├── domain/                  # Innermost — entities + business rules
│   ├── entities/
│   │   └── User.ts
│   └── value-objects/
│       └── Email.ts
├── application/             # Use cases — orchestrate domain logic
│   ├── use-cases/
│   │   ├── CreateUser.ts
│   │   └── GetUserById.ts
│   └── ports/               # Interfaces (driven/driving)
│       ├── UserRepository.ts
│       └── EmailService.ts
├── infrastructure/          # Outermost — frameworks, DB, external APIs
│   ├── persistence/
│   │   └── PgUserRepository.ts
│   ├── services/
│   │   └── SendGridEmailService.ts
│   └── web/
│       ├── routes.ts
│       └── controllers/
│           └── UserController.ts
└── main.ts                  # Composition root — wires everything together

Core Patterns

Entity (Domain Layer)

// Pure business logic — no framework imports
export class User {
  constructor(
    public readonly id: string,
    public readonly email: Email,
    public name: string,
    private passwordHash: string,
  ) {}

  changeName(newName: string): void {
    if (newName.length < 2) throw new DomainError('Name too short');
    this.name = newName;
  }

  verifyPassword(plaintext: string): boolean {
    return hashCompare(plaintext, this.passwordHash);
  }
}

Use Case (Application Layer)

// Depends only on ports (interfaces), not implementations
export class CreateUser {
  constructor(
    private userRepo: UserRepository,
    private emailService: EmailService,
  ) {}

  async execute(input: { email: string; name: string; password: string }): Promise<User> {
    const existing = await this.userRepo.findByEmail(input.email);
    if (existing) throw new ConflictError('Email already registered');

    const user = User.create(input);
    await this.userRepo.save(user);
    await this.emailService.sendWelcome(user.email);
    return user;
  }
}

Read the full file on GitHub · 142 lines

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. 5d ago First seen · 142 lines · 17 tokens per session scan A a266c67ae511

Subscribe to this mod's changes

clean-architecture is a skill published in the GitHub repository Plazmodium/odin-workflow (0 stars, last pushed 3mo ago), licensed MIT. It adds 17 tokens to every session and 1,025 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

csv-to-sif

Export a project's FF&E product-library CSV as dealer-system SIF. Use to produce a .sif schedule; use sif-to-csv for the reverse direction.

AlpacaLabsLLC/skills-for-architects · 38 tokens

environmental-analysis

Research climate, sun, flood, seismic, soil, contamination, and topography for a site. Use for environmental site analysis or hazard questions tied to a location.

AlpacaLabsLLC/skills-for-architects · 37 tokens

product-research

Find and compare current FF&E candidates from a design brief, with sourced purchasing facts and optional CSV-library save. Use to research or source products; not to match from an image or pair coordinating items.

AlpacaLabsLLC/skills-for-architects · 44 tokens

site-history

Neighborhood context and history — adjacent uses, architectural character, landmarks, commercial activity, and planned development from an address. Use when the user asks about a site's history or surroundings, "what's around this site", neighborhood character, or nearby planned development.

AlpacaLabsLLC/skills-for-architects · 53 tokens

nyc-landmarks

Check whether a NYC building is landmarked or in a historic district using LPC data. Use when the user asks "is this building landmarked", whether a site sits in a historic district, or whether LPC review applies. NYC only.

AlpacaLabsLLC/skills-for-architects · 52 tokens

b123d-modeling

Use this skill when asked to model, build, or modify a 3D part or assembly with build123d — from a text description, a technical drawing (image or PDF), dimensions in a spec, or an existing STEP/STL file.

pzfreo/build123d-mcp · 0 tokens