Skip to content
Development
Skill

/ports-and-adapters

Implement Hexagonal Architecture (Ports and Adapters) in Symfony; separate domain logic from infrastructure with clear boundaries

From plugin
superpowers-symfony
22744 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill ports-and-adapters --agent claude-code

SKILL.md

ports-and-adapters.SKILL.md
name: ports-and-adapters
description: Implement Hexagonal Architecture (Ports and Adapters) in Symfony; separate domain logic from infrastructure with clear boundaries
capabilities: [read, search]
tags: [architecture]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep

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`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

22744 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
227
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react3d252k
@facebook@facebookInstall Skill

Questions about ports-and-adapters.

Which coding agents can use ports-and-adapters?
ports-and-adapters installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.