Share the module, service, or API you need documented. Grok reads the source files, infers the architecture, identifies public interfaces, and understands the relationships between components — so the docs reflect what the code actually does, not what you hope it does.
Example prompt
Write API reference documentation for our payments service. Cover all public endpoints in /src/api/payments/, include request/response schemas from the TypeScript types, and document the error codes from /src/errors.ts.
Beyond API references, Grok can produce operational runbooks, architecture decision records, and onboarding guides. It understands the deployment pipeline, infrastructure dependencies, and failure modes from the code and config files in your repo.
Example prompt
Write an on-call runbook for the payments service. Include common alert scenarios, how to check service health, how to manually retry failed transactions, and the escalation path. Pull the alert definitions from our Terraform configs.
Paste existing documentation and ask Grok to review it against the current codebase. It identifies stale sections, missing endpoints, incorrect parameter descriptions, and gaps — then proposes specific updates.
Example prompt
Here's our current payments API doc (last updated 6 months ago). Compare it against the current codebase and give me a list of everything that's outdated, missing, or incorrect. Then generate the updated version.