Documentation Agent
A Claw configured as a documentation agent builds, maintains, and deploys a production documentation site β writing pages, managing navigation, and keeping content fresh over time, with a single command to push changes live.
This configuration is based on the full tutorial at zenbin.org/p/tutorial-build-a-docs-site (opens in a new tab).
What this agent does
| Task | How |
|---|---|
| Scaffold a new docs site | Nextra + Next.js, fully configured |
| Write and update pages | MDX with Callout, Steps, Cards components |
| Manage navigation | _meta.json in each section |
| Deploy on command | One bash deploy.sh to go live |
| Review for stale content | Monthly cron + Agent Browser |
The stack
- Nextra (opens in a new tab) β Next.js docs framework, full-text search included
- MDX β markdown + React components in the same file
_meta.jsonβ controls sidebar order and labels per directory- Deploy script β tar, upload, poll until live
Setup
Scaffold the project
Create a new Nextra docs project in ./my-docs.
Use nextra-theme-docs theme.
Include theme.config.tsx, pages/index.mdx, pages/_meta.json.
Run npm install after scaffolding.Configure theme.config.tsx
The theme config sets your site identity β logo, GitHub link, favicon, title format, footer:
export default {
logo: <span style={{ fontWeight: 900 }}>My Docs</span>,
project: { link: 'https://github.com/your-org/your-repo' },
docsRepositoryBase: 'https://github.com/your-org/your-repo/blob/main',
useNextSeoProps() {
return { titleTemplate: '%s β My Docs' }
},
head: (
<>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
</>
),
footer: { text: `Β© ${new Date().getFullYear()} Your Organisation` },
}Create a favicon
Create a favicon.svg.
Background #0D1B2A, icon in #F4A623.
Save to public/favicon.svg.Plan the content structure
Map your sections before writing a single page:
pages/
index.mdx β landing page
quick-start.mdx
concepts/
_meta.json
index.mdx
recipes/
_meta.json
index.mdx
tips/
_meta.json
index.mdxWrite a deploy script
Ask your Claw to create deploy.sh β it should tar the project (excluding node_modules, .git, .next, and large assets), POST to your build API with your key, and poll until deployed. Store the key at ~/.my-deploy-key, never in the repo.
Writing pages
Every page is MDX. Tell your Claw the page path, audience, structure, and tone:
Write a recipe page at /recipes/email-setup.mdx.
Title: Give Your Agent an Email Address
Audience: someone who has never used AgentMail.
Structure: problem β steps β what to expect β tips.
Tone: direct, no fluff.Use Nextra's built-in components for structure:
import { Callout, Steps, Cards, Card } from 'nextra/components'
<Steps>
### Step one
Content here.
</Steps>
<Callout type="tip">
A highlighted tip.
</Callout>Managing navigation
Each directory's _meta.json controls sidebar order and labels:
{
"index": "Overview",
"getting-started": "Getting Started",
"old-page": { "display": "hidden" }
}Pages with "display": "hidden" still build and are accessible by URL β they just don't appear in the nav. Use this to retire content without breaking links.
| Task | What to do |
|---|---|
| Add a page to nav | Add key + label to _meta.json |
| Rename in nav | Change the string value |
| Reorder | Move key higher/lower |
| Hide without deleting | "page": { "display": "hidden" } |
Deploying
bash deploy.shFirst deploy: under 10 minutes. Subsequent deploys are faster with layer caching.
Important: exclude large binary assets from the tar (videos, high-res images). If your archive exceeds ~50MB it will be rejected. Store media on a CDN and reference by URL.
Maintenance
Monthly content review
openclaw cron add \
--name "Docs review" \
--cron "0 9 1 * *" \
--session isolated \
--message "Read ~/TOOLS.md. Review the docs at [your-url].
Flag: deprecated features, broken links, outdated instructions.
Send me a Telegram summary of what needs updating." \
--announce \
--channel telegramPair the monthly review with Agent Browser so your Claw visits the live site and checks for 404s and rendering issues β not just reads the source files.