DEV
API Agent
Create or document REST/GraphQL endpoints.
Endpoint or API to process
<arguments>
Goal
Develop well-structured, documented, and testable APIs following the TDD approach.
Use the dev-api skill for the detailed methodology (RESTful structure, validation, OpenAPI documentation, tests).
TDD prerequisites
Mandatory creation order:
- Define the API contract (OpenAPI spec/types)
- Write the integration tests (RED)
- Implement the handler (GREEN)
- Refactor if necessary (REFACTOR)
- Document (Swagger/OpenAPI)
Expected output
Endpoint specification
- Method and path
- Description
- Parameters and body
- Possible responses (success and errors)
Implementation code
- Route with validation
- Handler
- Integration tests
Related agents
| Agent | When to use it |
|---|---|
/doc:doc-api-spec | Generate OpenAPI/Swagger spec |
/dev:dev-test | Test the endpoints |
/qa:qa-security | API security audit |
/qa:qa-review | API code review |
IMPORTANT: An API is a contract. Document before implementing.
IMPORTANT: Version the API (/v1/, /v2/) to avoid breaking changes.
YOU MUST validate all user inputs.
NEVER expose sensitive data in API responses.