Установка
SKILL.md
Prerequisites and compatibility
- Current Wear OS Compose version in-use: To find the installed library version, read
gradle/libs.versions.tomlorbuild.gradle.ktsdirectly. Don't run./gradlew dependenciesor other shell commands to resolve versions. - Wear OS Compose Material3 version: If an internal tool is available to establish the latest stable version
{VERSION}ofandroidx.wear.compose:compose-material3, use that tool.<!-- -->- Otherwise, fetch the official Maven metadata XML to identify
{VERSION}(highest number, ignoring-alpha,-beta, or-rc).
- Otherwise, fetch the official Maven metadata XML to identify
- Strict compliance: If a version is listed as stable, you MUST use it, unless overridden by the user. Do not downgrade based on initial "Unresolved reference" errors in the editor or outdated web search results.
- Kotlin version: For Wear Compose Material3, use Kotlin 2.0.0 or higher.
- Compose compiler:
- If Kotlin version is 2.0.0+ , the project must use the
org.jetbrains.kotlin.plugin.composeGradle plugin. - If Kotlin version is < 2.0.0 , the project must use
kotlinCompilerExtensionVersionincomposeOptions, matching the Compose to Kotlin Compatibility Map.
- If Kotlin version is 2.0.0+ , the project must use the
- Min SDK: Ensure
minSdkis at least 25. - Sample extraction mandate: Wear Compose libraries ship with an additional JAR file which contains individual samples for each and every component. You mustn't propose code changes, other than previews or basic changes such as color changes, until the samples in Capability 3 are extracted to the local cache. Library source files are incomplete and NOT a substitute for these samples; bypassing extraction is an environment setup failure.
Gotchas
- Mandatory sync and validation: After updating versions in
libs.versions.tomlorbuild.gradle.kts, you must perform a Gradle sync before refactoring any code. This ensures the environment has resolved the libraries correctly. - Prohibition of guessing (error protocol): If you encounter an 'Unresolved Reference' or API mismatch after a successful sync, do not attempt to 'fix' it by downgrading the library version.
Capabilities and tools
Capability 1: Migration
Use this guidance when migrating from an older version of Wear OS Compose or Horologist.
- Unless otherwise indicated by the developer, use the latest stable version of Wear Compose Material3 from
{VERSION}. - Read the migration guide.
- Use the official component mappings from the migration guide.
- Before refactoring any component (for example,
Chip->Button), check the parameter names, slot types, and "Expressive" design tokens. - Do not use the Horologist Composables, Compose Layout, or Compose Material libraries.
- Always check against the component guidance in Capability 4.
- Expect screenshot tests to fail when a migration has been performed: Even when migrating to very similar components, expected defaults for padding and positioning will have changed. Do not seek to artificially match the pre-migration screenshot, but give preference to the Material3 defaults.
Capability 2: Adding Wear OS Compose Material3 features or updating the app
Use this guidance when the developer asks to update a project which is using an earlier version of Wear OS Compose Material3, or when they ask to add further features.
- Unless otherwise indicated by the developer, use the latest stable version of Wear Compose Material3 from
{VERSION}. - Do not use the Horologist Composables, Compose Layout, or Compose Material libraries.
- Always check against the component guidance in Capability 4.
- Expect screenshot tests to fail when a migration has been performed: Even when migrating to very similar components, expected defaults for padding and positioning will have changed. Do not seek to artificially match the pre-migration screenshot, but give preference to the Material3 defaults.
Capability 3: Component samples
Wear Compose includes individual component samples for each and every component,
within the <artifact>-<version>-samples-sources.jar file. Gradle automatically
downloads these JAR files along with the main library JAR when using any of
compose-material3, compose-foundation or compose-navigation3.
Use the canonical component samples whenever adding or adjusting a Wear Compose Material3 component.
STRICT COMPLIANCE: Extraction is NOT optional. You are FORBIDDEN from implementing any code until samples are extracted and read. Bypassing this step with alternative search tools or by assuming library documentation is sufficient is a protocol breach. You MUST verify the local cache by reading a sample file before proceeding.
Exception: You don't need to extract samples if the request is strictly related to tooling (for example, adding @WearPreviewDevices), updating text/colors, or basic refactoring that doesn't involve adding new Wear Compose components.
Step 1: Prepare
- Check the
build.gradle.ktsorlibs.versions.tomlto ensure the Wear Compose version matches{VERSION}. - Ensure that the necessary dependencies are downloaded by doing a Gradle sync.
Step 2: Check the local cache
- Define the cache directory path:
/tmp/wear-compose-samples/{VERSION}/. Do NOT choose your own different location. - Check if this directory exists and contains subdirectories with
.ktfiles.<!-- -->- IF YES (cache hit): Proceed to Step 4.
- IF NO (cache miss): Proceed to Step 3.
Step 3: Network-based sample retrieval
Google Maven publishes a -samples-sources.jar alongside every library release.
Download and extract it directly without needing a local Gradle sync or cache
lookup.
-
Determine the
{VERSION}ofandroidx.wear.compose:compose-material3frombuild.gradle.ktsorlibs.versions.toml. -
Define
{ARTIFACT}as the items in the list["material3", "foundation"]. Also includenavigation3ifandroidx.wear.compose.navigation3is used. -
For each
{ARTIFACT}, run the following commands to download and extract the samples:# Download the samples-sources JAR curl -sSL "https://dl.google.com/dl/android/maven2/androidx/wear/compose/compose-{ARTIFACT}/{VERSION}/compose-{ARTIFACT}-{VERSION}-samples-sources.jar" -o {ARTIFACT}-{VERSION}-samples.jar # Extract and flatten into the cache directory unzip -q -o {ARTIFACT}-{VERSION}-samples.jar -d /tmp/wear-compose-samples/{VERSION}/{ARTIFACT}/ # Clean up rm {ARTIFACT}-{VERSION}-samples.jar -
If this works, proceed directly to step 4.
Step 4: Read samples and implement
- Read the relevant
.ktsample files. - Use these official, version-matched samples as the source of truth for:<!-- -->
- Required parameters and slot names.
- Default styling and typography tokens.
- Interactive behaviors (for example:
onClick,onLongClick). - Component nesting (for example:
AppScaffold->ScreenScaffold).
Capability 4: Component guidance
Mandatory: Use this capability as a checklist against any component use. It provides more holistic guidance on how to use each component in practice, beyond the component syntax.
-
AppScaffoldandScreenScaffold- [ ] Use
AppScaffoldas the outer container, withScreenScaffoldchildren. - [ ] Use only ONE
AppScaffoldand any number ofScreenScaffold.
- [ ] Use
-
ScalingLazyColumn- UseTransformingLazyColumninstead. -
TransformingLazyColumn- You will need the following imports:
<!-- --><br /><!-- -->import androidx.wear.compose.foundation.lazy.TransformingLazyColumn import androidx.wear.compose.foundation.lazy.TransformingLazyColumnDefaults import androidx.wear.compose.foundation.lazy.rememberTransformingLazyColumnState // ... import androidx.wear.compose.material3.lazy.rememberTransformationSpec import androidx.wear.compose.material3.lazy.transformedHeightCanonical example:
<!-- --><br /><!-- -->val columnState = rememberTransformingLazyColumnState() val transformationSpec = rememberTransformationSpec() ScreenScaffold( scrollState = columnState ) { contentPadding -> TransformingLazyColumn( state = columnState, contentPadding = contentPadding ) { item { ListHeader( modifier = Modifier .fillMaxWidth() .transformedHeight(this, transformationSpec) .minimumVerticalContentPadding(ListHeaderDefaults.minimumTopListContentPadding), transformation = SurfaceTransformation(transformationSpec) ) { Text(text = "Header") } } // ... other items item { Button( modifier = Modifier .fillMaxWidth() .transformedHeight(this, transformationSpec) .minimumVerticalContentPadding(ButtonDefaults.minimumVerticalListContentPadding), transformation = SurfaceTransformation(transformationSpec), onClick = { /* ... */ }, icon = { Icon( imageVector = Icons.Default.Build, contentDescription = "build", ) }, ) { Text( text = "Build", maxLines = 1, overflow = TextOverflow.Ellipsis, ) } } } }- [ ] Use
TransformingLazyColumninstead ofScalingLazyColumn. - [ ] You must pass the
contentPaddingparameter fromScreenScaffoldto theTransformingLazyColumn. - [ ] Use the
minimumVerticalContentPaddingmodifier to achieve required padding top and bottom.<!-- -->- This expects a value from defaults, such as
ButtonDefaults,CardDefaults, `ListHeaderDefaults. - Note: This is a scoped modifier available within
TransformingLazyColumnItemScope.
- This expects a value from defaults, such as
- [ ] Ensure the list morphs and scales.
- [ ] Use
transformedHeightmodifier. - [ ] Use
transform = SurfaceTransform(...). - [ ] If configuring a list for snapping, use
flingBehaviorandrotaryScrollableBehaviortogether:
<!-- --><br /><!-- -->val columnState = rememberTransformingLazyColumnState() ScreenScaffold(scrollState = columnState) { contentPadding -> TransformingLazyColumn( state = columnState, flingBehavior = TransformingLazyColumnDefaults.snapFlingBehavior(columnState), rotaryScrollableBehavior = RotaryScrollableDefaults.snapBehavior(columnState) ) { // ... // ... } } - [ ] Use
-
ScreenScaffold- [ ] Guard the
scrollIndicatorwith!LocalScrollCaptureInProgress.current.
- [ ] Guard the
-
EdgeButton- [ ] Do NOT use as the final item within a
TransformingLazyColumn. Instead, use the slot inScreenScaffold. - [ ] When used in a
TransformingLazyColumn, add the required overscroll behavior:
<!-- --><br /><!-- -->val columnState = rememberTransformingLazyColumnState() ScreenScaffold( scrollState = columnState, edgeButton = { EdgeButton( onClick = { /* TODO */ }, modifier = Modifier.scrollable( columnState, orientation = Orientation.Vertical, reverseDirection = true, // Apply overscroll to the EdgeButton for proper scrolling behavior. overscrollEffect = rememberOverscrollEffect(), ) ) { Text("More") } } ) { contentPadding -> TransformingLazyColumn( contentPadding = contentPadding, state = columnState, ) { // ... // ... } } - [ ] Do NOT use as the final item within a
-
Column- [ ] USE as a direct child of
ScreenScaffoldif the screen is will never scroll, even with the largest system font. - [ ] Use
TransformingLazyColumninstead for all other cases.
- [ ] USE as a direct child of
-
Styles
- [ ] Do NOT hard-code text sizes, use
typographyfromMaterialTheme. - [ ] Do NOT hard-code colors, use
colorSchemefromMaterialTheme.
- [ ] Do NOT hard-code text sizes, use
-
Use component defaults:
- [ ] Components such as
Buttonhave a correspondingButtonDefaultsobject. - [ ] Check for and use the
*Defaultsobject for any component when working with padding and styling values, in preference to hard-coded values.
- [ ] Components such as
-
Use Wear specific previews:
- [ ]
WearPreviewDevices - [ ]
WearPreviewFontScales
- [ ]
-
Ambient mode
- [ ] Use
LocalAmbientModeManagerinstead ofAmbientLifecycleObserver.
- [ ] Use
-
Navigation
- [ ] When adding navigation fresh, use Navigation3.
- [ ] For Navigation3 in Wear OS, use
SwipeDismissableSceneStrategy()from the Wear Composecompose-navigation3library.
-
Comments
- [ ] Where any Kotlin file has been modified, ensure that the existing comments are up to date and accurately reflect any changes to the implementation.
-
HorizontalPagerorVerticalPager- [ ] Use the Composable hierarchy in this order:
AppScaffold,HorizontalPagerScaffold,HorizontalPager,AnimatedPage,ScreenScaffold. Or similarly forVerticalPager.
- [ ] Use the Composable hierarchy in this order:
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: wear-compose-m3](https://darkplay.ru/ai/skills/android-skills-wear-compose-m3)
Из того же репозитория
Похожие скиллы и другие разделы каталога
Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
Kotlin Revieweraffaan-m · Ревьюер Kotlin и Android/KMP: корутины, Compose, архитектура и типичные ошибки.
ui-ux-pro-maxnextlevelbuilder · Профессиональные знания по UI/UX-дизайну для ИИ-ассистентов программирования. Включает…
expoanthropics · Официальные навыки Expo для создания, развёртывания, обновления и отладки приложений…
mcp-tunnelsanthropics · Подключение Claude к приватному MCP-серверу через туннель Anthropic MCP. Команда…
review-agent-governancewshobson · Требует сигнала одобрения человеком, прежде чем ИИ-агент сможет публиковать ревью PR…
RUGgithub · Чисто оркестрационный агент: разбивает запросы на части, передаёт всю работу субагентам…
chaos-engineeringalirezarezvani · Полный цикл chaos engineering: эксперименты с гипотезой, метрикой стабильного состояния…
docker-developmentalirezarezvani · Разработка в Docker и контейнерах: оптимизация Dockerfile, оркестрация docker-compose…
research-orchestratoralirezarezvani · Оркестратор исследований: маршрутизация к 6 специалистам или собственный 8-шаговый план.
zero-hallucination-coderalirezarezvani · Дисциплинированный конвейер кодинга: Discuss → Map → Decompose → Execute → Verify с…Лучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-makerЛучшие ИИ-инструменты для генерации текста и копирайтинга
Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра
NeuroscribeNeuroscribe
GoGPTGogpt
НейроТекстерNeuro-texter
ChatGPTOpenAI
Cosmo ScribeCosmoscribe
Memo HelperCopilot33
LibraChatLibrachatЛучшие ИИ-инструменты для генерации изображений
Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты
MagviMagvi
DALL-E 3OpenAI
SupaLabSupalab
Freestyling.aiFreestyling
ArtGeneration.meArtgeneration
BigjpgBigjpg
Художник от VKVK
Avato AI12ai
Virton AIVirton