/acc:clean-arch-knowledgefrom acc
Provides Clean Architecture and Hexagonal Architecture 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 Clean Architecture / Hexagonal Architecture patterns and PHP implementation guidelines.
┌────────────────────────────────────────────────────────────────┐
│ FRAMEWORKS & DRIVERS │
│ (Web, UI, DB, External Services, Devices) │
├────────────────────────────────────────────────────────────────┤
│ INTERFACE ADAPTERS │
│ (Controllers, Gateways, Presenters, Repositories) │
├────────────────────────────────────────────────────────────────┤
│ APPLICATION BUSINESS RULES │
│ (Use Cases, Application Services) │
├────────────────────────────────────────────────────────────────┤
│ ENTERPRISE BUSINESS RULES │
│ (Entities, Value Objects, Domain Services) │
└────────────────────────────────────────────────────────────────┘
▲
│
Dependencies point INWARD only
Rule: Source code dependencies must point INWARD. Inner layers know nothing about outer layers.
┌─────────────────┐
│ Primary │
│ Adapters │
│ (Controllers) │
└────────┬────────┘
│
▼
┌─────────────────┐
┌──────────►│ PORTS │◄──────────┐
│ │ (Interfaces) │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ APPLICATION │ │
│ │ (Use Cases) │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ DOMAIN │ │
│ │ (Entities) │ │
│ └─────────────────┘ │
│ │
│ ┌─────────────────┐ │
└───────────│ Secondary │───────────┘
│ Adapters │
│ (Repositories, │
│ External APIs) │
└─────────────────┘
Rule: Application core defines Ports (interfaces). Adapters implement them.
| Violation | Where to Look | Severity |
|---|---|---|
| Inner layer imports outer | Domain/Application importing Infrastructure | Critical |
| Framework in core | Doctrine/Symfony in Domain | Critical |
| Use Case with HTTP details | Request/Response in Application | Critical |
| Business logic in Controller | if/switch on domain state | Warning |
| Missing Port | Direct external service call | Warning |
| Adapter with logic | Repository doing validation | Warning |
// Application layer - defines the contract
namespace Application\Order\Port;
interface PaymentGatewayInterface
{
public function charge(PaymentRequest $request): PaymentResponse;
public function refund(string $transactionId, Money $amount): RefundResponse;
}
// Infrastructure layer - implements the contract
namespace Infrastructure\Payment;
final readonly class StripePaymentGateway implements PaymentGatewayInterface
{
public function __construct(
private StripeClient $stripe
) {}
public function charge(PaymentRequest $request): PaymentResponse
{
$charge = $this->stripe->charges->create([
'amount' => $request->amount->cents(),
'currency' => $request->currency->value,
'source' => $request->token,
]);
return new PaymentResponse(
transactionId: $charge->id,
status: PaymentStatus::from($charge->status)
);
}
}
namespace Application\Order\UseCase;
final readonly class ProcessPaymentUseCase
{
public function __construct(
private OrderRepositoryInterface $orders,
private PaymentGatewayInterface $paymentGateway, // Port
private EventDispatcherInterface $events
) {}
public function execute(ProcessPaymentCommand $command): PaymentResult
{
$order = $this->orders->findById($command->orderId);
$payment = $this->paymentGateway->charge(
new PaymentRequest($order->total(), $command->paymentToken)
);
if ($payment->isSuccessful()) {
$order->markAsPaid($payment->transactionId());
$this->orders->save($order);
}
return new PaymentResult($payment->transactionId(), $payment->status());
}
}
namespace Presentation\Api\Order;
final readonly class PaymentController
{
public function __construct(
private ProcessPaymentUseCase $processPayment
) {}
public function process(Request $request): JsonResponse
{
$command = new ProcessPaymentCommand(
orderId: new OrderId($request->get('order_id')),
paymentToken: $request->get('payment_token')
);
$result = $this->processPayment->execute($command);
return new JsonResponse([
'transaction_id' => $result->transactionId,
'status' => $result->status->value,
]);
}
}
For detailed information, load these reference files:
references/dependency-rule.md — The Dependency Rule explainedreferences/layer-boundaries.md — Layer responsibilities and boundariesreferences/port-adapter-patterns.md — Hexagonal Architecture patternsreferences/antipatterns.md — Common violations with detection patternsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
283 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.npx claudepluginhub dykyi-roman/awesome-claude-code --plugin accOther plugins' skills for the same job