guides
LLMs
Give AI assistants the cnippet ui docs with llms.txt, per-page markdown, the shadcn MCP server and a project rules file.
AI assistants often confuse cnippet ui with shadcn/ui or Radix. For example, they write asChild where cnippet ui uses the render prop, or install dialog instead of @cnippet/dialog. To avoid this, every page on this site is also available as plain markdown that you can give to an LLM.
llms.txt
/llms.txt is an index of the whole site that follows the llms.txt convention. It starts with notes for AI assistants, then lists every docs, component and motion page with a one-line description and a link to that page's markdown.
Use it when the assistant can fetch URLs on its own. It reads the index, then opens only the pages it needs.
llms-full.txt
/llms-full.txt puts every page in one file, including the first example for each component.
Use it when you want the assistant to have all the docs at once, for example in a project knowledge base or a long-context chat. The file is large, so use llms.txt or single pages when you only need a few components.
Markdown for any page
Add .md to the URL of any docs, component or motion page to get its markdown:
Component pages include the install command, usage, the Anatomy and Good to know sections, the API reference and the example code.
Copy page
Every page has a Copy page button next to its title. It copies the page's markdown to your clipboard, ready to paste into a chat. Its menu has more options:
- View as Markdown — opens the
.mdversion of the page. - Open in ChatGPT / Open in Claude — starts a new chat that reads the page, so you can ask questions about it.
- Open in v0 — on component pages, opens the component in v0.
MCP server
The shadcn MCP server lets AI editors browse, search and install cnippet ui components for you. Add the registry to your project's components.json:
Then set up the server for your editor:
Use --client cursor, --client vscode, --client codex or --client opencode for other editors, then restart the editor. Try prompts like these:
- "Show me all components in the @cnippet registry."
- "Add @cnippet/dialog and @cnippet/field to my project."
- "Build a sign-up form using components from @cnippet."
Project rules
AI editors read a rules file from your project on every request. Add the rules below so the assistant uses cnippet ui correctly without being reminded. Save them as AGENTS.md (Codex, Cursor, VS Code and most other editors), CLAUDE.md (Claude Code) or .github/copilot-instructions.md (GitHub Copilot).
Tips for better results
- Point the assistant at the docs first. For example: "Use cnippet ui. Read https://ui.cnippet.dev/llms.txt before writing any code."
- Keep the
@cnippet/prefix.npx shadcn@latest add @cnippet/dialoginstalls the Base UI version. A baredialoginstalls the Radix-based shadcn/ui component. - Follow Anatomy and Good to know. These sections list the correct part names, prop names and defaults. When they differ from what the assistant expects from other libraries, the docs are right.