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.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- compose-preview-review
- description
- 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.
02 资源文件 8
- 参考文档references/agent-audits.md23.7 KB
- 参考文档references/agent-pr.md11.8 KB
- 参考文档references/ci-agent-sessions.md5.3 KB
- 参考文档references/design-parity-lifecycle.md8.4 KB
- 参考文档references/mcp-review.md6.6 KB
- 参考文档references/stability.md3.4 KB
- 脚本scripts/run-agent-audit-samples.py22.4 KB
- 脚本scripts/test_run_agent_audit_samples.py2.6 KB
03 SKILL.md 正文
Compose Preview — Review
Workflows for reviewing pull requests that touch Compose UI and authoring agent-opened PRs that include preview screenshots.
Setting the CI up is a separate job with a separate skill —
compose-preview-ci owns baselines
branches, the apply action, and the fork-safe two-stage split. This skill
is about reading what that CI produces (and rendering by hand when it isn't
there).
This skill assumes the compose-preview skill is installed — it owns
the renderer, CLI, and Gradle plugin. Hosted catalog and UI Builder guidelines
reviews use its checklist without requiring a local CLI or Gradle checkout.
For local rendering workflows, check first with
compose-preview --version; if it's missing,
follow its setup reference
(usually one command: bash ~/.agents/skills/compose-preview/scripts/compose-preview --version).
Source
This skill is maintained at
github.com/yschimke/skills under
skills/compose-preview-review/. To update, see
setup.md § Update. The CLI, renderer, and
GitHub Actions referenced below ship from
github.com/yschimke/compose-ai-tools.
When to use this skill
Pick the workflow that matches the task:
| Task | Read |
|---|---|
| Review previews or a catalog render against Android design guidelines | Catalog guidelines checklist from the required compose-preview skill (read its installed reference first) |
| Review a PR locally that touches UI | references/agent-pr.md § Reviewing a PR |
| Review or author from a CI agent session (a mention-triggered agent on an Actions runner) | references/ci-agent-sessions.md |
| Author an agent-opened PR that touches UI | references/agent-pr.md § Authoring an Agent PR |
| Triage a flaky or unstable preview (time, randomness, animation, network images) | references/stability.md |
| Report, accept, verify, and close a design-parity difference | references/design-parity-lifecycle.md |
Wire compose-preview/main baselines + PR-comment CI for a project (or migrate from the legacy four-action setup) |
compose-preview-ci skill |
| Render previews on base and head and diff them | references/agent-pr.md § Render base and head locally |
Quick reference: review a UI PR locally
-
Check what preview CI the project already has, first. Scan
.github/workflows/forcompose-preview.yml(theapplyaction), legacy preview actions, and design-parity/design-artifacts pipelines — see references/ci-agent-sessions.md § Discover the repo's preview CI. If a sticky<!-- preview-diff -->comment is already on the PR, read it and cite it instead of re-rendering. See references/agent-pr.md § Optional: integrate with apply CI in comment mode. -
Render base and head. Use a worktree so the working copy stays put:
BASE=$(gh pr view <N> --json baseRefName -q .baseRefName) git worktree add ../_pr_base "origin/$BASE" (cd ../_pr_base && compose-preview show --json) > base.json compose-preview show --json > head.jsonKeep
../_pr_baseuntil step 5 is done:base.json'spngPaths point into it, andgit worktree remove ../_pr_basedeletes them. -
Diff by
id+sha256. Bucket into changed / new / removed. -
Read the PNGs for changed and new entries — that's the visual context the human reviewer will lack.
For a design-guidelines review, also follow the catalog guidelines checklist. Reuse the PR's
<!-- guidelines-report -->when it matches the head and applicable rules. Report stale, pending or unchecked coverage rather than treating an empty findings list as passed. -
Post a text-only review comment summarising deltas. Image upload only with explicit consent — see references/agent-pr.md § Uploading images. Then
git worktree remove ../_pr_base.
Reference docs
| Path | When to read |
|---|---|
| Catalog guidelines checklist | Keyless MCP review, published guideline results and CLI fallback; surface selection, pictures, measured evidence and coverage. |
| references/agent-pr.md | Full PR review + agent PR authoring guidance: comment structure, image hosting choices, things to flag, integration with the unified apply CI action when present. |
| references/ci-agent-sessions.md | Running this skill inside a mention-triggered CI agent session: Gradle-only rendering, commit-SHA-pinned image embedding, discovering and reusing the repo's existing preview-diff CI. |
| references/stability.md | Flaky / unstable previews: detection (render twice, CI symptoms), common causes (clock, randomness, animations, network images, locale), fixes, and how to review a suspect diff. |
| references/agent-audits.md | Agent audit recipes and data-product documentation clusters: accessibility, localisation, Wear clipping, resources, theme, traces, and failure triage. |
| references/mcp-review.md | Driving a PR review through the MCP server (two-workspace base+head flow, push notifications, edit-on-top iteration). |
| references/design-parity-lifecycle.md | Catalog-owner workflow for reporting, triage, scoped acceptance, status review, verification, and safe atomic closure. |
Related
- compose-preview skill — running the
renderer itself: CLI, Gradle plugin,
@Previewdesign patterns, capture modes (animations, scrolling), accessibility checks.
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.
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.
spike-p2
Use when the user says 'spike check'.
spike-p1
Use when the user says 'spike check'.