What it is
Maintains a project-level design system in Stitch: synthesise a DESIGN.md from existing screens or a description, upload it to create the design system, then apply it to existing screens. It is for Stitch users who need consistency across many screens. It does not generate screen designs and does not dictate a visual style.
Core workflow
| Stage | Content |
|---|---|
| Trigger | A project lacks a design system, tokens need updating, or an existing system must be applied to older screens. |
| Input | projectId, representative screens, the user’s style description, or an existing .stitch/DESIGN.md. |
| Steps | Fetch metadata and assets with list_projects, list_screens, get_screen; synthesise DESIGN.md when there are no screens or only a description; pause for user confirmation of display name, key colours, fonts, and roundness; call create_design_system_from_design_md right after upload; apply with apply_design_system. |
| Output | A project-level design system, screens with the system applied, DESIGN.md, and metadata.json. |
| Boundary | Explicit approval is required before upload; selectedScreenInstances may contain only id and sourceScreen, since position or size fields fail with invalid argument. |
| Getting started: confirm the palette and fonts to upload first, so you do not overwrite repeatedly. |
Traits
- A hard checkpoint: pause and ask the user before uploading; never upload unconfirmed.
- Two upload paths: the recommended script (base64 in-process, bypassing output token limits), or upload_design_md directly when DESIGN.md is under about 5KB.
- When applying, filter out instances whose type is DESIGN_SYSTEM_INSTANCE and pass only real screens.
- Once created, tokens live at project level, so generation prompts need not repeat them.
Who it is for and who it is not for
| Good fit | Poor fit |
|---|---|
| Multi-screen projects needing one palette, type, and roundness | Projects with no Stitch project yet |
| A new project that only has a style description | Changing one style detail on one screen |
| Applying new rules to legacy screens in bulk | Offline design generation |
How it differs
| Need | Use |
|---|---|
| Create or update a project-level design system | manage-design-system |
| Write DESIGN.md from existing screens | design-md |
| Extract rules from source code | extract-design-md |
| Generate a screen once | generate-design |
Source-level risks
| Risk | Source | Impact |
|---|---|---|
| Upload sends the local DESIGN.md to a remote service | Upload script and upload_design_md | Unconfirmed content reaches the cloud project |
| API key passed on the command line | Example –api-key argument | The key can persist in shell history |
| Skipping the checkpoint overwrites silently | WARNING checkpoint | A wrong version replaces the live system |
| Position or size fields break the call | apply_design_system note | Bulk application stops mid-way |
| Depends on other skills for structure | Repeated pointers to design-md | Document structure is unguaranteed if absent |