check-aggregate-consistency
Installation
SKILL.md
Aggregate Consistency Audit
Analyze PHP code for DDD aggregate design compliance — ensuring proper boundaries, invariant enforcement, and transactional consistency.
Detection Patterns
1. Cross-Aggregate Transaction
// CRITICAL: Multiple aggregates modified in single transaction
class TransferUseCase
{
public function execute(TransferCommand $command): void
{
$this->entityManager->beginTransaction();
try {
$source = $this->accountRepo->find($command->sourceId());
$target = $this->accountRepo->find($command->targetId());