AI coding agents
Make Claude Code, Cursor, Codex, Copilot and others use Fruit Design correctly.
One prompt does the setup
Your agent connects the MCP server, reads your requirements and picks the components.
Set up the Fruit Design UI library in this project and use it for all UI.
About the MCP server: "fruit-design" is a read-only server with the live docs of the library.
Tools: get_guide (install and rules), list_components, search_components, get_component
(props, guidelines, example), get_tokens, get_changelog (latest version and changes).
URL: https://design.fruitlabs.online/mcp (HTTP). Local alternative: npx -y @fruit-labs/design-mcp@latest (stdio).
1. Add that MCP server to the config of the agent you are (Claude Code:
claude mcp add --transport http --scope project fruit-design https://design.fruitlabs.online/mcp
Others: add it under "mcpServers" in their MCP config file). If tools only load after a
restart, tell me, and meanwhile read https://design.fruitlabs.online/llms-full.txt.
2. Call get_guide. Detect my stack and install accordingly. For React:
npm install @fruit-labs/design, then import "@fruit-labs/design/tokens.css" and
"@fruit-labs/design/styles.css" once. Flutter, Expo or React Native: use the token files at
https://design.fruitlabs.online/docs/mobile/. Other web stacks: use the CSS and tokens.
3. Read this project's requirements (README, specs, existing screens, my messages). List each
screen and the UI it needs, then pick the matching components yourself with
search_components and get_component. Never invent props, and never hand-build a component
the library already has.
4. Add the usage rules to AGENTS.md (or CLAUDE.md) so later sessions follow them too.
5. Build the screens, then check light, dark and a 375px width.
6. From now on, check get_changelog when you start UI work. If a newer version fixes bugs or
adds something, tell me and update after I agree. If you find a library bug, draft a GitHub
issue for me instead of patching node_modules.
Tell me which components you chose and why. Ask before replacing existing UI.Add the rules to your repo
Paste into AGENTS.md or CLAUDE.md.
## UI: Fruit Design
- Never hand-roll a button, field, select, table, modal, menu, toast or chat UI that Fruit Design already has.
- Never use native select, date, time, range, colour or number inputs. Use Select, DatePicker, TimePicker, Slider, ColorPicker, NumberInput.
- Colours, spacing, radii and shadows come only from the CSS variables in tokens.css. No raw hex.
- Accent-coloured text uses --accent-ink, never --accent.
- One filled (primary) Button per view. Destructive confirms use ConfirmDialog tone="danger".
- Status always pairs colour with a word.
- Glass (GlassPanel) only for things floating above content.
- Icons come from <Icon name="…">. No emoji as icons.
- Every screen must work in light and dark.
## Choosing components
Read the app's requirements, list each screen and what the user does on it, then search for a component for each need. Use the library's component whenever one exists.
## Mobile (Flutter, Expo, React Native)
No native components. Use the token files: https://design.fruitlabs.online/tokens/fruit_tokens.dart and https://design.fruitlabs.online/tokens/fruit-tokens.ts
## Updates and bugs
At the start of UI work, compare the installed version (`npm ls @fruit-labs/design`) with get_changelog or https://design.fruitlabs.online/api/version.json. If it is older, tell the user what changed and update after they agree, then build and check the screens. Copied (shadcn) source is not updated by npm: show the diff before overwriting local changes. If a component has a bug, check the changelog first; otherwise draft an issue for https://github.com/fruit-labs-org/fruit-labs-design/issues and file it only if the user agrees. Do not patch files in node_modules.
## Setup, languages and templates
- Quick setup: `npx @fruit-labs/design init` (installs, imports styles, adds agent rules and the MCP server).
- Translations and right-to-left: wrap the app in `<LocaleProvider locale="ar" dir="rtl" messages={{ 'Next page': '...' }}>`. Keys are the built-in English strings.
- Page templates: https://design.fruitlabs.online/templates/ (dashboard, ai-chat, sign-in, settings, pricing, onboarding). Theme builder: https://design.fruitlabs.online/themes/Machine-readable docs
- https://design.fruitlabs.online/llms.txt: index of components
- https://design.fruitlabs.online/llms-full.txt: every component with props and examples
For live lookups, add the MCP server.