|
| 1 | +--- |
| 2 | +tags: technical documentation, diátaxis, ai, docs, sphinx |
| 3 | +category: learning |
| 4 | +date: 2026-01-25 |
| 5 | +title: Hello Diátaxis |
| 6 | +--- |
| 7 | + |
| 8 | +# Hello [Diátaxis](https://diataxis.fr/start-here/) |
| 9 | + |
| 10 | +As a software engineer, I tend to treat user documentation as something to be written late in the development when I think that someone might use my software. |
| 11 | +I could improve this klingonian approach, but not today. |
| 12 | + |
| 13 | +Anyway, this weekend I decided to spend 10 minutes and request my apprentice (aka AI Agent) to refactor the documentation I wrote for my python application. |
| 14 | +I already had some documentation, but this was ... well, let's say not the best ;) |
| 15 | + |
| 16 | +So I need to tell my apprentice what I want, but writing prompts takes also time. I switched to another apprentice and asked it to write a prompt for me: |
| 17 | + |
| 18 | +This was my request: |
| 19 | + |
| 20 | +``` |
| 21 | +I have a python application and want to write the documentation |
| 22 | +and publish it to readthedocs. |
| 23 | +Please create a prompt for an ai agent to parse the code, |
| 24 | +existing documentation and generate the documentation. |
| 25 | +Look for best practices for writing documentation and include them in the prompt. |
| 26 | +Remember that less is more. |
| 27 | +``` |
| 28 | + |
| 29 | +In seconds I got this prompt: |
| 30 | + |
| 31 | +``` |
| 32 | +The AI Agent Prompt |
| 33 | +
|
| 34 | +Role: You are an expert Technical Writer specializing in Python |
| 35 | +and the Diátaxis framework. |
| 36 | +
|
| 37 | +Objective: Parse the provided codebase and existing notes to generate |
| 38 | +a comprehensive documentation suite optimized for Read the Docs (MkDocs or Sphinx). |
| 39 | +
|
| 40 | +Guidelines: |
| 41 | +
|
| 42 | +- Clarity over Volume: Use the "less is more" principle. Avoid fluff; prioritize "Time to First Hello World." |
| 43 | +- Standards: Ensure all docstrings follow PEP 257 (Google or NumPy style). |
| 44 | +- Structure (Diátaxis): Organize content into four distinct categories: |
| 45 | + - Tutorials: Learning-oriented (Step-by-step for beginners). |
| 46 | + - How-to Guides: Problem-oriented (Solving specific tasks). |
| 47 | + - Reference: Information-oriented (API technical descriptions). |
| 48 | + - Explanation: Understanding-oriented (Concepts and architecture). |
| 49 | +
|
| 50 | +Task Requirements: |
| 51 | +
|
| 52 | +- README.md: Create a high-level overview including installation, a 5-line "Quick Start" code block, and links to the full docs. |
| 53 | +- API Reference: Automatically generate documentation for all public classes and functions based on code logic and docstrings. |
| 54 | +- Requirement File: Ensure requirements.txt or pyproject.toml is correctly reflected in the setup instructions. |
| 55 | +- Configuration: Generate a basic .readthedocs.yaml and mkdocs.yml (or conf.py) file to ensure seamless deployment. |
| 56 | +
|
| 57 | +Output Format: Provide the documentation in Markdown (for MkDocs) or reStructuredText (for Sphinx). |
| 58 | +``` |
| 59 | + |
| 60 | +Like a good master I am ;), I checked the prompt my apprentice wrote and saw that the role is about Python and also `Diátaxis framework`. |
| 61 | + |
| 62 | +At this point I was like, why does my apprentice invent words and frameworks again? :) |
| 63 | + |
| 64 | +In the end, what should have been a 10 minute task to let my apprentice generate the documentation and then me to review and approve it, |
| 65 | +took me over one hour to understand what [Diátaxis](https://diataxis.fr/start-here/) is and why didn't I know about it before. :) |
| 66 | + |
| 67 | +I had to adapt the prompt slightly for my project setup (Sphinx, Myst Parser, etc.). |
| 68 | +The Sphinx theme and layout remained untouched but the chapters changed completely. |
| 69 | +Here is the refactored documentation: [pypeline-runner.readthedocs.io](https://pypeline-runner.readthedocs.io/en/latest/). |
| 70 | + |
| 71 | +I think I will use this "framework" for my future documentation projects and of course create an agentic [SKILL](https://agentskills.io/specification) to do this for me. ;) |
| 72 | + |
| 73 | +Have fun and happy documenting! |
0 commit comments