ports-and-adapters

ports-and-adapters is a skill for Claude Code from dev-toolings/superpowers-symfony. It costs 26 tokens per session (366 once invoked), scanned A, a copy of brainstorming, MIT.

A Symfony architecture guide based on Ports and Adapters, also called Hexagonal Architecture. It keeps business rules separate from databases, web requests, and other outside systems.

In plain words
What is it for?
Use it to plan and implement medium or complex Symfony architecture and workflow changes while preserving clear boundaries and recording risks and follow-up work.
Why use it?
It reduces coupling, so changes to infrastructure are less likely to disturb core business logic. It also provides checkpoints and decision records for complex changes.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the superpowers-symfony plugin — 44 skills, 13 commands, 7 agents, 1 hook shipped together

Good fit Use it to plan and implement medium or complex Symfony architecture and workflow changes while preserving clear boundaries and recording risks and follow-up work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dev-toolings/superpowers-symfony/ports-and-adapters
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 dev-toolings/superpowers-symfony --skill ports-and-adapters
Clone the repo
git clone --depth 1 https://github.com/dev-toolings/superpowers-symfony

Made for: Claude Code.

Or install superpowers-symfony, the plugin that ships this one along with the rest of its 44 skills, 13 commands, 7 agents, 1 hook.

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 ports-and-adapters

README.md
[![agentmods](https://agentmods.dev/badge/skills/dev-toolings/superpowers-symfony/ports-and-adapters/github.svg)](https://agentmods.dev/skills/dev-toolings/superpowers-symfony/ports-and-adapters)
Your own site
<a href="https://agentmods.dev/skills/dev-toolings/superpowers-symfony/ports-and-adapters"><img src="https://agentmods.dev/badge/skills/dev-toolings/superpowers-symfony/ports-and-adapters/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 ports-and-adapters

Your own site · 80×15
<a href="https://agentmods.dev/skills/dev-toolings/superpowers-symfony/ports-and-adapters"><img src="https://agentmods.dev/badge/skills/dev-toolings/superpowers-symfony/ports-and-adapters.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 366 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 80% copy Near-identical to another mod 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.00026 $0.00366
Opus 5.5 $0.00010 $0.00146
Sonnet 5.5 $0.00005 $0.00073
Haiku 4.5 $0.00003 $0.00037

Measured 23d ago against content hash 85fb7c609d44, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ports-and-adapters 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 23d 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.

Origin

This is a copy

80% identical to brainstorming — 40 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

content/skills/ports-and-adapters/SKILL.md · 44 lines

What it actually says

Ports And Adapters (Symfony)

Use when

  • Domain rules must not depend on Doctrine, HTTP, or a vendor SDK.
  • An infrastructure dependency (storage, payment, mail provider) must be swappable or faked.
  • Structuring a bounded context into Domain, Application and Infrastructure layers.

Default workflow

  1. Model the domain in plain PHP: entities and value objects without ORM attributes.
  2. Declare ports as interfaces inside the domain, such as a repository interface.
  3. Write use cases in the application layer as commands and handlers that depend only on ports.
  4. Implement adapters in infrastructure (Doctrine repository, API client) and map entities outside the domain, with XML mapping.
  5. Bind each port to its adapter in the service configuration; controllers live in infrastructure.

Guardrails

  • Nothing under src/Domain/ imports Symfony, Doctrine or vendor SDK classes.
  • Dependencies point inward: infrastructure knows the domain, never the reverse.
  • Do not add the layers to a CRUD module with no business rules.
  • Test the domain with plain unit tests and the adapters with integration tests.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • The layer layout and the port interfaces.
  • The adapters and their service bindings.
  • Domain unit tests that boot no kernel.

References

  • reference.md
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. 23d ago Changed · +2 lines 85fb7c609d44
  2. 1mo ago Changed · +2 lines · -3 tokens per session 3b02a65d6049
  3. 1mo ago First seen · 40 lines · 29 tokens per session scan A bb4564ec32f3

Subscribe to this mod's changes

ports-and-adapters is a skill published in the GitHub repository dev-toolings/superpowers-symfony (227 stars, last pushed 23d ago), licensed MIT. It adds 26 tokens to every session and 366 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 80% identical to brainstorming, differing in 40 lines, and is treated as a copy.

Related

Other skills, from other repositories

architecture-paradigm-cqrs-es

Applies CQRS and Event Sourcing for read/write separation and audit trails. Use when designing systems with complex domain logic or full state-change history.

athola/claude-night-market · 39 tokens

spine-design

Produce a system design doc — components, data flow, decisions made, tradeoffs, failure modes. Not a list of options. An actual design with calls made. Use when asked for "system design for", "architect this", "how should we build", or "design the backend".

tonone-ai/tonone · 62 tokens

warden-harden

Produce a hardening spec and implement it — auth patterns, security headers, rate limiting, input validation, secrets management, dependency hygiene. Use when asked to "harden this", "add security to this service", "what security do I need", or "secure this before launch".

tonone-ai/tonone · 61 tokens

cortex-integrate

Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate. Use when asked to "add AI to this", "LLM integration", "add Claude/GPT", or "AI-powered feature".

tonone-ai/tonone · 58 tokens

spine-api

Design and spec an API — endpoints, request/response shapes, error codes, auth pattern, pagination. Applies Stripe's consistency principles. Use when asked to "design an API", "build API endpoints", "create REST API", or "API for this feature".

tonone-ai/tonone · 57 tokens

backend-cqrs-patterns

Use this skill when the user says 'CQRS', 'command query segregation', 'separate read write model', 'command model', 'query model', 'read model', 'write model', 'materialized view', 'command handler', 'query handler'. This skill enforces: strict command/query separation, write model optimized for consistency, read…

j4flmao/agent-skills · 125 tokens