Skip to content

aldefy/compose-skill / skills/compose-expert

compose-expert

Unverified

Compose and Compose Multiplatform expert for UI development across Android, Desktop, iOS, and Web. Use whenever the user mentions Compose APIs (@Composable, remember, LaunchedEffect, NavHost, MaterialTheme, LazyColumn, Modifier, recomposition), Compose Multiplatform (commonMain, expect/actual, Res.*, ComposeUIViewController, UIKitView, ComposeViewport), Android TV (tv-material, D-pad, focus, Carousel), Material 3 motion, atomic design systems, design-to-code workflows, Paging 3, or navigation. Activates Review Mode on GitHub PR URLs and review phrases ("review this PR", "what's wrong with this"). Auto-detects Compose projects on session_start. Backed by actual androidx/androidx and JetBrains/compose-multiplatform-core source receipts. See "## When this skill applies" in SKILL.md for the full trigger surface.

FileKindSize
SKILL.mdskill md24.8 KB
agents/openai.yamlconfig278 B
references/accessibility.mdmarkdown11.2 KB
references/adaptive-layout-input.mdmarkdown5.2 KB
references/agentic-ui-a2ui.mdmarkdown4.7 KB
references/agsl-shaders.mdmarkdown11.5 KB
references/animation.mdmarkdown41.7 KB
references/appfunctions.mdmarkdown5.8 KB
references/appstate.mdmarkdown3.9 KB
references/atomic-design.mdmarkdown10.7 KB
references/auto-init.mdmarkdown1.6 KB
references/car-compose.mdmarkdown6.7 KB
references/composition-locals.mdmarkdown6.9 KB
references/deprecated-patterns.mdmarkdown8.3 KB
references/design-to-compose.mdmarkdown23.5 KB
references/graphics-modern.mdmarkdown2.6 KB
references/ink.mdmarkdown5.1 KB
references/lists-scrolling.mdmarkdown14.5 KB
references/material3-motion.mdmarkdown14.9 KB
references/media3-compose.mdmarkdown1.7 KB
references/ml-kit-agentic.mdmarkdown5.5 KB
references/modifiers.mdmarkdown13.6 KB
references/multiplatform.mdmarkdown21.1 KB
references/navigation-migration.mdmarkdown14.6 KB
references/navigation.mdmarkdown11.0 KB
references/official-android-skills.mdmarkdown2.7 KB
references/paging-mvi-testing.mdmarkdown6.4 KB
references/paging-offline.mdmarkdown6.4 KB
references/paging.mdmarkdown11.1 KB
references/performance.mdmarkdown22.7 KB
references/platform-specifics.mdmarkdown20.2 KB
references/pr-review.mdmarkdown14.1 KB
references/production-crash-playbook.mdmarkdown25.3 KB
references/remote-compose.mdmarkdown3.7 KB
references/side-effects.mdmarkdown13.0 KB
references/source-code/cmp-source.mdmarkdown17.8 KB
references/source-code/foundation-source.mdmarkdown560.9 KB
references/source-code/material3-source.mdmarkdown836.1 KB
references/source-code/navigation-source.mdmarkdown118.8 KB
references/source-code/runtime-source.mdmarkdown449.0 KB
references/source-code/ui-source.mdmarkdown313.1 KB
references/state-management.mdmarkdown17.6 KB
references/styles-experimental.mdmarkdown14.5 KB
references/text-editing.mdmarkdown3.8 KB
references/theming-material3.mdmarkdown13.0 KB
references/tv-compose.mdmarkdown30.2 KB
references/view-composition.mdmarkdown20.0 KB
references/wear-compose.mdmarkdown2.0 KB
references/xr-compose.mdmarkdown5.1 KB

references/car-compose.md

View on GitHub
# In-Car Apps (Android Auto and Android Automotive OS)

> Two different car surfaces. **While driving**, UI is template-based: apps built
> with the Android for Cars App Library (`androidx.car.app`) describe screens with
> library templates and the host renders them — do not plan on arbitrary Compose
> screens. **While parked**, video, game, and browser apps can run as ordinary
> adaptive Compose apps (see "Parked apps" below).

Google treats driver distraction as a hard constraint. An app must belong to a
supported category and meet car design and quality requirements before it can be
listed on Google Play for Android Auto and Android Automotive OS.

## What Compose is (and is not) for here

| Surface | UI technology |
|---|---|
| Car display while driving (navigation, POI, IoT, weather, media, messaging, calling) | Car App Library templates (`Screen`, `Template`) — not Compose |
| Your phone app, tablet app, settings and onboarding screens | Compose, as usual |
| Shared business logic, repositories, state | Plain Kotlin / KMP, reusable by the car `Screen` and Compose screens |

Design the car experience as a small, glanceable, templated surface backed by
the same domain layer as the phone UI. Do not try to reuse composables on the
car screen.

## Categories

Declare one or more categories in the `CarAppService` intent filter:

- `androidx.car.app.category.NAVIGATION`
- `androidx.car.app.category.POI` (parking, charging, fuel)
- `androidx.car.app.category.IOT`
- `androidx.car.app.category.WEATHER`
- `androidx.car.app.category.MEDIA` (templated media apps)
- `androidx.car.app.category.MESSAGING`
- `androidx.car.app.category.CALLING`

Qualifying criteria per category are defined in Android app quality for cars.

## Project structure

- Implement a `CarAppService` and declare it in the manifest with its category.
- Android Auto apps declare template capability in
  `res/xml/automotive_app_desc.xml`:

  ```xml
  <automotiveApp>
      <uses name="template" />
  </automotiveApp>
  ```

- For Android Automotive OS, add an automotive module that depends on
  `androidx.car.app:app-automotive`, which provides the `CarAppActivity`
  required to run on AAOS.
- When supporting both, keep `CarAppService` and screens in a shared module and
  depend on it from the mobile and automotive modules.

## State and Compose interop

- Own state outside the UI layer (ViewModel/state holder/repository) and expose
  `StateFlow`. Phone Compose screens collect it; car `Screen`s observe it and
  call `invalidate()` when content changes.
- Car screens are bound to the car host lifecycle, not an `Activity`. Do not
  capture phone `Context`, `Activity`, or composition-scoped objects in a car
  `Screen`.
- Keep template content small and rate-limited; the library enforces limits on
  items and navigation depth.

## Parked apps (video, games, browsers)

Parked apps run on Android Auto and Android Automotive OS only while the vehicle
is parked, so a regular adaptive Compose app can be the UI. Only three categories
qualify; other categories cannot be published as parked apps. Availability
varies: video is generally available on Android Automotive OS and unsupported on
Android Auto; games are generally available on both; browsers are beta on
Android Automotive OS only. Audio while driving is a separate beta feature.

Compose-relevant requirements (from the official `android-for-cars-parked-apps`
skill):

- **Manifest:** video sets `android:appCategory="video"`; games set `"game"`;
  browsers add `android.intent.category.APP_BROWSER` to an exported `MAIN`
  activity. Android Auto needs `CAR_LAUNCHER` on the `MAIN` intent filter;
  Android Automotive OS needs `android.hardware.type.automotive` declared. Never
  add `distractionOptimized` to a parked app activity.
- **Display continuity:** handle `screenSize`, `smallestScreenSize`,
  `orientation`, `screenLayout`, and `density` in `android:configChanges` so
  moving to a distant display does not recreate the activity or stutter playback.
  Do not request an orientation the display lacks: check
  `FEATURE_SCREEN_LANDSCAPE` / `FEATURE_SCREEN_PORTRAIT` first.
- **Back navigation:** Android Automotive OS vehicles are not required to have a
  back button or gesture. Provide explicit in-app back and close controls on
  non-root screens, unless compatibility mode
  (`android.software.car.display_compatibility`) is declared and active — then
  hide the duplicate affordance.
- **Insets:** OEMs may lock system bars visible. Track controllable bars with
  `OnControllableInsetsChangedListener`, and protect UI with
  `WindowInsets.safeDrawing`. For irregular display cutouts set
  `windowLayoutInDisplayCutoutMode` to `3` (always) or `2` (never) in
  `res/values-car-v30/integers.xml`; do not use the default or short-edges modes.
- **Driver distraction lifecycle:** when the vehicle moves, the OS covers the
  activity and calls `onPause` (and `onStop` on compatibility-mode vehicles).
  Pause playback on `ON_PAUSE`/`ON_STOP` with `LifecycleEventEffect`, expose a
  Media3 `MediaSession`, and stop external controls from resuming playback while
  `CarUxRestrictionsManager` reports distraction optimization is required.
- **Browsers:** block saved passwords and payment methods unless protected by a
  profile lock, and prompt before syncing sensitive data to the car.

Test against the car app quality tiers (Car ready, Car optimized, Car
differentiated), and cover both Android Auto and Android Automotive OS — they are
separate platforms.

## Driving rules to design for

- Minimize required attention: short text, large targets, few steps.
- Follow the Design for Driving guidelines: avoid video, long-form reading, and
  free-form text entry while driving; prefer voice and short choices.
- Make failures actionable and brief; do not strand the driver on an error.
- Test with the Desktop Head Unit (Android Auto) and the Android Automotive OS
  emulator, then on real hardware when possible.

## Testing

- Verify each template path against the category's quality checklist.
- Test process death and reconnect while connected to a head unit.
- Test with and without network, location, and notification permissions.
- Verify the phone app still works when the car screen is disconnected.

## Sources

- Official parked-apps agent skill: https://github.com/android/skills/tree/main/cars/android-for-cars-parked-apps
- Android for Cars App Library overview: https://developer.android.com/training/cars/apps
- Set up your project (categories): https://developer.android.com/training/cars/apps/library/set-up-project
- Android Automotive OS apps: https://developer.android.com/training/cars/apps/automotive-os
- App quality for cars: https://developer.android.com/docs/quality-guidelines/car-app-quality
- Car App Library release notes: https://developer.android.com/jetpack/androidx/releases/car-app
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall