/acc:hexagonal-knowledgefrom acc
Provides Hexagonal Architecture (Ports & Adapters) patterns, antipatterns, and PHP-specific guidelines for architecture audits.
Ships in acc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Quick reference for Hexagonal Architecture (Ports & Adapters) patterns and PHP implementation guidelines.
┌─────────────────────────────┐
│ PRIMARY ACTORS │
│ (Users, External Apps) │
└──────────────┬──────────────┘
│
┌──────────────▼──────────────┐
│ DRIVING ADAPTERS │
│ (Controllers, CLI, GUI, │
│ Message Consumers) │
└──────────────┬──────────────┘
│
┌─────────────────────────▼─────────────────────────┐
│ DRIVING PORTS │
│ (Input Interfaces) │
└─────────────────────────┬─────────────────────────┘
│
┌─────────────────────────▼─────────────────────────┐
│ │
│ APPLICATION CORE │
│ ┌─────────────────────────────────┐ │
│ │ APPLICATION LAYER │ │
│ │ (Use Cases, Services) │ │
│ └─────────────────┬───────────────┘ │
│ │ │
│ ┌─────────────────▼───────────────┐ │
│ │ DOMAIN LAYER │ │
│ │ (Entities, Value Objects, │ │
│ │ Domain Services) │ │
│ └─────────────────────────────────┘ │
│ │
└─────────────────────────┬─────────────────────────┘
│
┌─────────────────────────▼─────────────────────────┐
│ DRIVEN PORTS │
│ (Output Interfaces) │
└─────────────────────────┬─────────────────────────┘
│
┌──────────────▼──────────────┐
│ DRIVEN ADAPTERS │
│ (Repositories, External │
│ APIs, Message Publishers) │
└──────────────┬──────────────┘
│
┌──────────────▼──────────────┐
│ SECONDARY ACTORS │
│ (Database, External APIs, │
│ Message Queues) │
└─────────────────────────────┘
Core Rule: Application Core defines Ports. Adapters implement or use them.
| Concept | Description | Location |
|---|---|---|
| Port | Interface defining how to interact with the core | Application/Domain |
| Driving Port | Input interface (how to use the application) | Application layer |
| Driven Port | Output interface (what the application needs) | Application/Domain |
| Driving Adapter | Implements input mechanism (HTTP, CLI) | Infrastructure |
| Driven Adapter | Implements external dependencies | Infrastructure |
| Application Core | Business logic, isolated from I/O | Domain + Application |
| Violation | Where to Look | Severity |
|---|---|---|
| Core depends on adapter | Domain importing Infrastructure | Critical |
| Missing port abstraction | Direct external service call | Critical |
| Business logic in adapter | if/switch in adapter | Critical |
| Framework in core | Symfony/Laravel in Domain | Warning |
| Port with implementation details | Interface using DB types | Warning |
| Adapter without port | Controller calling repository directly | Warning |
<?php
declare(strict_types=1);
namespace Application\Order\Port\Input;
use Application\Order\DTO\CreateOrderRequest;
use Application\Order\DTO\CreateOrderResponse;
interface CreateOrderUseCaseInterface
{
public function execute(CreateOrderRequest $request): CreateOrderResponse;
}
<?php
declare(strict_types=1);
namespace Domain\Order\Port\Output;
use Domain\Order\Entity\Order;
use Domain\Order\ValueObject\OrderId;
interface OrderRepositoryInterface
{
public function findById(OrderId $id): ?Order;
public function save(Order $order): void;
public function nextIdentity(): OrderId;
}
<?php
declare(strict_types=1);
namespace Infrastructure\Http\Controller;
use Application\Order\Port\Input\CreateOrderUseCaseInterface;
use Application\Order\DTO\CreateOrderRequest;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
final readonly class CreateOrderController
{
public function __construct(
private CreateOrderUseCaseInterface $createOrder
) {}
public function __invoke(Request $request): JsonResponse
{
$dto = CreateOrderRequest::fromArray($request->toArray());
$response = $this->createOrder->execute($dto);
return new JsonResponse($response->toArray(), 201);
}
}
<?php
declare(strict_types=1);
namespace Infrastructure\Persistence\Doctrine;
use Domain\Order\Entity\Order;
use Domain\Order\Port\Output\OrderRepositoryInterface;
use Domain\Order\ValueObject\OrderId;
use Doctrine\ORM\EntityManagerInterface;
final readonly class DoctrineOrderRepository implements OrderRepositoryInterface
{
public function __construct(
private EntityManagerInterface $em
) {}
public function findById(OrderId $id): ?Order
{
return $this->em->find(Order::class, $id->value);
}
public function save(Order $order): void
{
$this->em->persist($order);
$this->em->flush();
}
public function nextIdentity(): OrderId
{
return OrderId::generate();
}
}
For detailed information, load these reference files:
references/ports-patterns.md — Driving and Driven Port patternsreferences/adapters-patterns.md — Adapter implementation patternsreferences/testing-patterns.md — Testing strategies for hexagonal architecturereferences/antipatterns.md — Common violations with detection patternsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc283 skills in this plugin
/access-control-knowledgeAccess Control knowledge base. Provides ACL, RBAC, ABAC, ReBAC models, multi-tenancy patterns, and PHP implementations (Symfony Voters, Laravel Gates) for security audits and generation./adr-knowledgeAction-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits./adr-templateGenerates Architecture Decision Records (ADR) for PHP projects. Creates structured decision documentation with context, decision, and consequences./analyze-ci-configAnalyzes existing CI/CD configurations. Detects issues in GitHub Actions and GitLab CI files, checks for best practices, caching efficiency, and security concerns./analyze-ci-logsAnalyzes CI/CD pipeline logs to identify failure causes. Parses error messages, detects common failure patterns, and provides fix recommendations./analyze-coupling-cohesionAnalyzes coupling and cohesion metrics in PHP codebases. Calculates Afferent/Efferent coupling (Ca/Ce), LCOM metrics, instability index, and abstractness. Identifies highly coupled modules and low cohesion classes.Other plugins' skills for the same job