value-objects-and-dtos — Claude Code skill: what it does
This skill guides Symfony work with immutable Value Objects and DTOs, covering constructor validation, value equality, and data crossing application boundaries.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a claude-codeWhat value-objects-and-dtos does
Use a Value Object for a domain concept with its own rules, and a DTO when data crosses an application boundary. The skill calls for readonly classes that validate in their constructors, compare Value Objects by value, and return new instances from operations. Setters are out.
For Doctrine, it prescribes embeddables. Input DTOs carry validation constraints; output DTOs use serializer attributes. The guidance also says to keep entities out of direct API input and output, and to represent money as an integer in minor units rather than a float. That integer representation is a constraint to preserve in the implementation. The expected result includes DTOs, mappings to and from entities, and unit tests for invariants.
Install it in Claude Code with npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a claude-code. The installed skill file is at ~/.claude/skills/value-objects-and-dtos/SKILL.md; reference.md provides further implementation detail.
What it helps with
- model a domain concept as a Value Object with enforced invariants
- transfer request or API data through DTOs
- validate class invariants during construction
- embed a value object in a Doctrine entity
- map input and output DTOs to entities
Example prompts for the agent
- Create an immutable Value Object for an address, validate it in the constructor, and test its invariants.
- Split this API's input and output DTOs, then map them to and from the entities.
- Model money as a Value Object and store its amount as an integer in minor units.
How to install value-objects-and-dtos
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a claude-code2Manually: put the files in place
~/.claude/skills/value-objects-and-dtos/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/value-objects-and-dtos/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a codex2Manually: put the files in place
.agents/skills/value-objects-and-dtos/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a cursor2Manually: put the files in place
.cursor/skills/value-objects-and-dtos/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/value-objects-and-dtos2Manually: put the files in place
.github/skills/value-objects-and-dtos/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/value-objects-and-dtosManually: put the files in place
.devin/skills/value-objects-and-dtos/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about value-objects-and-dtos
How do I install value-objects-and-dtos in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill value-objects-and-dtos -a claude-code. The skill file is at ~/.claude/skills/value-objects-and-dtos/SKILL.md.
What does value-objects-and-dtos do?
It guides Symfony implementations of immutable Value Objects and DTOs, including validation and the separation of incoming and outgoing data.
How should money be represented with this skill?
Use an integer count of minor units, not a float.
Source text
SKILL.md · MIT
--- 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`
© dev-toolings · MIT · dev-toolings/superpowers-symfony