# AI agents

Docs, a skill and an MCP server so Claude Code, Cursor and other agents add Plumbago components instead of writing look-alikes.

## Docs for agents

Every page of these docs is also plain Markdown: add `.md` to its address, like [/components/sheet.md](https://plumbago.ochotzas.com/components/sheet.md). Component pages include usage, every example and the full source.

- [/llms.txt](https://plumbago.ochotzas.com/llms.txt) is a short summary with a link to every page. Point an agent here first.
- [/llms-full.txt](https://plumbago.ochotzas.com/llms-full.txt) is all the docs in one file, for agents that read everything up front.

## Claude Code skill

A skill tells Claude Code how Plumbago works: check what exists, add components instead of writing look-alikes, style with the theme and keep the motion. Claude loads it when the work calls for it. Run this in your project:

```sh
npx plumbago skill
```

It writes `.claude/skills/plumbago/SKILL.md`. Commit it so everyone on the project gets it. Run it again with `--overwrite` after updating the CLI to get the latest version.

.claude/skills/plumbago/SKILL.md

```md
---
name: plumbago
description: Build React UI with Plumbago, calm components that move like iOS, copied into this project with the plumbago CLI. Use when adding or changing UI here, picking a component, styling with the Plumbago theme, or when the user mentions Plumbago, sheets, swipe rows, menus or other components it ships.
---

# Plumbago

This project uses Plumbago: React components built on Base UI and styled with Tailwind CSS v4, copied into the project as source. Once copied, they're this project's files to read and change.

## Find what exists

- `plumbago.json` at the project root says where things live: `paths.ui` for components, `paths.lib` for helpers, `css` for the Tailwind file that imports the theme. If it's missing, run `npx plumbago init` first.
- Run `npx plumbago list` to see every component with a one-line description.
- Read a component's docs as Markdown at https://plumbago.ochotzas.com/components/<name>.md: install, usage, every example and the source. The whole docs are at https://plumbago.ochotzas.com/llms-full.txt.

## Add components, don't rewrite them

- Before building a sheet, menu, select, date picker, toast, swipe row or similar from scratch, check whether Plumbago has it, then run `npx plumbago add <name>`. It copies the component, whatever it depends on, and installs missing packages.
- `add` keeps files that were changed locally. Pass `--overwrite` only when the user wants the upstream version back.
- Import components from the alias in `plumbago.json`, usually `@/components/ui/<name>`. All exports are named.
- Every component takes `className` (a string) and merges it last with `cn` from `@/lib/cn`. Compound components export their parts, such as `Sheet`, `SheetTrigger` and `SheetContent`.

## Style with the theme

- Use the theme's Tailwind utilities instead of raw colors or sizes:
  - Surfaces and text: `bg-bg`, `bg-surface`, `text-ink`, `text-ink-2`, `text-ink-3`, `border-line`.
  - Meaning: `accent`, `success`, `warning`, `danger` and their `-tint`.
  - Type: `text-caption` to `text-title1`. Corners: `rounded-sm` to `rounded-xl`. Motion: `ease-spring duration-spring`.
- Ink carries emphasis and color carries meaning. Use one primary button per screen; other buttons are secondary or plain.
- Group related content on an `Island` (a surface panel) on the page background. Don't nest islands.
- To change the accent, grays, corners, density or fonts, make a preset code on https://plumbago.ochotzas.com/create and run `npx plumbago apply <code>`. Don't hand-edit the theme's variables for that.

## Keep the motion

- Things that appear or leave use a blur fade on the spring; popups grow out of the button that opened them. The components already do this, so keep their animation classes when restyling.
- Respect reduced motion: blur, translate and scale go behind `motion-safe:`.
- Touch targets reach 44px, and decorative icons get `aria-hidden="true"`.
```

## MCP server

MCP lets an agent call tools. The Plumbago server runs on your computer through `npx`, works offline, and gives the agent three tools:

- **list_components**: Lists every component with a one-line description, or only those that match a word like sheet or date.

- **view_component**: Shows one component's description, the packages and components it needs, and its full source.

- **add_components**: Copies components into the project, like npx plumbago add, and says which packages are left to install.

Add it to your agent from the project folder, so components land in that project.

### Claude Code

```sh
claude mcp add plumbago -- npx -y plumbago@latest mcp
```

### Cursor

.cursor/mcp.json

```json
{
  "mcpServers": {
    "plumbago": {
      "command": "npx",
      "args": ["-y", "plumbago@latest", "mcp"]
    }
  }
}
```

### VS Code

.vscode/mcp.json

```json
{
  "servers": {
    "plumbago": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "plumbago@latest", "mcp"]
    }
  }
}
```

### Other agents

```sh
npx -y plumbago@latest mcp
```

Any client that runs MCP servers over standard input and output works. Add `--cwd <path>` if it doesn't start in your project folder.

## Project rules

Agents also read a rules file at the root of your project: `AGENTS.md` for most of them, `CLAUDE.md` for Claude Code. Paste this into yours so every agent knows to use Plumbago.

AGENTS.md

```md
## UI

This project uses Plumbago (https://plumbago.ochotzas.com/llms.txt) for its React components.

- Before writing a sheet, menu, select, picker, toast or similar, check `npx plumbago list` and add it with `npx plumbago add <name>` instead of building one.
- Components live where `plumbago.json` says, usually `src/components/ui`. They're our code now: change them freely.
- Style with the theme's utilities (`bg-surface`, `text-ink-2`, `rounded-lg`, `ease-spring`), not raw colors. Ink carries emphasis, color carries meaning.
- Keep the motion: things appear and leave with a blur fade, popups grow out of their button, and reduced motion only fades.
```
