clean-architecture-skill

clean-architecture-skill is a skill for Claude Code, Codex from darellchua2/opencode-config-template. It costs 30 tokens per session (522 once invoked), scanned A, original, Apache-2.0.

A way to organize software around features and clear boundaries between user-facing code, business rules, and outside systems. Clean architecture is a design approach intended to make code easier to test and change.

In plain words
What is it for?
Use it when starting a project, restructuring a difficult codebase, separating business logic from infrastructure, or planning testing and service boundaries.
Why use it?
It reduces tangled dependencies and keeps business logic from being tightly tied to databases, user interfaces, or infrastructure.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it when starting a project, restructuring a difficult codebase, separating business logic from infrastructure, or planning testing and service boundaries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darellchua2/opencode-config-template/clean-architecture-skill
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 darellchua2/opencode-config-template --skill clean-architecture-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

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-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/clean-architecture-skill/github.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/clean-architecture-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/clean-architecture-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/clean-architecture-skill/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-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/clean-architecture-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/clean-architecture-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 522 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 196
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 533
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00030 $0.00522
Opus 5.5 $0.00012 $0.00209
Sonnet 5.5 $0.00006 $0.00104
Haiku 4.5 $0.00003 $0.00052

Measured 1mo ago against content hash 9a89b325df60, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

clean-architecture-skill 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 1mo 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.

skills/clean-architecture-skill/SKILL.md · 31 lines

How it starts

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

What I do

Structure codebases by vertical feature slices + horizontal layers (domain ← application ← infrastructure ← presentation), enforce the dependency rule (source dependencies point inward only), define contracts at boundaries.

When to use me

  • Structuring a new codebase or module; deciding where a piece of code belongs
  • Reviewing whether a boundary is real (enforced) or decorative

Canonical house layouts: frontend features/<feature>/{_components,_containers,hooks} + domains/<feature>; backend modules/<module>/{domain,application,infrastructure,presentation} (domain holds interfaces, infrastructure holds implementations).

House Learnings

Learning: doc-claimed-purity-vs-reality

A layer rule documented but violated by >10 call sites is a false contract — leaving doc and code in disagreement trains every developer to ignore both. Either enforce the boundary with tooling (no-restricted-imports per-directory overrides, madge --circular, dependency-cruiser in CI) or rewrite the doc to describe reality. Never let architecture docs and code drift — the drift becomes the de facto standard. Detection: rg "from '@prisma/client'|from 'pg'" src/domain/ -l | wc -l · npx madge --circular --extensions ts src/domain/

Learning: cross-container-hook-borrowing

A feature container must NEVER import from a sibling container via relative path (../../_containers/ReportDetail/useReportDetail) — invisible coupling that breaks silently on refactor. If two containers need one hook, extract to the feature's hooks/ (intra-feature) or domains/{feature}/hooks/ (cross-feature). Containers import ONLY from @/-aliased shared locations or their own feature's hooks/. Detection: rg "from\s+['\"](\.\./)+.*_containers" --type ts --type tsx

Removed 2026-09: layered/hexagonal/clean-architecture comparison essays, dependency-rule diagrams, vertical/horizontal boundary walkthroughs, cross-cutting-concern lists, frontend/backend directory deep-dives, steps/common-issues ceremony — textbook architecture knowledge; the two codified learnings are this config's real additions.

Read the full file on GitHub · 31 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. 1mo ago Changed · -517 lines 9a89b325df60
  2. 1mo ago First seen · 548 lines · 30 tokens per session scan A be683c16bfea

Subscribe to this mod's changes

clean-architecture-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 28d ago), licensed Apache-2.0. It adds 30 tokens to every session and 522 once invoked, about $0.0001 per session on Opus 5.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-03.

Related

Other skills, from other repositories

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

brooks-test

Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…

hyhmrright/brooks-lint · 161 tokens

software-code-refactoring

Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…

stencila/stencila · 102 tokens

recipe-add-integration-tests

Add integration/E2E tests to existing codebase using Design Docs.

shinpr/claude-code-workflows · 19 tokens

ring:running-dev-cycle

Running the backend dev cycle: implements every task in a rolling-wave plan.md (ring:writing-plans format) for a Go/TS service, driving specialist agents through Gate 0 implementation/TDD, Gate 8 parallel review, and Gate 9 validation per epic, elaborating later phases at each phase boundary. Use when starting or…

LerianStudio/ring · 122 tokens

ring:instrumenting-streaming-events

Instrumenting streaming events: wires lib-streaming event emission end-to-end into a Lerian Go service via a 13-gate cycle (catalog, Builder bootstrap, Emit sites, outbox, HTTP manifest, NoopEmitter fallback, integration and chaos tests), dispatching ring:backend-go under TDD. Consumes the validated…

LerianStudio/ring · 102 tokens