/docsv0.1.0

Quickstart

Install @wrksz/docs and render your first MDX page in a Next.js App Router app.

This guide sets up @wrksz/docs in an existing Next.js 16+ App Router project with Tailwind CSS v4.

Set up @wrksz/docs with an AI agent

Hand this page to Claude Code, Codex, or any coding agent working in your repository.

Show prompt
Set up @wrksz/docs in this Next.js project by following https://docs.wrksz.dev/docs/quickstart.md.

Check the existing Next.js, React, and Tailwind versions first, match the repository's directory layout (src/ or root app/), add the docs routes and a starter index.mdx page, then type-check and build the app.

Manual setup

Install the package

Configure Next.js and styles

Wrap your Next.js config with withDocs so @wrksz/docs is transpiled and the agent Markdown rewrites are registered, then import the package stylesheet in your global CSS.

Define the site and content source

Create a site definition for navigation, metadata, and package registry lookups, and a source loader pointing at your MDX folder.

Wrap the root layout

Load the bundled font variables on <html> and wrap the app in DocsRoot. Passing the page list wires up the Cmd+K search palette across the whole site.

src/app/layout.tsx

Add the docs layout and catch-all page

Mount DocsLayout under /docs for the sidebar shell, and render each MDX page inside DocsPage with PageHeader, Prose, and PageFooter.

Write your first page

Add an index.mdx file in content/docs and start your dev server. Visit /docs to see the page, sidebar, and table of contents.

content/docs/index.mdx

Optional: SEO and Markdown for agents

Add three small route files to expose /llms.txt, /llms-full.txt, per-page /docs/*.md responses, sitemap.xml, and robots.txt. withDocs already configures the rewrites for the Markdown endpoints.

Next steps