add-rest-resource

add-rest-resource is a skill for Claude Code, Codex from tarlepp/symfony-flex-backend. It costs 28 tokens per session (666 once invoked), scanned A, original, MIT.

A Symfony workflow for adding or extending a CRUD REST resource, meaning an API endpoint that can create, read, update, and delete data. It connects entities, data-transfer objects, repositories, resources, controllers, validation, mapping, migrations, and tests using the repository's patterns.

In plain words
What is it for?
Use it to add a CRUD API resource or change its fields, responses, inputs, behavior, routes, roles, or persistence. It guides Doctrine migrations and tests for the endpoint and related data.
Why use it?
A REST feature crosses database, API input and output, validation, routing, and permissions. This helps keep those layers aligned instead of creating a separate or inconsistent implementation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add a CRUD API resource or change its fields, responses, inputs, behavior, routes, roles, or persistence. It guides Doctrine migrations and tests for the endpoint and related data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tarlepp/symfony-flex-backend/add-rest-resource
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.

Any agent
npx skills add tarlepp/symfony-flex-backend --skill add-rest-resource
Clone the repo
git clone --depth 1 https://github.com/tarlepp/symfony-flex-backend

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for add-rest-resource

README.md
[![agentmods](https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-rest-resource/github.svg)](https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-rest-resource)
Your own site
<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-rest-resource"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-rest-resource/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.

agentmods 80×15 button for add-rest-resource

Your own site · 80×15
<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-rest-resource"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-rest-resource.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 666 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00028 $0.00666
Opus 5.5 $0.00011 $0.00266
Sonnet 5.5 $0.00006 $0.00133
Haiku 4.5 $0.00003 $0.00067

Measured today against content hash 1b201761ec65, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-rest-resource 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 today.

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.

.github/skills/add-rest-resource/SKILL.md · 60 lines

How it starts

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

Add a REST resource

Use this skill when adding a CRUD API resource or extending an existing resource's input, output, or behavior.

Follow the shared skill guidance in .github/skills/shared-guidance.md.

Workflow

  1. Inspect composer.json, symfony.lock, the target endpoint's tests, and a complete nearby feature. ApiKey is one reference implementation; confirm its patterns against current code before reusing them. Check existing routes, role requirements, DTO conventions, and migrations before editing.
  2. Keep the change within the existing vertical-slice architecture: Entity -> DTO / AutoMapper -> Repository -> Resource -> Controller. Extend an existing class or pattern where appropriate; do not create a parallel abstraction.
  3. For a persistence change, update the entity using Doctrine attributes and existing entity interfaces/traits. Add serialization groups and Symfony Validator constraints consistent with the field's API exposure and validation needs. Generate and review a Doctrine migration; do not use doctrine:schema:update or hand-write schema changes. Follow .github/skills/add-doctrine-entity/SKILL.md for entity changes; every entity requires a corresponding repository and resource.
  4. Define API input/output through DTOs in src/DTO/. Follow the existing RestDto patterns, validation constraints, and patch/visited-field behavior. Update src/AutoMapper/ request mapping and configuration when request values need conversion (for example, resolving related entity IDs to entity references). Do not expose entities directly in responses.
  5. Add or update the repository in src/Repository/, following BaseRepository conventions and entity generics. Keep query/data-access behavior there; put orchestration and business rules in a resource or service.
  6. Add or update the resource in src/Resource/, extending RestResource and preserving its entity/repository types. Reuse lifecycle callbacks and repository helpers where they fit instead of duplicating generic CRUD behavior.
  7. Add or update the controller and route using the closest existing endpoint pattern. Generic CRUD endpoints commonly extend App\Rest\Controller, use role-specific action traits, map create/update/patch methods to their DTO classes, and apply explicit route and authorization attributes. Keep access checks at least as restrictive as the intended API policy. Use a custom __invoke controller only when that matches the endpoint's existing style.
  8. Follow .github/skills/write-tests/SKILL.md for testing. Cover authorization and validation outcomes when relevant; update fixtures only when the tests need the new data.
  9. Update API documentation attributes or relevant project docs if the change affects the documented contract or usage.

Read the full file on GitHub · 60 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. today First seen · 60 lines · 28 tokens per session scan A 1b201761ec65

Subscribe to this mod's changes

add-rest-resource is a skill published in the GitHub repository tarlepp/symfony-flex-backend (288 stars, last pushed today), licensed MIT. It adds 28 tokens to every session and 666 once invoked, about $0.0001 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-18.

Related

Other skills, from other repositories

horse-database-pooling

Guide for setting up thread-safe database connection pooling (FireDAC / UniDAC) in multithreaded Horse applications.

HashLoad/horse · 30 tokens

api-platform-performance

Tune API Platform 4.3 + Doctrine + Symfony performance — recognize the 4.x default trap eagerloading.forceeager: true (often counter-productive, switch to false + targeted join fetches), use EXTRALAZY for large collections, project DTOs in DQL (NEW App\\Dto\\PostListItem(...)) to avoid hydrating full entities for list…

gerard-labs/superpowers-api-platform · 0 tokens

doctrine-batch-processing

Process large-volume Doctrine datasets (million-row imports, mass updates, ETL) without memory blowup. Use toIterable() + EntityManager::clear() per batch, partial hydration with DQL projection (NEW App\Dto\X(...)), HINTREADONLY when entities aren't mutated, MEMORYPEAKUSAGE tracking. Trigger on "iterate over all…

gerard-labs/superpowers-api-platform · 108 tokens

doctrine-fetch-modes

Tune Doctrine fetch modes to eliminate N+1 and over-hydration — LAZY (default), EXTRALAZY for huge collections (count(), contains() without load), EAGER per-property only with justification, partial hydration with addSelect(), IndexBy for O(1) lookups, HINTREADONLY. Covers the API Platform 4.x eagerloading.forceeager…

gerard-labs/superpowers-api-platform · 130 tokens

doctrine-transactions

Handle Doctrine transactions correctly — EntityManager::wrapInTransaction() for atomic multi-entity writes, doctrinetransaction Messenger middleware for command-bus atomicity, Doctrine\ORM\OptimisticLockException handling with #[Version] column, isolation levels, flush strategies (per-request vs explicit). Trigger…

gerard-labs/superpowers-api-platform · 92 tokens

api-integration-architect

Design, implement, debug, and optimize API integrations with expert-level patterns for REST, GraphQL, webhooks, and authentication flows.

sickn33/agentic-awesome-skills · 33 tokens