clean-architecture

clean-architecture is a skill for Claude Code, Codex from DVNghiem/FlowDeck. It costs 18 tokens per session (623 once invoked), scanned A, original, MIT.

Guidance for Clean Architecture, a way of organizing software so business rules stay separate from databases, user interfaces, web frameworks, and outside services.

In plain words
What is it for?
Use it when designing or implementing a feature or service. It covers identifying business rules, defining interfaces, building adapters, and connecting the parts through dependency injection.
Why use it?
It keeps the core logic easier to test and less tied to a particular framework or infrastructure choice.

Skill for Claude CodeCodex

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

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/dvnghiem/flowdeck/clean-architecture
Any agent
npx skills add DVNghiem/FlowDeck --skill clean-architecture
Clone the repo
git clone --depth 1 https://github.com/DVNghiem/FlowDeck

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/dvnghiem/flowdeck/clean-architecture.svg)](https://agentmods.dev/skills/dvnghiem/flowdeck/clean-architecture)
Your own site
<a href="https://agentmods.dev/skills/dvnghiem/flowdeck/clean-architecture"><img src="https://agentmods.dev/badge/skills/dvnghiem/flowdeck/clean-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 623 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.00018 $0.00623
Opus 5 $0.00009 $0.00311
Sonnet 5 $0.00004 $0.00125
Haiku 4.5 $0.00002 $0.00062

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

src/skills/clean-architecture/SKILL.md · 92 lines

How it starts

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

clean-architecture

When to Activate

When designing or implementing a new feature or service that needs clear separation of concerns, testability, and independence from frameworks, databases, or UI libraries.

Steps

  1. Identify the core business logic - Determine the essential domain rules that would exist even if the application had no UI, database, or external services.
  2. Define the boundary - Draw a clear boundary between the inner circles (entities, use cases) and outer circles (interfaces, infrastructure).
  3. Place dependencies pointing inward - Dependencies should always point toward the center. The inner circle knows nothing about the outer circle.
  4. Define ports (interfaces) - Create interfaces in the domain layer that define how the outside world can interact with it.
  5. Implement adapters - Create concrete implementations (adapters) for databases, web frameworks, external APIs, etc. in the outer layers.
  6. Wire everything via dependency injection - Use a composition root or DI container to assemble the application.

Examples

// Domain Layer - Enterprise Business Rules (innermost circle)
class Order {
  constructor(
    private readonly id: string,
    private readonly items: OrderItem[],
    private readonly status: OrderStatus
  ) {}

  get total(): number {
    return this.items.reduce((sum, item) => sum + item.price * item.quantity, 0)
  }

  canBeFulfilled(): boolean {
    return this.status === 'pending' && this.items.length > 0
  }
}

// Application Layer - Application Business Rules
interface OrderRepository {
  findById(id: string): Promise<Order | null>
  save(order: Order): Promise<void>
}

interface NotificationService {
  sendOrderConfirmation(order: Order): Promise<void>
}

class PlaceOrderUseCase {
  constructor(
    private readonly orderRepo: OrderRepository,
    private readonly notifier: NotificationService
  ) {}

  async execute(orderData: OrderData): Promise<Order> {
    const order = new Order(orderData.id, orderData.items, 'pending')

    if (!order.canBeFulfilled()) {
      throw new InvalidOrderError('Order cannot be fulfilled')
    }

    await this.orderRepo.save(order)
    await this.notifier.sendOrderConfirmation(order)

    return order
  }
}

// Infrastructure Layer - Interface Adapters (outermost circle)
class PostgresOrderRepository implements OrderRepository {
  async findById(id: string): Promise<Order | null> {
    // Database implementation
  }

  async save(order: Order): Promise<void> {
    // Database implementation
  }
}

class EmailNotificationService implements NotificationService {
  async sendOrderConfirmation(order: Order): Promise<void> {
    // Email implementation
  }
}

Read the full file on GitHub · 92 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. 6d ago First seen · 92 lines · 18 tokens per session scan A 5a17f637dc4c

Subscribe to this mod's changes

clean-architecture is a skill published in the GitHub repository DVNghiem/FlowDeck (24 stars, last pushed 17d ago), licensed MIT. It adds 18 tokens to every session and 623 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-08-30.

Related

Other skills, from other repositories

oh-my-opencode-slim

Configure and improve oh-my-opencode-slim for the current user. Use when users want to tune agents, models, prompts, custom agents, skills, MCPs, presets, or plugin behavior. Also use when recurring workflow friction suggests a safe config or prompt improvement.

alvinunreal/oh-my-opencode-slim · 61 tokens

clonedeps

Clone important project dependency source code into an ignored local workspace so OpenCode can inspect library internals. Use when the user asks to clone dependencies, inspect dependency/source internals, understand SDK/framework behavior from source, debug library implementation details, or make core dependency repos…

alvinunreal/oh-my-opencode-slim · 76 tokens

codemap

Generate comprehensive hierarchical codemaps for UNFAMILIAR repositories. Expensive operation - only use when explicitly asked for codebase documentation or initial repository mapping.

alvinunreal/oh-my-opencode-slim · 34 tokens

worktrees

Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.

alvinunreal/oh-my-opencode-slim · 23 tokens

deepwork

High-cost orchestrator workflow for large, high-risk, multi-phase coding efforts with meaningful dependencies and review gates. Do not activate for routine multi-file changes.

alvinunreal/oh-my-opencode-slim · 34 tokens

simplify

Simplifies code for clarity without changing behavior. Use for readability, maintainability, and complexity reduction after behavior is understood.

alvinunreal/oh-my-opencode-slim · 27 tokens