---
title: "Add rules to AGENTS.md"
description: "Paste one block into AGENTS.md or CLAUDE.md, and your agent adds Gelatin UI items with the shadcn CLI, the MCP server, and the docs."
url: https://gelatinui.com/docs/agents
markdown_url: https://gelatinui.com/docs/agents.md
docs_index: https://gelatinui.com/docs/llms.txt
prompt: "Read https://gelatinui.com/docs/agents.md. Add its Gelatin UI block to AGENTS.md at the project root. For Claude Code, use CLAUDE.md. Make the file if it is missing. Done: the file holds the block once, with no key in it."
---

> Docs index: https://gelatinui.com/docs/llms.txt

# Add rules to AGENTS.md

> Paste one block into AGENTS.md or CLAUDE.md, and your agent adds Gelatin UI items with the shadcn CLI, the MCP server, and the docs.

One block of rules tells your agent how to work with Gelatin UI. With it, the agent adds Gelatin UI items with the shadcn CLI, reads their docs, and keeps your Pro API key out of your files.

## Add the block

1. Open `AGENTS.md` at the root of your project. For Claude Code, open `CLAUDE.md`. Make the file if it is missing.
2. Paste this block into the file. Your agent reads the file before it works in your code.

```md
## Gelatin UI

This project uses Gelatin UI, a shadcn registry of React components and blocks.

- Add an item with the shadcn CLI: `npx shadcn@latest add @gelatin-ui/<name>`. Never write a copy of an item by hand.
- Registry: `"@gelatin-ui": "https://gelatinui.com/r/{name}.json"` in the `registries` block of `components.json`. Pro items use `@gelatin-ui-pro`.
- MCP server: https://gelatinui.com/mcp. Order: search_items → compare_items when two fit → get_item outline → get_item sections → get_install_plan → write → check_usage.
- Docs as Markdown: https://gelatinui.com/components/<name>.md for an item, https://gelatinui.com/docs/llms.txt for the guides.
- Pro API key: only in `.env.local` (git ignores it) or a CI secret, as `GELATIN_UI_PRO_TOKEN`; never in chat or code.
- Gelatin UI is in alpha: items change often, and a new version can break your code. The code you add is yours, and it never changes unless you add the item again. To take a newer version, add the item again with --overwrite on a new branch, review the diff, and keep the edits you want.
- Rules:
  1. Put titles, text, icons, and actions in parts, not in props.
  2. Keep each part inside its root.
  3. Make a part a link with `render`, not `href`.
  4. Use the Base UI prop names: `disabled`, `readOnly`, `invalid`.
  5. Import items from the paths of your `components.json`.
  6. Color with the theme tokens, not with raw colors.
```

## Read the docs as Markdown

Each docs page and each item page has a Markdown copy. Add `.md` to the URL, or send the `Accept: text/markdown` header:

```bash
curl https://gelatinui.com/docs/install.md

curl -H "Accept: text/markdown" \
  https://gelatinui.com/components/button
```

[/llms.txt](https://gelatinui.com/llms.txt) lists each item page with the link to its Markdown copy.

## Connect the MCP server

The block tells your agent to use the MCP server, so connect it next. The [Connect the MCP server](https://gelatinui.com/docs/mcp-server.md) guide has the setup for Claude Code, Claude.ai, Cursor, VS Code, Codex, ChatGPT, Windsurf, and Zed, and the steps for any other client. It also says which clients work today.

## Next steps

- [Connect the MCP server](https://gelatinui.com/docs/mcp-server.md): connect your agent to the server that the block names.
- [Create an API key](https://gelatinui.com/docs/api-key.md): one key for the shadcn CLI and your agent.
- [Install Pro items](https://gelatinui.com/docs/pro-items.md): the same command, with your key.
