Migrate with your AI agent
DocsLit is built for AI agents, and that includes the move to DocsLit. The importer does the mechanical conversion in one command, and an agent can finish the rest, because everything that needs a human is a precise, machine-readable item: a file, a line, what was done instead and how to fix it.
There are two ways to involve an agent. Use the first for a whole project, and the second when you move content a page at a time.
Let the agent run the importer
docslit agents init writes an AGENTS.md and, for Claude Code, a docslit-migrate skill. To see the skill, or to paste it into a tool that takes a system prompt, print it:
The skill tells the agent to run the importer first, read the report and fix only what the report lists. See Agent setup.
A dry run costs nothing and shows the agent the size of the job as JSON:
The agent works through items in order, errors first, and re-runs docslit validate after each fix. The import reference lists every code and the usual fix.
Paste this prompt into your agent, with your source folder in place of ./my-docs:
docslit import ./my-docs --out ./docs-site --json and read the report. Work through every item in items, errors first, then warnings. For each one, open the file at the line given, apply the fix, and keep all content, code samples and links. Never invent a wc-* component or attribute: run docslit components <tag> --json to check. Replace every "Unconverted component" callout with real content. When done, run docslit validate --strict and docslit lint in ./docs-site until both are clean, and summarize what you changed and anything you could not convert.Convert one page with convert_mdx
When you want an agent to move pages individually, for example while you review each one, use the MCP tool convert_mdx. It runs the importer's converter on a single page or snippet without writing anything, so the agent stays in control of what lands in the project.
Connect the server in your project with docslit mcp. The tool takes:
mintlify, fern, gitbook or mkdocs. Fern adds the default code line numbers and Fern-only components, and gitbook converts {% %} blocks.For example, an agent sends a Mintlify page with a callout and a component DocsLit does not know:
The tool returns the converted page and a list of issues. This is the real response, shortened:
| Field | Contents |
|---|---|
markdown |
The full converted page, frontmatter included |
frontmatter, body |
The same, split |
issues |
Each item has severity, code, line, component, message, action and fix. Unknown components are never dropped. They stay in a marked callout. |
components |
What each source component became, with counts |
reusables |
Snippets the page needs, as { path, content } to save under docs/_reusables/ |
markup |
The result of check_markup over the converted page |
The recommended loop for one page is:
- Call
convert_mdxwith the page source. - Apply each
fixinissues, starting with errors. - Call
check_markupon the result until it is clean. - Call
create_page, which adds the page to the sidebar, and thenvalidatewithpageset. - Save any
reusablesthe page referenced.
The MCP prompt migrate-page packages this loop. In clients that show prompts as slash commands, run it with the page as source. See Prompts.
Tips for better results
- Run the importer first. Even for single pages, the importer's conversion is deterministic and checked, and an agent's hand conversion is not.
- Let the agent check attributes.
docslit components <tag> --jsonand theget_componenttool show the real attributes. Invented attributes are the most common mistake. - Keep the report open.
MIGRATION.mdis the to-do list, and deleting items as they are fixed shows progress. - Review the config by eye. Navigation, branding and redirects are mapped mechanically. A human should look at the first page of every tab.
- Finish with the quality checks.
docslit validate --strictfor correctness,docslit lintfor quality, anddocslit agents initso the agent that migrated the docs can keep maintaining them.
Next steps
- Read the platform guide: Mintlify, Fern, GitBook or MkDocs
- Look up any code in the import reference
- Set up the MCP server in MCP server