Developer guide Design system
Design system workflow
How tokens, the component bundle, previews and Claude Design artifacts fit together.
On this page
The Archipelego design system lives in design-system/. It holds the tokens, the brand book, the component bundle, the glyphs and the logo. The app loads it from there and never copies it. For the full reference of every token and component, read DESIGN.md.
What is where
| Path | What it is |
|---|---|
design-system/project/tokens.json |
The source of every token: colours per theme, type, spacing, canvas geometry, radii, strokes, shadows, durations, easings. |
design-system/project/README.md |
The brand book: voice, colour, type, motion, sound, layout and accessibility rules. |
design-system/project/components/bundle.js |
The component bundle. A classic script that registers everything on window.Archipelego. |
design-system/project/components/bundle.css |
The component styles, with the ap- class prefix. |
design-system/project/components/index.d.ts |
TypeScript types for the bundle. |
design-system/project/components/<Name>/ |
One folder per component, with README.md and preview.html. |
design-system/project/assets/ |
The glyph SVGs and the logo files. |
design-system/project/design-system.json |
The manifest of the published Claude Design System artifact. |
design-system/dev/ |
Local tooling: the token compiler, the compiled tokens.css, a showcase page and its server. |
design-system/gen-previews.js |
Generates the component previews, the component READMEs and the glyph files. |
design-prototype/project/*.dc.html |
The clickable Claude Design prototype artboards. |
Tokens
tokens.json is the only place where a token value is defined. Compile it into CSS custom properties:
npm run tokensThis runs node design-system/dev/build-tokens.js and writes design-system/dev/tokens.css.
- Colour and shadow tokens are written per theme: light under
:rootand[data-theme="light"], dark under[data-theme="dark"]. - Every other token is written once under
:root, for example--space-4or--duration-base. - Font families become
--font-display,--font-sansand--font-mono. - Each type style becomes a class, for example
.bodyor.mono.
npm run dev and npm run build run npm run tokens first, so the file is always fresh.
The bundle in the app
The app imports the design system through the @ds alias, defined in app/vite.config.ts. app/src/ds/index.ts is the single entry point:
import './react-global';
import '@ds/project/components/bundle.js';
import '@ds/dev/tokens.css';
import '@ds/project/components/bundle.css';The order matters. react-global sets window.React first, because the bundle reads window.React when it runs. The app and the bundle then share one React. index.ts re-exports the components and constants from window.Archipelego, with their types from index.d.ts.
The theme is a data-theme attribute on the html element. The app sets it to light or dark.
Previews and the showcase
Regenerate the component previews, the component READMEs and the glyph files:
node design-system/gen-previews.jsServe the showcase locally:
node design-system/dev/serve.jsIt serves the design-system/ folder on port 4173, with dev/index.html as the home page. Set PORT to use another port.
Claude Design artifacts
The design system is published as a Claude Design System artifact, described by design-system/project/design-system.json. Each component's preview.html starts with a @dsCard marker that places it in the published system. The prototype artboards in design-prototype/project/ are the clickable Claude Design prototype: the main canvas, the chat, AI keys, the library, the 3D explorer, features, docking and the phone layout.
Changes to the design system go through the design system owners. Change the source in design-system/, regenerate, and republish the artifact. The app picks the change up because it never copies the files.
Adding a block kind
A new kind touches several places. Keep them in step:
- Draw a glyph that reads at 16px, on the 24px grid with 1.75px strokes, round caps and joins. Add it to
GLYPHSin the bundle. - Add the kind to
KINDSin the bundle, with a title-case name and a layer (1 to 4, orsecurity). Setcontainer: trueonly for kinds that hold other blocks. - Add the kind to the
Kindtype inindex.d.ts. - Add it to the list of kinds in the brand book,
design-system/project/README.md. - Run
node design-system/gen-previews.jsto write the glyph file. - Add it to
KINDSinserver/src/explain.ts, so Explain and the Architect accept it. - Add it to
KNOWNinscripts/build-library.mjs, so library builds keep it. - Add it to a group in
GROUPSinapp/src/panels/Toolbox.tsx, so people can place it.