Help us improve
Share bugs, ideas, or general feedback.
From acc
Provides DDD patterns, antipatterns, checklists, and PHP guidelines for auditing Domain-Driven Design architecture.
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin accHow this skill is triggered — by the user, by Claude, or both
Slash command
/acc:ddd-knowledgeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Quick reference for DDD architecture patterns and PHP implementation guidelines.
Provides patterns, antipatterns, and PHP-specific guidelines for auditing traditional N-tier/Layered Architecture in PHP apps.
Applies DDD tactical patterns to domain code: enforces aggregate design, value objects over primitives, entity identity rules, and bounded context boundaries for domain modeling.
Implements Clean Architecture layers, SOLID principles, dependency injection, DDD, hexagonal architecture, and code quality patterns. Use for new service design or refactoring legacy code.
Share bugs, ideas, or general feedback.
Quick reference for DDD architecture patterns and PHP implementation guidelines.
Presentation → Application → Domain ← Infrastructure
↓
Domain (center)
Rule: Dependencies point INWARD. Domain has ZERO external dependencies.
| Layer | Contains | Depends On |
|---|---|---|
| Domain | Entities, Value Objects, Aggregates, Domain Services, Repository Interfaces, Domain Events | Nothing |
| Application | Use Cases, DTOs, Application Services | Domain |
| Infrastructure | Repository Implementations, External APIs, DB, Cache, Queue | Domain, Application |
| Presentation | Controllers, Actions, Request/Response, CLI | Application |
public function set*() methods| Violation | Where to Look | Severity |
|---|---|---|
use Doctrine\\ in Domain | Domain/*.php | Critical |
use Illuminate\\ in Domain | Domain/*.php | Critical |
use Infrastructure\\ in Domain | Domain/*.php | Critical |
| Only getters/setters in Entity | Domain/Entity/*.php | Warning |
=== 'pending' magic strings | Any PHP file | Warning |
public function set*() | Domain/Entity/*.php | Warning |
| Business logic in Controller | Presentation/*.php | Warning |
| Business logic in Repository | Infrastructure/*.php | Warning |
final readonly class Email
{
public function __construct(
public string $value
) {
if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
throw new InvalidArgumentException('Invalid email');
}
}
public function equals(self $other): bool
{
return $this->value === $other->value;
}
}
final class Order
{
private OrderStatus $status;
public function __construct(
private readonly OrderId $id,
private readonly CustomerId $customerId
) {
$this->status = OrderStatus::Pending;
}
public function confirm(): void
{
if (!$this->status->canTransitionTo(OrderStatus::Confirmed)) {
throw new DomainException('Cannot confirm order');
}
$this->status = OrderStatus::Confirmed;
}
}
// Domain/Repository/OrderRepositoryInterface.php
interface OrderRepositoryInterface
{
public function findById(OrderId $id): ?Order;
public function save(Order $order): void;
}
For detailed information, load these reference files:
references/layer-architecture.md — Detailed layer rules and boundariesreferences/domain-patterns.md — Entity, VO, Aggregate, Repository patternsreferences/application-patterns.md — UseCase, DTO, Command/Query patternsreferences/antipatterns.md — Common violations with detection patternsreferences/php-specific.md — PHP 8.4 specific implementationsassets/report-template.md — Structured audit report template