Loops & Context
Define ongoing UI prototyping loops, calibrate workspace skills, and attach supporting context files to guide codebase analysis.
In a Stitch Workspace, a loop isn’t a one-off bug ticket like “change button color to blue.” It’s a standing design goal that tells Stitch what kind of UX improvements to look for across your application’s routes.
Workspace features require running
stitch enable looponce on your machine. See Connect a Repository for setup.
Set up a loop with the /stitch skill
When you onboard a repository with the /stitch skill, your agent offers to configure our standard Scale Interactive Visual Prototyping loop (ui-prototyping). You can also ask /stitch to set up or tailor a loop at any time:
Use the UI prototyping template from the terminal
The CLI includes a built-in template registry that creates your standing loop and calibrates your workspace’s remote analysis skills in one step:
stitch create loop --template ui-prototyping
Running stitch create loop --template ui-prototyping does two things at once:
- Creates your standing loop with
CREATE_SUGGESTIONSautonomy so Stitch continuously proposes insights, solution specs, and Canvas design prompts. - Syncs three workspace skills (
design-synthesis,insight-guidelines, andsolution-guidelines) that steer Stitch’s backend research agents toward visual UI prototyping rather than generic code-quality lints.
To browse the other starter templates first, run stitch create loop --templates, or pick one interactively with stitch create loop -i.
If you want to target specific routes or workflows in your app, pass --objective alongside --template ui-prototyping so you customize the goal while keeping the UI prototyping skill calibration:
stitch create loop \
--template ui-prototyping \
--objective "Transform passive schedule and booking tables across /schedule and /venues into tactile, direct-manipulation surfaces."
Write outcome-focused objectives
The best loop objectives describe a durable UX outcome across multiple routes rather than a single closed task:
- Aim for outcomes: “Evaluate visual rhythm across
/feedand/scheduleso mobile schedule views are glanceable and tactile” or “Transform read-only booking summaries into direct-manipulation surfaces across/venuesand/checkout.” - Skip tiny tasks: One-line chores like “Fix table padding on
/schedule” or “Add a filter dropdown” are faster to just edit directly than to run through workspace synthesis.
You can list, inspect, or update your active loops whenever your focus shifts:
stitch find loops
stitch get loop <loop-id>
stitch edit loop <loop-id> --objective "..."
stitch delete loop <loop-id>
Objectives are immutable. Passing
--objectivetostitch edit loopreplaces the loop with a new one that has a new ID, so re-runstitch find loopsafterwards to pick up the new ID.
Track how a loop is measured
If a loop tracks metrics, stitch get loop <loop-id> shows them in a How it’s measured section, alongside the loop’s insights and solutions. Each metric lists:
- Its latest value, with its unit (for example
42 msor98.5%) - Its target, if one is set
- Its direction (↑ higher is better or ↓ lower is better)
- When it was last measured, or no measurements yet
The section is read-only. If metrics can’t be loaded, the rest of the loop still shows.
Attach supporting files and context
If you have product requirements, user research notes, or architecture docs that should inform your prototypes, attach them to your workspace.
Upload PDFs, images, or other documents with stitch upload file. Markdown and plain-text files are stored as workspace contexts instead of files:
stitch upload file ./specs/checkout-prd.pdf
stitch find files
Or add a quick note directly from the terminal with stitch create context:
stitch create context \
--title "Checkout Flow Goals" \
--description "Reduce guest checkout from four separate steps to a single focused view."
stitch find contexts
Original: https://stitch.withgoogle.com/docs/cli/priorities-and-context/
Translated from the official Google Stitch documentation. Original content © Google LLC. This is an independent, unofficial translation.