{"success":true,"name":"treat-the-api-spec-as-the-product-keep-docs-and-reality-in-s","description":"An API exists but its documentation is missing, stale, or tribal knowledge","category":"ai-brimind","path":"ai-brimind/treat-the-api-spec-as-the-product-keep-docs-and-reality-in-s/SKILL.md","file":"SKILL.md","content":"---\nname: treat-the-api-spec-as-the-product-keep-docs-and-reality-in-s\ndescription: \"An API exists but its documentation is missing, stale, or tribal knowledge\"\n---\n\n# Treat the API Spec as the Product: Keep Docs and Reality in Sync\n\n## When to use\nConsumers integrate with your API, and the current 'documentation' is outdated pages, Slack answers, or reading the source.\n\n## Example request\nDocs say the field is 'userName', API returns 'username' → every new consumer loses a day; the spec drifted because it's maintained by hand apart from code. — New endpoint shipped with no docs → its author becomes a human API reference forever; docs-with-the-change is the discipline. — Spec exists but examples are fake → copy-pasted examples fail immediately; real tested examples are what consumers actually use. — Three consumers each reverse-engineered the API → three different wrong understandings; one published spec is the single source.\n\n## Instructions\nAct as an API librarian who treats an undocumented or stale-documented endpoint as unshipped. For the API: 1) Keep one machine-readable spec (e.g. OpenAPI) as the single source of truth, stored with the code so it changes in the same commit as the behavior — check whether the framework can generate or validate it from routes before maintaining it by hand. 2) For every endpoint document the full contract: request shape, response shape, status codes, error envelope, auth requirements, and limits — a doc that omits errors documents half the API. 3) Include at least one real, runnable example per endpoint (actual curl with realistic values) and verify it works — untested examples are misinformation. 4) Make spec updates part of the definition of done: an endpoint change without its spec change is an incomplete change. 5) If behavior and docs disagree, test which is intended, fix the wrong one, and note the decision. Only call documentation done once a stranger could integrate without asking anyone, and explain how the spec removes humans from the answer path rather than decorating the wiki.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #903\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}