ddd-knowledge

DDD (Domain-Driven Design) knowledge base. Provides design patterns and anti-patterns for auditing domain-driven design, including PHP-oriented practical guidance to help assess implementations of domain models, aggregates, boundaries, and domain events.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "ddd-knowledge" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-6c634d157710180ee5d3371d8b8f0977e6d34b948cb6f96af5a365bd0df58b20. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

DDD (Domain-Driven Design) knowledge base. Provides design patterns and anti-patterns for auditing domain-driven design, including PHP-oriented practical guidance to help assess implementations of domain models, aggregates, boundaries, and domain events.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

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

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 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.4 DDD Patterns

Value Object

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

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

// 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.4 specific implementations

Assets

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

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供完整的 DDD 架构知识体系,包含核心原则、检查清单和违规检测表
  • 针对 PHP 开发者提供具体实现指南和代码示例
  • 适用于代码审计、架构评审等实际开发场景
Trigger Precision85/100

Highlights

  • 触发词精准覆盖 DDD 架构、领域驱动设计审计、PHP 特定指南等核心场景
  • description 内容完整且位置正确,边界清晰
Structure and Standards92/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档结构完整但缺少明确的 When to Use 使用场景说明章节

    Recommendation: 建议添加 When to Use 章节,明确说明在什么场景下使用此知识库

Highlights

  • 文档结构清晰,包含核心原则、检查清单、违规参考、代码示例等多个完整模块
  • 提供端到端的 PHP 代码示例,便于开发者直接参考使用
Execution Reliability88/100

Highlights

  • 代码示例语法正确,基于 PHP 8.4 标准,参数使用合理
  • Value Object 示例中包含异常处理,覆盖主要错误场景
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.