AI-native documentation for Next.js, TanStack Start, SvelteKit, Astro, and Nuxt.
Write MDX or Markdown, configure the docs site in TypeScript, and ship a polished documentation experience for humans, IDEs, and agents without maintaining a pile of routing boilerplate.
- Framework adapters for Next.js, TanStack Start, SvelteKit, Astro, and Nuxt
- One
docs.config.tsfile for routing, theme, search, metadata, feedback, and AI surfaces - Built-in themes with shared MDX components such as
Callout,Tabs,HoverLink, andPrompt - Built-in search with simple, Typesense, Algolia, MCP, and custom provider options
- Generated API reference from framework route handlers or a hosted OpenAPI JSON document
- Next.js changelog pages from dated MDX entries
- Machine-readable docs through
.mdroutes, JSON-LD structured data,llms.txt, sitemaps,robots.txt,skill.md, agent discovery, and MCP - Page-level agent compaction with
docs agent compactandagent.compactdefaults - Agent and reader-facing docs scoring with
docs doctor --agentanddocs doctor --site
Run the CLI inside an existing app:
npx @farming-labs/docs initOr start a new project:
npx @farming-labs/docs init --template next --name my-docsThe CLI detects your framework, installs the right packages, creates docs.config.ts, adds the
theme CSS, scaffolds starter pages, and starts the dev server.
All frameworks use defineDocs():
import { defineDocs } from "@farming-labs/docs";
import { fumadocs } from "@farming-labs/theme";
export default defineDocs({
entry: "docs",
theme: fumadocs(),
metadata: {
titleTemplate: "%s - Docs",
description: "My documentation site",
},
});Next.js projects also wrap next.config.ts:
import { withDocs } from "@farming-labs/next/config";
export default withDocs();And import the theme CSS:
@import "tailwindcss";
@import "@farming-labs/theme/default/css";Other framework adapters follow the same shape: configure docs once, add the adapter route/helper, and import the matching theme CSS.
Docs are plain Markdown or MDX files.
app/docs/
page.mdx
installation/
page.mdx
guides/
deployment/
page.mdxPages use frontmatter for metadata:
---
title: "Installation"
description: "Get up and running"
---
# Installation
Your docs content here.The framework exposes machine-readable docs in Next.js, with sitemap routes available when
sitemap is enabled:
/llms.txt/llms-full.txt/sitemap.xml/sitemap.md/.well-known/sitemap.md/skill.md/.well-known/skill.md/.well-known/agent.json/.well-known/agent/mcp/.well-known/mcp/docs/<slug>.md/docs/<slug>withAccept: text/markdown/docs/<slug>withSignature-Agent- Schema.org JSON-LD on each docs page
- generated
robots.txtviadocs robots generate
The canonical API routes remain available under /api/docs, including /api/docs?format=skill,
/api/docs/mcp, and /api/docs/agent/spec.
Canonical Next.js markdown reads with Accept: text/markdown or Signature-Agent are handled by
that same shared /api/docs route, so apps do not need a second markdown-only API wrapper.
The agent discovery JSON also includes structured-data capability metadata plus robots.enabled,
robots.route, and robots.defaultRoute so agents can find page metadata and the static crawl
policy without guessing.
Use docs doctor --agent when you want to inspect the machine-facing quality of the docs site.
Use docs doctor --site when you want a reader-facing audit of navigation, descriptions,
structure, trust signals, and feedback.
pnpm exec docs doctor --agent
pnpm exec docs doctor --site
pnpm exec docs doctor --agent --json
pnpm exec docs doctor --agent --url https://docs.example.comExpected output looks like:
@farming-labs/docs doctor — agent
Score: 92/105 (Agent-ready)
Framework: nextjs • Entry: docs • Content: app/docs
Explicit agent-friendly pages: 10/41 pages (24%)The command checks docs config resolution, content discovery, API route wiring, public agent routes,
llms.txt, sitemap routes, robots.txt, skill.md, MCP, search, feedback, page metadata, and
generated agent.md freshness.
Hosted checks request the public agent routes and verify the MCP initialize handshake. Use --json
when the result needs to feed CI, dashboards, GitHub Actions summaries, or another system.
Use the full docs for feature-specific setup:
Installable Agent Skills live in skills/farming-labs and cover setup,
CLI usage, configuration, themes, Ask AI, and page actions.
pnpm install
pnpm build
pnpm devUseful checks:
pnpm test
pnpm typecheckSee the Contributing guide.
MIT