home / skills / makfly / superpowers-symfony / api-platform-dto-resources
This skill helps you design and evolve API Platform contracts in Symfony by enforcing explicit DTO resources, mappings, and policy-safe behavior.
npx playbooks add skill makfly/superpowers-symfony --skill api-platform-dto-resourcesReview the files below or copy the command above to add this skill to your agents.
---
name: symfony:api-platform-dto-resources
allowed-tools:
- Read
- Write
- Edit
- Bash
- Glob
- Grep
description: Deliver robust API Platform contracts in Symfony with explicit operations, mapping, and policy-safe behavior. Use for api platform dto resources tasks.
---
# Api Platform Dto Resources (Symfony)
## Use when
- Designing or evolving API Platform contracts and operations.
- Aligning serialization, validation, and security behavior.
## Default workflow
1. Define operation-level contract and payload boundaries.
2. Implement resource/DTO/provider/processor changes with explicit mapping.
2. Apply operation-specific validation and security constraints.
2. Validate functional behavior across happy and negative paths.
## Guardrails
- Keep API contract explicit and version-aware.
- Avoid exposing internal entity fields implicitly.
- Prevent drift between docs and actual serialization.
## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
## Output contract
- API artifacts changed (resource/DTO/provider/processor).
- Contract/security decisions and rationale.
- Functional verification results.
## References
- `reference.md`
- `docs/complexity-tiers.md`
This skill helps deliver robust API Platform DTO-based resources in Symfony by making operation contracts, mapping, and security explicit. It focuses on clear payload boundaries, predictable serialization, and policy-safe behavior to avoid accidental data leaks. Use it to align implementation with declared API contracts and to document rationale for contract decisions.
The skill inspects API operation definitions and maps them to DTOs, resources, providers, and processors to ensure serialization and validation match the declared contract. It enforces operation-specific validation and security constraints, reviews mapping layers for leaks, and produces a concise output of changed artifacts and rationale. Functional verification covers both happy paths and negative scenarios to detect contract drift.
What artifacts will change when applying this skill?
Expect changes to resources, DTOs, providers, and processors, plus updated validation and security rules.
How does this prevent exposing internal fields?
By requiring explicit mapping between DTOs and entities and enforcing operation-level serialization rules instead of relying on implicit entity serialization.