hexagonal-architecture
Skill0 starsChanged 23 days agoMITView on GitHub
Ports-and-adapters architecture patterns for testable, framework-independent domain logic.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- Lukk17/agent-standardstheir own version, first seen Nov 7, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
- nledford/engineering-review-boardtheir own version, first seen Nov 3, 2026
- zernie/vigilestheir own version, first seen Nov 1, 2026
- sandlada/skill-hexagonal-architecturetheir own version, first seen Oct 25, 2026
Used with
Projects with it also use domain-driven-design, improve-codebase-architecture and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
jarrodmedranoSkilldomain-driven-design
This skill should be used whenever domain modeling is taking place. It provides specialized guidance for type-driven and data-driven design based on Rich Hickey and Scott Wlaschin's principles. The skill helps contextualize current modeling within the existing domain model, identifies inconsistencies, builds ubiquitous language, and creates visualizations (Mermaid, Graphviz/DOT, ASCII diagrams) to communicate domain concepts clearly. Use this skill when designing types, modeling business domains, refactoring domain logic, or ensuring domain consistency across a codebase.
Also in 4 projects that use this
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 3 projects that use this
GoogleSkillgrill-me
A relentless interview to sharpen a plan or design.
Also in 3 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- rrezartprebreza/spring-boot-skills★ 344same name
- yamcodes/arkenv★ 151same name
- Fmarzochi/EGC★ 61same name
- fatonh/symfony-skills★ 35same name
- zernie/vigiles★ 15same name
- nledford/engineering-review-board★ 11same name
- gongyijie85/dsh-ecc★ 8same name
- kayaman/skills★ 3same name
- ankhorage/devtools★ 2same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- arch-constraint-guardSkill
- backend-patternsSkill
- clean-architectureSkill
- codebase-mappingSkill
- context-budgetSkill
- cqrsSkill
- ddd-architectureSkill
- debug-flowSkill
- dependency-auditSkill
- django-patternsSkill
- django-tddSkill
- event-driven-architectureSkill
- fd-codenavSkill
- fd-mapSkill
- frontend-patternSkill
- git-releaseSkill
- git-workflowSkill
- golang-patternsSkill
- java-patternsSkill
- layered-architectureSkill
- performance-profilingSkill
- postgres-patternsSkill
- python-patternsSkill
- refactor-guideSkill
- research-firstSkill
- rust-patternsSkill
- saga-architectureSkill
- security-scanSkill
- tdd-workflowSkill
- test-gap-detectorSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When building applications that must remain flexible to changing external systems (databases, APIs, UI frameworks) and need to support …
- Distinctive: line 14
Define inbound ports: - Create interfaces (ports) for primary/ driving actors (UI, API controllers) that trigger application logic.
- Distinctive: line 15
Define outbound ports: - Create interfaces (ports) for secondary/ driven actors (databases, external services) that the domain calls.
- Distinctive: line 16
Implement primary adapters: - Create adapters for inbound traffic (REST controllers, GraphQL resolvers, CLI commands).
- Distinctive: line 17
Implement secondary adapters: - Create adapters for outbound traffic (Postgres repositories, Redis caches, email gateways).
“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
hexagonal-architecture
When to Activate
When building applications that must remain flexible to changing external systems (databases, APIs, UI frameworks) and need to support multiple entry points (ports) for the same business logic.
Steps
- Identify the core domain - Isolate the pure business logic that makes no references to infrastructure.
- Define inbound ports - Create interfaces (ports) for primary/ driving actors (UI, API controllers) that trigger application logic.
- Define outbound ports - Create interfaces (ports) for secondary/ driven actors (databases, external services) that the domain calls.
- Implement primary adapters - Create adapters for inbound traffic (REST controllers, GraphQL resolvers, CLI commands).
- Implement secondary adapters - Create adapters for outbound traffic (Postgres repositories, Redis caches, email gateways).
- Ensure domain has no external dependencies - The domain layer should compile and run with no imports from adapters.
- Wire via dependency injection - Connect adapters to ports at application startup.
Examples
// Domain Core - Pure business logic, no infrastructure dependencies
class Transfer {
constructor(
public readonly fromAccountId: string,
public readonly toAccountId: string,
public readonly amount: number
) {}
execute(accounts: Map<string, Account>): TransferResult {
const from = accounts.get(this.fromAccountId)
const to = accounts.get(this.toAccountId)
if (!from || !to) {
return TransferResult.failed('Account not found')
}
if (!from.canDebit(this.amount)) {
return TransferResult.failed('Insufficient funds')
}
from.debit(this.amount)
to.credit(this.amount)
return TransferResult.success()
}
}
// Inbound Port (Primary Port) - Interface for driving operations
interface TransferUseCase {
execute(transfer: Transfer): TransferResult
}
// Outbound Port (Secondary Port) - Interface for driven operations
interface AccountRepository {
findById(id: string): Promise<Account | null>
save(account: Account): Promise<void>
}
interface EventBus {
publish(event: DomainEvent): Promise<void>
}
// Primary Adapter - REST API
class TransferController implements TransferUseCase {
constructor(private readonly accounts: AccountRepository) {}
async execute(transfer: Transfer): Promise<TransferResult> {
const allAccounts = await this.accounts.findById(transfer.fromAccountId)
// ... handle via injected port
}
}
// Secondary Adapter - PostgreSQL implementation
class PostgresAccountRepository implements AccountRepository {
constructor(private readonly db: Database) {}
// ... implementation
}Related Skills
- clean-architecture
- layered-architecture
- ddd-architecture
- backend-patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

