| name | dg-sync |
| description | Sync local files with a Google Stitch project. Downloads all screens and updates local config. Use when the user has made changes in Stitch's web UI and wants to pull them into their local project.
|
Sync local files with a Google Stitch project.
Instructions
-
Find the project to sync from:
- If a project ID was provided as argument, use it
- Otherwise, call
mcp__stitch__list_projects and show available projects
- Let the user pick which project to sync
-
List all screens in the project using mcp__stitch__list_screens.
-
Show what will be synced:
Project: [name] ([id])
Screens to sync: [count]
- Screen Name 1
- Screen Name 2
...
-
Confirm with the user before downloading.
-
Download each screen using mcp__stitch__get_screen_code and save the HTML to screens/[screen-name].html.
-
Update .guardrc.json with:
projectId: the synced project ID
screens: array of synced screen records (id, name, lastSynced timestamp)
lastSync: current timestamp
-
Report results:
- How many screens were synced
- Which files were created/updated in
screens/
- Any screens that failed to download
-
Check for design system using mcp__stitch__list_design_systems. If one exists and no local DESIGN.md is found, suggest running /dg-design to create one.
-
Next step: "Run /dg-preview to see synced screens."