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, Key Concepts, How It Works, Usage, Troubleshooting — docs pages with the same shape for every feature, and code in every usage section.
Documentation rots fastest when every page has its own structure — readers can't build navigation instincts and writers can't tell what's missing. This setup generates docs pages against a five-section skeleton with tech-docs rules: define every term at first use (assume a competent reader new to THIS system), document what the system does rather than roadmap dreams. Require Code Examples puts a fenced, language-tagged, usable-as-written block in every behavior-describing section.
One skeleton, every feature
Each feature's page comes back with the same five sections — navigation instincts transfer.
Watch the term rule
"Define every term at first use" assumes the right reader: competent, but new to this system.
Trust the Troubleshooting slot
A pinned section means failure modes get documented while they're remembered, not after the third support ticket.
Because usage sections drift into abstraction without one. The CODE RULES require that "every section that describes behavior or usage must include a fenced code example with a language tag," and that examples be "usable as written — no pseudo-code, no '...' placeholders." That keeps Usage and How It Works concrete. The markdown-output-builder shapes the prompt; your assistant fills the fenced blocks, and you still verify the code runs.
A competent reader who is new to THIS system — the DOCUMENT block names exactly that audience. So Key Concepts defines the terms a reader must know, and jargon gets defined where it first appears rather than shipped to a glossary. It's not writing for a beginner engineer generally; it assumes competence but zero familiarity with your specific system.
Not quite — this is the five-section feature-page skeleton: Overview, Key Concepts, How It Works, Usage, Troubleshooting. Per the notFor, endpoint references need parameter tables and stricter rules that the API Documentation setup adds. Use this one for feature pages that share one shape, with a pinned Troubleshooting section so failure modes get documented while they're remembered.
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.
Overview, Authentication, Endpoints, Error Handling, Rate Limits — endpoint docs in an identical structure, with parameter tables and runnable examples forced.
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 an AI meeting assistant — define the use case, turn transcripts into structured notes, extract decisions and action items, classify follow-ups, write a shareable summary, evaluate accuracy, then ready it for the team.
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.
The full path to knowledge that's findable by people and AI — plan the taxonomy, structure it for search, write the articles, tag the metadata, make it retrievable, then ship it maintainable.
Design a system's architecture on its real trade-offs instead of a confident diagram — put the model in an architect's seat, work the decisions one at a time, and write down the why.
Design a schema on its data, not a hunch — model the entities and relationships, set the constraints that protect integrity, plan indexes around real queries, then document the schema and migration.
Connect systems so they don't break each other — map the integration boundaries, design the event and webhook contracts, plan retries and failure handling, then document the integration.
Recover a legacy system's architecture before you change it — package the codebase context, explain the current structure, surface the risks and seams, then document the recovered architecture.
Design a pipeline that moves data without corrupting it — map the sources and ingestion, design the transformation stages, set validation and quality gates, then document the pipeline and monitoring.
Turn source material and a target audience into clear docs, help, or knowledge-base content — gather the material, outline the piece, write it section by section, then check it for clarity and gaps.
Organize a site so people and crawlers find things — inventory the content, group it into a real hierarchy, design the sitemap and navigation, then document the information architecture for the build.
The new engineer asks how the system actually works and gets a whiteboard photo from two years ago, or an AI answer that confidently names a queue that isn't there. Here is how to document system architecture with AI: the current state, with every component traced to a fact or marked unconfirmed.