Diátaxis documentation
Use Diátaxis as a decision tool, not a four-folder template. Start from the reader's immediate need, give each page one primary purpose, and link across purposes when the reader is likely to need a different kind of help.
Read references/framework.md before a broad documentation audit, information-architecture change, or ambiguous classification. It records the primary sources, the compass, and the distinctions most often lost in shorter skills.
Classify the need
Ask two questions internally:
- Does the reader need action or understanding?
- Are they acquiring skill or applying existing skill?
Map the answers:
| Reader need |
Mode |
Documentation type |
| Learn by doing |
action + acquisition |
Tutorial |
| Complete a real task |
action + application |
How-to guide |
| Look up facts while working |
cognition + application |
Reference |
| Understand reasons and relationships |
cognition + acquisition |
Explanation |
Infer the type when the evidence is clear. Ask only when choosing incorrectly would materially change the requested artifact.
Choose the operation
Create or revise one page
- State the intended reader and outcome in working notes.
- Select one primary documentation type.
- Preserve accurate repository-specific facts and examples.
- Write according to the type rules below.
- Move substantial off-purpose material to a better page, or link to an existing page.
- Check navigation so the reader has an obvious next destination.
Audit a documentation set
- Inventory pages and their apparent audience.
- Classify each page by its dominant need; record uncertain or mixed pages.
- Find user journeys and missing destinations, not merely empty quadrants.
- Flag misleading titles, duplicated material, stale facts, dead ends, and mixed-purpose pages.
- Recommend the smallest useful restructure. Do not create empty sections merely to complete a matrix.
- Report evidence and concrete moves, splits, merges, or links.
Restructure mixed documentation
- Preserve the source material and map every substantive section.
- Choose a primary page for each distinct reader need.
- Split only where the mix harms usability; short context or a small example may remain.
- Replace duplication with purposeful cross-links.
- Keep landing pages and READMEs as routing surfaces. They may summarize several types without pretending to be one of them.
- Verify that no claims or operational steps were lost.
Write by type
Tutorial
- Own the learner's success.
- Provide one reliable path with an early visible result.
- Use concrete steps, expected observations, and a coherent learning sequence.
- Minimize branching, alternatives, and extended theory.
- Test commands and examples when the repository permits it.
How-to guide
- Start from a specific real-world goal.
- Assume a competent practitioner and omit foundational teaching.
- Use ordered actions and conditionals only where the task requires them.
- Include prerequisites and success checks.
- Link to reference facts instead of reproducing exhaustive option lists.
Reference
- Describe the machinery accurately, completely, and consistently.
- Mirror the product or API structure.
- Prefer stable headings, tables, signatures, defaults, constraints, and edge cases.
- Keep instruction and rationale subordinate; link outward for tasks and concepts.
- Generate from authoritative interfaces where possible, then verify the result.
Explanation
- Explain why the subject exists and how its parts relate.
- Discuss constraints, history, alternatives, and tradeoffs.
- Connect the topic to adjacent concepts.
- Avoid turning the page into a numbered procedure or an exhaustive field catalog.
Respect repository context
- Follow existing terminology, style, navigation, and contribution rules.
- Treat plans, decision records, research notes, release notes, and issue backlogs as valid genres outside the four product-documentation types.
- Keep a README focused on orientation, first success, status, and routes to deeper documentation.
- Preserve existing document frontmatter; Diátaxis classification does not authorize removing or rewriting repository metadata conventions.
- Treat
index.md files as navigation surfaces. Do not flag their purposeful links and short descriptions as duplicated human-facing documentation.
- Prefer gradual improvement over a repository-wide rewrite without evidence.
- Do not sacrifice accuracy, runnable examples, accessibility, or source attribution for quadrant purity.
Final check
- Identify the primary reader need in one sentence.
- Confirm the title signals that need.
- Confirm the page behaves like its chosen type.
- Split or link only where another need would interrupt the page's flow.
- Verify facts and examples against current sources.
- Make the next step discoverable.
- Confirm existing frontmatter remains intact and navigation indexes were not mistaken for duplicate content.
1---2name: diataxis-docs3description: Design, classify, write, audit, or restructure technical documentation with the Diátaxis framework. Use for tutorials, how-to guides, reference material, explanations, documentation maps, README routing, documentation audits, or requests to separate mixed-purpose docs. Do not apply it automatically to internal plans, ADRs, research logs, or specifications unless the user wants those artifacts organized as product documentation.4---56# Diátaxis documentation78Use Diátaxis as a decision tool, not a four-folder template. Start from the reader's immediate need, give each page one primary purpose, and link across purposes when the reader is likely to need a different kind of help.910Read [references/framework.md](references/framework.md) before a broad documentation audit, information-architecture change, or ambiguous classification. It records the primary sources, the compass, and the distinctions most often lost in shorter skills.1112## Classify the need1314Ask two questions internally:15161. Does the reader need action or understanding?172. Are they acquiring skill or applying existing skill?1819Map the answers:2021| Reader need | Mode | Documentation type |22| ------------------------------------ | ----------------------- | ------------------ |23| Learn by doing | action + acquisition | Tutorial |24| Complete a real task | action + application | How-to guide |25| Look up facts while working | cognition + application | Reference |26| Understand reasons and relationships | cognition + acquisition | Explanation |2728Infer the type when the evidence is clear. Ask only when choosing incorrectly would materially change the requested artifact.2930## Choose the operation3132### Create or revise one page33341. State the intended reader and outcome in working notes.352. Select one primary documentation type.363. Preserve accurate repository-specific facts and examples.374. Write according to the type rules below.385. Move substantial off-purpose material to a better page, or link to an existing page.396. Check navigation so the reader has an obvious next destination.4041### Audit a documentation set42431. Inventory pages and their apparent audience.442. Classify each page by its dominant need; record uncertain or mixed pages.453. Find user journeys and missing destinations, not merely empty quadrants.464. Flag misleading titles, duplicated material, stale facts, dead ends, and mixed-purpose pages.475. Recommend the smallest useful restructure. Do not create empty sections merely to complete a matrix.486. Report evidence and concrete moves, splits, merges, or links.4950### Restructure mixed documentation51521. Preserve the source material and map every substantive section.532. Choose a primary page for each distinct reader need.543. Split only where the mix harms usability; short context or a small example may remain.554. Replace duplication with purposeful cross-links.565. Keep landing pages and READMEs as routing surfaces. They may summarize several types without pretending to be one of them.576. Verify that no claims or operational steps were lost.5859## Write by type6061### Tutorial6263- Own the learner's success.64- Provide one reliable path with an early visible result.65- Use concrete steps, expected observations, and a coherent learning sequence.66- Minimize branching, alternatives, and extended theory.67- Test commands and examples when the repository permits it.6869### How-to guide7071- Start from a specific real-world goal.72- Assume a competent practitioner and omit foundational teaching.73- Use ordered actions and conditionals only where the task requires them.74- Include prerequisites and success checks.75- Link to reference facts instead of reproducing exhaustive option lists.7677### Reference7879- Describe the machinery accurately, completely, and consistently.80- Mirror the product or API structure.81- Prefer stable headings, tables, signatures, defaults, constraints, and edge cases.82- Keep instruction and rationale subordinate; link outward for tasks and concepts.83- Generate from authoritative interfaces where possible, then verify the result.8485### Explanation8687- Explain why the subject exists and how its parts relate.88- Discuss constraints, history, alternatives, and tradeoffs.89- Connect the topic to adjacent concepts.90- Avoid turning the page into a numbered procedure or an exhaustive field catalog.9192## Respect repository context9394- Follow existing terminology, style, navigation, and contribution rules.95- Treat plans, decision records, research notes, release notes, and issue backlogs as valid genres outside the four product-documentation types.96- Keep a README focused on orientation, first success, status, and routes to deeper documentation.97- Preserve existing document frontmatter; Diátaxis classification does not authorize removing or rewriting repository metadata conventions.98- Treat `index.md` files as navigation surfaces. Do not flag their purposeful links and short descriptions as duplicated human-facing documentation.99- Prefer gradual improvement over a repository-wide rewrite without evidence.100- Do not sacrifice accuracy, runnable examples, accessibility, or source attribution for quadrant purity.101102## Final check103104- Identify the primary reader need in one sentence.105- Confirm the title signals that need.106- Confirm the page behaves like its chosen type.107- Split or link only where another need would interrupt the page's flow.108- Verify facts and examples against current sources.109- Make the next step discoverable.110- Confirm existing frontmatter remains intact and navigation indexes were not mistaken for duplicate content.