API Spec — Tạo OpenAPI Specification

Tự động generate OpenAPI (Swagger) specification cho API endpoints từ code hiện có hoặc feature description.

Cú pháp

Cập nhật bộ mới: /docs-project:prd có thể generate PRD với API contracts, request/response schema, auth requirements. Dùng chung với custom /api-spec để có OpenAPI.

Luồng hoạt động

1

Bước 1: Scan API routes

Đọc controllers/routes, extract endpoints, methods, parameters.
2

Bước 2: Analyze schemas

Đọc DTOs, Zod schemas, Prisma models → generate request/response schemas.
3

Bước 3: Generate OpenAPI

Tạo OpenAPI 3.0 spec: paths, schemas, authentication, examples.
4

Bước 4: Validate

Validate spec syntax, check completeness.

Ví dụ thực tế


Khi nào dùng / không dùng


Skills liên quan (bộ mới)

Prefix: /docs-project:prd, :prd --sprint N, :prd --all-sprintsGenerate PRD chi tiết, có thể include API contracts section với request/response schema, auth, error codes.
Prefix: /docs-project:fullPipeline 1-lệnh: PRD → UI Specs → QA Test Plan. Có thể extend cho API contracts + integration tests.
Prefix: /mcp-builderBuild MCP server cho LLM-external service integration. FastMCP (Python), MCP SDK (Node/TypeScript). Tool design, API integration, resource providers.
Khi dùng: Muốn AI agents (Claude, GPT) gọi API PrimeCommerce trực tiếp qua MCP.
Prefix: /backend-developmentBackend implementation guidance: REST/GraphQL/gRPC APIs, auth (OAuth, JWT), databases, microservices, security (OWASP), Docker/K8s.