Skip to content
Back to skills

Acc Ddd Knowledge Majiayu000

ASecurity

DDD architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Domain-Driven Design audits.

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
businessphpapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill acc-ddd-knowledge-majiayu000 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Acc Ddd Knowledge Majiayu000?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Acc Ddd Knowledge Majiayu000
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-acc-ddd-knowledge-majiayu000/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-acc-ddd-knowledge-majiayu000)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: acc-ddd-knowledge
description: DDD architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Domain-Driven Design audits.
---

# DDD Knowledge Base

Quick reference for DDD architecture patterns and PHP implementation guidelines.

## Core Principles

### Layer Dependencies (Clean Architecture)

```
Presentation → Application → Domain ← Infrastructure
                    ↓
              Domain (center)
```

**Rule:** Dependencies point INWARD. Domain has ZERO external dependencies.

### Layer Responsibilities

| 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 |

## Quick Checklists

### Domain Layer Checklist

- [ ] No framework imports (Doctrine, Eloquent, Symfony)
- [ ] Entities have behavior, not just data
- [ ] Value Objects for domain concepts (Email, Money, Id)
- [ ] Repository INTERFACES defined here
- [ ] Enums for fixed value sets
- [ ] Domain Events for side effects
- [ ] No `public function set*()` methods

### Application Layer Checklist

- [ ] UseCases orchestrate, don't decide
- [ ] DTOs for input/output
- [ ] No business logic (if/switch on domain state)
- [ ] Transaction boundaries here
- [ ] No HTTP/CLI concerns

### Infrastructure Layer Checklist

- [ ] Implements Domain interfaces
- [ ] No business logic in repositories
- [ ] External service adapters
- [ ] Caching, queuing implementations

### Presentation Layer Checklist

- [ ] Validates input
- [ ] Maps to DTOs
- [ ] Calls UseCase
- [ ] Formats response
- [ ] No business logic

## Common Violations Quick Reference

| 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 |

## PHP 8.5 DDD Patterns

### Value Object

```php
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;
    }
}
```

### Entity with Behavior

```php
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;
    }
}
```

### Repository Interface

```php
// Domain/Repository/OrderRepositoryInterface.php
interface OrderRepositoryInterface
{
    public function findById(OrderId $id): ?Order;
    public function save(Order $order): void;
}
```

## References

For detailed information, load these reference files:

- `references/layer-architecture.md` — Detailed layer rules and boundaries
- `references/domain-patterns.md` — Entity, VO, Aggregate, Repository patterns
- `references/application-patterns.md` — UseCase, DTO, Command/Query patterns
- `references/antipatterns.md` — Common violations with detection patterns
- `references/php-specific.md` — PHP 8.5 specific implementations

## Assets

- `assets/report-template.md` — Structured audit report template

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.