This document first explains how users use stitch, followed by the detailed technical specifications.
stitch is used for page design review and preview collaboration.
Suitable scenarios:
- Landing pages, marketing pages, activity pages
- Page requirements with significant UI changes
- Changes requiring a design preview before deciding whether to proceed with development
Its core functions are:
- Generating or submitting page previews
- Waiting for manual approval
- Blocking
verify / archive / finalizebefore approval
AI Conversation:
Use OSpec to help me open the Stitch plugin.
Skill Mode:
Use $ospec to help me open the Stitch plugin.
Command Line:
ospec plugins enable stitch .After enabling stitch, typically these 3 things need to be completed:
- Select a provider
- Configure Stitch authentication
- Run a doctor check to confirm both the local machine and the project are ready
The default provider is gemini, but it can be switched to codex.
Most users do not need to change the runner; just confirm which one is used in .skillrc.plugins.stitch.provider.
If using gemini:
- Configure the
stitchMCP in~/.gemini/settings.json - Add
X-Goog-Api-Key
Example:
{
"mcpServers": {
"stitch": {
"httpUrl": "https://stitch.googleapis.com/mcp",
"headers": {
"X-Goog-Api-Key": "your-stitch-api-key"
}
}
}
}If using codex:
- Configure the
stitchMCP in~/.codex/config.toml - Also requires
X-Goog-Api-Key
Example:
[mcp_servers.stitch]
type = "http"
url = "https://stitch.googleapis.com/mcp"
headers = { X-Goog-Api-Key = "your-stitch-api-key" }
[mcp_servers.stitch.http_headers]
X-Goog-Api-Key = "your-stitch-api-key"ospec plugins doctor stitch .This command checks:
- Whether the plugin is enabled
- Whether the provider is configured
- Whether the local CLI is available
- Whether Stitch MCP and authentication are ready
After enabling, the following Stitch-related items appear in the project:
.skillrc.plugins.stitch.ospec/plugins/stitch/project.json.ospec/plugins/stitch/exports/.ospec/plugins/stitch/baselines/.ospec/plugins/stitch/cache/
Approval artifacts tied to a specific change are placed in:
changes/active/<change>/artifacts/stitch/
- Initialize project:
ospec init . - Open Stitch:
ospec plugins enable stitch . - Configure provider and authentication:
ospec plugins doctor stitch . - Create a UI change
- Run Stitch:
ospec plugins run stitch <change-path> - Send the generated
preview_urlto the reviewer - After approval, execute:
ospec plugins approve stitch <change-path> - Proceed with
ospec verifyandospec finalize
Recommended for these change types:
ui_changepage_designfeature_flowapi_changebackend_changeintegration_change
This document defines the goals, running contracts, and implementation boundaries for the stitch plugin in OSpec.
In project delivery, page development often requires manual review. stitch provides the bridge for this process, ensuring manual approval is required before a change is archived.
- The name for this plugin is
stitch. - The default provider is
gemini. - Changes can activate the
stitch_design_reviewoptional step. stitchuses a project-level workspace:.ospec/plugins/stitch/.- Gate artifacts are stored in
changes/active/<change>/artifacts/stitch/. verify / archive / finalizecommands respect thestitchgate.
- Project-level config:
.skillrc.plugins.stitch - Project-level workspace:
.ospec/plugins/stitch/ - Change-level artifacts:
changes/active/<change>/artifacts/stitch/
.ospec/plugins/stitch/
project.json
exports/
baselines/
cache/
project.json: Stitch project ID and configuration.exports/: Exported screenshots or design files for comparison.baselines/: Reference design baselines.cache/: Intermediate data cache.
changes/active/<change>/artifacts/stitch/
approval.json
summary.md
result.json
approval.json: Approval status (pending,approved,rejected).summary.md: Human-readable summary of the review.result.json: Structured execution result includingpreview_url.
ospec plugins statusospec plugins enable stitchospec plugins doctor stitchospec plugins run stitch <change-path>ospec plugins approve stitch <change-path>ospec plugins reject stitch <change-path>
The current version implements the Stitch runtime bridge with the following conventions:
Built-in support for Gemini CLI + stitch MCP or Codex CLI + stitch MCP.
Default runner configuration (if not overridden):
{
"mode": "command",
"command": "node",
"args": [
"${ospec_package_path}/dist/adapters/gemini-stitch-adapter.js",
"--change",
"{change_path}",
"--project",
"{project_path}"
],
"cwd": "{project_path}",
"timeout_ms": 900000
}Choose between gemini and codex in .skillrc.plugins.stitch.provider.
result.json contains:
- Execution timestamp
- Runner command and parameters
- Parsed
preview_url screen_mappingfor visual comparison
If checkpoint is also enabled and checkpoint_ui_review is active:
stitchshould export comparable screenshots to.ospec/plugins/stitch/exports/.result.jsonmust map these exports to routes/themes.- Without these exports,
checkpointcannot perform automated visual consistency checks.
When implementing or extending the Stitch plugin, follow this document to ensure boundaries are maintained and design details are not lost across dialogue rounds.