fumadocs
Set up a documentation site with Fumadocs. Use when scaffolding a new docs app or adding documentation to a project using Next.js, Waku, React Router, or TanStack Start.
- License 许可
- MIT
- 最近更新
- 2026-10-23
- Stars
- ★ 5
- Forks
- 0
01 前言 Front Matter
- name
- fumadocs
- description
- Set up a documentation site with Fumadocs. Use when scaffolding a new docs app or adding documentation to a project using Next.js, Waku, React Router, or TanStack Start.
03 SKILL.md 正文
Set up a Fumadocs site
Instructions for AI coding agents, follow them in order. Fumadocs docs: https://fumadocs.dev/docs, append .mdx to any docs page URL to get it as Markdown, https://fumadocs.dev/llms.txt lists all pages.
1. Keep the docs site separate
Create the docs as its own app: a new directory or repository, or a new workspace package (e.g. apps/docs) in a monorepo.
Don't add Fumadocs to an existing marketing or product app unless the user explicitly asks for it: Fumadocs UI ships global styles and its own layouts, mixing them into an unrelated app leads to style conflicts, coupled deployments and harder upgrades. If the user does want it inside an existing app, skip step 2 and run npx @fumadocs/cli@latest init --yes in the app (adds the docs in a dedicated route group, supports Next.js, Waku, React Router and Tanstack Start), or follow the manual installation guide of the framework:
- Next.js: https://fumadocs.dev/docs/manual-installation/next.mdx (Recommended)
- Waku: https://fumadocs.dev/docs/manual-installation/waku.mdx (Recommended if user prefer Vite)
- React Router: https://fumadocs.dev/docs/manual-installation/react-router.mdx
- Tanstack Start: https://fumadocs.dev/docs/manual-installation/tanstack-start.mdx
- Astro: https://fumadocs.dev/docs/manual-installation/astro.mdx (Not recommended, some features and syntax are not supported due to framework limitations)
2. Scaffold with create-fumadocs-app
Use the official scaffolder, it produces the reference project structure with search, llms.txt and OG images configured. Templates:
+next+fuma-docs-mdx(Next.js): the default, use it unless the user prefers another framework.waku,react-router,tanstack-start: when the user already uses that framework.+next+fuma-docs-mdx+static,react-router-spa,tanstack-start-spa: when the site must be fully static (hosted on a CDN).
Run it non-interactively (requires Node.js 22+), --yes uses defaults for unspecified options and --pm selects the package manager:
npx create-fumadocs-app@latest my-docs --template +next+fuma-docs-mdx --install --yes
All options: https://fumadocs.dev/docs/cli/create-fumadocs-app.mdx
Don't hand-write the setup from memory or pin older versions, the generated project is the source of truth. Don't edit the .source/ folder, it is generated by Fumadocs MDX.
3. Verify
Run npm run dev, open http://localhost:3000/docs and make sure pages render. Run npm run build before you finish, fix build errors by reading the docs of the relevant feature rather than removing it.
4. Add content
- Pages are MDX files in
content/docs, the folder structure defines the URLs. Every page needs atitlein its frontmatter, and ideally adescription. meta.jsonfiles order pages and folders: https://fumadocs.dev/docs/page-conventions.mdx and https://fumadocs.dev/docs/navigation.mdx- When migrating existing Markdown docs, move them as-is and keep their content, only adjust frontmatter and links. Supported syntax and components: https://fumadocs.dev/docs/markdown.mdx
- Site name and links live in
lib/layout.shared.tsx, GitHub info inlib/shared.ts(Next.js template; other templates put app code undersrc/, check the generated README).
5. Deploy separately
Deploy the docs app as its own project on the hosting provider: https://fumadocs.dev/docs/deploying.mdx
To serve it under the main domain, use a subdomain like docs.example.com, or route /docs/* from the main site to the docs deployment (e.g. Next.js Multi-Zones). Keep the docs under the default /docs route so both options work.
04 同仓库更多 Skills
writing-guidelines
Review docs/prose for Writing Guidelines compliance. Use when asked to "review my docs", "check writing style", "audit prose", "review docs voice and tone", or "check this page against the writing handbook".
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wrangler
Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
workers-best-practices
Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
web-perf
Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.
using-agent-skills
Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of work at hand. This is the meta-skill that governs how all other skills are discovered and invoked.