Skip to content
Development
Skill

/value-objects-and-dtos

Design Value Objects for domain concepts and DTOs for data transfer with proper immutability (readonly) and validation

From plugin
superpowers-symfony
23344 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos --agent claude-code

SKILL.md

value-objects-and-dtos.SKILL.md
name: value-objects-and-dtos
description: Design Value Objects for domain concepts and DTOs for data transfer with proper immutability (readonly) and validation
capabilities: [read, search]
tags: [architecture]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep

Value Objects And Dtos (Symfony)

Use when

  • A domain concept with rules of its own (money, email, address) travels as raw scalars.
  • Data crosses a boundary: request input, API output, message payload.
  • Storing a value object inside a Doctrine entity.

Default workflow

1. Decide: a value object for a domain concept with invariants, a DTO for data crossing a boundary. 2. Make it `readonly`, validate in the constructor, and fail fast. 3. Give value objects equality by value and operations that return new instances. 4. Persist value objects as Doctrine embeddables. 5. Keep input DTOs (validation constraints) apart from output DTOs (serializer attributes).

Guardrails

  • No setters and no mutation: a change returns a new instance.
  • DTOs carry data only, with no behavior.
  • Never expose entities directly as API input or output.
  • Store money as an integer in minor units, never as a float.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • Value objects with their invariants and equality.
  • Input and output DTOs, and their mapping to and from entities.
  • Unit tests for each invariant.

References

  • `reference.md`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

23344 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
233
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about value-objects-and-dtos.

Which coding agents can use value-objects-and-dtos?
value-objects-and-dtos installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.