Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tarlepp/symfony-flex-backend --skill add-api-dto-mappinggit clone --depth 1 https://github.com/tarlepp/symfony-flex-backendWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-api-dto-mapping)<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-api-dto-mapping"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-api-dto-mapping/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-api-dto-mapping"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-api-dto-mapping.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00038 | $0.01456 |
| Opus 5.5 | $0.00015 | $0.00582 |
| Sonnet 5.5 | $0.00008 | $0.00291 |
| Haiku 4.5 | $0.00004 | $0.00146 |
Grade A, and why
add-api-dto-mapping scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.
What is this?
Use this skill when adding or changing an API DTO, its validation, request mapping, or argument resolution without necessarily adding a complete CRUD resource. For a full resource or persistence change, also follow add-rest-resource or add-doctrine-entity as appropriate.
Follow the shared skill guidance, including repository instructions and AI rules.
Table of Contents ᐞ
Workflow ᐞ
- Trace the affected endpoint through its controller DTO selection,
RestDtoValueResolver, AutoMapper configuration, request mapper, DTO, and resource validation/persistence. Inspect nearby tests andBodySubscriberwhen request-body handling matters. Usesrc/DTO/User/andsrc/AutoMapper/User/as references, not as templates to copy without checking the target feature. - Establish which fields callers may supply, which operations accept them, and
the required types, defaults, nullability, and response exposure. Distinguish
omitted fields from explicit
null, empty strings, empty arrays,false, and zero. Ask before changing an unspecified API contract, relationship replacement/addition policy, or authorization boundary. - Extend the existing DTO family under
src/DTO/. REST DTOs followRestDtoandRestDtoInterface, with operation-specific create, update, and patch subclasses where needed. Keep properties, accessors, and collection types explicit. Setters for writable fields must recordsetVisited()consistently with the field's intended null semantics; do not mark omitted fields as visited or mark fields visited while loading existing entity state. Do not apply blanket readonly or constructor-only patterns to these mutable DTOs. - Add Symfony Validator constraints to the appropriate DTO properties or
classes, preserving operation-specific requirements such as create-only
password constraints. Reuse existing custom constraints in
src/Validator/when appropriate. When creating or changing a project-specific constraint, also follow add-validation-constraint. InspectRestResource::getDtoForEntity()andRestResourceBaseMethods: patch loads existing state before merging visited input and validating, whereas update starts from a fresh DTO. Do not weaken required-field validation to make partial requests pass. - Update the feature's
RequestMapperundersrc/AutoMapper/, extendingRestRequestMapper. Its$propertieslist is the writable-field allowlist; expose only intended inputs. The base mapper reads present fields from$request->request, calls matching setters, and usestransform<Property>()methods when defined. Keep conversions there rather than manually mapping request data in controllers or services. Preserve explicit failures for invalid values; do not silently substitute defaults, discard invalid references, or coerce incompatible input. - For relations and enums, follow nearby transformers and validation. Relation
IDs can be resolved through the corresponding resource's
getReference()and checked withEntityReferenceExists; obtaining a reference alone does not prove that the entity exists or that the caller may associate it. Preserve relevant authorization checks. Keep relationship application in existing DTO$mappingshooks, including replacement versus additive patch behavior such asPatchUserGroups. Keep unrelated business logic in resources or services. - Register every affected request DTO in the feature's
AutoMapperConfiguration::$requestMapperClasses, extendingRestAutoMapperConfigurationand injecting the feature request mapper. Check the controller's method-to-DTO selection. ReuseRestDtoValueResolver: it resolvesRestDtoInterfacearguments for supported actions in the registered controller collection, not arbitrary concrete DTO arguments or custom endpoints. Do not introduce a parallel request-binding mechanism or change shared resolvers just to support one field. If resolver changes are required, inspect service registration and preserve unrelated argument resolution and decorator behavior. - Keep DTO
load(), visited-field updates, and custom mapping hooks consistent with the entity and resource flow. Inspect the actual response serializer context, groups, and OpenAPI metadata separately; a request DTO change does not automatically change response exposure. Never expose credentials or privileged fields incidentally. Preserve the endpoint's established output contract rather than adding a new response-mapping architecture as part of an input-only change. For shared serialization, population, or error output changes, use update-api-response-contract. - Inspect
tests/Integration/DTO/,tests/Integration/AutoMapper/, andtests/Integration/ValueResolver/RestDtoValueResolverTest.phpfor existing helpers. Cover setters and visited fields, transformations, registered DTO mappings, validation, and entity updates as relevant. Exercise omitted versus explicit values, invalid enums or references, and create/update/patch differences. For API contract or wiring changes, also test through the real HTTP boundary, including JSON body handling, error responses, persistence, authorization, and sensitive-field exclusion where affected. Direct mapper calls alone do not verify the complete request flow. - Update relevant API metadata and existing documentation when the accepted input, output, validation, or patch semantics change. Do not generate a migration for a DTO-only change; use the entity skill when persisted mapping actually changes.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 15d ago Changed · -3 lines 3b30502dc1a5
- 20d ago Changed · -2 lines 0dd6508548f8
- 21d ago Changed · +1 lines 3ae3670892a8
- 1mo ago Changed · +2 lines acd8f1145ce4
- 1mo ago Changed · +2 lines 8c83bdca55f9
- 1mo ago Changed · -1 lines 5084d38a15bd
- 1mo ago First seen · 123 lines · 38 tokens per session scan A 562c2166866a
add-api-dto-mapping is a skill published in the GitHub repository tarlepp/symfony-flex-backend (286 stars, last pushed today), licensed MIT. It adds 38 tokens to every session and 1,456 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-21.
add-api-dto-mapping compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| add-api-dto-mappingtarlepp/symfony-flex-backend | Skill | 286 | today | MIT | A | 38 | Claude Code, Codex |
| api-platform-identifiersgerard-labs/superpowers-api-platform | Skill | 2 | 6mo ago | MIT | A | 0 | Claude Code |
| api-platform-upgradegerard-labs/superpowers-api-platform | Skill | 2 | 6mo ago | MIT | A | 49 | Claude Code |
| bootstrap-checkgerard-labs/superpowers-api-platform | Skill | 2 | 6mo ago | MIT | A | 125 | Claude Code |
| ports-and-adaptersgerard-labs/superpowers-api-platform | Skill | 2 | 6mo ago | MIT | A | 120 | Claude Code |
| cakephp-restAtulPurohit/Antigravity-Awesome-Skills | Skill | 6 | 4mo ago | none | A | 22 | Claude Code, Codex |
| codeigniter-restAtulPurohit/Antigravity-Awesome-Skills | Skill | 6 | 4mo ago | none | A | 17 | Claude Code, Codex |