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.01425 |
| Opus 5.5 | $0.00015 | $0.00570 |
| Sonnet 5.5 | $0.00008 | $0.00285 |
| Haiku 4.5 | $0.00004 | $0.00143 |
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 yesterday.
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 — 123 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
.github/skills/add-rest-resource/SKILL.md or
.github/skills/add-doctrine-entity/SKILL.md as appropriate.
Follow the shared skill guidance, including
.github/copilot-instructions.md and doc/AI_RULES.md.
Table of Contents ᐞ
Workflow ᐞ
- Read
composer.jsonfor installed packages and supported versions, andsymfony.lockfor recipes. 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. 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. - Follow
.github/skills/write-tests/SKILL.md. Inspecttests/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.
- yesterday 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 (288 stars, last pushed today), licensed MIT. It adds 38 tokens to every session and 1,425 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.
Other skills, from other repositories
api-platform-upgrade
Migrate an API Platform codebase from 3.x or 4.0–4.2 up to 4.3. Trigger when composer.lock shows api-platform/ < 4.3, when grep finds.
api-platform-identifiers
Choose and wire up API Platform 4.3 resource identifiers — UUID v7 (recommended for temporal cursor pagination), ULID, scalar (string/int), \DateTimeInterface, composite identifiers via Link(uriVariables: …), custom identifiers (slug) with #[ApiProperty(identifier: true)], decorating UriVariableTransformerInterface to…
bootstrap-check
Verify a Symfony project's bootstrap state before any work — .env / .env.dist parity, config/bundles.php enabled bundles, config/services.yaml recipe-default App\ block with exclude:, config/packages/apiplatform.yaml flags (hydraprefix, eagerloading.forceeager, usesymfonylisteners), composer.lock presence, framework /…
ports-and-adapters
Apply Hexagonal Architecture / Ports & Adapters in Symfony — Domain (POPOs, no framework imports), Application (use cases orchestrating ports), Infrastructure (Symfony / Doctrine / API Platform adapters). Bounded contexts variant: one context per business domain with a Contract/ public surface. Deptrac to enforce…
cakephp-rest
Build secure, fast RESTful APIs using CakePHP's built-in routing and serialization capabilities.
codeigniter-rest
Build secure RESTful APIs using the CodeIgniter framework.