Markdown Output Prompt — Lock the Document Structure
The contract that stops AI documents from restructuring themselves: a pinned section skeleton, forced tables, and strict consistency rules.
Overview, Authentication, Endpoints, Error Handling, Rate Limits — endpoint docs in an identical structure, with parameter tables and runnable examples forced.
API docs are the strictest documentation discipline: callers script against them, so structure drift is breakage. This setup documents API areas in five pinned sections under Strict consistency, with Required Tables (parameters and error codes as real tables, never prose) and Require Code Examples (every usage section carries a fenced, language-tagged, usable-as-written request example). Authentication gets its own section with an example — the part every integrator hunts for first.
One prompt per API area
Feed each endpoint group below the prompt; every area returns the same skeleton.
Check the tables
Method, path, parameters, error codes — Required Tables keeps them scannable and diffable.
Keep examples runnable
"Usable as written" means an integrator can paste the example and get a response — the doc's real test.
The prompt pins exactly five '## ' sections in fixed order: Overview, Authentication, Endpoints, Error Handling, and Rate Limits, under a single '# ' title. Its consistency rules forbid reordering, merging, omitting a heading (even a short one), or rewording the exact heading text. If you need a different skeleton, edit the prompt in the Markdown Output Builder before you run it in ChatGPT, Claude, or Gemini.
The table rules force any comparison of items, options, or features into a real markdown table with a header row, separator row, and one row per item, so parameters and error codes stay diffable rather than collapsing into prose. Same columns apply to every row, with '—' filling cells that have no value. You still eyeball the generated tables for accuracy after running the prompt.
The code rules demand every behavior or usage section carry a fenced, language-tagged example that is 'usable as written' — no pseudo-code and no '...' placeholders — so an integrator can paste the Authentication or Endpoints example and get a real response. That is the doc's actual test. The prompt structures the request; you confirm the example truly runs against your live API.
The contract that stops AI documents from restructuring themselves: a pinned section skeleton, forced tables, and strict consistency rules.
Overview, Installation, Usage, Examples, Configuration — the README skeleton with required, runnable code examples.
Added, Changed, Fixed, Removed, Security — changelog entries written as user-visible changes, not commit messages.
Summary, Why It Matters, What Happens Next — the executive summary contract for readers who will never open the source.
Stop getting 'Sure, here is the JSON…' — the output-contract pattern that forces models to return only parseable JSON: schema, example, and a strict rule block.
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Build prompts that produce documents in a fixed structure — headings, sections, and tables.
The full path to docs people can actually navigate — plan the doc set, structure the site, write the guides and the API reference, then ship it as a coherent documentation site.
An endpoint exists but its docs don't, so "document this API" from code alone invents parameters, status codes, and an auth flow that were never real. Here's how to write API documentation with AI from the facts you provide, with unknowns flagged and checked against the real API.
The changelog gets written last, from a list of PR titles someone else wrote for a reviewer who has moved on. Here is how to generate a changelog with AI that records what shipped for the people upgrading — and parks what nobody can stand behind yet.