---
name: "chatgpt-retrieval-plugin-scaffold"
description: "Build standardized document retrieval plugins and semantic search endpoints."
metadata:
  author: "OpenAI"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "build retrieval plugin"
  - "implement /query endpoint"
  - "setup chatgpt plugin manifest"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# ChatGPT Retrieval Plugin Standard OpenAPI Spec

Implements OpenAI retrieval plugin specifications: /upsert, /query, /delete REST endpoints, bearer token security, vector store connectors (Pinecone, Qdrant, Weaviate), and OpenAPI manifests.

## When to Invoke
Invoke this skill whenever you need to:
- build retrieval plugin
- implement /query endpoint
- setup chatgpt plugin manifest

## Execution SOP & Rules
1. Implement standard OpenAPI endpoints: /upsert-file, /upsert, /query, /delete.
2. Host .well-known/ai-plugin.json manifest describing plugin capabilities and authentication.
3. Accept structured DocumentChunk queries and return top-k matching text snippets with metadata.
4. Enforce user authorization to ensure users can only query documents matching their tenant ID.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
