{
  "openapi": "3.1.0",
  "info": {
    "title": "DEVLIB Catalog API",
    "version": "2.0.0"
  },
  "paths": {
    "/api/catalog.json": {
      "get": {
        "summary": "Catálogo completo para agentes",
        "responses": {
          "200": {
            "description": "173 recursos DEVLIB"
          }
        }
      }
    },
    "/api/categories.json": {
      "get": {
        "summary": "Categorias e totais",
        "responses": {
          "200": {
            "description": "Categorias"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "Instruções de descoberta para LLMs",
        "responses": {
          "200": {
            "description": "Guia"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP Streamable HTTP",
        "responses": {
          "200": {
            "description": "Resposta MCP"
          }
        }
      }
    },
    "/api/ai/recommend": {
      "post": {
        "summary": "Analisa requisitos e recomenda uma arquitetura fundamentada",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "project"
                ],
                "properties": {
                  "project": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Análise com stack, requisitos, riscos, trade-offs e perguntas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema_version",
                    "summary",
                    "requirements",
                    "recommendations",
                    "tradeoffs",
                    "risks",
                    "next_questions"
                  ],
                  "properties": {
                    "schema_version": {
                      "const": "2"
                    },
                    "engine": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "requirements": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "recommendations": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "tradeoffs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "risks": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "next_questions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida"
          }
        }
      }
    },
    "/api/ai/search": {
      "get": {
        "summary": "Busca dinâmica no catálogo",
        "responses": {
          "200": {
            "description": "Resultados"
          }
        }
      }
    },
    "/api/ai/explain": {
      "get": {
        "summary": "Explica conceitos com fontes",
        "responses": {
          "200": {
            "description": "Explicação fundamentada"
          }
        }
      }
    }
  }
}
