RFC-012 · Open Design Agent Kit
Let the agent see what it built
The agent that writes an artifact never sees it: every tool result is text. We add check_open_design_artifact, which renders the artifact in the export browser and returns size-capped screenshots as images plus the existing preflight findings, for pages at desktop and phone width, card designs at their format, and decks slide by slide. Agents are told to check before calling a design done.
Problem
Composition problems that checks can't measure (a cramped hero, a lopsided grid, an empty slide) ship unless the user notices them. Three gaps sit next to that:
- Preflight is only reachable through
export_open_design_artifactwithcheckOnly: true, framed as a poster step, so agents only run it for posters. - Decks are excluded from preflight.
- Web pages are checked at one viewport, so a layout that scrolls sideways on a phone passes.
Both hosts now accept images in tool results (VS Code LanguageModelDataPart.image, MCP ImageContent), and export already renders artifacts headlessly.
Goals
- One call shows the agent what the artifact looks like and what's measurably wrong, for pages, cards and decks.
- A bounded token cost per call.
- The same behaviour on VS Code, MCP hosts and the CLI.
Non-goals
- An LLM-judged aesthetic score.
- Pixel diffs against a previous render.
- Interaction or animation testing.
Proposal
A new tool rather than another export flag. It shares page loading with export through one helper, openArtifactPage, so export's behaviour is unchanged.
| Artifact | What is rendered | Findings tagged by |
|---|---|---|
| Page (no card) | Desktop 1440×900 and mobile 390×844 | viewport |
| Card design | Each card at its registered format | card |
| Deck | Every slide; one contact sheet of up to 12 | slide |
Images are JPEG, at most 1568 px on the long edge, three per call by default. A new horizontal-scroll check names the element that makes a page scroll sideways.
Alternatives considered
- Return images from
checkOnlyexports. One tool fewer, but it makes poster vocabulary the entry point for every artifact, and that path rejects decks. - Write screenshots to disk and return paths. Copilot's agent can't open image files, which is the gap this closes.
Risks and mitigations
| Risk | Mitigation |
|---|---|
| Token cost in long sessions | Three images by default; maxImages: 0 returns findings only |
| A browser start per check (1–2 s) | Acceptable for an end-of-step check; no daemon |
| Clients that ignore images | The text always carries every finding |
Rollout
- Core function and tests with a real browser.
- VS Code and MCP tools; CLI
checkwith--fail-on. - Instructions on every host: check before saying done, at most two fix rounds.
Open questions
- A "Check" button in the preview. Deferred to a follow-up.
- Running the check automatically on registration. Decided: no, registration stays browser-free.
Sources
openspec/changes/archive/2026-10-07-add-visual-check/proposal.mdopenspec/changes/archive/2026-10-07-add-visual-check/design.mdpackages/core/src/export/exportArtifact.tspackages/core/src/poster/preflight.ts