Configure @farming-labs/docs
Edit the existing docs.config.ts or docs.config.tsx without replacing unrelated settings.
Read only the focused reference that matches the requested option family.
Workflow
- Identify the framework, package root, config path, package manager, and installed Farming Labs
package versions.
- Read the current config and its imports before editing. Preserve callbacks, theme factories,
custom adapters, and framework wiring that are outside the request.
- Select the smallest relevant reference from the routing table below. Do not load every
reference for a narrow change.
- Implement the option with
defineDocs() when the project already uses it. Keep secrets in
environment variables and keep public agent projections free of private data.
- Update any adapter forwarder or route that the selected reference says must stay aligned with
config.
- Run the project typecheck or build and one focused runtime/CLI check for the changed surface.
- Report the config path, behavior change, verification, and any deployment requirement.
Config location
| Framework |
Config path |
Additional required wiring |
| Next.js |
docs.config.ts[x] at the project root |
Wrap Next config with withDocs() |
| TanStack Start |
docs.config.ts[x] at the project root |
Pass config to the docs server and keep the public forwarder aligned |
| Farm.js |
docs.config.ts[x] at the project root |
Wrap defineConfig() with withDocs(); Farm owns docs routing and production output |
| SvelteKit |
src/lib/docs.config.ts |
Pass config to the docs server and hooks |
| Astro |
src/lib/docs.config.ts |
Pass config to the docs server and middleware |
| Nuxt |
docs.config.ts at the project root |
Pass config to defineDocsHandler() and public middleware |
TanStack Start, Farm.js, SvelteKit, Astro, and Nuxt normally need contentDir and nav in addition to
entry and theme.
Minimal shape
import { defineDocs } from "@farming-labs/docs";
import { fumadocs } from "@farming-labs/theme";
export default defineDocs({
entry: "docs",
theme: fumadocs(),
});
Add only the requested fields. Do not copy a full reference example into a project unless every
field is required.
Reference routing
All references are one hop from this file.
| Request |
Read |
| Core options, review, code validation, Docs Cloud, static export, theme/UI, metadata |
Core configuration |
| Markdown negotiation, audience projections, contracts, llms.txt, sitemaps, robots |
Agent content and discovery |
| Published skills, A2A cards, golden evaluations, agent compaction |
Agent Skills and evaluations |
| Search providers, audience-aware search, changelog, human or agent feedback |
Search and feedback |
| MCP routes/auth/security/tools or generated API references |
MCP and API reference |
Invariants
staticExport: true disables server-only search and AI behavior. Static Agent Bundles must not
advertise server capabilities they cannot serve.
- Audience blocks shape representations; they are not access control. Never put secrets in
<Agent>, <Human>, <Audience>, or agent.md.
- MCP HTTP is public by default. Add
mcp.security.authenticate only when the project explicitly
needs authentication.
- Keep
mcp.route synchronized with non-Next public forwarders.
- Keep raw API keys out of config. Store only environment-variable names.
- Use a hosted OpenAPI
specUrl instead of local route scanning when the API lives elsewhere.
- Preserve custom
components, icons, callbacks, search adapters, and theme options unless the
request changes them.
Verification
Use the package manager already selected by the project:
pnpm typecheck
pnpm build
pnpm exec docs doctor --agent --config docs.config.tsx
Run only commands that exist in package.json; adapt the config path for the framework. For a
route change, probe the exact affected endpoint. For static outputs, prefer the matching
--check command before writing generated files.
Recovery
- If config evaluation fails, inspect imports and environment access; do not silently replace the
config with a static approximation.
- If a public route returns 404, check adapter forwarding and the configured route together.
- If a static deployment advertises unavailable features, regenerate the Agent Bundle after the
config change.
- If typechecking rejects an option, inspect the installed package version before assuming the
current reference applies.
Full human documentation: Configuration and
API reference.
1---2name: configuration3description: docs.config.ts options for @farming-labs/docs. Use when configuring entry, contentDir, theme, staticExport, navigation, search, feedback, agent surfaces, MCP, API references, review, metadata, or framework-specific config wiring for Next.js, TanStack Start, Farm.js, SvelteKit, Astro, and Nuxt.4---56# Configure @farming-labs/docs78Edit the existing `docs.config.ts` or `docs.config.tsx` without replacing unrelated settings.9Read only the focused reference that matches the requested option family.1011## Workflow12131. Identify the framework, package root, config path, package manager, and installed Farming Labs14 package versions.152. Read the current config and its imports before editing. Preserve callbacks, theme factories,16 custom adapters, and framework wiring that are outside the request.173. Select the smallest relevant reference from the routing table below. Do not load every18 reference for a narrow change.194. Implement the option with `defineDocs()` when the project already uses it. Keep secrets in20 environment variables and keep public agent projections free of private data.215. Update any adapter forwarder or route that the selected reference says must stay aligned with22 config.236. Run the project typecheck or build and one focused runtime/CLI check for the changed surface.247. Report the config path, behavior change, verification, and any deployment requirement.2526## Config location2728| Framework | Config path | Additional required wiring |29| --- | --- | --- |30| Next.js | `docs.config.ts[x]` at the project root | Wrap Next config with `withDocs()` |31| TanStack Start | `docs.config.ts[x]` at the project root | Pass config to the docs server and keep the public forwarder aligned |32| Farm.js | `docs.config.ts[x]` at the project root | Wrap `defineConfig()` with `withDocs()`; Farm owns docs routing and production output |33| SvelteKit | `src/lib/docs.config.ts` | Pass config to the docs server and hooks |34| Astro | `src/lib/docs.config.ts` | Pass config to the docs server and middleware |35| Nuxt | `docs.config.ts` at the project root | Pass config to `defineDocsHandler()` and public middleware |3637TanStack Start, Farm.js, SvelteKit, Astro, and Nuxt normally need `contentDir` and `nav` in addition to38`entry` and `theme`.3940## Minimal shape4142```ts43import { defineDocs } from "@farming-labs/docs";44import { fumadocs } from "@farming-labs/theme";4546export default defineDocs({47 entry: "docs",48 theme: fumadocs(),49});50```5152Add only the requested fields. Do not copy a full reference example into a project unless every53field is required.5455## Reference routing5657All references are one hop from this file.5859| Request | Read |60| --- | --- |61| Core options, review, code validation, Docs Cloud, static export, theme/UI, metadata | [Core configuration](references/core-options.md) |62| Markdown negotiation, audience projections, contracts, llms.txt, sitemaps, robots | [Agent content and discovery](references/agent-content-and-discovery.md) |63| Published skills, A2A cards, golden evaluations, agent compaction | [Agent Skills and evaluations](references/agent-skills-and-evaluations.md) |64| Search providers, audience-aware search, changelog, human or agent feedback | [Search and feedback](references/search-and-feedback.md) |65| MCP routes/auth/security/tools or generated API references | [MCP and API reference](references/mcp-and-api-reference.md) |6667## Invariants6869- `staticExport: true` disables server-only search and AI behavior. Static Agent Bundles must not70 advertise server capabilities they cannot serve.71- Audience blocks shape representations; they are not access control. Never put secrets in72 `<Agent>`, `<Human>`, `<Audience>`, or `agent.md`.73- MCP HTTP is public by default. Add `mcp.security.authenticate` only when the project explicitly74 needs authentication.75- Keep `mcp.route` synchronized with non-Next public forwarders.76- Keep raw API keys out of config. Store only environment-variable names.77- Use a hosted OpenAPI `specUrl` instead of local route scanning when the API lives elsewhere.78- Preserve custom `components`, `icons`, callbacks, search adapters, and theme options unless the79 request changes them.8081## Verification8283Use the package manager already selected by the project:8485```bash86pnpm typecheck87pnpm build88pnpm exec docs doctor --agent --config docs.config.tsx89```9091Run only commands that exist in `package.json`; adapt the config path for the framework. For a92route change, probe the exact affected endpoint. For static outputs, prefer the matching93`--check` command before writing generated files.9495## Recovery9697- If config evaluation fails, inspect imports and environment access; do not silently replace the98 config with a static approximation.99- If a public route returns 404, check adapter forwarding and the configured route together.100- If a static deployment advertises unavailable features, regenerate the Agent Bundle after the101 config change.102- If typechecking rejects an option, inspect the installed package version before assuming the103 current reference applies.104105Full human documentation: [Configuration](https://docs.farming-labs.dev/docs/configuration) and106[API reference](https://docs.farming-labs.dev/docs/reference).