wear-compose-m3
できること
このスキルは、Wear Compose Material 3ライブラリを使ったWear OSアプリの作成、更新、移行を導きます。スキャフォールド、遅延リスト、アンビエントモード、Material 2.5やHorologistからの移行を扱います。スマートウォッチのアプリを作る開発者向けです。
使う場面
- ✓Material 3のコンポーネントを使って、新しいWear OSアプリを始めるとき。
- ✓Material 2.5またはHorologistから、腕時計アプリをWear Compose Material 3に移行したいとき。
- ✓腕時計アプリに、スクロールするリストやアンビエントモードの画面が必要なとき。
スキルのリンク
https://github.com/android/skills/blob/main/wear/wear-compose-m3/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Wear Compose Material 3を使って、スクロールするリストとアンビエントモードを持つWear OSの画面を作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、現在のライブラリのバージョンと最新の安定版を確認し、KotlinとSDKの要件を設定します。そのうえで、Material 3のスキャフォールドとリストを使って、画面を作るか移行します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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 & Compose compiler: Use Kotlin 2.0.0+ with the
org.jetbrains.kotlin.plugin.composeGradle plugin. - Min SDK: Ensure
minSdkis at least 25. - Compile SDK & AGP: Ensure
compileSdkand AGP meet the library's AAR metadata floors (compileSdk >= 35andAGP >= 8.6.0for1.6.x;compileSdk >= 37andAGP >= 9.1.0for1.7.x).
Gotchas
- Mandatory sync and validation: After updating versions in
libs.versions.tomlorbuild.gradle.kts, perform a Gradle sync (or./gradlew assembleDebug) before refactoring, and run./gradlew assembleDebugafter refactoring to verify the build. - 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, updates, and adding features
Use this guidance when migrating from an older version of Wear OS Compose or Horologist, updating an existing Wear Compose Material3 project, or adding features.
- Unless otherwise indicated by the developer, use the latest stable version of Wear Compose Material3 from
{VERSION}(superseding any literal version strings in the migration guide). - When migrating from Material 2.5 or Horologist, read the migration guide and use its official component mappings.
- 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; replace Horologist components with Wear Compose M3 equivalents (
AppScaffold-> M3AppScaffold,ScreenScaffold-> M3ScreenScaffold,ScalingLazyColumn->TransformingLazyColumn,ResponsiveListHeader->ListHeader,PagerScreen->HorizontalPagerScaffold,Chip->Button,Confirmation->ConfirmationDialog). - Always check against the component guidance in Capability 3.
- Expect screenshot tests to fail when migrating or updating components: expected defaults for padding and positioning will have changed. Do not seek to artificially match the previous screenshot, but give preference to the Material3 defaults.
Capability 2: Component samples
Use this table of reference to find canonical samples for Wear Compose components. When working with a Wear Compose component, you must use the samples linked from the table to ensure you know how to correctly use it.
Important: Symbols marked with [alpha], [beta], or [rc] are only
available in that pre-release track and are not in stable {VERSION}. Do
not use them unless the project explicitly targets that pre-release version.
Material 3 components in androidx.wear.compose.material3.*
| Component / Symbol | Reference Samples |
|---|---|
AlertDialog, AlertDialogDefaults |
AlertDialogSample |
AnimatedPage, HorizontalPagerScaffold, VerticalPagerScaffold |
OneHandedGestureSamples, PageIndicatorSample, PagerScaffoldSample |
AnimatedText, rememberAnimatedTextFontRegistry |
AnimatedTextSample |
AppCard |
CardSample |
AppScaffold |
[ListHeaderSample](re |
よくある質問
どのバージョンのライブラリを使いますか?
別のバージョンを使うよう指示しない限り、最新の安定版を使います。
最低のSDKの要件は何ですか?
minSdkは25以上、Kotlinは2.0.0以上が必要です。
バージョンを探すためにシェルコマンドを実行しますか?
いいえ。ビルドファイルを直接読み、必要な場合は公式のMavenのメタデータを確認します。
詳細
作者による元の説明
Guidance for Wear OS Compose Material3 (Wear Compose Material 3 / Wear Compose Material3) watch and wearable apps. Covers creating, updating, and migrating projects (Material 2.5 and Horologist migration) using androidx.wear.compose.material3, androidx.wear.compose.foundation, and androidx.wear.compose.navigation3, including AppScaffold, ScreenScaffold, TransformingLazyColumn, ambient mode, and previews.
repo: android/skills
人気
- GitHubのスター
- 10k
- ランキング
- #11939
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/29
コメント
- …
このリポジトリの他のスキル
agp-9-upgrade
10kエージェントが、AndroidアプリをAndroid Gradle Plugin 9にアップグレードし、その破壊的変更に対応できるよう支援します。マルチプラットフォームのプロジェクトは対象外です。
camerax
10kエージェントが、CameraXを使ってAndroidのカメラ機能を作れるよう支援します。動画の録画、ハードウェアの制御、ML Kit、Media3のエフェクトを含みます。
android-for-cars-parked-apps
10kエージェントが、Androidの動画、ゲーム、ブラウザのアプリを、Android AutoとAndroid Automotiveで駐車中のアプリとして動かせるように適合させるよう支援します。
appfunctions
10kエージェントが、Androidアプリの主要な作業の流れを見つけ、AIエージェントや音声コマンドが実行できるAppFunctionsとして公開できるよう支援します。
似ているスキル
android-clean-architecture
280kエージェントがAndroidプロジェクトを効率よく整理できるようにします。コードを構造化して、保守や新機能の開発をしやすくします。
compose-multiplatform-patterns
280kエージェントがKMPプロジェクトでCompose MultiplatformとJetpack Composeのパターンを使えるようにします。状態管理、ナビゲーション、テーマ設定、パフォーマンスを扱います。
dart-flutter-patterns
280kエージェントがDartとFlutterのアプリ向けのコードを書けるようにします。最新のパターンを使い、堅牢で管理しやすいアプリを作ります。