api-endpoint

api-endpoint is a command for Claude Code from TheBeardedBearSAS/claude-craft. It costs 5 tokens per session (3,242 once invoked), scanned A, original, MIT.

An API Platform command for creating a Symfony REST API endpoint with validation, OpenAPI documentation, pagination, and tests.

In plain words
What is it for?
Use it to expose an entity through operations such as listing, reading, creating, updating, or deleting records.
Why use it?
It removes the need to assemble the endpoint’s common pieces by hand and helps keep the API contract and tests together.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

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 commands/thebeardedbearsas/claude-craft/api-endpoint
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

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 api-endpoint

README.md
[![agentmods](https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/api-endpoint.svg)](https://agentmods.dev/commands/thebeardedbearsas/claude-craft/api-endpoint)
Your own site
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/api-endpoint"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/api-endpoint.svg" alt="Measured on agentmods" height="20"></a>
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,242 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.1 $0.00005 $0.03242
Opus 5 $0.00003 $0.01621
Sonnet 5 $0.00001 $0.00648
Haiku 4.5 $0.00001 $0.00324

Measured 2d ago against content hash e2c179ecf3e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

api-endpoint 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.

.claude/commands/symfony/api-endpoint.md · 477 lines

How it starts

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

Création Endpoint API Platform

Tu es un développeur Symfony et API Platform senior. Tu dois créer un endpoint API REST complet avec validation, documentation OpenAPI, pagination et tests.

Arguments

$ARGUMENTS

Arguments :

  • Ressource (nom de l'entité)
  • Opérations (list, get, post, put, patch, delete)

Exemple : /symfony:api-endpoint Product "list,get,post,patch,delete"

MISSION

Étape 1 : Configurer la Ressource API Platform

Entity avec API Platform Attributes
<?php

declare(strict_types=1);

namespace App\Entity;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Delete;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\Groups;

#[ORM\Entity(repositoryClass: {Entity}Repository::class)]
#[ORM\Table(name: '{entities}')]
#[ApiResource(
    operations: [
        new GetCollection(
            uriTemplate: '/{entities}',
            normalizationContext: ['groups' => ['{entity}:list']],
            paginationEnabled: true,
            paginationItemsPerPage: 20,
        ),
        new Get(
            uriTemplate: '/{entities}/{id}',
            normalizationContext: ['groups' => ['{entity}:read']],
        ),
        new Post(
            uriTemplate: '/{entities}',
            denormalizationContext: ['groups' => ['{entity}:write']],
            validationContext: ['groups' => ['Default', '{entity}:create']],
            security: "is_granted('ROLE_USER')",
        ),
        new Patch(
            uriTemplate: '/{entities}/{id}',
            denormalizationContext: ['groups' => ['{entity}:write']],
            security: "is_granted('ROLE_USER') and object.getOwner() == user",
        ),
        new Delete(
            uriTemplate: '/{entities}/{id}',
            security: "is_granted('ROLE_ADMIN')",
        ),
    ],
    order: ['createdAt' => 'DESC'],
)]
#[ApiFilter(SearchFilter::class, properties: [
    'name' => 'partial',
    'status' => 'exact',
])]
#[ApiFilter(OrderFilter::class, properties: ['createdAt', 'name'])]
#[ApiFilter(DateFilter::class, properties: ['createdAt'])]
class {Entity}
{
    #[ORM\Id]
    #[ORM\Column(type: 'uuid', unique: true)]
    #[ORM\GeneratedValue(strategy: 'CUSTOM')]
    #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
    #[ApiProperty(identifier: true)]
    #[Groups(['{entity}:list', '{entity}:read'])]
    private ?string $id = null;

    #[ORM\Column(length: 255)]
    #[Assert\NotBlank(groups: ['{entity}:create'])]
    #[Assert\Length(min: 3, max: 255)]
    #[Groups(['{entity}:list', '{entity}:read', '{entity}:write'])]
    private string $name;

    #[ORM\Column(type: 'text', nullable: true)]
    #[Groups(['{entity}:read', '{entity}:write'])]
    private ?string $description = null;

    #[ORM\Column(length: 50)]
    #[Assert\Choice(choices: ['draft', 'published', 'archived'])]
    #[Groups(['{entity}:list', '{entity}:read', '{entity}:write'])]
    private string $status = 'draft';

    #[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
    #[Assert\PositiveOrZero]
    #[Groups(['{entity}:read', '{entity}:write'])]
    private ?string $price = null;

    #[ORM\ManyToOne(targetEntity: User::class)]
    #[ORM\JoinColumn(nullable: false)]
    #[Groups(['{entity}:read'])]
    private User $owner;

    #[ORM\Column(type: 'datetime_immutable')]
    #[Groups(['{entity}:list', '{entity}:read'])]
    private \DateTimeImmutable $createdAt;

    #[ORM\Column(type: 'datetime_immutable', nullable: true)]
    #[Groups(['{entity}:read'])]
    private ?\DateTimeImmutable $updatedAt = null;

    public function __construct()
    {
        $this->createdAt = new \DateTimeImmutable();
    }

    // Getters et Setters...
}

Read the full file on GitHub · 477 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 · 477 lines · 5 tokens per session scan A e2c179ecf3e8

Subscribe to this mod's changes

api-endpoint is a command published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 3d ago), licensed MIT. It adds 5 tokens to every session and 3,242 once invoked, about $0.0000 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-09-03.