Leadtype
Leadtype is a docs pipeline for teams that want one MDX source to serve humans and agents. Write docs once, render them in your app, then generate the files agents need: markdown mirrors, llms.txt, root llms-full.txt, search JSON, Agent Readability metadata, and package-bundled AGENTS.md output.
It is not a docs website framework. Bring your own host and UI — a custom Next.js app, TanStack Start, Nuxt, Astro, SvelteKit, Fumadocs, anything — and let leadtype handle conversion, validation, search, and the agent-facing outputs it specializes in.
Pick your path
You're building a docs website — Quickstart — render MDX in your app and generate llms.txt, markdown mirrors, search, and discovery files for HTTP agents.
You're shipping docs inside an npm package — Bundle docs into a package — generate an AGENTS.md plus per-topic markdown that ships in the tarball so coding agents read version-matched docs from node_modules. Agents that install your package then run cheaper and stop confidently guessing wrong about your API — see the evals.
You have a site without a docs tree — a CMS-backed blog, a marketing site, a data-driven app — Generate artifacts without a docs tree — hand generateAgentArtifacts() an in-memory page list and get the same agent artifact set, no .mdx files required.
Just want the mental model first? — How it works — the pipeline, the two output modes, and every artifact named once.
Key terms
These show up throughout the docs. The full glossary lives in How it works → Vocabulary.
- Site mode — the default
leadtype generate. Writes website artifacts topublic/:llms.txt, markdown mirrors, search index, sitemap, robots, Agent Readability files. - Bundle mode —
leadtype generate --bundle. WritesAGENTS.md+ relativedocs/*.mdinto a package directory so coding agents can read them fromnode_modulesafter install. Ifagents.mcp.enabledis set, it also includes package-local MCP retrieval files. - Agent Readability — the structured discovery and attribution data (
agent-readability.json+ JSON-LD + sitemap + markdown alternate links) that lets agents fetch, identify, and cite docs without scraping HTML.
What leadtype can do
Docs pipeline
One MDX source — local folders, mounted collections, or remote git repos pinned to a ref — converted, validated, localized, and rendered in your app via createDocsSource() without leadtype owning your UI.
AEO & Agent Readability
llms.txt, markdown mirrors with content negotiation, JSON-LD identity, robots Content-Signals, sitemaps, skills, and a docs MCP server — the full agent surface, mapped against the public scoring rubrics.
Agent artifacts without a docs tree
generateAgentArtifacts() emits the same agent surface from an in-memory page list — for CMS blogs, marketing sites, data-driven pages, and microfrontend fragments.
Writing for agents
Frontmatter contracts, agent-safe MDX components, and the content rule that moved the evals: document the non-obvious, not your type signatures.
Search & AI answers
A static search index, framework hooks, source-grounded AI answers, and search tools agents can call via WebMCP.
Version-matched package docs
Bundle AGENTS.md and markdown inside npm packages so coding agents read node_modules/<pkg>/AGENTS.md — they run cheaper and stop guessing wrong about your API.
Leadtype is a pipeline, not a website framework — it pairs with a custom docs app or layers under Fumadocs, Starlight, and friends. See Methodology for where it fits.