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, Installation, Usage, Examples, Configuration — the README skeleton with required, runnable code examples.
READMEs die in two ways: missing sections (no install steps, no examples) and decorative code blocks that don't run. This setup generates READMEs against the five-section skeleton every reader expects, with README-specific rules — one-paragraph project description up top, most common use case first — and Require Code Examples: every behavior-describing section carries a fenced, language-tagged block that is usable as written, no pseudo-code, no "..." placeholders.
Generate and describe your project below it
The prompt carries the structure; your project details go in the input under it.
Check the code rule
"Usable as written" bans the placeholder snippets that make READMEs look done without being useful.
Keep common-case-first
The README rule that matters most: the reader installing for the first time outranks the power user.
The CODE RULES require a fenced, language-tagged block in every section that describes behavior or usage, so Installation, Usage, and Examples each need one while a prose-only Overview may not. A block fails the rule 'usable as written' if it leans on pseudo-code or '...' placeholders, so 'pip install ...' or 'your-config-here' must become real commands before you ship the file.
It lands inside the closest existing section, never as a new top-level heading. The CONSISTENCY RULES say 'Do not add new top-level sections' and fix those five '## ' headings in order, so a Troubleshooting note folds under Configuration or Usage and API notes fold into Examples. Every generated README keeps the same five-section shape instead of sprouting one-off headings.
That happens when the assistant treats the whole document as one block. The OUTPUT RULES already state 'Do not wrap the document in code fences' and 'Start directly with the # title line', returning only the markdown with no preamble. If a stray outer fence still appears, resend the prompt unchanged in ChatGPT, Claude, or Gemini — a fresh generation usually drops it, since the rule is baked in.
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.
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.
Generate documentation that matches the code instead of drifting from it — have AI explain what the code really does, write it up as structured docs, then validate the format holds.
Your README works perfectly on the one machine where the tool was already installed. Everyone else hits a missing prerequisite in the first ninety seconds. Here's how to build a README from your real setup facts — and the clean-machine run that decides whether any of it is true.
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.