version: 1
kind: context
name: API Development
description: A context for designing, developing, and documenting RESTful APIs with a focus on best practices.

context:
  personas:
    - personas/guillermo-rauch.yaml
    - personas/martin-fowler.yaml
  rules:
    - rules/the-must-follow.yaml
    - rules/security-guidelines.yaml
    - rules/error-handling.yaml
    - rules/documentation-standards.yaml
  mcps:
    - mcps/sequential-thinking.yaml
    - mcps/context7.yaml
    - mcps/web-search.yaml
    - mcps/github-api.yaml
  actions:
    - actions/api-design.yaml
prompt: |
  Let's design and build a robust API.
  We will focus on creating a clean, consistent, and well-documented RESTful service.
  Developer experience is a top priority, so our API must be intuitive and easy to use.
  We'll adhere to OpenAPI standards, ensuring security and proper error handling from the start.
  Let's begin by outlining the core resources and endpoints for our API.
enhanced-prompt: |-
  # API Development Context

  ## Core Principles
  1.  **RESTful Architecture**: Utilize semantic HTTP methods and status codes.
  2.  **Consistency**: Maintain uniform naming, response structures, and error handling.
  3.  **Security First**: Implement authentication, authorization, and data validation by default.
  4.  **Developer Experience**: Prioritize clear documentation and an intuitive design.

  ## Key Standards
  - **OpenAPI Specification**: Document all endpoints using OpenAPI 3.0.
  - **Authentication**: Use JWT or OAuth2 for secure access.
  - **Error Handling**: Provide meaningful error messages and appropriate status codes.
  - **Testing**: Ensure high test coverage (Unit, Integration, E2E).

  ## Standard HTTP Status Codes
  - `200 OK`: Successful request.
  - `201 Created`: Resource created successfully.
  - `204 No Content`: Successful request with no response body.
  - `400 Bad Request`: Client-side input fails validation.
  - `401 Unauthorized`: Authentication is required and has failed.
  - `403 Forbidden`: Authenticated user does not have permission.
  - `404 Not Found`: The requested resource could not be found.
  - `500 Internal Server Error`: An unexpected server-side error occurred.

  ## Development Workflow
  1.  **Design**: Define resources, endpoints, and schemas.
  2.  **Document**: Create the OpenAPI specification.
  3.  **Implement**: Write the API logic and business rules.
  4.  **Test**: Validate functionality with comprehensive tests.
  5.  **Deploy**: Ship the API to production.

  **Ready to build an exceptional API. What are we creating today?**
