writing-documentation-with-diataxis
Applies the Diataxis framework to create or improve technical documentation. Use when being asked to write high quality tutorials, how-to guides, reference docs, or explanations, when reviewing documentation quality, or when deciding what type of documentation to create. Helps identify documentation types using the action/cognition and acquisition/application dimensions.
What this skill does
# Writing Documentation with Diataxis
You help users create and improve technical documentation using the Diataxis framework, which identifies four distinct documentation types based on user needs.
## What Diataxis Is
Diataxis is a framework for creating documentation that **feels good to use** - documentation that has flow, anticipates needs, and fits how humans actually interact with a craft.
**Important**: Diataxis is an approach, not a template. Don't create empty sections for tutorials/how-to/reference/explanation just to have them. Create content that serves actual user needs, apply these principles, and let structure emerge organically.
**Core insight**: Documentation serves practitioners in a domain of skill. What they need changes based on two dimensions:
1. **Action vs Cognition** - doing things vs understanding things
2. **Acquisition vs Application** - learning vs working
These create exactly four documentation types:
- **Learning by doing** → Tutorials
- **Working to achieve a goal** → How-to Guides
- **Working and need facts** → Reference
- **Learning to understand** → Explanation
**Why exactly four**: These aren't arbitrary categories. The two dimensions create exactly four quarters - there cannot be three or five. This is the complete territory of what documentation must cover.
## The Diataxis Compass (Your Primary Tool)
When uncertain which documentation type is needed, ask two questions:
**1. Does the content inform ACTION or COGNITION?**
- Action: practical steps, doing things
- Cognition: theoretical knowledge, understanding
**2. Does it serve ACQUISITION or APPLICATION of skill?**
- Acquisition: learning, study
- Application: working, getting things done
Then apply:
| Content Type | User Activity | Documentation Type |
|--------------|---------------|--------------------|
| Action | Acquisition | **Tutorial** |
| Action | Application | **How-to Guide** |
| Cognition | Application | **Reference** |
| Cognition | Acquisition | **Explanation** |
## When Creating New Documentation
### 1. Identify the User Need
Ask yourself:
- Who is the user? (learner or practitioner)
- What do they need? (to do something or understand something)
- Where are they? (studying or working)
### 2. Use the Compass
Apply the two questions above to determine which documentation type serves this need.
### 3. Apply the Core Principles
**For Tutorials** (learning by doing):
- You're responsible for the learner's success - every step must work
- Focus on doing, not explaining
- Show where they're going upfront
- Deliver visible results early and often
- Maintain narrative of expectation ("You'll see...", "Notice that...")
- Be concrete and specific - one path only, no alternatives
- Eliminate the unexpected - perfectly repeatable
- Encourage repetition to build the "feeling of doing"
- Aspire to perfect reliability
**For How-to Guides** (working to achieve goals):
- Address real-world problems, not tool capabilities
- Assume competence - they know what they want
- Provide logical sequence that flows with human thinking
- Address real-world complexity with conditionals ("If X, do Y")
- **Seek flow** - anticipate their next move, minimise context switching
- Omit unnecessary detail - practical usability beats completeness
- Focus on tasks, not tools
- Name guides clearly: "How to [accomplish X]"
**For Reference** (facts while working):
- Describe, don't instruct - neutral facts only
- Structure mirrors the product architecture
- Use standard, consistent patterns throughout
- Be austere and authoritative - no ambiguity
- Separate description from instruction
- Provide succinct usage examples
- Completeness matters here (unlike how-to guides)
**For Explanation** (understanding concepts):
- Talk about the subject from multiple angles
- Answer "why" - design decisions, history, constraints
- Make connections to related concepts
- Provide context and bigger picture
- Permit opinion and perspective - discuss trade-offs
- Keep boundaries clear - no instruction or pure reference
- Take higher, wider perspective
### 4. Use Appropriate Language
**Tutorials**: "We will create..." "First, do X. Now, do Y." "Notice that..." "You have built..."
**How-to Guides**: "This guide shows you how to..." "If you want X, do Y" "To achieve W, do Z"
**Reference**: "X is available as Y" "Sub-commands are: A, B, C" "You must use X. Never Y."
**Explanation**: "The reason for X is..." "W is better than Z, because..." "Some prefer W. This can be effective, but..."
### 5. Check Boundaries
Review your content:
- Does any part serve a different user need?
- Is there explanation in your tutorial? (Extract and link to it)
- Are you instructing in reference? (Move to how-to guide)
- Is there reference detail in your how-to? (Link to reference instead)
If content serves multiple needs, split it and link between documents.
## When Reviewing Existing Documentation
Use this iterative workflow:
**1. Choose a piece** - Any page, section, or paragraph
**2. Challenge it** with these questions:
- What user need does this serve?
- Which documentation type should this be?
- Does it serve that need well?
- Is the language appropriate for this type?
- Does any content belong in a different type?
**3. Use the compass** if the type is unclear
**4. Identify one improvement** that would help right now
**5. Make that improvement** according to Diataxis principles
**6. Repeat** with another piece
Don't try to restructure everything at once. Structure emerges from improving individual pieces.
## Key Principles
**Flow is paramount**: Documentation should move smoothly with the user, anticipating their next need. For how-to guides especially, think: What must they hold in their mind? When can they resolve those thoughts? What will they reach for next?
**Boundaries are protective**: Keep documentation types separate. The most common mistake is mixing tutorials (learning) with how-to guides (working).
**Structure follows content**: Don't create empty sections. Write content that serves real needs, apply Diataxis principles, and let structure emerge organically.
**One need at a time**: Each piece serves one user need. If users need multiple things, create multiple pieces and link between them.
**Good documentation feels good**: Beyond accuracy, documentation should anticipate needs, have flow, and fit how humans work.
## Common Mistakes to Avoid
1. **Tutorial/How-to conflation** - Tutorials are for learning (study), how-to guides are for working. Signs you've mixed them:
- Your "tutorial" assumes users know what they want to do
- Your "tutorial" offers multiple approaches
- Your "how-to guide" tries to teach basic concepts
- Your "tutorial" addresses real-world complexity
2. **Over-explaining in tutorials** - Trust that learning happens through doing. Give minimal explanation and link to detailed explanation elsewhere.
3. **How-to guides that teach** - Assume competence. Don't explain basics.
4. **Reference that instructs** - Reference describes, it doesn't tell you what to do.
5. **Explanation in action-oriented docs** - Move it to explanation docs and link to it.
## Quick Reference Table
| Aspect | Tutorials | How-to Guides | Reference | Explanation |
|--------------------|---------------------|---------------------|----------------------|------------------------|
| **Answers** | "Can you teach me?" | "How do I...?" | "What is...?" | "Why...?" |
| **User is** | Learning by doing | Working on task | Working, needs facts | Studying to understand |
| **Content** | Action steps | Action steps | Information | Information |
| **Form** | A lesson | Directions | Description | Discussion |
| **Responsibility** | On the teacher | On thRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.