antigravity-viewer-card
Show a render of the person's own Compose previews in Antigravity — one render_preview call with preview=<FunctionName> on the local compose-preview-mcp server, a look at the PNG, then the card and a few bullets.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- antigravity-viewer-card
- description
- Show a render of the person's own Compose previews in Antigravity — one render_preview call with preview=<FunctionName> on the local compose-preview-mcp server, a look at the PNG, then the card and a few bullets.
03 SKILL.md 正文
Rendering previews in Antigravity
Render first, explore later. Your first tool call is render_preview.
Only if it fails do you look anything up.
-
Call
render_previewon the localcompose-preview-mcpserver withpreviewset to the preview function name andprojectset to the absolute path of the open workspace, for examplepreview: "ListScreenPreview", project: "/Users/me/workspace/MyApp". Always passproject: Antigravity starts the server in the plugin folder, so it can't find the workspace on its own. If the person names a screen rather than a preview (ListScreen), useListScreenPreview. Nothing else is needed first: the server finds the preview and writes the card. Never use thecompose-preview-catalogserver for project previews: it only holds library catalogs.- If the result is
pending, callrender_previewagain with the same arguments; the first render of a session waits for a Gradle build. - If the error names a
Closestmatch that is clearly the preview the person meant, call once more with that name.
- If the result is
-
Look at the PNG at
pngPathwith the file viewer, so you see what the person sees (R1). -
Reply with the
embedline from the result, 2–4 bullets describing what you saw, and this summary, filled only from the result. Write "unavailable" for anything missing; don't look it up.Render: <uri> Image: <widthPx> × <heightPx>; hash <sha256>Under it, add
[Open full size](file://<pngPath>)so the person can see the PNG at its real size; the card fits it into a small frame.If the result lists
otherMatches, name them in one line.
After editing a preview's source, call render_preview with the same
preview again; the server recompiles. Never run ./gradlew, clean, or delete
build folders. If the image still shows the old code, call render_preview
once more with force: {"reason": "<what you edited>"}; if it is still stale,
say so and stop.
Token-frugal iteration. For intermediate checks before the final visual
sign-off, pass observe: "semantics" (default) or observe: "hash" to avoid
repeated full-screen PNG payloads, or pass crop: {"ref": "n3"} (or testTag /
role + text) with observe: "png" to inspect a single node's pixels. Always
inspect the rendered PNG (observe: "png" or pngPath) before calling a visual
change done (R1).
Compose Preview Sidecar & App Simulator
The compose-preview plugin ships an Antigravity Auxiliary Pane sidecar with
three interactive modes (browse, ui-builder, and simulator via
compose-preview launch --adb). Surface a one-click pill in chat when the
person wants an interactive gallery, the local UI Builder, or a live
interactive app simulator:
- Open [Compose Preview](sidecar://compose-preview/compose-preview/) in the side
pane to browse all
@Previews live, switch to the local UI Builder, or runcompose-preview launch --adbin the browser simulator. - When
Simulator (launch --adb)is active in the sidecar (or started from the CLI withcompose-preview launch --project <dir> --live --adb), it registersemulator-5554+ gRPC8554withadb, so the person can also mirror and control the running app in [Android Device Hub](sidecar://android-cli-plugin/device-hub/) ifandroid-cli-pluginis installed.
Never fake a render. Don't hand-build HTML, CSS, SVG or any other mock
of the preview, and don't draw it from the source. Only the PNG and card
from render_preview count as a preview. If rendering fails, say so, include
the error, and stop.
That's the whole task. Don't read other skill, asset or source files, search
the session or brain/ folders, call status, register_project or
list_previews first, or print base64.
Older servers (the result has pngPath but no embed): run
python3 ~/.gemini/config/plugins/compose-preview/assets/compose-preview-card.py '<result JSON text>'
and use the line it prints. If preview is rejected, call list_previews
once, then render_preview with the uri and inline=false.
Without the MCP server (compose-preview-mcp is not enabled, not listed,
or not allowed in this context), run the same flow through the CLI from the
workspace folder; never switch to the compose-preview-catalog server:
compose-preview show --preview <FunctionName> --json, or, when the person asks about accessibility,compose-preview a11y --preview <FunctionName> --json(it renders too). Narrow to one preview; a miss lists the closest names.- Look at the PNG at the preview's
pngPath(R1). - Run
python3 ~/.gemini/config/plugins/compose-preview/assets/compose-preview-card.py '<that JSON>'and reply with the line it prints, the bullets and the summary as above (Render: <id>). Ana11yrun gives the card the same findings, overlay and Audit view; layout bounds need the MCP server, so say they are unavailable rather than describing them.
When the person asks about accessibility or layout, add
details: ["a11y"], ["layout"] or both to that same render_preview call:
the card gains the overlay toggles and the result one summary line each. Don't
call separate a11y or layout tools for it.
Do more (variants, source locations) only when the person asks.
04 同仓库更多 Skills
harness-notes
Use whenever you change Compose UI code (composables, @Preview functions, themes) or render or review Compose previews, catalog components or UI Builder designs. Carries the mandatory cross-harness agent rules (R1–R4) and per-host notes for these tools.
compose-preview-setup
Run right after the compose-preview plugin is installed, or when a render fails because the CLI is missing or the project is "not prepared". Checks the compose-preview CLI, prepares the current Gradle project once, and renders one preview so the person sees it working.
compose-catalogs-setup
Run right after the compose-catalogs plugin is installed, or when the hosted catalog server cannot be reached or asks for access. Checks the hosted preview.coo.ee catalog server, completes the access grant, and shows one catalog so the person sees it working.
spike-p2
Use when the user says 'spike check'.
spike-p1
Use when the user says 'spike check'.
compose-preview-review
Review Compose UI previews and pull requests by rendering base and head, diffing them, and checking catalog design guidelines. Use for a UI design review, a UI PR locally or from a CI agent session (@claude mention), authoring an agent-opened PR that touches UI, or triaging flaky or unstable previews (time/random/animation). Pairs with the compose-preview skill; for wiring the CI that posts those diffs, see the compose-preview-ci skill.