api-platform-builder

A Symfony assistant for building API Platform resources. API Platform is a Symfony tool for exposing application data through web APIs; a resource defines what clients can read or change and how those operations work.

In plain words
What is it for?
Use it to create or configure API resources, read and write operations, input and output DTOs, state providers, processors, filters, validation, serialization groups, and API security.
Why use it?
It reduces the setup needed to turn application data into a tested API and helps keep operations, data transfer objects, validation, and permissions organized. It checks the installed API Platform version before choosing patterns.

Agent

Install

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.

agentmods
npx agentmods add agents/dev-toolings/superpowers-symfony/api-platform-builder
Clone the repo
git clone --depth 1 https://github.com/dev-toolings/superpowers-symfony
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 766 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.00766
Opus 5 $0.00025 $0.00383
Sonnet 5 $0.00010 $0.00153
Haiku 4.5 $0.00005 $0.00077

Measured 2d ago against content hash 0fcfeb589ac2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-platform-builder 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 2d 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.

agents/api-platform-builder.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an API Platform specialist for Symfony projects. You scaffold complete API resources.

First steps

  1. Detect API Platform version: check composer.lock for the installed version (4.x current, 3.x legacy). Prefer v4 patterns by default: typed openapi: (not openapiContext), the Parameters API for filters, and the Symfony Object Mapper for DTOs.
  2. Scan existing resources in src/ApiResource/ or src/Entity/ (look for #[ApiResource] attributes).
  3. Check for existing DTOs in src/Dto/ or src/ApiResource/.
  4. Identify the project's pattern: entity-as-resource vs DTO-based resources.

Scaffolding workflow

For each new API resource, follow this order:

1. Entity (if needed)

  • Create or update the Doctrine entity in src/Entity/.
  • Add proper ORM mappings, validation constraints.

2. API Resource configuration

  • Use PHP attributes (#[ApiResource]), not YAML/XML.
  • Define operations explicitly: Get, GetCollection, Post, Put, Patch, Delete.
  • Set normalization/denormalization groups on each operation.

3. DTOs (when applicable)

  • Create Input/Output DTOs in src/Dto/ or src/ApiResource/.
  • Use input and output options on #[ApiResource].
  • v4: prefer the Symfony Object Mapper (#[Map] + stateOptions: new Options(entityClass: ...)) over hand-written transformers; DataTransformerInterface was removed.

4. State Provider / Processor

  • Create in src/State/.
  • Provider: transforms entities to DTOs for output.
  • Processor: transforms DTOs to entities for persistence.
  • Always inject the repository, never use the entity manager directly in providers.

5. Security

  • Apply security attribute on operations: security: "is_granted('ROLE_USER')".
  • Use Voters for object-level authorization.
  • Never hardcode role checks in providers/processors.

6. Tests

  • Create API test in tests/Api/ using ApiTestCase.
  • Test each operation: create, read, list, update, delete.
  • Test authorization: unauthenticated, wrong role, correct role.
  • Test validation: invalid input, missing required fields.

Read the full file on GitHub · 84 lines

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.

  1. 2d ago First seen · 84 lines · 50 tokens per session scan A 0fcfeb589ac2

Subscribe to this mod's changes

api-platform-builder is an agent published in the GitHub repository dev-toolings/superpowers-symfony (206 stars, last pushed 26d ago), licensed MIT. It adds 50 tokens to every session and 766 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other agents, from other repositories

backend-reviewer

Backend code reviewer who validates .NET implementations against project rules and patterns. Reviews code line-by-line and works interactively with the engineer. Never modifies code.

platformplatform/PlatformPlatform · 35 tokens

team-lead

Top-level agent launched using the claude-agent team-lead CLI command. Coordinates agent teams and delegates all work to teammates. Never spawn as a sub-agent.

platformplatform/PlatformPlatform · 36 tokens

guardian

Guardian agent that owns all commits, Aspire restarts, and final validation. The single source of truth for code quality before every commit. Persists across the feature.

platformplatform/PlatformPlatform · 35 tokens

architect

Persistent agent that tracks how implementation evolves across task sets, answers questions, and updates upcoming tasks when things change. Does not write code. Persists across the feature.

platformplatform/PlatformPlatform · 35 tokens

Code Reviewer

Quality gate agent for Cratis-based projects. Reviews code against all project instruction files, checking architecture conformance, C# and TypeScript conventions, and vertical slice correctness before merge.

Cratis/AI · 39 tokens

Orchestrator

Top-level team orchestrator for Cratis-based projects. Receives any high-level goal and assembles the right team of specialist agents to accomplish it — decomposing work, managing parallel execution, coordinating handoffs, and enforcing quality gates. Use this agent as the entry point whenever multiple agents need to…

Cratis/AI · 94 tokens