diataxis-writing

Diataxis documentation framework practice guide. Provides diagnosis, classification, templates, and quality assessment for four documentation types (Tutorial/How-to/Reference/Explanation).

3,891 stars

Best use case

diataxis-writing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Diataxis documentation framework practice guide. Provides diagnosis, classification, templates, and quality assessment for four documentation types (Tutorial/How-to/Reference/Explanation).

Teams using diataxis-writing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/diataxis-writing/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/amumulam/diataxis-writing/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/diataxis-writing/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How diataxis-writing Compares

Feature / Agentdiataxis-writingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Diataxis documentation framework practice guide. Provides diagnosis, classification, templates, and quality assessment for four documentation types (Tutorial/How-to/Reference/Explanation).

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Diátaxis Documentation Framework Practice

## Quick Start

When creating or refactoring documentation:

### Pre-Writing Questions (Must Ask)

**Before starting, ask the user:**

1. **Language Preference**: "What language should this document be written in?"
   - English / 中文 / Other

2. **Output Method**: "After completion, how would you like to output this document?"
   - Chat message (default)
   - Feishu document (via MCP/mcporter)
   - Local Markdown file
   - GitHub repository
   - Other platforms

### Tool Availability Check (After User Selection)

**After user selects output method, automatically check tool availability:**

```bash
# Run auto-detection (script is in ./scripts/ relative to this skill)
python3 scripts/output-handler.py --detect
```

**Check results:**
- ✅ Tool available → Proceed with selected output method
- ⚠️ Tool not available → Inform user and suggest alternatives

**For Feishu output via MCP:**
- Check if mcporter is installed
- Check if MCP feishu server is configured (typically in `/root/config/mcporter.json` or `~/.mcporter/mcporter.json`)
- Test connection to Feishu MCP server

**If tool not available:**
1. Inform user: "Selected output method [X] is not available"
2. Suggest alternatives: "Available options: [list]"
3. Ask user to confirm alternative or configure tool

### Writing Workflow

After confirming language, output preference, and tool availability:

1. **Identify User Needs** - Use the [Diataxis Compass](references/compass.md) to determine document type
2. **Select Template** - Choose the corresponding template from [templates/](templates/)
3. **Apply Checklist** - Use the corresponding [checklist](references/) during writing
4. **Quality Assessment** - Use the [quality framework](references/quality-framework.md) to evaluate the final draft
5. **Execute Output** - Output using the user's chosen method and language

## Four Documentation Types

Diataxis identifies four fundamentally different documentation types, corresponding to four user needs:

| Type | User Need | Document Purpose | Key Characteristics |
|------|-----------|------------------|---------------------|
| **Tutorial** | Acquire skills (study) | Provide learning experience | Practice-oriented, minimize explanation, concrete steps |
| **How-to Guide** | Apply skills (work) | Help complete tasks | Goal-oriented, assume competence, handle real scenarios |
| **Reference** | Apply skills (work) | Describe technical facts | Neutral description, accurate and complete, structured |
| **Explanation** | Acquire skills (study) | Provide understanding context | Discursive, allows opinions, provides context |

### Type Details

- **Tutorial**: [references/four-types.md#Tutorial](references/four-types.md)
- **How-to Guide**: [references/four-types.md#How-to Guide](references/four-types.md)
- **Reference**: [references/four-types.md#Reference](references/four-types.md)
- **Explanation**: [references/four-types.md#Explanation](references/four-types.md)

## Using the Diataxis Compass

When unsure about document type, use the compass tool: [references/compass.md](references/compass.md)

Ask two questions:
1. **Content Type**: Is it action guidance (action) or cognitive knowledge (cognition)?
2. **User State**: Is the user acquiring skills (acquisition/study) or applying skills (application/work)?

## Common Use Cases

### Use Case 1: Troubleshooting Records → How-to Guide or Explanation

Troubleshooting records typically belong to:
- **How-to Guide**: If it's step-by-step guidance on "how to solve X problem"
- **Explanation**: If it's principle analysis on "why X problem occurred"

Template: [templates/template-troubleshooting.md](templates/template-troubleshooting.md)

### Use Case 2: Experience Summary → How-to Guide or Explanation

- **Best Practices**: How-to Guide (guidance on how to do things correctly)
- **Lessons Learned**: Explanation (explaining why certain approaches are wrong)

Template: [templates/template-best-practices.md](templates/template-best-practices.md)

### Use Case 3: Learning Notes → Tutorial or Explanation

- **Learning Notes**: Tutorial (if containing practical steps)
- **Theory Summary**: Explanation (if conceptual understanding)

Template: [templates/template-learning-notes.md](templates/template-learning-notes.md)

### Use Case 4: Exploratory Sharing → Explanation

Technical exploration, experiment records, and comparative analysis typically belong to Explanation.

Template: [templates/template-exploration.md](templates/template-exploration.md)

## Checklists

Use checklists during and after writing:

- Tutorial: [checklist/checklist-tutorial.md](checklist/checklist-tutorial.md)
- How-to: [checklist/checklist-how-to.md](checklist/checklist-how-to.md)
- Reference: [checklist/checklist-reference.md](checklist/checklist-reference.md)
- Explanation: [checklist/checklist-explanation.md](checklist/checklist-explanation.md)

## Quality Assessment

Use the Functional Quality and Deep Quality framework: [references/quality-framework.md](references/quality-framework.md)

### Functional Quality
- Accuracy, completeness, consistency, usability, precision

### Deep Quality
- Flow, fitting human needs, beauty, anticipating user needs

## Common Mistakes

Avoid the following error patterns: [references/common-mistakes.md](references/common-mistakes.md)

1. **Type Conflation** - Mixing Reference content into Tutorial
2. **Misplacement** - Writing Explanation as Tutorial
3. **Boundary Blur** - Mixing too much explanation into How-to
4. **Structural Misalignment** - Reference not reflecting product architecture

## Language Style

Four types use different language styles: [references/writing-language.md](references/writing-language.md)

- **Tutorial**: "We will...", "Notice...", "Now do X..."
- **How-to**: "If you want X, do Y", "Refer to X documentation for complete options"
- **Reference**: "X inherits Y", "Subcommands: a, b, c", "Must use X"
- **Explanation**: "The reason for X is...", "W is better than Z because..."

## Output Methods

After completing the document, output using the user's chosen method:

### Available Output Methods

1. **Chat Message** - Display directly in conversation (default)
2. **Feishu Document** - Create/update Feishu document via **MCP/mcporter** (requires MCP feishu server)
3. **Local Markdown** - Save as .md file (built-in support)
4. **GitHub Repo** - Commit to code repository (requires MCP github or git)
5. **Other Platforms** - User provides platform and MCP capabilities

**Important:** For Feishu output, always use MCP/mcporter method, NOT channel tools.

### Detect Available Tools

Use [scripts/output-handler.py](scripts/output-handler.py) to auto-detect (script is in `./scripts/` relative to this skill file):

```bash
python3 scripts/output-handler.py --detect
```

### Tool Availability Check

**After user selects output method, check if tool is available:**

1. Run `output-handler.py --detect`
2. Check if selected tool is configured and available
3. If not available:
   - Inform user: "Selected output method [X] is not available"
   - Suggest alternatives from available tools list
   - Ask user to confirm alternative

### Choose Output Method

**Must ask user:** "Document completed, how would you like to output?"

Based on user selection:
- **Chat** → Reply directly
- **Feishu (MCP)** → Use mcporter to call Feishu MCP server
  ```bash
  node /path/to/mcporter/dist/cli.js call feishu doc.create '{"title":"...", "content":"..."}'
  # Note: mcporter path varies by installation, common paths:
  # - ~/.npm/_npx/*/node_modules/mcporter/dist/cli.js
  # - Or use: npx mcporter call feishu doc.create ...
  ```
- **Local** → Call `write` tool or `output-handler.py --output local`
- **GitHub** → Call `output-handler.py --output github`
- **Other** → Ask user to provide MCP server information

### Language Considerations

Output in the user's chosen language:
- If English → Output in English
- If Chinese (中文) → Output in Chinese
- If other → Confirm translation capabilities

### Output Platform Details

Complete platform list and configuration methods: [references/output-platforms.md](references/output-platforms.md)

| Platform | Required Tools | Configuration Difficulty | Use Case |
|----------|---------------|-------------------------|----------|
| Chat | None | - | Quick reply |
| Feishu (MCP) | MCP feishu server | Medium | Team collaboration |
| Local MD | write | Low | Personal knowledge |
| GitHub | MCP github/git | Medium | Tech blog |
| Notion | MCP notion | Medium | Knowledge base |
| Google Docs | MCP google | High | Google ecosystem |

## Theoretical Framework

Complete Diataxis theory:

- **Map Model**: [references/map.md](references/map.md)
- **Theoretical Foundations**: [references/four-types.md](references/four-types.md)
- **Quality Theory**: [references/quality-framework.md](references/quality-framework.md)

## Using Scripts (Optional)

Use the diagnosis script to automatically identify document types (script is in `./scripts/` relative to this skill):

```bash
python3 scripts/diagnose.py <document content or file path>
```

---

**Skill Version**: 1.0  
**Theory Source**: https://diataxis.fr  
**Author**: Zhua Zhua (Created for Master)

Related Skills

afrexai-copywriting-mastery

3891
from openclaw/skills

Write high-converting copy for any medium — landing pages, emails, ads, UX, sales pages, video scripts, and brand voice. Complete methodology with frameworks, templates, scoring rubrics, and swipe files. Use when writing or reviewing any user-facing text.

Content & Documentation

afrexai-conversion-copywriting

3891
from openclaw/skills

Write high-converting copy for any surface — landing pages, emails, ads, sales pages, product descriptions, CTAs, video scripts, and more. Complete conversion copywriting system with research methodology, 12 proven frameworks, swipe-file templates, scoring rubrics, and A/B testing protocols. Use when you need to write or review any copy meant to drive action.

Content & Documentation

human-writing

3891
from openclaw/skills

Guidelines and standards for professional, human-like writing and documentation. Use this skill when generating READMEs, technical documentation, code comments, or any formal written output to avoid common AI 'tells', buzzwords, and stylistic tropes. Ensure content follows the 'Professional Human in the Field' standard: high precision, zero fluff, and no emojis in technical contexts.

Content & Documentation

marketing-copywriting

3891
from openclaw/skills

Generate marketing copy, emails, and promotional content based on customer personas with multi-style rewriting capabilities

Content & Documentation

writing-agent-creator

3891
from openclaw/skills

Generate writing agent configurations for OpenClaw. Use when the user wants to: (1) Create specialized writing agents (tech, marketing, academic, business, creative) (2) Add custom agent templates (persisted, won't be overwritten) (3) Generate sub-agent spawn instructions (4) List available agent templates IMPORTANT: This skill GENERATES configs - it does NOT modify user's existing files. User custom templates are saved to ~/.openclaw/workspace/agent-templates/

superpowers-writing-plans

3891
from openclaw/skills

Use when you have a spec or requirements for a multi-step task, before touching code - guides writing comprehensive implementation plans with bite-sized tasks, TDD, and DRY/YAGNI principles

harvey-specter-writing-style

3891
from openclaw/skills

Rewrite or draft text in a Harvey Specter (Suits)-inspired writing style: confident, concise, sharp-witted, leverage-focused, and decisive. Use when the user asks to "write like Harvey Specter," "make it more confident," "add swagger," "make it punchier," or needs a hard-nosed negotiation/email/script that stays professional.

don-corleone-writing-style

3891
from openclaw/skills

Rewrite or draft text in a Don Corleone (Godfather)-inspired patriarchal dealmaker writing style: formal, measured, loyal-favors oriented, and decisive. Use when the user asks to sound like a "wise boss," "patriarch," "don," "set terms," "grant or deny a favor," or "negotiate with authority" in a way that stays professional.

writing-style-cloner

3891
from openclaw/skills

Antonia的个人写作风格克隆器。将语音转录稿或草稿直接改写为符合Antonia写作风格的自媒体文章。

diataxis-docs-framework

3891
from openclaw/skills

Enterprise technical documentation best practices, patterns, and frameworks for developer and partner adoption. Covers content architecture (Diataxis four quadrants), 14 content types (tutorials, how-to guides, API reference, SDK docs, migration guides, changelogs, runbooks, integration guides, troubleshooting, architecture docs), pluggable writing styles (Diataxis, Google, Microsoft, Stripe, Canonical, Minimal), information architecture, docs-as-code workflows, documentation audit, anti-patterns checklist, and developer experience (DX) strategy. 27 rules, 5 references, 6 style guides. Baseline: Diataxis + Google OpenDocs + Good Docs Project. Triggers on: "write docs", "document this", "API docs", "developer docs", "migration guide", "changelog", "tutorial", "how-to guide", "reference docs", "documentation strategy", "docs audit", "information architecture", "developer experience", "partner docs", "SDK documentation", "runbook", "troubleshooting guide", "integration guide", "quickstart", "getting started", "technical writing", "docs-as-code", "DX", mentions of "Diataxis", "Good Docs Project", or "Google OpenDocs".

elixir-writing-docs

3891
from openclaw/skills

Guides writing Elixir documentation with @moduledoc, @doc, @typedoc, doctests, cross-references, and metadata. Use when adding or improving documentation in .ex files.

adr-writing

3891
from openclaw/skills

Write Architectural Decision Records following MADR template. Applies Definition of Done criteria, marks gaps for later completion. Use when generating ADR documents from extracted decisions.