This page is written for a coding agent working in a user's app, and for the person who runs it. The short version: DS source supports React apps only for now. The design system goes into an app through the UI kit, which one command writes. Do not copy colours, CSS variables, token values or component source from this site, an export or a tool answer into the app by hand.
How to use it
In the React app's folder, run:
npx designsource add --yesIt writes the theme and the UI kit components, installs their libraries and names the folder to import them from. Then restyle the app's screens with those components, and run npx designsource check to see what still bypasses the kit: hardcoded colours, hand-built controls, your own copies of kit components. It needs no token and writes nothing.
add also keeps the kit's rules for coding agents in the app's AGENTS.md (and CLAUDE.md), between designsource:rules markers. Follow them, and write your own notes outside the markers.
If it prints this line, stop:
No design system is connected to this folder. Ask the user to run npx designsource in a terminal in this folder, then run this command again. Do not paste a project token into a command.Ask the user to run npx designsource in a terminal in that folder, then run add again. Never ask for the project token, and never put one in a command.
With the MCP server, the order is the same:
- If the folder has no design system yet, call
create_design_system, oruse_design_systemto pick one the user already has. - Call
add_ui_kit. It writes the same filesadddoes. - Restyle the app with the components it added.
- Call
check_design_system, fix what it lists, and call it again.
Call get_integration_guide for the full steps.
React only for now
DS source supports React apps only for now. Vue, Svelte, Angular and plain CSS are not supported yet. Check package.json first. If the app is not a React app, stop and tell the user it is not supported yet. Do not port the components, and do not apply the tokens by hand: a hand-built copy does not update when the design system changes.
The kit also needs React 19 and TypeScript; add says so in one line when an app has neither.
--yes and --force
--yesasks nothing: every component, the theme and the/design-systemsection, your edits kept. It never reads a token from the keyboard, so it cannot hang waiting for one. Agents pass it.--forcereplaces files designsource did not write, and components the user edited. Ifaddsays a file would be replaced, ask the user before running it again with--force.
How it works
The kit is the 62 components the workbench preview renders, as source files in the app, painted by the design system's theme. Each file carries a stamp, so a later add refreshes the theme and every component the user did not edit. Values copied by hand have no stamp: they drift the first time the design system changes, and nothing tells them apart from the app's own code.
add needs the project token, and it finds one with no prompt in two safe ways:
- The user ran
npx designsourceornpx designsource connectin a terminal in this folder once. That saves the token, or an account link, for the folder. Every lateraddin the folder finds it, the agent's included. DS_SYNC_TOKENis set in the environment the agent runs in, from the shell profile or a CI secret store. The user sets it there; it is never typed into a command.
Typing --token <value> or DS_SYNC_TOKEN=<value> npx … puts the token in the agent's transcript, so an agent never does either. npx designsource itself signs the user in, so it runs only in a terminal: an agent cannot run it for them.
The MCP server states the same order when a client connects. Its readers (get_tokens, get_css_variables, get_shadcn_theme, get_component_source) still answer, and add one line when the folder is not ready for the values: a React app without the kit is told to call add_ui_kit, and an app that is not React is told it is not supported yet.
What can go wrong
- The keychain cannot be read from a sandboxed shell. On macOS the token lives in the login keychain, and on Linux in the Secret Service. A sandboxed agent shell may be denied them, so
addsays the token is in the keychain and cannot be read here. Ask the user to runnpx designsource --store filein a terminal in the folder once: it moves the token into a private file only they can read, which the agent's shell can read. Exports need Pro: the project owner's account is on Free.addstops on a file it did not write: ask the user, then run again with--forceonly if they agree.
Related
add: every flag.check: what the report counts.- Tokens and credentials: where a token is looked for, in order.
- The agent guide: what
get_integration_guidesays. - The UI kit in your app.