Agent skill

Hexagonal Architecture

by citypaul in citypaul/.dotfiles

A skill your agent uses when the user or project explicitly adopts hexagonal (ports and adapters) architecture — a README, CLAUDE.md, or ADR that says so is the opt-in.

Custom licenceAuto-check passedDevelopment

Install Hexagonal Architecture

skills CLI
$ npx skills add citypaul/.dotfiles --skill hexagonal-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install citypaul/.dotfiles hexagonal-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/citypaul/.dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude/.claude/skills/hexagonal-architecture .claude/skills/hexagonal-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hexagonal-architecture
GitHub stars
740
Token cost
~10k tokens
SKILL.md length
3,922 words
Files
8
Skills in repo
44
Repo updated
First seen
Licence
Custom licence

At a glance

A skill your agent uses when the user or project explicitly adopts hexagonal (ports and adapters) architecture — a README, CLAUDE.md, or ADR that says so is the opt-in.

  • Works in 5 steps: Put the business rule (time windows,… → Declare the ports the use case needs as… → Write one adapter per driven port that… → …
  • Project explicitly adopts hexagonal (ports and adapters) architecture — a README
  • SKILL.md covers Before You Write Code, Core Concept, Ports = Public Contracts and Adapters = Implementations, plus 7 more sections
  • Needs STRIPE_KEY

What it does

Hexagonal Architecture is an agent skill from citypaul/.dotfiles. Use when the user or project explicitly adopts hexagonal (ports and adapters) architecture — a README, CLAUDE.md, or ADR that says so is the opt-in. Once a project has opted in, load this for every code change in it, not only architecture work — a new feature, a transport or SDK swap, a bug fix, or a small business-rule change to a function that still calls an SDK directly; load it alongside tdd, never instead of it, and follow its Before You Write Code section before editing. Implements TypeScript ports…

Its SKILL.md is about 10k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files (for example `resources/cqrs-lite.md`, `resources/cross-cutting-concerns.md` and `resources/greenfield-sequence.md`).

It sits in Development, covering Debugging, Architecture decision records and Test-driven development. It works with TypeScript.

When your agent uses it

  • Project explicitly adopts hexagonal (ports and adapters) architecture — a README
  • ADR that says so is the opt-in

Example prompts

  • “/hexagonal-architecture”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Put the business rule (time windows, filters, who is addressed, subject lines and message text, truncation) in a pure inside function that…
  2. Declare the ports the use case needs as exported interfaces inside, beside the use case: driven ports as role nouns (OrderRepository…
  3. Write one adapter per driven port that imports the SDK and translates its shapes to the port's types, and a driving adapter (route, CLI…
  4. Wire SDK client → adapter → use case in the composition root only (src/index.ts, main.ts, or composition/). The root keeps taking SDK…
  5. Test the use case through its driving port with hand-written in-memory fakes of the driven ports; test each adapter against the SDK…

What it can do on your machine

Read from SKILL.md and the folder at commit cd4028d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.stripe.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • STRIPE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hexagonal Architecture loads about 10k tokens when it runs. Until then it costs about 185 tokens; SKILL.md has 3,922 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~185
When it runs · the whole SKILL.md, loaded when a task matches
~10k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 3,922 words (~10,261 tokens).

“This skill applies only to projects that have opted in to hexagonal architecture. Do not apply these patterns to projects that use a different architecture. For introducing hex arch into an existing codebase incrementally, see resources/incremental-adoption.md.”

— opening of SKILL.md by citypaul, Custom licence
name
hexagonal-architecture

Read the full SKILL.md on GitHub

Files

SKILL.md and 7 other files in claude/.claude/skills/hexagonal-architecture of citypaul/.dotfiles.

  • SKILL.md
  • resources/cqrs-lite.md
  • resources/cross-cutting-concerns.md
  • resources/greenfield-sequence.md
  • resources/incremental-adoption.md
  • resources/references.md
  • resources/testing-hex-arch.md
  • resources/worked-example.md

Open the folder on GitHubat commit cd4028d

Compare with similar skills

Hexagonal Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hexagonal Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hexagonal Architecture this skillcitypaul/.dotfiles740—~10kAutomated safety check: PassCustom licence
Development Workflowrunceel/ReactiveProperty944—~1.4kAutomated safety check: PassMIT
Optimizeopenplayerjs/openplayerjs649—~1.9kAutomated safety check: PassMIT
Leon Coding Agentleon-ai/leon18k—~1.1kAutomated safety check: PassMIT
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
Rememberantonio-orionus/Arroxy391—~571Automated safety check: PassMIT

Similar skills

  • Development Workflow

    runceel/ReactiveProperty

    ReactiveProperty repository development policy. An agent skill from runceel/ReactiveProperty.

    944 GitHub stars~1.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Optimize

    openplayerjs/openplayerjs

    Find and safely apply ONE worthwhile code optimization (reuse, simplification, efficiency, or a dead-weight cleanup) somewhere in packages//src, with new regression tests proving behavior is…

    649 GitHub stars~1.9k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Leon Coding Agent

    leon-ai/leon

    Has Leon's agent investigate, change and verify code in a repository with its file, search and shell tools, staying inside the scope the owner authorized.

    18k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Remember

    antonio-orionus/Arroxy

    Persists a durable Arroxy lesson — a gotcha, user preference, workflow rule, or design decision — to the right tracked file (project memory, AGENTS.md, CONTEXT.md, dev-docs, or an ADR) so any coding…

    391 GitHub stars~571 tokensUpdated today
    DevelopmentAuto-check passed
  • Workflow Authoring

    QuintinShaw/pi-dynamic-workflows

    Guidance for writing, editing, reviewing, and debugging JavaScript workflow code for pi-dynamic-workflows.

    555 GitHub stars~671 tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from citypaul/.dotfiles

All 44 skills in this repo
  • Find Skills

    citypaul/.dotfiles

    Discover and, with authorization, install agent skills from the open skills ecosystem.

    740 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Render Code Shape

    citypaul/.dotfiles

    Render the shape of code — module boundaries, the types that cross them, signatures, and a cited call graph — for code that already exists or a change about to be built.

    740 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Structure Codebase

    citypaul/.dotfiles

    Design, audit, and evolve physical source and package structures that expose real architectural boundaries while keeping related behavior together.

    740 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Test Design Reviewer

    citypaul/.dotfiles

    Review test quality using Dave Farley's eight properties of good tests.

    740 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Characterisation Tests

    citypaul/.dotfiles

    A skill your agent uses when modifying existing code that lacks tests and you need to document its actual current behavior before making changes -- the legacy code dilemma where you need tests to…

    740 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • CI Debugging

    citypaul/.dotfiles

    Systematic CI/CD failure diagnosis using hypothesis-first investigation, local reproduction, and environment delta analysis.

    740 GitHub stars~1.5k tokensUpdated today
    Auto-check: notes

Works with

Categories

Questions about Hexagonal Architecture

What does Hexagonal Architecture do?

A skill your agent uses when the user or project explicitly adopts hexagonal (ports and adapters) architecture — a README, CLAUDE.md, or ADR that says so is the opt-in. dotfiles.md, or ADR that says so is the opt-in.

When should I use Hexagonal Architecture?

Hexagonal Architecture fits situations like: project explicitly adopts hexagonal (ports and adapters) architecture — a README; ADR that says so is the opt-in.

How do I install Hexagonal Architecture in Claude Code?

Run `npx skills add citypaul/.dotfiles --skill hexagonal-architecture -a claude-code`. Or copy the skill folder (claude/.claude/skills/hexagonal-architecture in citypaul/.dotfiles) into .claude/skills/hexagonal-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Hexagonal Architecture in Codex?

Run `npx skills add citypaul/.dotfiles --skill hexagonal-architecture -a codex`. Or copy the skill folder (claude/.claude/skills/hexagonal-architecture in citypaul/.dotfiles) into .agents/skills/hexagonal-architecture in your project. Codex loads it when a task matches its description.

Can I use Hexagonal Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add citypaul/.dotfiles --skill hexagonal-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hexagonal-architecture, .gemini/skills/hexagonal-architecture, .github/skills/hexagonal-architecture and .opencode/skills/hexagonal-architecture in your project.

What does Hexagonal Architecture need to run?

Going by SKILL.md and its folder, Hexagonal Architecture needs credentials named STRIPE_KEY.

Does Hexagonal Architecture access the network?

SKILL.md names 1 domain. As links in the text: docs.stripe.com. This is read from the text; nothing was executed.

Is Hexagonal Architecture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hexagonal Architecture use?

Hexagonal Architecture has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Hexagonal Architecture use?

About 10k tokens (SKILL.md is roughly 41k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hexagonal Architecture?

Skills that share tags, products or a category with Hexagonal Architecture: Development Workflow (runceel/ReactiveProperty, 944 stars), Optimize (openplayerjs/openplayerjs, 649 stars), Leon Coding Agent (leon-ai/leon, 18k stars) and Dbg (theodo-group/debug-that, 158 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hexagonal Architecture?

citypaul (a GitHub user) maintains it in citypaul/.dotfiles, which has 740 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 9, 2026.

Source: citypaul/.dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.