/acc:create-dtofrom acc
Generates typed, immutable DTO classes for PHP 8.4 with layer-specific types (request, response, command, query, integration) including serialization methods and unit tests.
Ships in acc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate DTOs for transferring data between layers, API boundaries, and external systems.
| Type | Purpose | Location |
|---|---|---|
| Request DTO | API input validation | Presentation layer |
| Response DTO | API output formatting | Presentation layer |
| Command DTO | Use case input | Application layer |
| Query Result DTO | Read model output | Application layer |
| Integration DTO | External API data | Infrastructure layer |
Determine the purpose and layer for the DTO.
Path based on type:
src/Presentation/Api/{Context}/Request/src/Presentation/Api/{Context}/Response/src/Application/{Context}/DTO/src/Infrastructure/ExternalApi/{Service}/DTO/fromArray() — Create from raw datafromEntity() — Create from domain entity (Response DTOs)toArray() / jsonSerialize() — Serialize for outputPath: tests/Unit/{Layer}/{Context}/{Type}/
| Type | Path |
|---|---|
| Request DTO | src/Presentation/Api/{Context}/Request/ |
| Response DTO | src/Presentation/Api/{Context}/Response/ |
| Application DTO | src/Application/{Context}/DTO/ |
| Integration DTO | src/Infrastructure/ExternalApi/{Service}/DTO/ |
| Unit Tests | tests/Unit/{Layer}/{Context}/{Type}/ |
| Type | Pattern | Example |
|---|---|---|
| Request | {Action}{Entity}Request | CreateOrderRequest, UpdateUserRequest |
| Response | {Entity}Response | OrderResponse, UserResponse |
| Collection | {Entity}CollectionResponse | OrderCollectionResponse |
| Application | {Entity}DTO | UserDTO, OrderDTO |
| Integration | {Service}{Action}Response | PaymentGatewayResponse |
final readonly class {Name}Request
{
public function __construct(
#[Assert\NotBlank]
public string $field,
#[Assert\Valid]
public ?NestedRequest $nested = null
) {}
public static function fromArray(array $data): self;
}
final readonly class {Name}Response implements \JsonSerializable
{
public function __construct(
public string $id,
public string $name,
/** @var array<ItemResponse> */
public array $items = []
) {}
public static function fromEntity({Entity} $entity): self;
public function jsonSerialize(): array;
}
final readonly class {Name}DTO
{
public function __construct(
public string $id,
public string $field
) {}
public static function fromRequest({Name}Request $request): self;
public function toArray(): array;
}
| Anti-pattern | Problem | Solution |
|---|---|---|
| Business Logic | DTO with calculations | Keep DTOs data-only |
| Mutable DTO | setters, state changes | Use readonly, immutable |
| Domain Objects | Returning entities from API | Map to Response DTO |
| Anemic Validation | No input validation | Use Assert attributes |
| Deep Nesting | Complex nested DTOs | Flatten or split |
| Missing Serialization | No JSON support | Implement JsonSerializable |
For complete PHP templates and examples, see:
references/templates.md — Request, Response, Application, Collection, Integration DTO templatesreferences/examples.md — Order, User, Payment examples and testsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc283 skills in this plugin
/access-control-knowledgeAccess Control knowledge base. Provides ACL, RBAC, ABAC, ReBAC models, multi-tenancy patterns, and PHP implementations (Symfony Voters, Laravel Gates) for security audits and generation./adr-knowledgeAction-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits./adr-templateGenerates Architecture Decision Records (ADR) for PHP projects. Creates structured decision documentation with context, decision, and consequences./analyze-ci-configAnalyzes existing CI/CD configurations. Detects issues in GitHub Actions and GitLab CI files, checks for best practices, caching efficiency, and security concerns./analyze-ci-logsAnalyzes CI/CD pipeline logs to identify failure causes. Parses error messages, detects common failure patterns, and provides fix recommendations./analyze-coupling-cohesionAnalyzes coupling and cohesion metrics in PHP codebases. Calculates Afferent/Efferent coupling (Ca/Ce), LCOM metrics, instability index, and abstractness. Identifies highly coupled modules and low cohesion classes.Other plugins' skills for the same job