The agent guide

Docs

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:

  1. Detect the stack. Read package.json and the config files before touching anything. A React app gets the UI kit through add_ui_kit. Anything else is not supported yet: the agent tells the user so and stops, porting nothing. Call get_project once for the name, fonts, corner strategy and whether there is a mockup page.
  2. Wire the tokens in. add_ui_kit writes 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 calls create_design_system or use_design_system.
  3. 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>.
  4. Blocks, if the app needs pages. list_blocks names the ready-made layouts; get_block_source returns every file of one with the paths it takes. Each renders inside BlockStage as a full-viewport page. When add_ui_kit added the full kit, the blocks are already in the app under the /design-system section and are not copied again.
  5. Screens, if the project has them. list_screens names them and get_screen_source returns one with its parts. add_ui_kit with screens writes 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 with login, generate_screen makes or changes a screen or page first.
  6. Build the home page, when the project has a mockup: get_mockup_page returns the layout spec with the renderer and schema; render it as the first route.
  7. 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.
  8. Check the work. When check_design_system is 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_kit keeps the kit's rules in the app's AGENTS.md between designsource:rules markers; the agent writes its own notes outside them.
  9. 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.