Render a Jetpack Compose or Compose Multiplatform @Preview in the person's project to PNG and look at it. Use when asked to render, show or check what one of their composables or @Previews looks like, to verify a Compose UI edit, or to compare before/after.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Compose Preview?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/yschimke-compose-preview)
---
name: compose-preview
description: Render a Jetpack Compose or Compose Multiplatform @Preview in the person's project to PNG and look at it. Use when asked to render, show or check what one of their composables or @Previews looks like, to verify a Compose UI edit, or to compare before/after.
---
# Compose Preview
Render `@Preview` composables to PNG without Android Studio (Android via
Robolectric, CMP Desktop via Skia). CLI, Gradle plugin and renderers ship from
[compose-ai-tools](https://github.com/yschimke/compose-ai-tools); the MCP server
from [compose-preview-server](https://github.com/yschimke/compose-preview-server).
Related skills, each installed beside this one: **compose-catalog** for library components (Material
3, Wear M3) with no project, **compose-design-review** to review UI against design guidelines and
accessibility, and **android-simulator** to run a whole app.
## Render first
For a request to render or show a preview, follow the short loop below. A
requested guidelines review belongs to the compose-design-review skill
([its checklist](../compose-design-review/references/design-guidelines.md)). If
tools are unavailable, report blocked evidence and follow the integration's
setup guidance.
With the local MCP server attached (compose-preview-server 3.78.0+), its
`initialize` instructions say how to call it: `render_preview
preview=<FunctionName>`, no exploring or registering first, no hand-built
mocks. Follow them. This skill adds the budget: a routine render is at most
three tool calls, with no base64 in the reply and images only when you need to
see them.
Your first call is the render. Don't grep for the preview or read its source
first: the server finds it by function name. Look things up only if the render
fails.
1. **Render.** If your client reads local files (Claude Code, Codex, Gemini
CLI, OpenCode, Antigravity), pass `inline=false`. The result is `pngPath`,
`sha256`, dimensions and `changed`, with no image tokens. If it lists
`otherMatches`, render one only if the person asked about it.
**If it carries a `variantChoice` whose `message` says to ask** (several
previews matched and the host showed no chooser), the person picks, not
you: reply with the rendered match and every entry in `choices` as a
numbered list, ask which one they meant, and stop. Don't pick one or
shorten the list to "other variants are available". A grid result or a
declined choice needs no question.
2. **Look only when you need to.** Read `pngPath` with your file reader
before you describe or judge the UI; that is what the person sees. Skip the
read when `changed` or `sha256` already answers the question, such as
"did my edit land?". Describe only what you saw. If you can't view images
here, say so plainly.
**Never claim a visual check you didn't make.** `changed` only means the
pixels differ from an earlier render; it can be `true` on the first render
of a session and it says nothing about *how* they changed. To say an edit
looks right ("the title is bigger", "verified", "fixed"), read `pngPath`
first. If you didn't, or a render failed, say the result is unverified.
3. **Reply** briefly, with `pngPath` so the person can open the same image.
Don't write "the image above": in a terminal or print-mode harness the
person doesn't see images your tools return. Point at `pngPath` instead.
**Library components come from the catalog.** When the person names a
library component (Material 3, Wear M3 `EdgeButton`, …) rather than one of
their own previews, follow the compose-catalog skill: the hosted catalog's
published snapshot, not a new preview file in their project
([catalog-mcp.md](../compose-catalog/references/catalog-mcp.md#resourcesread-before-catalog_render_preview)).
**Sweeps use hashes.** For more than one render (variants, devices, font
scales, locales, a before/after check), pass `observe=hash` or use
`render_matrix` with `contactSheet: false`, which returns per-cell hashes
only. Fetch pixels only for the final screen or the cells whose hash moved,
or that you must judge by eye: one `render_preview` per such cell (its
`overrides` or `uri`, `inline=false`) and one read of its `pngPath`.
**Design guidelines and accessibility reviews** follow the compose-design-review
skill ([design-guidelines.md](../compose-design-review/references/design-guidelines.md),
[a11y.md](../compose-design-review/references/a11y.md)), which also covers
handing multi-render reviews to a `design-reviewer` subagent. For a routine hash
sweep here, keep `contactSheet: false`, and never claim visual coverage from
hashes alone.
**After a source edit**, call `render_preview` again. `notify_file_changed` is
optional. **If the result says it is stale**, make exactly one more call with
`force: {"reason": "<why>"}`. **Never** run `./gradlew`, `clean`, or delete
`build/` dirs to chase a render; if a forced render is still wrong, read
[mcp.md § Troubleshooting](./references/mcp.md#troubleshooting-first--when-not-to-act)
(start with `compose-render mcp doctor`).
**Details on request.** Add `details: ["a11y", "layout"]` only when the
person asks about accessibility or layout. `observe=png` returns inline pixels
for clients that can't read files.
**No MCP tool?** Use the CLI: `compose-render render --json --filter <Name>`
(`show` instead of `render` before 2.106.0), then read the entry's `pngPath`. Stale: `--force=<reason>`, once. See
[cli.md](./references/cli.md). On either path, only output from the render
tools is a render: never a hand-built HTML, CSS or SVG mock. Report a failed
render with its error.
**Running the whole app, not one composable?** Navigation, deep links, runtime
permissions, folds, networks, Wear tiles and phone sync, live reload or the
app's androidTest suite belong to the android-simulator skill
([simulator.md](../android-simulator/references/simulator.md)): Robolectric's
simulator, no emulator or device. A `@Preview` render stays the cheaper check
for a single screen.
**Not previewable** (takes a ViewModel or injected service)? Propose extracting
a stateless inner composable and preview that
([state-hoisting.md](./references/state-hoisting.md)).
## Install / update (only if missing)
The CLI is `compose-render` from release 2.105.0; `compose-preview` is the same CLI under its
old name, still installed beside it, and the one to use on an older release. Check with
`compose-render --version`. If it's missing, run this skill's stub,
`bash <this skill's dir>/scripts/compose-preview --version`: its first run
installs the CLI and puts it on `PATH`. Every other route, updating, and the
Gradle plugin are in [setup.md](./references/setup.md); MCP wiring (the local
server and the one hosted URL) is in [mcp.md](./references/mcp.md).
## Working with platform skills
An official platform skill, such as Android's
[Wear Compose Material 3 skill](https://developer.android.com/agents/skills/wear/wear-compose-m3/skill),
owns API, dependency and migration choices. This skill only renders and
verifies:
- **Defer.** Follow the platform skill for which component, API or version to
use. Don't treat this skill's references as a second API guide.
- **Changes are expected.** During a migration a changed hash or image is
information, not a regression. Only a render failure or a new accessibility
error blocks. Don't restore old screenshots or tune the UI to match them.
- **Mind the catalog version.** A hosted catalog renders one fixed library
version, which may differ from the project's `libs.versions.toml`. See
[catalog-mcp.md § Choosing a component](../compose-catalog/references/catalog-mcp.md#choosing-a-component-with-a-platform-skill).
**Migration workflow.** Before editing, `find_previews_for_file` for each file
and record a baseline with `render_preview observe=hash`. Make the platform
skill's edits, re-render, and report failures and new accessibility errors
(`get_preview_data kind=a11y/atf`) as blockers. Show a before/after for one to
three key screens, and check a small round device and the largest font scale
on Wear. Details:
[wear-ui.md § Verification workflow](./references/wear-ui.md#verification-workflow).
## Reference index
Read only what the task needs.
| Topic | Read |
|---|---|
| Install, update, which skills, apply the Gradle plugin, zero-code init script | [setup.md](./references/setup.md) |
| CLI commands, `--filter`/`--id`/`--force`, `counts` buckets, render filenames, SVG output, Gradle tasks, `build-brief` for non-preview builds | [cli.md](./references/cli.md) |
| **Which MCP server** (local vs hosted `https://preview.coo.ee/mcp`); local server setup, tools, history, multi-workspace, **troubleshooting** | [mcp.md](./references/mcp.md) |
| Interaction loop: semantic refs, `observe` modes, `diff_semantics`, crop, `render_matrix` (variants/matrix), record → test, failure `kind`s | [agent-loop.md](./references/agent-loop.md) |
| Per-render data (a11y, layout, recomposition, SVG) | [data-products.md](./references/data-products.md) |
| Multi-preview, GIFs, `@SettledPreview`, scrolling captures | [capture-modes.md](./references/capture-modes.md) |
| Wear Compose UI / Wear Tiles | [wear-ui.md](./references/wear-ui.md), [wear-tiles.md](./references/wear-tiles.md) |
| CMP `:shared` modules | [cmp-shared.md](./references/cmp-shared.md) |
| Android XML drawables / icons | [resource-previews.md](./references/resource-previews.md) |
| Runtime permissions per render | [runtime-permissions.md](./references/runtime-permissions.md) |
| Editable override knobs | [override-knobs.md](./references/override-knobs.md) |
| Display filters | [display-filters.md](./references/display-filters.md) |
| Remote Compose, `compose-render rc` | [remote-compose.md](./references/remote-compose.md) |
| Agent allowlists, staging PNGs | [permissions.md](./references/permissions.md) |
| Cloud sandboxes | [agent-cloud.md](./references/agent-cloud.md) |
| VS Code extension (humans) | [vscode.md](./references/vscode.md) |
Moved to their own skills: the simulator references to
[android-simulator](../android-simulator/SKILL.md), design guidelines and
accessibility to [compose-design-review](../compose-design-review/SKILL.md),
and the hosted catalog and server access to
[compose-catalog](../compose-catalog/SKILL.md).
CI and PR review are the opt-in [compose-preview-ci](../compose-preview-ci/SKILL.md)
and [compose-preview-review](../compose-preview-review/SKILL.md) skills;
[setup.md § Which skills](./references/setup.md#which-skills) adds them.
## Offer the next step
When one of these signals is visible, you may end a reply with its one-sentence
offer. At most one offer per reply, and never repeat an offer the person
ignored.
| Signal | Offer |
|---|---|
| A PR that changes UI, and the repo has no preview CI | "I can set up CI that posts before/after renders on PRs." Needs the review skills: `scripts/install.sh --skills compose-preview-review,compose-preview-ci`, or `/plugin install compose-review@compose-agent-plugins`. |
| Reviewing a UI PR | "I can render base and head and diff them for this review." Same review skills as above. |
| They want to browse every preview themselves | "`compose-render browse` or the [VS Code extension](./references/vscode.md) shows them all." |
| They need navigation or a running app | "I can run the whole app without an emulator." The android-simulator skill ([simulator.md](../android-simulator/references/simulator.md)). |
| They want to design a new screen rather than edit code | "The UI Builder can design it with you first: <https://ui.coo.ee/start>." |