clean-ddd-hexagonal

clean-ddd-hexagonal is a skill for Claude Code, Codex from ccheney/robust-skills. It costs 49 tokens per session (748 once invoked), scanned A, original, MIT.

A backend design guide combining Domain-Driven Design, Clean Architecture, and Hexagonal Architecture. These approaches keep business rules central and separate them from APIs, databases, message brokers, and other outside systems.

In plain words
What is it for?
Use it for APIs and microservices with complex business rules, multiple entry points, replaceable infrastructure, domain events, use cases, repositories, or strict dependency direction.
Why use it?
It helps keep complex, long-lived backends testable and easier to change when infrastructure or entry points change.

Skill for Claude CodeCodex

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

Good fit Use it for APIs and microservices with complex business rules, multiple entry points, replaceable infrastructure, domain events, use cases, repositories, or strict dependency direction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ccheney/robust-skills/clean-ddd-hexagonal
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 ccheney/robust-skills --skill clean-ddd-hexagonal
Clone the repo
git clone --depth 1 https://github.com/ccheney/robust-skills

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-ddd-hexagonal

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccheney/robust-skills/clean-ddd-hexagonal/github.svg)](https://agentmods.dev/skills/ccheney/robust-skills/clean-ddd-hexagonal)
Your own site
<a href="https://agentmods.dev/skills/ccheney/robust-skills/clean-ddd-hexagonal"><img src="https://agentmods.dev/badge/skills/ccheney/robust-skills/clean-ddd-hexagonal/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-ddd-hexagonal

Your own site · 80×15
<a href="https://agentmods.dev/skills/ccheney/robust-skills/clean-ddd-hexagonal"><img src="https://agentmods.dev/badge/skills/ccheney/robust-skills/clean-ddd-hexagonal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 748 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
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00049 $0.00748
Opus 5.5 $0.00020 $0.00299
Sonnet 5.5 $0.00010 $0.00150
Haiku 4.5 $0.00005 $0.00075

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

Security

Grade A, and why

clean-ddd-hexagonal 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-ddd-hexagonal/SKILL.md · 49 lines

How it starts

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

Clean Architecture, DDD, and Hexagonal Architecture

Use these related patterns to solve a concrete domain or dependency problem. This is an opinionated synthesis, not a mandatory folder layout. The user's explicit instructions take precedence over this skill's guidelines.

Choose the scope

Start from the requested behavior, existing domain model, and current dependencies. Preserve the project's language and architecture unless changing them is part of the task. Simple CRUD can remain simple; team size, entity count, and file length do not determine whether DDD is appropriate.

Design question Relevant pattern
What language and consistency rules describe the business? DDD, bounded contexts, aggregates
Which way should source dependencies point? Clean/Onion Architecture
How can the application use different interfaces or infrastructure? Hexagonal ports and adapters
Do reads and writes need different models? CQRS
Must state be reconstructed from an event history? Event Sourcing

If a business invariant is unknown, identify the specific missing rule and continue work that does not depend on it. Do not invent business behavior or require a discovery workshop for a local fix.

Preserve the boundaries that matter

  • Keep domain behavior independent of HTTP, persistence, and messaging implementations. Put orchestration in application use cases and external I/O in adapters.
  • Model entity identity separately from value-object equality. Choose aggregate boundaries from transactional invariants and contention.
  • Prefer transactions contained within an aggregate. When a requirement needs cross-aggregate atomicity, make that tradeoff explicit rather than silently replacing it with eventual consistency.
  • Use an outbox when a committed database change and external event delivery must be reliable together.
  • Treat CQRS, Event Sourcing, repository interfaces, and separate presentation folders as choices justified by the task. Adapt example naming and directories to the project.

Read the full file on GitHub · 49 lines

Files

What ships with it

7 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. 1mo ago Changed · -164 lines · -71 tokens per session 6b719ae95e3b
  2. 1mo ago First seen · 213 lines · 120 tokens per session scan A 5b7dcd3f34d5

Subscribe to this mod's changes

clean-ddd-hexagonal is a skill published in the GitHub repository ccheney/robust-skills (61 stars, last pushed 21d ago), licensed MIT. It adds 49 tokens to every session and 748 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

principle-clean-architecture

Clean Architecture, hexagonal architecture, ports and adapters, and dependency rule. Auto-load when designing architecture, choosing layers, ports, adapters, or keeping the domain free of framework code.

lugassawan/swe-workbench · 43 tokens

principle-resiliency

Resiliency principles — fault tolerance, partial failure, failure domains, bulkheads, fail-fast vs fail-soft, health checks, liveness vs readiness probes, idempotency keys, safe retry, deduplication, exactly-once effects, token and leaky buckets, synchronized retries, and 429 responses. Auto-load when isolating…

lugassawan/swe-workbench · 126 tokens

principle-distributed-systems

Distributed systems principles — CAP, consistency models (linearizable, causal, eventual, read-your-writes), quorum, leader election, partitioning, idempotency across nodes, fallacies of distributed computing. Auto-load when reasoning about CAP/PACELC trade-offs, choosing a consistency model, ordering events with…

lugassawan/swe-workbench · 96 tokens

principle-error-handling

Error handling principles — errors as values vs exceptions, wrapping and context chains, retry with exponential backoff and jitter, circuit breakers and bulkheads, log-once boundary discipline. Auto-load when discussing errors as values, retry, exponential backoff, jitter, fail fast, fail soft, idempotent retry, error…

lugassawan/swe-workbench · 74 tokens

principle-event-driven

Event-driven architecture — event sourcing, CQRS, sagas, schema evolution, consumer groups, partitions, idempotent handlers, outbox pattern, dead letter queues. Auto-load when designing event-driven systems, evaluating event sourcing or CQRS, planning saga workflows, implementing idempotent consumers or the outbox…

lugassawan/swe-workbench · 84 tokens

principle-performance

Performance engineering principles — latency vs throughput, profile-before-optimize discipline, Big-O instincts for common patterns, data locality and cache-friendliness, N+1 queries on a list endpoint, TTL sizing for hot-path endpoints, stampede prevention with single-flight. Auto-load when reviewing hot-path code…

lugassawan/swe-workbench · 92 tokens