Guide

Generate documentation from source

Turn repository evidence into a DocsPress-compatible Markdown tree without inventing commands, behavior, or support guarantees.

1. Install the repository skills

Install both DocsPress skills so generation can hand off to publication after review:

Install DocsPress skills bash
npx skills add Automattic/docspress --all --full-depth
npx skills list

2. Ask for an evidence pass first

Prompt Coding agent Plan Thinking
Use $generate-docs-from-source to inspect the public surface of this repository. Build a coverage map from package metadata, exports, commands, configuration reads, tests, examples, and existing docs. Show the proposed docs tree before writing pages, and identify any contradictions instead of guessing.
$generate-docs-from-source @repository package.json src/ test/ docs/
Separate repository research from documentation writing.

The agent should treat tests and executable examples as stronger evidence than comments. It should preserve useful existing documentation and avoid documenting private helpers as public APIs.

3. Generate the smallest complete tree

A typical project may need:

docs/ File tree
  • index.md
  • getting-started/
    • index.md
    • installation.md
    • configuration.md
  • guides/
    • first-workflow.md
  • reference/
    • api.md
    • cli.md
  • troubleshooting.md
The source determines which pages exist; this is a shape, not a required template.

Each page should have one clear outcome, verified examples, relative links, and a stable route. Use ordinary Markdown for ordinary prose. Use DocsPress blocks for prompts, connected flows, terminal sessions, API exchanges, callouts, collapsible file trees, code alternatives, and verification results when those semantics are useful.

4. Keep publication disabled

The generation pass may prepare a DocsPress workflow when one is missing, but it should start with workflow_dispatch, status: draft, and dry-run: true.

Continue with Review and publish.