Tutorials & tips

Published:

24 Nov, 2026

Documentation best practices: how to structure, write, and maintain better docs

A well-structured docs page with numbered steps and a verified success message, read by both people and AI agents.

AI summary

Effective documentation starts with usersโ€™ tasks, a predictable structure, and instructions readers can verify. Test whether people and AI agents can find and apply that content, connect updates to product workflows, and use real questions and feedback to guide improvements.

Good documentation helps someone answer a question or complete a task. Even when every page is accurate, readers can struggle to find the information they need or understand how to use it. They also need to trust that the instructions reflect how the product works today.

AI agents increasingly retrieve that same documentation to answer questions and perform tasks on someoneโ€™s behalf. These seven practices will help you plan and maintain docs that both people and agents can use, whether youโ€™re starting a new site or improving an existing one.

1. Identify your audiences and the tasks they need to complete

Before creating pages, list the people who rely on your documentation and what theyโ€™re trying to achieve. Your productโ€™s feature list describes what youโ€™ve built, but it wonโ€™t necessarily tell you what users need help doing.

For example, imagine a software product called Northstar, which helps teams analyze data. Its documentation might serve several audiences:

Audience

Main task

Content needed

New customer

Create their first report

Getting started tutorial

Developer

Send data from another application

API quickstart and reference

Administrator

Control access to company data

Permissions and security guides

Existing user

Fix a failed data import

Troubleshooting instructions

Create a similar table for your product. Start with three or four audiences and identify their two most important tasks. For each task, note what the reader needs beforehand, the action theyโ€™ll take, and what success looks like.

Compare this list with your existing docs. If a critical task has no clear starting page, youโ€™ve identified a content gap. If a task requires jumping between several unrelated pages, you may need a more complete guide.

Using GitBook: Organize related content into pages and groups, and use separate site sections when audiences need distinct entry points. Base those divisions on readersโ€™ needs, even when different teams own the content.

2. Build your navigation around user goals and journeys

Use those tasks to plan your sidebar. Readers should be able to predict where information belongs without knowing how your company is organized internally.

For Northstar, a starting structure might look like this:

  • Getting started: Overview, set up your account, create your first report

  • Guides: Connect a data source, manage dashboards, invite teammates

  • Concepts: How data sync works, roles and permissions

  • API reference: Authentication, endpoints, webhooks

  • Troubleshooting: Import failures, common error messages

Documentation sidebar for a fictional product called Northstar, with a search field and five sections: Getting started, Guides, Concepts, API reference and Troubleshooting. Getting started is open, showing Overview, Set up your account and Create your first report, with Create your first report highlighted. Guides is open, showing Connect a data source, Manage dashboards and Invite teammates.

This structure separates learning a workflow from understanding a concept or looking up a technical detail. Someone creating their first report shouldnโ€™t have to navigate API endpoint descriptions to find the next step.

To plan your own structure, write each important topic on a card or in a spreadsheet. Group topics by the readerโ€™s goal, name each group using words your users recognize, and put the most common starting tasks near the top. Keep groups focused: if you notice that โ€œGuidesโ€ is becoming a home for everything, divide it into meaningful task categories.

Our information architecture guide dives into more detail about choosing documentation categories, organizing pages, and applying frameworks such as Diรกtaxis. Itโ€™s a great next step if youโ€™re following the advice here.

Next, sketch the route from a visitorโ€™s first page to a completed task. A getting-started page should link to the next action so readers can continue the task. Link to reference material when necessary, but donโ€™t make readers reconstruct an entire workflow from reference pages.

Using GitBook: Create the hierarchy with pages and page groups. For larger sites, use site sections to separate substantial areas such as product guides and API documentation. Start with the simplest structure that works.

Mozilla.ai brought documentation for several separate open source projects into a single hub. Developers can more easily discover related tools and find the information they need.

Try it: Give someone unfamiliar with your product a goal, such as โ€œCreate your first report.โ€ Ask them where theyโ€™d click first. If their answer differs from what you expected, revisit the labels or grouping. You can run the same test with an agent, then ask how it completed the task, where it got stuck, and why it succeeded or failed.

3. Write instructions that lead to a verifiable result

A task-based page should take a reader from a known starting point to an outcome they can verify. Give individual tasks their own guides, with separate conceptual explanations and reference pages where needed.

Use this template:

  1. Title and outcome: Use โ€œConnect a PostgreSQL data sourceโ€ as the title, followed by one sentence explaining what the reader will accomplish.

  2. Before you begin: List required access, credentials, supported versions, or other prerequisites.

  3. Instructions: Give numbered actions in the order they must happen.

  4. Verify the result: Explain what success looks like and how to confirm it.

  5. Troubleshooting and next steps: Address likely failures and link to related tasks.

Make instructions specific enough to follow without guessing. โ€œConfigure your connection settingsโ€ is vague. For our fictional Northstar product, a better example would be: โ€œOpen Settings โ†’ Data sources, select Add source, choose PostgreSQL, and enter your database host and credentials. Select Test connection before saving.โ€

Use the precise labels in your product and show the expected success or error message. Where a step is complicated, add a focused screenshot or code sample directly beside it.

A documentation page titled "Connect a PostgreSQL data source", shown in a browser window with a sidebar. Five sections are separated by dividers: a title with a one-line outcome; "Before you begin", listing two prerequisites; three numbered steps; "Verify the result", with a "Connection successful" confirmation; and "Troubleshooting and next steps", with one tip and a link to the next guide.

Before publishing, ask a teammate to perform the task with only that page open. Note every guess they make: an unexplained field, missing permission, ambiguous button, or unclear success condition. Revise the instructions wherever they have to guess.

Avoid mixing requirements, background explanations, and actions into one paragraph. Readers should be able to scan the numbered steps, then consult additional detail when they need it.

Using GitBook: Use headings, stepper blocks, code blocks, and hints to separate instructions from notes or warnings. GitBook Agent can help restructure a draft, but the product owner should verify every setting, command, and expected result.

4. Test whether people can find the right information

Check whether page titles, search terminology, and links between related articles help readers find your instructions. Start with titles that describe the task or question. โ€œAuthenticationโ€ might be an appropriate reference category, but โ€œSet up single sign-onโ€ is more useful for a person (or agent) trying to complete that task. Use the words customers use when asking for help, and define specialist terminology when you introduce it.

Then run a simple findability test. Give a colleague three realistic questions without showing them where the answers live. For Northstar, those might be โ€œHow do I connect a database?โ€, โ€œWho can invite teammates?โ€, and โ€œWhy did my import fail?โ€ Ask them to find an answer using navigation or search, and watch where they hesitate.

If they search for โ€œdatabase connectionโ€ but the relevant page is titled โ€œExternal ingestion,โ€ consider changing the title or introducing the familiar term in the page. If the answer requires several steps, link the relevant pages in sequence.

Readers also need a clear route through the task. When we rebuilt GitBookโ€™s own documentation, we reorganized content around user journeys rather than product features. We tested whether someone could follow a single section from start to finish without unnecessary detours, moving, merging, or removing pages that interrupted the journey. Apply the same test to your most important workflows.

Using GitBook: Published sites include search, and AI Assistant can offer another way to ask questions when enabled. Test both, but donโ€™t rely on AI to compensate for missing content or unclear navigation.

5. Make your documentation useful to people and AI agents

The same information may now be read directly by a person or retrieved by an agent thatโ€™s answering a question, writing code, or completing a workflow. In GitBookโ€™s 2026 readership research, AI agents accounted for 51.8% of intentional documentation reads in the analyzed week across qualifying GitBook-hosted sites.

You donโ€™t need to write two versions of every page. Start with accurate, well-structured content: descriptive headings, explicit prerequisites, clearly named settings, and examples that include expected outcomes. Avoid instructions that depend on visual context alone, such as โ€œClick the button on the right.โ€

In our recent experiment on documentation defects, missing steps caused AI agents to spend up to nearly 10x more tokens trying to complete a task, while incorrect values led them to confidently report incorrect results. Keeping your content accurate and complete is vital.

An agent may also need to know when to stop. If a task requires administrator approval, live credentials, or a potentially disruptive change, state that condition next to the relevant step. Make clear which instructions are safe in a test environment and which require human review.

Next, check that compatible tools can access the content. GitBook publishes Markdown versions of pages, llms.txt and llms-full.txt, and an MCP server for published docs. These give AI tools ways to retrieve your content. Accurate, clear instructions are still necessary for correct answers.

Test with three common user questions or tasks. Ask a connected agent to find the relevant page, explain the steps, and identify any prerequisites. Compare its answer with the source documentation. If the agent misses a condition, ask it why and investigate whether the page is ambiguous, the information is inaccessible, or retrieval failed.

Using GitBook: The published docs MCP server lets agents ask questions through AI Assistant (when enabled) and leave direct feedback about unclear or missing content. You can review AI Assistant questions, MCP searches, and agent feedback in GitBook, then use GitBook Agent to propose targeted fixes for review. Weโ€™ll cover how to act on these insights in section 7.

Verifone is already putting this into practice, using GitBookโ€™s MCP integration to let partners connect their own AI agents to documentation, retrieve answers, and generate code for their integrations.

6. Give documentation updates a place in your existing workflow

Documentation becomes outdated when product changes happen without corresponding content changes. Assign responsibility for each documentation area and identify the events that should trigger an update.

Area

Responsible team

Review trigger

API reference

Engineering

Endpoint or schema change

Product guides

Product and docs

Feature or UI release

Troubleshooting

Support and docs

Repeated support issue

Access and security

Security or IT

Permission or policy change

For example, when Northstar changes a permission setting, review the affected instructions, screenshots, and related troubleshooting pages. Before publishing, verify that someone can still follow the documented steps successfully.

Between releases, review high-impact pages such as onboarding, authentication, and frequently used workflows. Check that instructions still work, links resolve, examples are accurate, and screenshots match the product. Use each pageโ€™s importance and usage to decide how often to review it.

Using GitBook: Contributors can propose edits through change requests for review. The Content gaps, Broken links, and Style guide features can surface issues; GitBook Agent can help prepare fixes. Review factual changes before merging, especially technical instructions. Some quality features require specific plans.

Our step-by-step documentation audit guide explains how to combine these tools into a repeatable process.

Tuum takes this further by generating its OpenAPI specifications from the codebase and automatically publishing updated API references through GitBook as part of its release process.

7. Use reader behavior to decide what to improve next

Once youโ€™ve published, watch where people and agents find answers and where they get stuck as they work through tasks.

Review signals such as searches with no results, unanswered AI Assistant questions, negative feedback, popular pages, and agent or MCP activity. Investigate whatโ€™s behind each signal: frequent visits may mean a page is useful, and an agent may fail because it lacks permissions even when the instructions are sound.

For example, suppose human readers and agents repeatedly ask how to recover from an authentication error. The reference may list an error code without explaining its cause or recovery steps. Add a short troubleshooting procedure with a sample response, likely causes, and actions to try.

Then test the same question with a colleague and a connected agent. Can each find and use the new instructions? This is often faster to repeat with agents, but human task testing still reveals confusion agents might miss.

Using GitBook: Docs Insights shows human and agent traffic, MCP searches, and AI Assistant questions. Agents can also submit direct feedback about unclear or outdated information through published-docs tools. Use these signals to identify gaps, then ask GitBook Agent to suggest improvements for your team to review.

At Gantner, GitBookโ€™s AI insights helped the documentation team identify a customer question that had also reached the product manager through support. The team found the content gap without waiting for someone to report it.

Set aside 30 minutes each month to review recurring problems and their consequences, then choose one or two improvements to test.

A checklist for improving your documentation

You donโ€™t need to rebuild your entire docs site at once. Start with a critical user journey and work through these checks:

  • Identify the intended reader and their goal.

  • Make the starting page easy to find.

  • Write instructions with prerequisites and a verifiable outcome.

  • Test navigation, search, and agent access.

  • Assign an owner and a review trigger.

  • Use reader questions and feedback to choose your next improvement.

Keep revisiting important tasks as your product changes and new questions arise. Small improvements can make it easier for people and agents to get reliable answers.

How to structure documentation: Information architecture best practices

How to audit and improve your docs with GitBook Agent and MCP

Research: What documentation defects cost AI coding agents

Share
Get the GitBook newsletter

Get the latest product news, useful resources and more in your inbox. 130k+ people read it every month.

Email

Accurate docs. Better answers.

Your docs are already feeding AI. Are users getting the right answers or the wrong ones?

Accurate docs. Better answers.

Your docs are already feeding AI. Are users getting the right answers or the wrong ones?

Accurate docs. Better answers.

Your docs are already feeding AI. Are users getting the right answers or the wrong ones?

Enterprise

Intelligent documentation thatโ€™s built to scale




Verifone thumbnail
Verifone logo - white
Verifone

How Verifone increased assistant traffic by 8x after migrating to GitBook

The State of Docs Report 2026

State of Docs brings together insights from documentation experts from across the industry

Verifone thumbnail
Verifone logo - white
Verifone

How Verifone increased assistant traffic by 8x after migrating to GitBook

The State of Docs Report 2026

State of Docs brings together insights from documentation experts from across the industry

Verifone thumbnail
Verifone logo - white
Verifone

How Verifone increased assistant traffic by 8x after migrating to GitBook

The State of Docs Report 2026

State of Docs brings together insights from documentation experts from across the industry