farming-labs-docs
npx skills add https://github.com/farming-labs/docs --skill farming-labs-docs
Agent 安装分布
Skill 文档
@farming-labs/docs â Getting Started
Always consult the project docs (and /docs routes when available) for the latest API and examples.
@farming-labs/docs is a modern, flexible MDX-based documentation framework. Write markdown, get a polished docs site. Supported frameworks: Next.js, SvelteKit, Astro, Nuxt.
Quick reference
CLI
| Scenario | Command |
|---|---|
| Add docs to existing app | npx @farming-labs/docs init |
| Start from scratch (clone example) | mkdir my-docs && cd my-docs then npx @farming-labs/docs init --template <next | nuxt | sveltekit | astro> |
CLI flags
| Flag | Description |
|---|---|
--template <name> |
Clone example: next, nuxt, sveltekit, astro. Use in an empty folder. |
--theme <name> |
Skip theme prompt (e.g. --theme fumadocs, --theme greentree). |
--entry <path> |
Skip entry path prompt (default docs). |
Packages by framework
| Framework | Core + adapter | Theme package |
|---|---|---|
| Next.js | @farming-labs/docs, @farming-labs/next |
@farming-labs/theme |
| SvelteKit | @farming-labs/docs, @farming-labs/svelte |
@farming-labs/svelte-theme |
| Astro | @farming-labs/docs, @farming-labs/astro |
@farming-labs/astro-theme |
| Nuxt | @farming-labs/docs, @farming-labs/nuxt |
@farming-labs/nuxt-theme |
Themes (all frameworks)
fumadocs, darksharp, pixel-border, colorful, greentree. Theme name in config must match the themeâs CSS import path (e.g. greentree â @farming-labs/theme/greentree/css for Next).
Critical: theme CSS
Every setup must import the themeâs CSS in the global stylesheet. Without it, docs pages will not be styled.
- Next.js:
app/global.cssâ@import "@farming-labs/theme/<theme>/css";(e.g.default,greentree). - SvelteKit:
src/app.cssâ@import "@farming-labs/svelte-theme/<theme>/css"; - Astro: Import in the docs layout or page file:
import "@farming-labs/astro-theme/<theme>/css"; - Nuxt:
nuxt.config.tsâcss: ["@farming-labs/nuxt-theme/<theme>/css"]
Use the same theme name in docs.config and in the CSS import.
Core config: defineDocs
All frameworks use a single config file (docs.config.ts or docs.config.tsx):
import { defineDocs } from "@farming-labs/docs";
import { fumadocs } from "@farming-labs/theme"; // or svelte-theme, astro-theme, nuxt-theme
export default defineDocs({
entry: "docs",
contentDir: "docs", // SvelteKit/Astro/Nuxt
theme: fumadocs(),
metadata: {
titleTemplate: "%s â Docs",
description: "My documentation site",
},
});
- Next.js:
docs.config.tsxat project root; wrap Next config withwithDocs()from@farming-labs/next/config. - SvelteKit:
src/lib/docs.config.ts; routes undersrc/routes/docs/. - Astro:
src/lib/docs.config.ts; pages undersrc/pages/<entry>/. - Nuxt:
docs.config.tsat project root;server/api/docs.tsandpages/docs/[...slug].vue.
Doc content and frontmatter
Docs live under the entry directory (e.g. docs/ or app/docs/). Each page is MDX (or Markdown) with frontmatter:
---
title: "Installation"
description: "Get up and running"
icon: "rocket"
---
# Installation
Content here.
Routing is file-based: docs/getting-started/page.mdx â /docs/getting-started.
Path aliases (CLI)
When running init, the CLI may ask about path aliases:
- Next.js:
@/(e.g.@/docs.config) vs relative paths. - SvelteKit:
$lib/vs relative. - Nuxt:
~/vs relative.
If the user chooses âno aliasâ, generated code uses relative paths to docs.config (e.g. ../../docs.config), and tsconfig may omit the paths block.
Common gotchas
- Theme CSS missing â Docs look unstyled until the theme CSS is imported in the global stylesheet (or Nuxt
css). - Wrong theme package â Use the theme package for the same framework (e.g.
@farming-labs/svelte-themefor SvelteKit, not@farming-labs/theme). - From scratch â Use
--templatein an empty directory; the CLI clones the example and runs install. - Existing project â Run
initin the project root; the CLI detects the framework and scaffolds files.
Resources
- Repo: farming-labs/docs
- Docs site: Check the projectâs
/docs(e.g. installation, CLI, configuration). - Examples:
examples/next,examples/nuxt,examples/sveltekit,examples/astroin the repo.