Przejdź do treści
Biblioteka skilli
Programowanie · Pisanie

openapi

/openapi

Pomaga dokumentować API w OpenAPI i Swagger, z atrybutami PHP, walidacją Redocly i wersjonowanymi specyfikacjami, nawet gdy użytkownik prosi tylko o udokumentowanie endpointu.

Repozytorium
agent-config ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga dokumentować API w OpenAPI i Swagger, z atrybutami PHP, walidacją Redocly i wersjonowanymi specyfikacjami, nawet gdy użytkownik prosi tylko o udokumentowanie endpointu.

Wyzwalacze z opisu

document this endpoint
Oryginalny opis (EN)

Use when documenting APIs — OpenAPI/Swagger, PHP attributes, Redocly validation, versioned specs — even when the user just says 'document this endpoint' without naming OpenAPI.

Jak działa

  1. When to use
  2. Procedure: Add OpenAPI documentation
  3. OpenAPI attributes
  4. Response documentation
  5. Validation with Redocly
  6. Versioned documentation
  7. Output format
  8. Auto-trigger keywords
  9. Gotcha
  10. Do NOT
Sekcje z nagłówków SKILL.md, w oryginale · 150 linii, 648 słów
Podgląd SKILL.md
---
model_tier: medium
name: openapi
description: "Use when documenting APIs — OpenAPI/Swagger, PHP attributes, Redocly validation, versioned specs — even when the user just says 'document this endpoint' without naming OpenAPI."
domain: engineering
workspaces:
  - engineering
packs:
  - engineering-base
---

# openapi

## When to use

Use this skill when adding or updating API documentation, writing OpenAPI annotations on controllers, or validating API specs.

## Procedure: Add OpenAPI documentation

1. **Gather context** — read `agents/reference/docs/controller.md` for OpenAPI patterns, `agents/settings/contexts/api-versioning.md` for versioning, and check 2-3 existing controllers for annotation style.
2. **Detect tooling** — check `composer.json` for `l5-swagger` or `laravel-openapi`, look for `@OA\` vs `#[OA\` syntax in existing controllers, find the config file.
3. **Write annotations** — add `#[OA\...]` attributes to the controller method. Include path, summary, tags, all parameters, and all response codes (200, 401, 403, 404, 422).
4. **Define schemas** — create or reuse `#[OA\Schema]` for request/response types. Use `$ref` for shared types.
5. **Validate** — run the spec validation (`npx @redocly/cli lint` or `php artisan l5-swagger:generate`). Fix any errors.
6. **Verify accuracy** — compare the documented request/response with the actual controller + FormRequest + Resource to ensure they match.

## OpenAPI attributes

### Detection

Check the project for OpenAPI tooling:
- Look for `darkaonline/l5-swagger` or `vyuldashev/laravel-openapi` in `composer.json`.
- Check for `@OA\` or `#[OA\` annotations in controllers.
- Look for `config/l5-swagger.php` or similar config files.

### PHP 8 attribute syntax

Modern Laravel projects use PHP 8 attributes instead of docblock annotations:

```php
#[OA\Get(
    path: '/projects',
    summary: 'List all projects',
    tags: ['Projects'],
    parameters: [
        new OA\Parameter(
            name: 'page',
            in: 'query',
            required: false,
            schema: new OA\Schema(type: 'integer'),
        ),
    ],
    responses: [
        new OA\Response(
            response: 200,
            description: 'Successful operation',
        ),
    ],
)]
public function __invoke(ListProjectsRequest $request): ProjectCollection
{
    // ...
}
```

### Conventions

- Place OpenAPI attributes **directly on the controller method**.
- **Paths are relative to the server URL.** If the server is configured as `http://host/api/v1`,
  then `path: '/projects'` resolves to `/api/v1/projects`. Never repeat the server prefix in the path.
- Use **tags** matching the resource name (e.g., `Projects`, `Users`).
- Document **all parameters** — path, query, and header.
- Document **all response codes** — 200, 201, 401, 403, 404, 422.
- Use **schema references** (`$ref`) for reusable types.

## Response documentation

### Resource schemas

Define reusable schemas for API Resources:

```php
#[OA\Schema(
    schema: 'Project',
    properties: [
        new OA\Property(property: 'id', type: 'integer'),
        new OA\Property(property: 'name', type: 'string'),
        new OA\Property(property: 'status', type: 'string', enum: ['active', 'archived']),
    ],
)]
```

### Pagination schema

Document paginated responses with `meta` and `links`:

```php
#[OA\Response(
    response: 200,
    description: 'Paginated list',
    content: new OA\JsonContent(
        properties: [
            new OA\Property(property: 'data', type: 'array', items: new OA\Items(ref: '#/components/schemas/Project')),
            new OA\Property(property: 'meta', ref: '#/components/schemas/PaginationMeta'),
        ],
    ),
)]
```

## Validation with Redocly

If the project uses Redocly for OpenAPI validation:

```bash
# Validate the spec
npx @redocly/cli lint openapi.yaml

# Preview documentation
npx @redocly/cli preview-docs openapi.yaml
```

Check for `.redocly.yaml` or `redocly.yaml` config in the project root.

## Versioned documentation

When the API uses URL-based versioning (e.g., `/api/v1/`, `/api/v2/`):

- The version prefix is typically part of the **server URL**, not the individual endpoint paths.
- Check the OpenAPI server configuration to understand what prefix is already included.
- When creating a v2 endpoint, add new documentation — don't modify v1 docs.
- Mark deprecated endpoints with `deprecated: true`.


## Output format

1. OpenAPI annotations as PHP attributes on controllers/models
2. Spec validation passing via Redocly

## Auto-trigger keywords

- OpenAPI
- Swagger
- API documentation
- PHP attributes
- Redocly

## Gotcha

- OpenAPI attributes must match the actual endpoint behavior — stale docs are worse than no docs.
- The model tends to define response schemas that don't match the Resource class output.
- Don't document internal endpoints in the public API spec.

## Do NOT

- Do NOT skip OpenAPI documentation when creating new endpoints.
- Do NOT document internal/private endpoints that are not part of the public API.
- Do NOT use docblock `@OA\` annotations when the project uses PHP 8 attributes.
- Do NOT hardcode example values that contain real customer data.
- Do NOT create documentation that contradicts the actual implementation.

Wersje

RepozytoriumWynikLicencja
Ta strona · event4u-app/agent-config100MIT
itechmeat/llm-code100MIT
claude-dev-suite/claude-dev-suite100MIT
codewithmukesh/dotnet-claude-kit100MIT
Tyler-R-Kendrick/agent-skills100MIT
finom/vovk87MIT

Migawka bazy z 13.11.2026 · wersja paczki 99e4543ce6cc (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90backend-openapi-documentation
    Dokumentuje API metodą spec-first w OpenAPI 3.x, z generowaniem kodu i wersjonowanymi specyfikacjami.
  • 100openapi-spec
    Pisze specyfikację OpenAPI 3.1, sprawdza ją Redocly CLI, generuje typy TypeScript i typowanego klienta fetch, buduje dokumentację HTML i pilnuje poprawności specyfikacji.
  • 95api-documentation-generator
    Generuje specyfikacje OpenAPI i Swagger oraz dokumentację API z kodu albo projektu.
  • 100api-documenting
    Generuje dokumentację API z kodu: referencja API, dokumentacja endpointów i specyfikacje OpenAPI lub Swagger.
  • 100nestjs-documentation
    Automatyzuje dokumentację Swagger/OpenAPI w NestJS i standaryzuje schematy odpowiedzi, w tym stronicowane i generyczne, z wtyczką Nest CLI i wersjonowanymi dokumentami API.
  • 100openapi-expert
    Wspiera projektowanie API, dokumentację i generowanie kodu ze specyfikacji OpenAPI i Swagger, w tym webhooki i polimorfizm.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.