docs: migrate to Fumadocs (44 pages, 12 sections, ADR 0007)#277
Conversation
Ports the entire Docusaurus content tree to apps/docs-next: Sections ported (from apps/docs/docs): - adapters/ (1 page) - agents/ (4 pages: tools, skills, runtime, delegation) - chat-uis/ (4 pages: react, ink, components, theming) - components/ (1 page) - contributing/ (1 page) - data-layer/ (3 pages: adapters, memory, rag) - examples/ (12 pages) - getting-started/ (read-this-first, for-ai-agents — quickstart and installation already authored fresh in #277) - hooks/ (3 pages: useChat, useStream, useReactive) - infrastructure/ (4 pages: cli, eval, observability, sandbox) - packages/ (3 pages) - theming/ (1 page) Total: 56 routes generated, build clean, all routes return 200. Frontmatter handling: - Stripped Docusaurus 'sidebar_position' (replaced by meta.json ordering) - Auto-extracted title from first H1 when missing - Auto-extracted description from first paragraph when missing - Quoted 20 frontmatter values containing @ : ` characters (would otherwise break YAML parsing) Examples cleanup: - Replaced 11 Docusaurus-only inline JSX placeholders (<SupportBot />, <RAGChat />, etc.) with explanatory callouts. The interactive sandboxes will be reintroduced in a follow-up using AgentsKit's own components (dogfooding moment). Wiring: - pnpm docs → now points to docs-next (Fumadocs dev) - pnpm docs:legacy → preserves the Docusaurus site for transition - pnpm docs:build → Fumadocs production build Decision recorded in: - docs/architecture/adrs/0007-docs-platform-fumadocs.md What lands in follow-ups (Phase 0 #211): - Visual identity (logo, OG image, custom Tailwind tokens) - docs.agentskit.io domain wiring (depends on #235) - i18n strategy decision (Crowdin / LLM / freeze) - Recipes section (#229) - Migration guides — Vercel AI / LangChain (#241, #242) - Embedded docs assistant (RAG over docs) - TypeDoc API reference integration - Archive apps/docs once parity confirmed and traffic moved Refs #238 #211
Closes #228. Writes complete Concepts pages for adapter, tool, skill, memory, retriever, runtime — replacing the placeholder stubs from #277. Each page follows the same structure: - One-paragraph definition (what it is, what it isn't) - Minimal interface (TypeScript code block) - Built-in usage example - When to write your own - Common pitfalls table - Link to the canonical ADR for full invariants Content density: - adapter: 83 lines (~600 words) - tool: 139 lines (~900 words) - skill: 145 lines (~950 words) - memory: 118 lines (~800 words) - retriever: 130 lines (~850 words) - runtime: 176 lines (~1100 words) Built and verified: 56 routes, all 200 in production server. Aligned with the manifesto principle 'docs are product, not afterthought' and the load-bearing distinctions: - Tool (what model calls) vs Skill (what model becomes) - ChatMemory vs VectorMemory (split, not unified) - Empty results vs error (the asymmetry across contracts) Refs #228 #211
Concepts section complete (closes #228)Replaced all 6 stub concept pages with full content (~5,200 words total):
Each page: one-paragraph definition → minimal interface → built-in example → when to write your own → pitfalls table → ADR link. Build verified: 56 routes, all 200. Same PR — pushed to |
Recipes section added (closes #229)Adds 10 self-contained, copy-paste recipes plus an index, wired into the sidebar between Concepts and Adapters:
Build: 67 routes, all 200. ~1100 lines of new MDX, no JSX components needed (pure markdown + code blocks). Each recipe ends with 'Tighten the recipe' (next-level moves) and 'Related' (links to Concepts + sibling recipes) — keeps readers cross-linking through the substrate. |
Migration guide: Vercel AI SDK → AgentsKit (closes #241)New 'Migrating' section with the full Vercel AI SDK guide. Content:
Build: 69 routes, all 200. Next migration targets (follow-up PRs):
|
Migration guide: LangChain.js → AgentsKit (closes #242)Same structure as the Vercel AI SDK guide. 9 side-by-side examples covering the full surface: ChatOpenAI, prompt templates, tools, AgentExecutor, memory, retrieval, LCEL chains, LangGraph, callbacks. Honest section 'Where LangChain.js still wins' covers:
Includes a Build: 70 routes, all 200. |
PostHog analytics added (closes #243)Opt-in, privacy-respecting analytics for the docs site. How it works
Files
Verified
Next steps (once live)
|
Refs #239. Decides what happens to the three existing non-English locales (pt-BR, es, zh-Hans) after the Docusaurus → Fumadocs migration. Recommendation: freeze translations at migration time, ship EN-only Fumadocs first, revisit localization as a separate initiative once the EN source stabilizes. Four options evaluated: A. Freeze and archive (recommended) B. Continuous LLM-assisted machine translation C. Crowdin or equivalent managed pipeline D. Delete the translations Key reasoning: - We have no sustained translation contributors or QA process - Shipping translations without commitment = anti-product (violates Manifesto principle 6) - Archive (not delete) preserves work for future re-engagement - EN surface is still shifting weekly in Phase 0 — translating moving targets is wasted motion - Deferring execution lets us pick B or C later with traffic data from PostHog (PR #277) Implementation plan (to land alongside docs.agentskit.io promotion): - Move apps/docs/i18n/* to apps/docs/archive-i18n/ with a README - Add Vercel/CF Pages locale-aware redirects with a one-time banner - Document the decision in Contributing / Translations page - Add PostHog dashboard for archived locale path traffic - Retire i18n from the Docusaurus build Criteria for reopening (not dates): - Sustained external contributor coverage - Corporate sponsor funding - Traffic data showing ≥10% locale traffic - AgentsKit-hosted translation agent reaching acceptable quality Also creates rfcs/README.md with process notes distinguishing RFCs (reversible proposals) from ADRs (shipped decisions). Refs #239 #211 #277 #243
Mastra migration guide addedCompletes the migration trio (Vercel AI SDK + LangChain + Mastra). Pushed to this PR. Framing: Mastra is AgentsKit's closest philosophical cousin — agent-first, plug-and-play. The case for migrating is weaker than from Vercel AI SDK or LangChain, and the guide says so up front. Readers whose use case needs voice, durable workflows, or Mastra Cloud/Studio are told to stay. Coverage (8 side-by-side examples):
Includes 'Where Mastra still wins' with 5 honest scenarios, plus a pragmatic 7-step migration checklist. Build: 70 routes, all 200. |
Visual identity shipped — direction 1.4 (Triangle / foam mono)User picked 1.4 from the brand-preview iterations: 3-circle triangle, foam monochrome on B-palette terminal background. Logo files (all in
OG image:
Theme tokens (
Wiring:
Build: 71 routes (new |
Refs #239. Decides what happens to the three existing non-English locales (pt-BR, es, zh-Hans) after the Docusaurus → Fumadocs migration. Recommendation: freeze translations at migration time, ship EN-only Fumadocs first, revisit localization as a separate initiative once the EN source stabilizes. Four options evaluated: A. Freeze and archive (recommended) B. Continuous LLM-assisted machine translation C. Crowdin or equivalent managed pipeline D. Delete the translations Key reasoning: - We have no sustained translation contributors or QA process - Shipping translations without commitment = anti-product (violates Manifesto principle 6) - Archive (not delete) preserves work for future re-engagement - EN surface is still shifting weekly in Phase 0 — translating moving targets is wasted motion - Deferring execution lets us pick B or C later with traffic data from PostHog (PR #277) Implementation plan (to land alongside docs.agentskit.io promotion): - Move apps/docs/i18n/* to apps/docs/archive-i18n/ with a README - Add Vercel/CF Pages locale-aware redirects with a one-time banner - Document the decision in Contributing / Translations page - Add PostHog dashboard for archived locale path traffic - Retire i18n from the Docusaurus build Criteria for reopening (not dates): - Sustained external contributor coverage - Corporate sponsor funding - Traffic data showing ≥10% locale traffic - AgentsKit-hosted translation agent reaching acceptable quality Also creates rfcs/README.md with process notes distinguishing RFCs (reversible proposals) from ADRs (shipped decisions). Refs #239 #211 #277 #243
Validates Fumadocs as the replacement for Docusaurus (apps/docs). Sits in parallel — the existing site keeps serving traffic until the migration is approved. Stack: - Next.js 16.2 (app router, Turbopack) - Fumadocs UI 16.7 + Fumadocs MDX 14.2 + Fumadocs Core 16.7 - Tailwind v4 + fumadocs-ui/css/preset.css (neutral theme) - React 19, TypeScript 5.5+ Structure: - app/(home)/ landing page (hero + 3-feature grid) - app/docs/ docs shell with Fumadocs sidebar + search - app/api/search/ built-in search API (createFromSource) - content/docs/ MDX content - index welcome + substrate table - getting-started/ quickstart + installation (ported from Docusaurus) - concepts/ mental-model (full) + 6 stub pages linking to ADRs - lib/source.ts loader bound to .source/server - mdx-components.tsx default Fumadocs MDX components Verified: - pnpm install succeeds - pnpm exec next build generates 14 static pages, 0 errors - All routes 200 in production server (/, /docs, all sub-pages) - Search API returns highlighted hits Decision criteria comparison documented in apps/docs-next/README.md. Not yet wired into root pnpm dev/build — install + run manually until the spike is approved. Next steps if approved: 1. Port remaining sections from apps/docs 2. Decide i18n strategy (Crowdin vs freeze vs LLM-translate) 3. Set up docs.agentskit.io on Vercel 4. Archive apps/docs Refs #238 #211
Ports the entire Docusaurus content tree to apps/docs-next: Sections ported (from apps/docs/docs): - adapters/ (1 page) - agents/ (4 pages: tools, skills, runtime, delegation) - chat-uis/ (4 pages: react, ink, components, theming) - components/ (1 page) - contributing/ (1 page) - data-layer/ (3 pages: adapters, memory, rag) - examples/ (12 pages) - getting-started/ (read-this-first, for-ai-agents — quickstart and installation already authored fresh in #277) - hooks/ (3 pages: useChat, useStream, useReactive) - infrastructure/ (4 pages: cli, eval, observability, sandbox) - packages/ (3 pages) - theming/ (1 page) Total: 56 routes generated, build clean, all routes return 200. Frontmatter handling: - Stripped Docusaurus 'sidebar_position' (replaced by meta.json ordering) - Auto-extracted title from first H1 when missing - Auto-extracted description from first paragraph when missing - Quoted 20 frontmatter values containing @ : ` characters (would otherwise break YAML parsing) Examples cleanup: - Replaced 11 Docusaurus-only inline JSX placeholders (<SupportBot />, <RAGChat />, etc.) with explanatory callouts. The interactive sandboxes will be reintroduced in a follow-up using AgentsKit's own components (dogfooding moment). Wiring: - pnpm docs → now points to docs-next (Fumadocs dev) - pnpm docs:legacy → preserves the Docusaurus site for transition - pnpm docs:build → Fumadocs production build Decision recorded in: - docs/architecture/adrs/0007-docs-platform-fumadocs.md What lands in follow-ups (Phase 0 #211): - Visual identity (logo, OG image, custom Tailwind tokens) - docs.agentskit.io domain wiring (depends on #235) - i18n strategy decision (Crowdin / LLM / freeze) - Recipes section (#229) - Migration guides — Vercel AI / LangChain (#241, #242) - Embedded docs assistant (RAG over docs) - TypeDoc API reference integration - Archive apps/docs once parity confirmed and traffic moved Refs #238 #211
Closes #228. Writes complete Concepts pages for adapter, tool, skill, memory, retriever, runtime — replacing the placeholder stubs from #277. Each page follows the same structure: - One-paragraph definition (what it is, what it isn't) - Minimal interface (TypeScript code block) - Built-in usage example - When to write your own - Common pitfalls table - Link to the canonical ADR for full invariants Content density: - adapter: 83 lines (~600 words) - tool: 139 lines (~900 words) - skill: 145 lines (~950 words) - memory: 118 lines (~800 words) - retriever: 130 lines (~850 words) - runtime: 176 lines (~1100 words) Built and verified: 56 routes, all 200 in production server. Aligned with the manifesto principle 'docs are product, not afterthought' and the load-bearing distinctions: - Tool (what model calls) vs Skill (what model becomes) - ChatMemory vs VectorMemory (split, not unified) - Empty results vs error (the asymmetry across contracts) Refs #228 #211
Closes #229. Adds a Recipes section with 10 self-contained, copy-paste recipes plus an index page, all wired into the sidebar. Recipes (each end-to-end and runnable as written): - rag-chat — streaming React chat grounded in your docs - pdf-qa — CLI Q&A over a local PDF - code-reviewer — agent that reads diff, runs tests, posts review - discord-bot — bot with per-channel memory and tools - research-team — planner + researcher + writer multi-agent - cost-guarded-chat — abort the run when budget exceeded (observer) - persistent-memory — chat that remembers across processes - confirmation-gated-tool — security-critical tool with onConfirm - custom-adapter — wrap any LLM API in 30 lines (incl. mock pattern) - eval-suite — vitest-based agent quality scoring in CI Each page follows the same shape: - One-paragraph framing - 'Install' line - Working code (with KEY placeholder) - 'Run it' command - 'What's happening' / 'Why this works' explainer - 'Tighten the recipe' for next steps - 'Related' links to Concepts + sibling recipes Notable design choices: - Index has a table of recipes with elapsed-time estimates (5-15 min) - All recipes link back to Concepts pages and ADRs for deeper reading - 'Cost-guarded chat' demonstrates that observers + AbortController are enough — no special primitive needed - 'Custom adapter' includes the deterministic mock-adapter pattern - 'Eval suite' includes both hard-coded scoring AND llm-as-judge Build: 67 routes, all 200. Recipes appear in the sidebar between Concepts and Adapters. Refs #229 #211
Closes #241. New 'Migrating' section in the sidebar with an index and the full Vercel AI SDK → AgentsKit migration guide. Content: - TL;DR table mapping Vercel AI SDK exports to AgentsKit equivalents (streamText, useChat, tool, generateText, experimental_StreamData, provider helpers, route handler patterns) - Six side-by-side migration examples: 1. Basic streaming chat (client hook) 2. Securing the API key (server action + route handler variants) 3. Tool calling (Zod → JSON Schema 7 conversion) 4. Multi-provider swap 5. Agent runtime with memory + retrieval (biggest win) 6. Multi-agent / delegation 7. Observability / telemetry - 'Where Vercel AI SDK still wins' — honest callouts: generateObject (until Fase 2), consumer chat SDK footprint, Vercel-ecosystem investment, v1.0 maturity today - Incremental migration path (keep existing, add AgentsKit for new features, consolidate via the Adapter contract) Design notes: - Before/after code blocks preserve the 'recognize my code' feeling; no tricks, no cherry-picking - Callouts cross-link to ADRs so readers can verify claims - Index page previews LangChain and Mastra guides (follow-ups #242) - Sidebar order: Getting Started → Concepts → Recipes → Migrating → ... Refs #241 #211
Closes #242. New page in the Migrating section mapping LangChain.js patterns to AgentsKit equivalents. Content: - TL;DR equivalence table (ChatOpenAI, .invoke/.stream, ChatPromptTemplate, StructuredTool, AgentExecutor, BufferMemory, VectorStore, RetrievalQAChain, RunnableSequence, LangGraph, callbacks) - 9 side-by-side migration examples: 1. Basic chat with streaming 2. Prompts and templates (no template engine in core — plain JS works) 3. Tool calling (Zod → JSON Schema 7 bridge) 4. AgentExecutor → Runtime (biggest win, hard maxSteps cap) 5. Memory hierarchy → split ChatMemory/VectorMemory 6. Retrieval / RetrievalQAChain → RAG as a Retriever 7. Chains / LCEL → plain JavaScript composition 8. LangGraph → delegation (with honest deferral of durable execution) 9. Callbacks → Observers - 'Where LangChain.js still wins' — honest callouts: integrations catalog, LangSmith ecosystem, LangGraph today, one-library-many-solutions preference, team familiarity - Incremental migration path (keep LangChain for existing pipelines, adopt AgentsKit for new features, port chat layer first) - Dependency size check (du -sh) showing the 100-200 MB delta Rationale for the 'honest win' section: LangChain still has the broadest integration catalog and LangSmith is genuinely useful. Pretending otherwise loses credibility. The README's 'when NOT to use AgentsKit' principle applied to this specific migration. Refs #242 #211
Closes #243. Adds lightweight, privacy-respecting PostHog integration to the Fumadocs docs site. Design: - Opt-in via NEXT_PUBLIC_POSTHOG_KEY. Unset means PostHog never loads — localhost, CI, and any deployment without the env var are telemetry-free. - AnalyticsProvider wraps the app; no-op when key is absent. - Captures $pageview on every Next.js route change (automatic capture disabled, manual via usePathname + useSearchParams so SPA navigation is tracked correctly). - Captures $pageleave for time-on-page. - Enriches $pageview with a 'section' property inferred from the path (home, getting-started, concepts, recipes, migrating, etc.) for easy funnel analysis. - No identify(), no PII, no session recordings. - Respects Do-Not-Track (respect_dnt: true). - EU/US host selectable via NEXT_PUBLIC_POSTHOG_HOST. Exports: - AnalyticsProvider (used in app/layout.tsx) - track(event, properties) helper for custom events; no-op when disabled Docs: - apps/docs-next/ANALYTICS.md — full audit trail of what's tracked, what isn't, enable/disable instructions, privacy notes - apps/docs-next/.env.example — the two relevant env vars Verified: - Build clean, 70 routes all static - Without key set, HTML contains zero PostHog references (grep 0) - Suspense boundary around the provider avoids Next 16's useSearchParams prerender bailout Refs #243 #211
Completes the trio of migration guides (Vercel AI SDK + LangChain + Mastra). Mastra is the closest philosophical cousin to AgentsKit — agent-first, plug-and-play, not chat-first. That makes the guide the most honest of the three: the case for migrating is weaker here than from the other two. Content: - TL;DR equivalence table (Agent class, createTool, Memory, RAGAgent, Workflows, Mastra orchestrator, telemetry) - 8 side-by-side migration examples: 1. Basic agent (inline + Skill flavors) 2. Tool calling (Zod → JSON Schema 7 bridge) 3. Memory (split working/semantic into ChatMemory + Retriever) 4. RAG (as a Retriever, not a specialized Agent) 5. Workflows → delegation (with honest deferral of durable execution) 6. Evals (shape differences only) 7. Telemetry (Observer contract vs built-in OTEL) 8. No orchestrator container (why the Runtime is the smallest unit) - Generous 'Where Mastra still wins' section: - Voice (shipped in Mastra, planned in AgentsKit) - Durable long-running workflows (Phase 3 in AgentsKit) - Class-per-agent mental model (taste) - Mastra Cloud / Studio ecosystem - Integration catalog breadth - Pragmatic migration checklist (7 steps, leave voice in Mastra until shipped) - Bundle-size check Key framing: AgentsKit and Mastra agree on philosophy (agent-first, composable, plug-and-play). The difference is shape and scope — formal contracts vs evolving class hierarchy, narrow core vs feature-rich orchestrator. Readers should stay on Mastra if voice, durable workflows, or Mastra Cloud are load-bearing for them. Build: 70 routes, all 200. Refs #211
Ships the chosen brand direction across the docs site. Variant 1.4 from the brand-preview-logos selection (3-circle triangle, foam monochrome, B-palette terminal background). Logo: - public/brand/logo-mark.svg — glyph alone, currentColor, 72x64 - public/brand/logo-wordmark.svg — glyph + 'agentskit' lockup in JetBrains Mono Bold - public/favicon.svg — square with rounded background, baked colors - public/apple-touch-icon.svg — same shape, 180x180 Open Graph: - app/api/og/route.tsx — edge runtime, Next.js ImageResponse - Renders 1200x630 PNG with logo + title + description + tagline strip - Accepts ?title= and ?description= query params for per-page OG - public/brand/og-default.png — pre-rendered fallback (28KB) Theme: - app/global.css — adds AgentsKit token set under :root and Tailwind @theme: ak-midnight, ak-foam, ak-graphite, ak-surface, ak-border, ak-green, ak-blue, ak-red, font-mono - Maps Fumadocs's .dark theme variables to the B palette so the docs shell uses our colors out of the box Layout: - app/layout.tsx — wires favicon, apple-touch-icon, openGraph, twitter card metadata. Adds JetBrains Mono via next/font with --font-mono CSS variable. Updates metadataBase to agentskit.io - app/layout.config.tsx — Fumadocs nav now shows the inline LogoMark + 'agentskit' wordmark in mono (no more bare text title) - app/(home)/page.tsx — landing hero rebuilt around the logo, with the new 'JavaScript actually deserves' tagline matching the README Docs: - public/brand/README.md — what's where, palette, usage rules, token reference Verified locally: - pnpm exec next build → 71 routes (added /api/og) - /api/og returns 1200x630 PNG (28 KB) - All assets serve 200 in production server - Logo inherits currentColor, works in dark and light contexts Refs #211 (Phase 0 visual identity)
Avoids the pnpm fallback that opens npmjs.com when running 'pnpm docs' from inside apps/docs-next instead of the repo root. Both work now: pnpm docs # from repo root (turbo filter) cd apps/docs-next && pnpm docs # from inside the package
e3f7c69 to
6673f3a
Compare
Summary
Full migration from Docusaurus to Fumadocs. The spike (initial commit) plus the migration commit ports every page from
apps/docstoapps/docs-nextand wires the root scripts.Closes the spike portion of #238 — visual identity, i18n, recipes, and migration guides land in follow-up PRs as planned in Phase 0 (#211).
Decision recorded
docs/architecture/adrs/0007-docs-platform-fumadocs.md— formal ADR documenting why Fumadocs over Nextra/Starlight/VitePress/Mintlify, what we accept, what's deferred.What's in this PR
Scaffold (initial spike commit)
Migration commit (this push)
apps/docs/docs/*ported as MDX with cleaned frontmatter<Component />placeholders in examples replaced with explanatory callouts@/:/backtick characterspnpm docsnow points at Fumadocs dev serverpnpm docs:legacyVerified
pnpm installcleanpnpm docs:build→ 56 static pages, 0 errorsTry locally
pnpm install pnpm docs # open http://localhost:3000Compare side-by-side with the legacy site:
pnpm docs:legacy # open http://localhost:3000 (Docusaurus port)What lands in follow-up PRs
Tracked in Phase 0 (#211):
docs.agentskit.iodomain wiring (depends on [P0.24] Configure agentskit.io (DNS + SSL + redirect) #235 DNS)apps/docsonce parity confirmed and traffic movedTest plan
pnpm docs, click aroundRefs #238 #211