Operational guide for agentic coding assistants in this repository.
- Project:
routing-wiki - Stack: Fumadocs (fumadocs-ui + fumadocs-mdx) on Next.js 16 (App Router) + TypeScript
- Styling: Tailwind CSS v4 + Fumadocs preset
- Package manager:
pnpm - Node:
>=20.0 - Main content: Chinese docs about Bird/BGP
- Build output:
./out(static export; also used by Cloudflare assets)
Read these first before changing behavior:
package.json(scripts/engines/deps)README.md(workflow + authoring expectations)source.config.ts(Fumadocs MDX pipeline: remark/rehype plugins, Shiki langs, math)next.config.mjs(Next.js config, static export)lib/source.ts(content source loader)lib/layout.shared.tsx(nav/header config)content/docs/**/meta.json(doc IA / sidebar order)tsconfig.json(TS baseline, path aliases)wrangler.toml(deploy output)pnpm-workspace.yaml(pnpmonlyBuiltDependencies/allowBuilds)
.cursor/rules/: not found.cursorrules: not found.github/copilot-instructions.md: not found If these files appear later, treat them as high-priority instructions.
Run from repo root.
pnpm install
pnpm run dev(Next.js dev server, defaulthttp://localhost:3000)
pnpm run build(static export to./out)pnpm run serve(preview built site viaserve out)
pnpm run typecheck(fumadocs-mdx && next typegen && tsc --noEmit)
Do not assume missing tools exist.
- No
lintscript inpackage.json - No ESLint/Prettier config discovered
- No configured test runner (
vitest/jest/playwright) - No
testscript Current quality gate is:
pnpm run typecheckpnpm run build
There is no test framework configured, so single-test execution is unavailable. If asked to run one test, state repo facts first. Fallback verification options:
- Full typecheck:
pnpm run typecheck - Full build:
pnpm run buildIf tests are added later, document exact commands here.
No formatter is enforced in repo, so match local file conventions.
- Prefer ESM
import/export - Use
import typefor type-only imports - Use the
@/*path alias for repo-local modules (configured intsconfig.json) - Fumadocs imports follow package entry points, e.g.
fumadocs-ui/components/tabs
- TS/TSX in
app,components,lib: single quotes - Use 2-space indentation
- Keep semicolon style consistent with the file
- Keep meaningful explicit types (props/options/returns)
- Prefer small composable
type/interface - Avoid
any,@ts-ignore,@ts-expect-errorwhere practical
- Prefer function components; mark client components with
'use client' - Keep components declarative and small
- Style with Tailwind utility classes and Fumadocs theme tokens (
fd-*)
- Components/types:
PascalCase - Functions/variables:
camelCase - Docs paths/slugs: kebab-case style is common
- Add defensive checks for user/content-derived data
- In plugins/transformers, return safe defaults for invalid matches
- Do not silently swallow errors in new logic
- Keep error messages specific and actionable
- Docs live under
content/docs/(Markdown/MDX) - Every doc needs front matter (
title,description) - Navigation order/labels come from
meta.json(pages,title,root) - Top-level sections use
"root": trueto become separate sidebar groups - A folder's
index.md(x)is its landing page - Use Fumadocs components:
- Admonitions:
<Callout type="info|success|warn|error" title="..."> - Tabs:
<Tabs items={[...]}><Tab value="..."> - Diagrams:
```mermaidcode blocks (converted bylib/remark-mermaid.ts) - Math:
$...$/$$...$$(remark-math + rehype-katex)
- Admonitions:
- Use language-tagged code fences (
shell,bird2, ...). Custom grammars live inlangs/and are registered insource.config.ts(rehypeCodeOptions.langs) - Preserve Chinese-first tone and terminology consistency
Before editing:
- Read target file + nearby patterns
- Prefer minimal diffs over broad refactors
- Do not add dependencies unless requested After editing:
- Run
pnpm run typecheck - Run
pnpm run build - Report pre-existing failures separately
- Do not commit unless explicitly asked
- Keep commit scope focused (one concern per commit)
- In PR description, include:
- what changed
- why it changed
- validation commands run
Use external Fumadocs / Next.js best practices as reference only. Repository facts and existing behavior always take precedence unless the user explicitly requests migration.