api-docs Skill
Customizes OpenAPI v3 documentation for API Platform resources using attributes, YAML configuration, or factory decorators.
- GitHub Stars
- 29
- Dateien
- 1
- Letzter Commit
- 22. Okt. 2026
- Lizenz
- —
- Erlaubte Tools
- —
Was macht der api-docs Skill?
api-docs ist ein Agent Skill. Customizes OpenAPI v3 documentation for API Platform resources using attributes, YAML configuration, or factory decorators.
Zusammenfassung erzeugt aus der SKILL.md des Skills.
Über den api-docs skill
Modifying OpenAPI v3 documentation for API Platform resources is the primary function of this skill. Developers use it when they need to refine endpoint descriptions, add property examples, or manage how resources appear in Swagger outputs. It provides the necessary syntax and configuration patterns for both Symfony and Laravel environments to ensure API documentation accurately reflects the underlying code.
An agent should load this skill when a user requests changes to API documentation, such as documenting a specific field, hiding an operation, or adding custom response descriptions. The skill provides guidance on using PHP attributes like ApiProperty and Post, configuring global information via YAML or PHP files, and implementing an OpenApiFactory decorator for wide-scale changes like setting custom server URLs. It covers specific technical tasks such as suppressing ID generation on embedded objects and defining custom header parameters.
Was ein agent damit machen kann
- 1Hiding sensitive endpointsPrevent specific operations or entire resources from appearing in the generated OpenAPI documentation.
- 2Configuring global API metadataSet the API title, version, and security schemes at the application level.
Geschrieben basierend auf dem SKILL.md des skills. Jeder use case wurde gegen ein zitat daraus geprüft.
So installierst du den api-docs Skill
Jeder Befehl kopiert den Skill-Ordner in das Skills-Verzeichnis des Clients. Starte den Client neu oder beginne eine neue Session, um ihn zu laden.Den api-docs Skill in Plugin installieren
/plugin marketplace add api-platform/skillset /plugin install api-platform@api-platform-skillset
Den api-docs Skill in Claude Code installieren
~/.claude/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs ~/.claude/skills/api-docsDen api-docs Skill in Claude Code (project) installieren
.claude/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs .claude/skills/api-docsDen api-docs Skill in Codex installieren
~/.agents/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs ~/.agents/skills/api-docsDen api-docs Skill in Gemini CLI installieren
~/.gemini/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs ~/.gemini/skills/api-docsDen api-docs Skill in Claude.ai installieren
npx degit api-platform/skillset/skills/api-docs api-docs && zip -r api-docs.zip api-docs # claude.ai → Customize → Skills → + → Create skill → Upload a skill → api-docs.zip
SKILL.md
Auf GitHub ansehenCustomizing API Documentation
API Platform generates OpenAPI v3 documentation automatically. Customize it using attributes.
Global Info & Security Schemes (YAML)
Set the API-wide title, version, description and auth schemes in
config/packages/api_platform.yaml:
api_platform:
openapi:
info:
title: 'My API'
version: '1.0.0'
description: 'What this API does.'
components:
securitySchemes:
Bearer:
type: http
scheme: bearer
bearerFormat: JWT
Operation-Level Customization
use ApiPlatform\Metadata\Post;
use ApiPlatform\OpenApi\Model\Operation;
use ApiPlatform\OpenApi\Model\Response as OpenApiResponse;
#[Post(
openapi: new Operation(
summary: 'Create a new order',
description: 'Creates an order and sends confirmation email.',
responses: [
'201' => new OpenApiResponse(description: 'Order created successfully'),
'422' => new OpenApiResponse(description: 'Validation failed'),
]
)
)]
class Order {}
Property Documentation
use ApiPlatform\Metadata\ApiProperty;
class Order
{
#[ApiProperty(description: 'The unique identifier', example: 1)]
public int $id;
#[ApiProperty(
description: 'Current status',
example: 'pending',
openapiContext: ['enum' => ['pending', 'shipped', 'delivered']]
)]
public string $status;
#[ApiProperty(
genId: false,
types: ['https://schema.org/sender'],
openapiContext: [
'example' => ['address' => 'user@example.com', 'name' => 'John'],
],
)]
public Recipient $from;
}
Use genId: false on embedded objects (non-IRI properties) to suppress @id generation.
Hiding from Documentation
// Hide entire resource
#[ApiResource(openapi: false)]
// Hide specific operation
#[Get(openapi: false)]
// Hide from Hydra entrypoint only (keep in OpenAPI)
#[Get(hydra: false)]
Custom Parameters
use ApiPlatform\Metadata\HeaderParameter;
#[Post(
parameters: [
'X-Idempotency-Key' => new HeaderParameter(
description: 'Unique key to prevent duplicate processing',
required: true,
),
],
)]
OpenApiFactory Decorator (Global Customization)
Decorate the built-in factory for global changes like custom server URLs:
<?php
namespace App\OpenApi;
use ApiPlatform\OpenApi\Factory\OpenApiFactoryInterface;
use ApiPlatform\OpenApi\Model;
use ApiPlatform\OpenApi\OpenApi;
final class OpenApiFactory implements OpenApiFactoryInterface
{
public function __construct(
private readonly OpenApiFactoryInterface $decorated,
private readonly string $openapiUrl,
) {}
public function __invoke(array $context = []): OpenApi
{
$openApi = $this->decorated->__invoke($context);
return $openApi->withServers([
new Model\Server($this->openapiUrl),
]);
}
}
Register as a decorator in services.yaml:
App\OpenApi\OpenApiFactory:
decorates: 'api_platform.openapi.factory'
arguments:
$openapiUrl: '%env(OPENAPI_URL)%'
Laravel
All the attribute-level customization — operation openapi: new Operation(...),
#[ApiProperty] description/example/openapiContext, openapi: false, hydra: false,
HeaderParameter — is framework-neutral and works unchanged. Only the global pieces
differ:
- Global title/version/description are top-level keys in
config/api-platform.php('title','version','description'); there is noopenapi.infoYAML. Security schemes are configured under theswagger_uiblock (apiKeys,oauth,http_auth) in the same file, andopenapi.tagsis available there too. - To decorate the OpenAPI factory, bind your decorator in a service provider with the
container's
extend()(resolving the innerOpenApiFactoryInterface) instead of the Symfonydecorates:YAML — theOpenApiFactoryInterfaceandwithServers(...)API are identical.
Dateien in diesem Skill
1api-docs Skill-Fragen
Wie installiere ich den api-docs Skill in Claude Code?
Führe npx degit api-platform/skillset/skills/api-docs ~/.claude/skills/api-docs aus. Claude Code lädt Skills aus ~/.claude/skills (alle Projekte) oder .claude/skills (ein Projekt) und nutzt einen Skill, wenn seine Beschreibung zur Aufgabe passt.
Welche Clients können den api-docs Skill nutzen?
Jeder Client, der das Agent Skills-Format liest: Claude Code, Codex, Gemini CLI und claude.ai (als ZIP hochladen). Skripte im Skill laufen nur dort, wo der Client Codeausführung erlaubt.
How do I add custom descriptions or examples to an API property?
Use the #[ApiProperty] attribute to define a description, an example value, or additional OpenAPI context.
Can I customize global API information like the title and version?
Yes, in Symfony you set these in config/packages/api_platform.yaml under the openapi.info key, while in Laravel they are set in config/api-platform.php.
How do I suppress the @id generation for embedded objects?
Apply genId: false to the property using the #[ApiProperty] attribute.