Every way in hands the agent the same guide: the get_integration_guide tool, and the integrate-design-system prompt that tells it to call that tool first. It is written for the agent, in steps, with guardrails at the end. This page is what it says.
How to use it
Ask the agent to integrate the design system. In Claude Code, /mcp__designsource__integrate-design-system; elsewhere, "integrate the design system using the designsource MCP". The agent reads the guide and checks that the app is a React app before it edits anything; DS source supports React apps only for now. Expect it to ask your client's permission once for add_ui_kit.
How it works
The steps, in the guide's order:
- Detect the stack. Read
package.jsonand the config files before touching anything. A React app gets the UI kit throughadd_ui_kit. Anything else is not supported yet: the agent tells the user so and stops, porting nothing. Callget_projectonce for the name, fonts, corner strategy and whether there is a mockup page. - Wire the tokens in.
add_ui_kitwrites the theme into the global stylesheet (with Tailwind v4 and shadcn set up first when missing) and brings in the components. If the folder has no design system yet, the agent first callscreate_design_systemoruse_design_system. - Bring in the components. Done by the same call; import from the alias it names. The components' responsive classes query a container named
stage, which the theme makes<html>. - Blocks, if the app needs pages.
list_blocksnames the ready-made layouts;get_block_sourcereturns every file of one with the paths it takes. Each renders insideBlockStageas a full-viewport page. Whenadd_ui_kitadded the full kit, the blocks are already in the app under the/design-systemsection and are not copied again. - Screens, if the project has them.
list_screensnames them andget_screen_sourcereturns one with its parts.add_ui_kitwithscreenswrites them; the agent mounts each on a route itself. Marketing pages pull the same way plus"site", the header and footer that link them. Signed in withlogin,generate_screenmakes or changes a screen or page first. - Build the home page, when the project has a mockup:
get_mockup_pagereturns the layout spec with the renderer and schema; render it as the first route. - Migrate the existing styles. Restyle the app's screens with the kit components and replace hardcoded colours, radii, shadows and fonts with the tokens, screen by screen; do not stop after adding the kit.
- Check the work. When
check_design_systemis in the tool list, call it, fix the hardcoded colours, hand-built controls and copies of kit components it lists, and call it again.add_ui_kitkeeps the kit's rules in the app'sAGENTS.mdbetweendesignsource:rulesmarkers; the agent writes its own notes outside them. - Document. Say in the repository where the tokens come from and how they are updated.
An Icons section follows the steps: the project's icon set, the package to install, the style and weight to pass, to use icons from that set only, and to switch a shadcn component added later from lucide-react to the kit's icons module. With filled-when-selected on, it also names the two icon groups and the controls that swap them.
Then the guardrails: keep the semantic and component variables as the one source of a value, change the design system rather than the generated stylesheet, keep every reference chain, and name what was not done. One more says: Do not copy token values, CSS variables or component source into the app by hand; add_ui_kit writes them and keeps them updatable. When add_ui_kit is not in the agent's tool list, the guide says to ask the user to update designsource and stop.
The guide closes with what to do when this repository should get a design system of its own: list_design_systems and use_design_system to pick one of yours, create_design_system to make one after reading the codebase, and the line that says to run login when the computer is not signed in.
The Export dialog's Prompt for your coding agent says the same in short: check for React, run npx designsource add --yes, restyle with the kit.
Related
- MCP tools and prompts: each tool the steps name.
- For coding agents: the short version, and React only for now.
- How agents use a design system.