acc-ddd-knowledge
DDD architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Domain-Driven Design audits.
Best use case
acc-ddd-knowledge is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
DDD architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Domain-Driven Design audits.
Teams using acc-ddd-knowledge should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/acc-ddd-knowledge/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How acc-ddd-knowledge Compares
| Feature / Agent | acc-ddd-knowledge | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
DDD architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Domain-Driven Design audits.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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 templateRelated Skills
adr-knowledge-base
ADR知見の体系的参照・適用。主要ADR抜粋(ADR_010, 013, 016, 019, 020, 021)・ADR検索・参照方法・技術決定パターン集・ADR作成判断基準。Phase C以降の技術決定時に使用。
add-knowledge
Add notes and learnings to Tim's work knowledge base at Spotify from any Claude Code session
acc-testing-knowledge
Testing knowledge base for PHP 8.5 projects. Provides testing pyramid, AAA pattern, naming conventions, isolation principles, DDD testing guidelines, and PHPUnit patterns.
acc-stability-patterns-knowledge
Stability Patterns knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Circuit Breaker, Retry, Rate Limiter, Bulkhead, and resilience audits.
acc-solid-knowledge
SOLID principles knowledge base for PHP 8.5 projects. Provides quick reference for SRP, OCP, LSP, ISP, DIP with detection patterns, PHP examples, and antipattern identification. Use for architecture audits and code quality reviews.
acc-saga-pattern-knowledge
Saga Pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for saga orchestration, choreography, and distributed transaction audits.
acc-psr-overview-knowledge
PHP Standards Recommendations (PSR) overview knowledge base. Provides comprehensive reference for all accepted PSRs including PSR-1,3,4,6,7,11,12,13,14,15,16,17,18,20. Use for PSR selection decisions and compliance audits.
acc-psr-coding-style-knowledge
PSR-1 and PSR-12 coding standards knowledge base for PHP 8.5 projects. Provides quick reference for basic coding standard and extended coding style with detection patterns, examples, and antipattern identification. Use for code style audits and compliance reviews.
acc-psr-autoloading-knowledge
PSR-4 autoloading standard knowledge base for PHP 8.5 projects. Provides quick reference for namespace-to-path mapping, composer.json configuration, directory structure, and common mistakes. Use for autoloading audits and project structure reviews.
acc-outbox-pattern-knowledge
Outbox Pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for transactional outbox, polling publisher, and reliable messaging audits.
acc-layer-arch-knowledge
Layered Architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for traditional N-tier/Layered Architecture audits.
acc-hexagonal-knowledge
Hexagonal Architecture (Ports & Adapters) knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Hexagonal Architecture audits.