hexagonal-domain-isolation

hexagonal-domain-isolation is a skill for Claude Code from helmedeiros/clean-code-skills. It costs 51 tokens per session (860 once invoked), scanned A, original, MIT.

A software-architecture guide for keeping business rules separate from databases, frameworks, and external services. This separation is often called domain isolation or hexagonal architecture.

In plain words
What is it for?
Use it to inspect domain-module dependencies, identify infrastructure leakage, design translation layers between systems, and keep domain models focused on business concepts.
Why use it?
It prevents changes to an API, database, or framework from forcing changes throughout the business logic.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the clean-code-skills plugin — 21 skills, 2 commands shipped together

Good fit Use it to inspect domain-module dependencies, identify infrastructure leakage, design translation layers between systems, and keep domain models focused on business concepts.

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

Made for: Claude Code.

Or install clean-code-skills, the plugin that ships this one along with the rest of its 21 skills, 2 commands.

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 hexagonal-domain-isolation

README.md
[![agentmods](https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/hexagonal-domain-isolation.svg)](https://agentmods.dev/skills/helmedeiros/clean-code-skills/hexagonal-domain-isolation)
Your own site
<a href="https://agentmods.dev/skills/helmedeiros/clean-code-skills/hexagonal-domain-isolation"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/hexagonal-domain-isolation.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 860 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 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.00051 $0.00860
Opus 5 $0.00026 $0.00430
Sonnet 5 $0.00010 $0.00172
Haiku 4.5 $0.00005 $0.00086

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

Security

Grade A, and why

hexagonal-domain-isolation 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 7d 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/hexagonal-domain-isolation/SKILL.md · 103 lines

How it starts

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

Hexagonal Architecture: Domain Isolation

Protect the domain model from infrastructure, framework, and external system concerns by enforcing strict boundaries that keep business logic pure and independent.

When This Skill Applies

  • Domain objects contain serialization annotations, ORM decorators, or framework dependencies
  • Business logic changes when an external API contract changes
  • The domain model mirrors a database schema instead of business concepts
  • The user mentions domain isolation, anti-corruption layer, or clean domain
  • Framework upgrades require modifying business logic

Core Principle

The domain model represents business concepts and rules in their purest form. It must not be contaminated by infrastructure concerns like database schemas, serialization formats, API contracts, or framework conventions. An anti-corruption layer (ACL) translates between the domain's language and external systems' languages, ensuring the domain remains stable even when external systems change.

Workflow

Step 1: Audit Domain Dependencies

Check what the domain module imports. Any import from an infrastructure, framework, or external library is a boundary violation. The domain should depend only on the language's standard library and its own types.

Step 2: Identify Contamination

Look for: ORM annotations on domain entities, JSON serialization attributes, framework base classes, external API types used in domain logic, database column names influencing domain field names.

Step 3: Introduce Translation Layers

Create separate models for each boundary:

  • Domain model: pure business objects.
  • Persistence model: ORM entities that map to database tables.
  • API model: DTOs that match external API contracts.

Mappers translate between these models at the boundary.

Step 4: Build the Anti-Corruption Layer

For external systems whose model differs from yours, create an ACL that translates their concepts into your domain language. The ACL adapter implements a domain port.

Read the full file on GitHub · 103 lines

Files

What ships with it

1 file 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. 7d ago First seen · 103 lines · 51 tokens per session scan A 3ac9599fe5d5

Subscribe to this mod's changes

hexagonal-domain-isolation is a skill published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 51 tokens to every session and 860 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

drift-testing

Verifies API implementations against OpenAPI specifications using the Drift CLI, catching spec drift and supporting Bi-Directional Contract Testing (BDCT). Use when the user mentions Drift, API contract testing, provider contract testing, provider verification, spec drift, API conformance testing, OpenAPI…

pactflow/pactflow-agent-skills · 158 tokens

openapi-parser

Parses complex OpenAPI specs and generates Drift test cases from them. Use whenever the user wants to generate, write, or scaffold Drift tests from an OpenAPI spec — especially when the spec contains complex schemas: anyOf/oneOf/allOf, discriminators, polymorphism, inheritance, $ref chains, regex patterns, enums, or…

pactflow/pactflow-agent-skills · 145 tokens

demographic-modeling

This skill should be used when the user asks to "design a demographic model", "model a person/organisation/role", "design party relationships", "plan identity structures", or "work with demographic archetypes". Covers designing openEHR demographic models using the PARTY hierarchy, roles, capabilities, relationships…

Cadasto/openehr-assistant-plugin · 126 tokens

epf-bsp-init

A helper for describing a 1C external report or data processor so it can be added through the platform’s standard “Additional reports and processors” section.

IngvarConsulting/unica · 72 tokens

platform-help

A reference skill for the 1C platform and BSL, the programming language used to build 1C business applications. It helps clarify the platform’s object model, APIs, versions, and compatibility.

IngvarConsulting/unica · 50 tokens

api-design

Design and review guidance for 1C:Enterprise APIs, which are interfaces that let software components call each other. It covers public and internal interfaces, compatibility, versioning, and moving users to changed interfaces.

IngvarConsulting/unica · 83 tokens