Skip to main content

Agent guides

An agent guide is a setup or troubleshooting procedure, written in the docs page people already read, that the build compiles into an Agent Skill. Agents get the steps, how to check each one worked, and what to do when a check fails. People reading the page see the same steps they always did, so the two can't drift apart.

Transcript

Your setup page is already a procedure. Mark it up, and the build turns it into a skill an agent can follow, one step at a time.

Here's the Example SDK's installation page. People read it as they always have: install the package, set your key, and check that it works.

Wrap the procedure in AgentGuide. Put each step in a Step component, with a Check that says how to tell it worked. Then add a Symptom for each error people hit.

Some directions are for one reader. ForHumans shows on the page, like where to find the button.

ForAgents is hidden from people, and goes only to agents, like never ask for the key in the chat. It's hidden, not secret: anyone can read it in the page's source.

Build the site, and the guide compiles into a skill named after it. Steps come in order, each with its check, and the key step says "Needs the user".

Now an agent hits the module not found error. It reads the guide, searches, opens its troubleshooting, and answers with the fix and how to check it.

Start with the agent guides page on the plugin's docs site.

This site's guides​

Every procedure on this site is a guide. Read a page, then the skill the build made from it:

PageSkill
Getting startedsetup-docusaurus-mcp
Deploy to Verceldeploy-docusaurus-mcp-vercel
Deploy to Netlifydeploy-docusaurus-mcp-netlify
Deploy to Cloudflare Workersdeploy-docusaurus-mcp-cloudflare
GitHub Pages and other static hostsdeploy-docusaurus-mcp-static-host
This pagewrite-docusaurus-agent-guide

Their symptoms come from Troubleshooting deployments, where each section names the guides it belongs to. This site's MCP endpoint serves the skills (skill://setup-docusaurus-mcp/SKILL.md), and the repository ships the same files, so npx skills add scalvert/docusaurus-plugin-mcp-server installs them.

Done when:

npm run build logs [MCP] Packaged N skill(s), including M agent guide(s) with no [MCP] Agent guide: warnings, and the compiled SKILL.md lists every step in order, each with its check.

  • The site builds with the plugin: npm run build writes build/mcp/bundle.json. If not, follow Getting started first.
  • A procedure for one task, with an end someone can see: a command's output, a page that loads, a setting that shows as on.

1. Wrap the procedure​

Wrap the procedure in AgentGuide and say how to tell it worked with DoneWhen. The components need no import; the plugin adds them to your theme's MDX components:

<AgentGuide
name="setup-widget"
kind="setup"
description="Install the widget CLI. Use when the user wants to install or set up the widget.">

<DoneWhen>

`widget --version` prints a version number.

</DoneWhen>

<Prerequisites>

- Node.js 22 or later. Check: `node --version`.

</Prerequisites>

...the steps...

</AgentGuide>
  • name becomes the skill's name: up to 64 lowercase letters, digits, and single hyphens. It can't match another skill's name, including the built-in docs-research. Make it specific enough to stand out among the other skills an agent has installed.
  • kind is setup for a procedure with steps, or troubleshooting for symptoms only, for problems that aren't tied to one setup.
  • description is what an agent reads to decide whether to use the guide, up to 1024 characters. Say what it does, then "Use when…".
  • title is optional: the compiled guide's title. Without it, the guide uses the page's h1.
  • DoneWhen says how to tell the whole guide worked. Every guide has exactly one.
  • Prerequisites is optional, and only for setup guides: what has to be true before step 1, each with how to check it.

Leave a blank line after each opening tag and before each closing tag, so the Markdown inside is parsed as Markdown.

Check:

The page has one AgentGuide with a name, kind, and description, and one DoneWhen inside it.

2. Mark up each step​

Wrap each step in Step, with a Check that says how to tell it worked:

<Step id="install" symptoms="not-found">

## 1. Install the CLI

```bash
npm install -g widget
```

<Check>

`widget --version` prints a version number.

</Check>

</Step>
  • id is stable: agents and symptoms refer to the step by it. Don't renumber it when steps move.
  • A step's title is its title prop, or the first heading inside it. Wrapping existing headings, as above, keeps them in the page's table of contents. A leading 1. is dropped, since the compiled guide numbers steps itself.
  • Check says how to tell a step worked. Make it something observable: command output, a file's contents, text on screen.
  • needs="user" marks a step only a person can do, such as signing in or changing an admin setting. The agent tells the user what to do and waits.
  • confirm marks a step that changes or deletes something the user may want to keep, such as a production deploy. The agent asks first.
  • symptoms lists the symptoms to try when the check fails; without it, the agent gets the whole list.

Use ForAgents inside a step for what only an agent needs, such as when to stop and hand back to the user, and ForHumans for directions that only make sense on screen.

Write steps that work:

  • One action per step. If a step can fail in two places, split it.
  • Describe; don't command. Write steps the way you would for a person. Text addressed to "the AI" telling it to run things right away looks like prompt injection to hosts.
  • Keep guides to Markdown. Hosts treat served skills as untrusted and won't run bundled scripts without asking the user.
Check:

Every Step has an id, a title or heading, and a Check.

3. Add troubleshooting​

A Symptom is one thing that can go wrong: what the user sees, why, how to fix it, and when to give up and escalate. Symptoms usually live on a troubleshooting page and attach to their guide by name. An existing section can be wrapped as it is; its heading becomes the title:

<Symptom id="not-found" guide="setup-widget">

## `command not found: widget`

**Cause:** npm's global bin directory isn't on the `PATH`.

**Fix:** Open a new terminal, or add `$(npm prefix -g)/bin` to the `PATH`.

<Check>

`widget --version` prints a version number.

</Check>

**Escalate if:** the command is still missing after a new terminal.

</Symptom>
  • Start the title with the exact error text. Agents match errors by searching for what they saw. The title is the symptom's title prop, or its first heading.
  • Label the parts. The build reads Cause:, Fix:, and Escalate if: from paragraphs that start with them.
  • Share symptoms. A symptom several guides share, like a deployment error that happens on every platform, names them all: guide="deploy-vercel deploy-netlify". Each guide gets it, and you write it once. Put a shared symptom outside the guides. A symptom inside a guide can't name another guide.
Check:

Each Symptom has an id, a title or heading that starts with what the user sees, and a guide naming the guides it belongs to (or sits inside its guide).

4. Build​

npm run build

The build reads guides from the built HTML and compiles each into a skill named after the guide. It fails, listing every problem at once, when a guide is malformed, and warns about what makes a guide weaker, such as a step without a Check. npx docusaurus-mcp-verify repeats the warnings for an existing build.

Check:

The build log has [MCP] Packaged N skill(s), including M agent guide(s), with your guide counted, and no [MCP] Agent guide: warnings.

5. Read it as an agent​

The compiled guide is in the bundle. Print its SKILL.md:

jq -r '.skills.skills[] | select(.skillPath == "setup-widget") | .files[] | select(.path == "SKILL.md") | .text' build/mcp/bundle.json

Or run the server locally (Getting started) and ask a connected agent to fetch skill://setup-widget/SKILL.md with docs_fetch. Links in a compiled guide are absolute URLs, so the guide still works when an agent reads it away from your site.

Check:

The compiled SKILL.md lists every step in page order, each with its check, and its troubleshooting links to the symptoms you attached.

Troubleshooting​

[MCP] Invalid agent guides: and the build fails​

Cause: A guide breaks one of the format's rules. The error lists each problem with its page, for example a guide with no description, a step with no id, a symptoms prop naming a symptom that doesn't exist, a Step outside an AgentGuide, two guides with the same name, Prerequisites in a troubleshooting guide, or a symptom inside a guide that names another guide.

Fix: Fix each listed problem on the page it names, then build again.

Check:

npm run build completes.

[MCP] Invalid skill at agent guide with is already used by, and the build fails​

Cause: The guide's name matches another skill: a skill in the plugin's skills dir, or the built-in docs-research. Every skill needs its own name. Two guides with the same name fail with [MCP] Invalid agent guides: instead.

Fix: Rename the guide, or the other skill, then build again.

Check:

npm run build completes.

[MCP] Agent guide: warnings in the build log​

Cause: The guide compiles, but something makes it weaker: a step without a Check, a step without a title or heading, a guide without symptoms, or guide markup (including ForAgents and ForHumans) outside the page's content element.

Fix: Add what the warning names. For markup outside the content element, move it into the page's content, or adjust contentSelectors.

Check:

The build log has no [MCP] Agent guide: lines.

[MCP] Found N agent guide(s), but skills are disabled​

Cause: The site sets skills: false, so the build compiles no skills, and its guides aren't served. docusaurus-mcp-verify doesn't repeat this warning.

Fix: Remove skills: false from the plugin options, or set skills to an object such as { builtin: false } to turn off only the built-in skill. Then build again.

Check:

The build log has [MCP] Packaged N skill(s), including M agent guide(s).

Markdown inside a component shows as plain text, like **Fix:** or a code fence​

Cause: MDX parses a component's content as Markdown only when there's a blank line after the opening tag and before the closing tag.

Fix: Add the blank lines, and put each component tag on its own line.

Check:

The rendered page shows the formatting, and so does the compiled SKILL.md.

Expected component `Step` to be defined​

Cause: The page uses a guide component that MDX doesn't know. The mdxComponents plugin option is false, the site has an ejected MDXComponents that replaces the plugin's, or the site lists @docusaurus/theme-classic under themes, which loads after the plugin and replaces its components.

Fix: Import the components in the page (import { AgentGuide, Step, Check } from 'docusaurus-plugin-mcp-server/theme'), spread mdxComponents into your MDXComponents, or list the plugin under themes after the classic theme (MDX components).

Check:

The page builds.

Reference​

  • Guides are skills, so they're served only when skills are on (the default). With indexers: false, the build skips all MCP output, so it compiles and checks no guides.
  • The build doesn't read guide markup on a page it leaves out: an excludeRoutes page, or one shorter than minContentLength. It also skips markup inside an excludeSelectors element. Neither case gets a warning.
  • The complete format, including the compiled SKILL.md layout and every build check, is in the agent guide format.