Documents
3 – Generate Docs
3 – Generate Docs
Type
Document
Status
Published
Created
Sep 5, 2025
Updated
Mar 1, 2026
Updated by
Dosu Bot

Dosu generates documentation by analyzing your code, conversations, issues, and pull requests. You provide a topic and instructions; Dosu researches your data sources and produces a draft.

null

Approach#

When you request a document, Dosu:

  1. Reviews your published templates and selects one that matches your documentation request (if available)
  2. Searches for existing documentation patterns in your knowledge base to model the structure of the new document
  3. Searches your selected data sources for relevant information
  4. Gathers context from code, discussions, issues, and PRs
  5. Synthesizes findings into a structured document with citations

Data sources can include GitHub repositories, GitLab repositories, Slack conversations, Linear tickets, pull request discussions, and any other sources you've connected to Dosu.

Template Selection#

Template selection is available as the first step in the documentation generation workflow. When templates exist in your knowledge store, Dosu automatically checks for a matching template before beginning research.

How It Works:

  • Dosu searches your published templates for one that matches your documentation request
  • When a matching template is found, Dosu uses it as a structural guide for both research and writing
  • Templates are returned with title, description, and body content to guide the documentation structure
  • Dosu records which template was used to generate each page, enabling you to query pages by their assigned template and regenerate documents with the same template configuration
  • If no matching template exists, Dosu proceeds with standard research and outline generation

To use template selection, you must first create and publish templates in your knowledge store. This helps ensure consistent structure and high-quality output by leveraging proven documentation patterns.

Style Guidelines#

Documentation generation supports space-level style guidelines that control how Dosu writes and formats content. As part of its standard workflow, Dosu automatically reads any configured style guidelines before generating documentation and applies them throughout the process.

How It Works:

  • Before invoking the documentation generator, Dosu automatically reads your space's style guidelines
  • These guidelines are then applied during research planning, outline creation, and document writing
  • The documentation generator receives the guidelines automatically—no manual configuration needed

Style guidelines help you maintain consistency across your documentation by defining:

  • Writing conventions and tone
  • Formatting standards
  • Documentation structure preferences
  • Team-specific practices and terminology

Style guidelines are optional but recommended for maintaining consistent documentation quality across your workspace.

Automatic Pattern Matching#

When you generate documentation through the UI, Dosu automatically includes an instruction to search for existing documentation and model new documents on their structure and style. This helps ensure that documentation across your knowledge base maintains consistent patterns as it grows.

How It Works:

  • When you create a document using the UI workflow, Dosu adds a default instruction to search your published documents for similar content that matches your documentation request
  • The structure, formatting, and organizational patterns from existing documents are analyzed and used as a model for the new content
  • This learned pattern is applied with the following precedence: your explicit instructions take priority, followed by any configured style guidelines, and finally the patterns learned from existing documentation
  • New documents automatically follow the conventions established in your existing documentation unless you specify otherwise

This default behavior ensures that UI-generated documentation integrates seamlessly with your existing documentation set, maintaining consistency in structure, tone, and formatting conventions without requiring manual configuration.

Creating a Document#

  1. Click Documents in the left navigation.
  2. Click + New.
  3. Enter a Document Name.
  4. Provide Instructions for Dosu describing what you want documented.
  5. Select which Data Sources Dosu should research.
  6. Click Generate.

Generation typically takes a few minutes.

Drafts and Publishing#

Documents start as drafts. While in draft state, you can review and edit the content before making it available more broadly.

Publishing Options#

You can publish documents to two destinations:

Within Dosu:
When you publish internally:

  • Dosu references it when answering questions on GitHub and Slack
  • Dosu monitors related code for changes and suggests updates when PRs are merged

If you want Dosu to keep documentation up to date as your codebase evolves, publishing is required. See Maintain Docs for details on how automatic updates work.

To GitHub:
You can also publish documents directly to GitHub repositories via pull request. When publishing to GitHub:

  1. Select a target repository with the Dosu GitHub App installed
  2. Browse the directory tree to choose where the file should be created
  3. Specify a filename (or leave empty to use the document title)
  4. Dosu creates a pull request with your document as a markdown file

The document is published as a pending PR tracked by Dosu. Once the PR merges, the document becomes synced and tracked by GitHub—similar to documentation imported from GitHub. This enables version control and collaboration through standard GitHub workflows.

To Confluence:
Publishing to Confluence syncs your document to a Confluence space, making it visible in your team's Confluence workspace while Dosu keeps it up to date.

Next Steps#

With Generate Docs enabled, you can quickly move from empty pages to structured, review-ready documentation.

  • Use Drafts for early iterations.
  • Click Publish once you’re happy, and Dosu will help keep it up to date.
  • Pair this with Maintain Docs to keep your documentation up to date.

Documentation shouldn’t slow you down. Dosu integrates it into your everyday workflow.