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/agentic-ui-a2ui.md

View on GitHub
# Agentic UI with A2UI

> Status reviewed 2026-11-05. The AndroidX A2UI artifacts are alpha APIs. Pin an
> exact version, read its release notes, and expect source changes during upgrades.

## When to use A2UI

A2UI is an open, declarative JSON protocol for an agent to describe UI. The
AndroidX renderer maps that description to trusted native Compose components.
It does **not** download or execute generated Kotlin code.

Use it when an agent must return an interactive surface whose structure is not
known at build time. Do not use it for ordinary server-driven flags, fixed
forms, or screens that are simpler and safer to model as normal app state.

```kotlin
dependencies {
    implementation("androidx.compose.material3:material3-a2ui:1.0.0-alpha02")
}
```

Always confirm the latest alpha and migration notes before copying this version.

## Architecture

An integration has three main pieces:

1. **Catalog** — the only components and client functions the agent may use.
2. **Message processor** — parses streaming protocol messages, validates them
   against the catalog, and exposes active surface models.
3. **Surface** — a model rendered by `A2uiSurface` inside the app's Compose tree.

The provided Material 3 Basic Catalog covers common text, input, layout, card,
and list components. The app supplies its own image, video, and audio renderers
so the library does not impose Coil, Glide, or Media3.

```kotlin
@Composable
fun AgentSurface(surface: A2uiSurfaceModel) {
    A2uiSurface(surfaceModel = surface)
}
```

Treat this as an architectural sketch. Alpha releases may rename factories and
interfaces; use the current API reference for exact construction code.

## Catalog design

Prefer a narrow catalog of domain-level components over giving the agent a bag
of low-level primitives.

```text
Safer:  ProductCard, ShippingChoice, ConfirmOrder
Broader: Text, Row, Column, Button, arbitrary URL opener
```

- Keep privileged actions out of the catalog.
- Validate identifiers and URLs again in application code.
- Separate read-only functions from actions that mutate data.
- Require user confirmation for purchases, deletion, sharing, authentication,
  and other consequential operations.
- Use the app's own design tokens and accessibility defaults in custom catalog
  components.

The catalog is a capability boundary, not merely a component registry.

## State and events

A2UI supports streamed structural updates, fine-grained data binding, and
outbound user events. Local bound-data changes should update the surface without
an agent round trip. Actions that need agent reasoning flow outward as events.

Keep transport and rendering separate:

```text
agent stream -> JSON extraction -> parser/processor -> surface StateFlow
user action  <- outbound event collection          <- rendered surface
```

Run message collection in a lifecycle-owned coroutine. Clear surface state when
the containing conversation/session is cleared.

## Failure handling

- Reject messages that do not validate against the negotiated catalog.
- Render explicit loading and error states; streamed trees are temporarily
  incomplete by design.
- Bound surface size, nesting depth, list lengths, media size, and update rate.
- Log schema failures without recording prompts, personal data, or model output
  containing secrets.
- Never assume that protocol validation makes a destructive client function safe.

## Testing

Test at three levels:

1. Parser/processor tests for valid, partial, malformed, and out-of-order messages.
2. Catalog component tests using A2UI testing stubs and Compose semantics.
3. End-to-end tests that assert confirmation and authorization boundaries.

Include accessibility assertions for generated forms and test progressive
updates with repeated runs. Do not rely only on screenshot tests: event routing,
focus, labels, and error recovery are behavioral contracts.

## A2UI versus Remote Compose

| Concern | A2UI | Remote Compose |
|---|---|---|
| Producer | Agent/backend using an open JSON protocol | Trusted app/tooling producing a binary document |
| Primary use | Generative, agent-controlled surfaces | Cross-process/device remote surfaces and widgets |
| Components | Catalog constrained by the app | Remote Compose capability/profile constrained |
| Trust model | Treat input as untrusted | Treat producer as trusted, still validate document limits |

Do not describe the two systems as interchangeable.

## Sources

- Android A2UI overview: https://developer.android.com/develop/ui/compose/agentic
- Catalogs: https://developer.android.com/develop/ui/compose/agentic/manage-catalogs
- Rendering surfaces: https://developer.android.com/develop/ui/compose/agentic/render-surfaces
- A2UI specification: https://a2ui.org
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