home / skills / makfly / superpowers-symfony / value-objects-and-dtos

value-objects-and-dtos skill

/skills/value-objects-and-dtos

This skill helps refine Symfony value objects and dtos architecture with checkpointed execution and auditable decisions to manage complexity.

npx playbooks add skill makfly/superpowers-symfony --skill value-objects-and-dtos

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.1 KB
---

name: symfony:value-objects-and-dtos
allowed-tools:
  - Read
  - Glob
  - Grep
description: Apply production-grade Symfony architecture and execution workflows with controlled scope and clear checkpoints. Use for value objects and dtos tasks.
---

# Value Objects And Dtos (Symfony)

## Use when
- Refining architecture/workflows/context handling in Symfony projects.
- Planning and executing medium/complex changes safely.

## Default workflow
1. Establish current boundaries, constraints, and coupling points.
2. Propose smallest coherent architectural adjustment.
2. Execute in checkpoints with validation at each stage.
2. Summarize tradeoffs and follow-up backlog.

## Guardrails
- Use existing project patterns by default.
- Avoid broad refactors without explicit need.
- Keep decision log clear and auditable.

## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.

## Output contract
- Architecture/workflow changes.
- Checkpoint validation outcomes.
- Residual risks and next steps.

## References
- `reference.md`
- `docs/complexity-tiers.md`

Overview

This skill applies production-grade Symfony architecture and execution workflows focused on value objects and DTOs. It provides a controlled, incremental approach with clear checkpoints, validation, and an auditable decision log. Use it to reduce coupling, improve data integrity, and manage medium-to-complex changes safely.

How this skill works

I start by mapping current boundaries, constraints, and coupling points that affect value objects and DTOs. I propose the smallest coherent architectural adjustment needed, then execute changes in iterative checkpoints with validation at each stage. At the end I summarize tradeoffs, residual risks, and a prioritized follow-up backlog.

When to use it

  • When refining data modeling and immutability rules for domain value objects.
  • When introducing or standardizing DTOs for API input/output and service boundaries.
  • When planning medium or complex changes that risk cross-cutting coupling.
  • When you need auditable checkpoints and rollback-safe execution.
  • When the project lacks consistent patterns for mapping, validation, or lifecycle of DTOs/value objects.

Best practices

  • Prefer existing project patterns and extend them minimally rather than broad rewrites.
  • Isolate changes behind clear interfaces and mapping layers to limit blast radius.
  • Execute in small checkpoints and validate with unit and integration tests at each step.
  • Keep a concise decision log recording rationale, alternatives, and tradeoffs.
  • Document residual risks and convert them into a prioritized follow-up backlog.

Example use cases

  • Introduce immutable value objects for monetary amounts and replace ad-hoc arrays across services.
  • Create a standardized DTO layer for a public API release, including versioned mappers and validators.
  • Refactor a service boundary to accept DTOs instead of domain entities to reduce coupling.
  • Add incremental validation and mapping tests while keeping production behavior unchanged until final cutover.

FAQ

How large should each checkpoint be?

Keep checkpoints small enough to validate with targeted tests and roll back quickly—typically a single service or mapping surface per checkpoint.

When is a broad refactor acceptable?

Only when the cost of continued incremental work exceeds the disruption of a coordinated refactor and stakeholders approve a higher-risk, higher-impact plan.