Visual design exploration
Follow android-design for every design decision: design questions, emphasis budget, role pairs, reveal, not stretch, components, theming, layout, and visual criteria. This skill owns the exploration loop and chat workflow. Phone, foldable, tablet, desktop, and Wear OS app screens are in scope; Wear tiles, watch faces, and widgets are out of scope.
Tooling
Run android-design-preview from the shell (android-design-preview <command> --help documents flags, exit codes, and JSON output). When it is not on PATH, run sh <skill-dir>/scripts/android-design-preview, where <skill-dir> is the folder containing this SKILL.md.
- Default previews (
start,check,tree,render,open) run device-free in layoutlib without a device,adb, or emulator. Passopen --live [--serial <id>] [--avd <name>]only for opt-in live motion and touch on a visible device or emulator. - If the bundled script is missing or
android-design-previewexits3, stop, point the user to references/setup.md, and wait. Never edit user sandbox config unasked.
1. Brief
When an app exists, read its relevant screens, theme, assets, and any DESIGN.md and design/*.explore.kt first. Answer android-design's seven design questions in your reply before writing code:
- Pick one seed color from the brand or subject (a dish, an album, a trip), never the default
#6750A4. - Name the three or more layered tactics for any hero moment.
- Keep app code and dependencies unchanged.
- Use representative, non-sensitive data and assets. Use image generation only for files inside
design/assets/, never as a substitute for a Compose board. - For alternatives, place multiple
direction("...")blocks inside one.explore.ktfile so they compare side by side, each a distinct composition rather than a recoloring.
2. Write
Work in the app's repository root or the folder the user names; write outside this skill's own repository.
- Keep board tokens on
designBoard(seed = ..., variant = ..., brandFont = ...)(orwearBoard(seed = ...)). Read any existingDESIGN.mdas a constraint without editing it until the user approves a direction (step 6). - Author
design/<slug>.explore.kt(design/<slug>-wear.explore.ktfor Wear OS usingwearBoard(...)). - Read references/compose-signatures.md for pinned Material 3 Expressive, Wear M3, and Exploration Kit signatures.
- Follow the kit rules: tag the single primary CTA with
Modifier.testTag("ad:primary"); useMaterialTheme.colorScheme.*role pairs (no rawColor(...)hex literals or.copy(alpha = ...)in screen code); useSymbolIcon(...)anddesignPainter("assets/..."); author one adaptive screen (listDetail,supportingPane, orBoxWithConstraints) instead of duplicating per-breakpoint screens (aim for ~150 to 300 lines per direction).
Done when design/<slug>.explore.kt compiles cleanly with all requested direction(...) blocks and kit rules applied.
3. Iterate and check
Every check writes PNGs on disk and returns their paths in images, plus boardUrl, layout summaries, and findings (each with a fix hint and reference anchor in android-design/references/). Read a reference section when a finding points to it instead of pre-reading every reference file.
- First draft (full check): run
android-design-preview check <file>(unscoped) to check every direction, screen, overlay, and view (light,dark,foldable,tablet,desktop, orwatchandwatch-largeon Wear). - Targeted fixes (scoped loop): edit the file, then run one bare
android-design-preview check <file> --direction <d> --view <v>(add--screen <s>when a direction has multiple screens) for the single direction and view you changed. Keep each shell call to a single bare command (never pipe, chain, or loop across views during iteration). Scoped checks always return a 1x PNG path whether findings pass or fail. Callandroid-design-preview tree <file> --direction <d> --view <v>only when a finding needs exact bounds orfile:line. - Inspect the PNG before claiming a fix: after any visual change, open the returned 1x PNG path for the changed view with your file-reading tool to verify hierarchy, icon fit, asset legibility, and spacing balance.
- Final gate (full check): before showing the person, run unscoped
android-design-preview check <file>once more, verify adaptation inlayoutsummaries (tablet/desktopreveal what your adaptation answer promised), checkcolorsfor one strong fill, and open the returnedlightanddesktop(watchandwatch-largeon Wear) PNGs. - Fix cap: cap full checks at two fix rounds (scoped iterations between them are uncapped). Report any unresolved findings instead of looping.
4. Show
Run android-design-preview open <file> on interactive runs (or share boardUrl from check). In your reply:
- State in one line what the exploration covers and name the tactics layered for hero moments.
- Report any remaining unresolved findings.
- Share the absolute
.explore.ktpath and clickableboardUrl, and state"visual quality checked from layout metrics and native-resolution renders".
Stop here for this turn: wait for the user's reply before revising, writing DESIGN.md, or editing app code.
5. Revise
- Whenever the user refers to
"this","here", or a clicked element, checkselectionfirst (from the latestcheckresponse orandroid-design-preview selection <file>). If no selection exists, ask the person to click the part they mean on the browser board rather than guessing from source. Ifselection.staleis true, confirm the match usingcallNameandcallChain. - Edit the same
design/<slug>.explore.ktfile (the server watches saves and pushes focus-first SSE updates). Iterate with scopedcheck, open the returned PNG after visual changes, and run the final unscopedcheckgate before presenting.
6. Approve, port, or delete
- Record the approved direction: when the user approves a direction, write its seed, scheme variant, and brand font into
DESIGN.mdat the repo root (create it when missing; update only those shared defaults). - Explore-only: after recording
DESIGN.md, approval ends the task; leave app source code untouched. - Build / port: once the user approves a direction for implementation, read references/porting.md and follow the host project's planning, branch, verification, and review workflow.
- Delete: remove
design/<slug>.explore.kt(or-wear.explore.kt) when asked; keepDESIGN.mdunless asked to remove it too.
