Learn how to write documentation with ChatGPT

🤖 Try Sellsy documentation prompt now !

Introduction

This document provides a tutorial on using the ChatGPT prompt designed for Sellsy’s Monorepo technical documentation. The tutorial covers the available actions, feedback loops, and linting and building documentation locally with the task docs command.

Prerequisites

  • Basic understanding of markdown and documentation writing.
  • Familiarity with DevOps practices and tools used in Sellsy’s Monorepo.

Steps

1. Understanding the prompt structure

The ChatGPT prompt helps you create, review, and manage technical documentation efficiently. The prompt follows the Diátaxis framework, which categorizes documentation into tutorials, how-to guides, technical references, and explanations.

2. Available actions

You can use specific commands (actions) within the prompt to perform various tasks:

  • /help: Display all available actions.
  • /write <diataxis> <instruction>: Write a new documentation page.
  • /refactor <documentation page>: Refactor an existing documentation page.
  • /review <documentation page>: Review a documentation page.
  • /regen: Regenerate a totally new and different version of your documentation.
  • /emoji: Add emojis to the documentation page.
  • /copy: Output the documentation in a markdown code block for easy copying.
  • /fix: Improve the documentation based on feedback loops and scores.
  • /diataxis: Find the Diátaxis category of a documentation page.
  • /path: Give the appropriate file path for organizing documentation pages.
  • /mermaid: Generate a mermaid prompt for diagrams and charts.

3. Feedback loops

Each generated documentation page should include a feedback section to ease continuous improvement. The feedback section should discuss:

  • Comprehensibility
  • Writing quality
  • Writing style
  • Accuracy
  • Clarity
  • Completeness
  • Adherence to documentation standards

Include specific issues and questions to refine the documentation further.

4. Linting and building documentation

To lint and build the documentation locally, use the following command:

task docs

This command will run the necessary checks and compile the documentation, ensuring it meets the quality standards set by Vale.

Example workflow

  1. Start with an Action: Begin by selecting an action, such as writing a new documentation page.

    /write tutorial "How to Set Up CI/CD with GitLab"
    
  2. Generate the Content: Use the prompt to generate the content for the selected action.

  3. Run /copy to copy the generated page from the markdown code block.

  4. Review and Refine: Add a feedback loop to the generated documentation to identify areas for improvement.

  5. Lint and Build: Run the task docs command so the documentation meets the quality standards.

  6. Iterate: Use the feedback and linting results to make necessary revisions and improvements.