ddd-knowledge
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "ddd-knowledge":https://skillpi.com/zh/skills/deepskill-6c634d157710180ee5d3371d8b8f0977e6d34b948cb6f96af5a365bd0df58b20。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
DDD(领域驱动设计)知识库。提供用于领域驱动设计审计的设计模式与反模式,并包含面向 PHP 的实践指南,帮助评估领域模型、聚合、边界与领域事件等实现情况。
介绍来源: third_party · dykyi-roman · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
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 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 implementations
Assets
assets/report-template.md— Structured audit report template
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供完整的 DDD 架构知识体系,包含核心原则、检查清单和违规检测表
- 针对 PHP 开发者提供具体实现指南和代码示例
- 适用于代码审计、架构评审等实际开发场景
亮点
- 触发词精准覆盖 DDD 架构、领域驱动设计审计、PHP 特定指南等核心场景
- description 内容完整且位置正确,边界清晰
待提升项
-
缺少 When to Use 章节 原报告严重程度:轻微
文档结构完整但缺少明确的 When to Use 使用场景说明章节
改进建议:建议添加 When to Use 章节,明确说明在什么场景下使用此知识库
亮点
- 文档结构清晰,包含核心原则、检查清单、违规参考、代码示例等多个完整模块
- 提供端到端的 PHP 代码示例,便于开发者直接参考使用
亮点
- 代码示例语法正确,基于 PHP 8.4 标准,参数使用合理
- Value Object 示例中包含异常处理,覆盖主要错误场景
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。