api-docs skill
Customizes OpenAPI v3 documentation for API Platform resources using attributes, YAML configuration, or factory decorators.
- GitHub stars
- 29
- Files
- 1
- Last commit
- Oct 22, 2026
- License
- —
- Allowed tools
- —
What does the api-docs skill do?
api-docs customizes OpenAPI v3 documentation for API Platform resources using attributes, YAML configuration, or factory decorators.
Summary generated from the skill's SKILL.md.
About the 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.
What an agent can do with it
- 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.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the api-docs skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the api-docs skill in Plugin
/plugin marketplace add api-platform/skillset /plugin install api-platform@api-platform-skillset
Install the api-docs skill in Claude Code
~/.claude/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs ~/.claude/skills/api-docsInstall the api-docs skill in Claude Code (project)
.claude/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs .claude/skills/api-docsInstall the api-docs skill in Codex
~/.agents/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs ~/.agents/skills/api-docsInstall the api-docs skill in Gemini CLI
~/.gemini/skills/api-docs/SKILL.md
$ npx degit api-platform/skillset/skills/api-docs ~/.gemini/skills/api-docsInstall the api-docs skill in Claude.ai
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
View on GitHubCustomizing 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.
Files in this skill
1api-docs skill questions
How do I install the api-docs skill in Claude Code?
Run npx degit api-platform/skillset/skills/api-docs ~/.claude/skills/api-docs. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the api-docs skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
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.