本文へ移動
cccskills
無料GitHub で公開

android

Provides expert knowledge for building modern native Android apps using Kotlin, Jetpack Compose, Material Design 3, MVI architecture, Hilt dependency injection, and Media3/ExoPlayer.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Android + Kotlin (Jetpack Compose & Media3)

This playbook defines the architecture, UI design system, performance guidelines, and testing strategy for native Android applications.

android-ui-design owns specialized Jetpack Compose phone UI/UX design, implementation, review, and audit guidance. This skill remains the general guide for architecture, Hilt dependency injection, Media3, performance, and testing.


1. Lead Architect & Modularization

Architecture (MVI / MVVM with Clean Architecture)

  • Prefer MVI (Model-View-Intent) for state management. Ensure a strict unidirectional data flow:
    • UiState: Single source of truth for the UI state.
    • UiIntent: Actions initiated by the user or system.
    • UiEffect: One-time events (navigation, toasts, snackbars).
  • Separate the project into clean logical modules:
    • app: Application entry point, launcher activity, global dependency injection configuration.
    • core: Shared resources, network layer, media playback logic (ExoPlayer/Media3), storage.
    • feature: Individual business features (isolated and independent of other features).

Dependency Injection (Hilt)

  • Annotate the Application class with @HiltAndroidApp.
  • Annotate Activities and Fragments with @AndroidEntryPoint.
  • Use constructor injection for ViewModels with @HiltViewModel.

2. Jetpack Compose UI/UX

Recomposition & State Management

  • Consume StateFlow from ViewModels safely using collectAsStateWithLifecycle() to respect the activity lifecycle.
  • Keep data models immutable. Mark configuration classes with @Immutable or @Stable to prevent redundant recompositions.
  • Use contentType and key in LazyColumn and LazyRow to optimize item recycling and rendering performance.
  • Avoid fixed hardcoded margins. Apply WindowInsets to support modern edge-to-edge screens.

3. Performance & Multimedia (Media3 / ExoPlayer)

Playback & Services

  • Run ExoPlayer / Media3 inside a robust Foreground Service (using MediaSessionService) to ensure playback continues when the app is in the background.
  • Clean up resources: release player instances in onDestroy or when the service is stopped.
  • Control wake locks strictly to avoid draining the user's battery when playback is paused.

Kotlin Coroutines & Threading

  • Always inject CoroutineDispatcher instances instead of hardcoding them:
    • Dispatchers.IO: Database access, network operations, file reading.
    • Dispatchers.Default: CPU-intensive operations (parsing JSON, filtering large lists).
    • Dispatchers.Main: UI modifications and light interactions.

R8 & Resource Optimization

  • Enable shrinking and obfuscation in production builds:
    • isMinifyEnabled = true
    • isShrinkResources = true
  • Convert all static images to the modern WebP format to minimize the application binary size.

4. Quality Assurance & Automated Testing

Unit Testing

  • Use JUnit 5 and MockK for mocking dependencies.
  • Test ViewModels and Reducers by asserting StateFlow updates. Use Turbine to easily test Kotlin Flows.
  • Mock all multimedia/ExoPlayer components to avoid loading actual audio/video resources in unit tests.

UI Testing

  • Create UI tests using Compose test rules: createComposeRule() or createAndroidComposeRule<MainActivity>().
  • Assert correct rendering, visibility states, and user interactions without executing real network calls.

5. Key Gradle & ADB Commands

Use these commands for building, checking code style, running tests, and profiling performance:

CommandAction
./gradlew initInitialize a new Gradle project structure.
./gradlew app:dependenciesList all dependencies of the application module.
./gradlew assembleDebugValidate compilation and generate debug APK.
./gradlew ktlintCheckRun KtLint check to enforce Kotlin style guidelines.
./gradlew lintDebugRun Android Lint tool to inspect code quality and UI issues.
./gradlew testDebugUnitTestRun unit tests for debug build variant.
./gradlew connectedAndroidTestRun instrumented UI tests on connected emulator or device.
./gradlew assembleReleaseGenerate release build variant with R8 optimizations.
adb shell dumpsys batterystatsProfile system battery consumption metrics.
adb shell am dumpheap <package> heap.hprofDump application heap memory file for profiling.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when adding monitoring, metrics, logging, or tracing to Spring AI or LLM integration code. Covers token tracking, latency measurement, cost estimation, and prompt/response logging. Use when user mentions AI monitoring, token costs, or LLM observability.

日本語の概要は準備中です。原文の説明を表示しています。

lgzarturo/springboot-course32026年10月12日 更新

Design, implement, review, and audit Android Jetpack Compose UI/UX for phone interfaces. Use when a request concerns concrete Compose layout, components, interaction, accessibility, or visual behavior. Do not activate for framework or dependency presence alone; non-UI Android work is excluded.

日本語の概要は準備中です。原文の説明を表示しています。

lgzarturo/springboot-course32026年10月12日 更新

Provides expert knowledge for designing, implementing, and managing REST API versioning strategies with deprecation workflows.

日本語の概要は準備中です。原文の説明を表示しています。

lgzarturo/springboot-course32026年10月12日 更新

astro

無料

Provides expert knowledge for building Astro 5+ sites with Islands Architecture, Content Collections, TypeScript, and performance-first rendering strategies.

日本語の概要は準備中です。原文の説明を表示しています。

lgzarturo/springboot-course32026年10月12日 更新

Audits token storage mechanisms to prevent XSS-based JWT theft.

日本語の概要は準備中です。原文の説明を表示しています。

lgzarturo/springboot-course32026年10月12日 更新

Provides patterns to configure AWS RDS (Aurora, MySQL, PostgreSQL) with Spring Boot applications. Configures HikariCP connection pools, implements read/write splitting, sets up IAM database authentication, enables SSL connections, and integrates with AWS Secrets Manager. Use when setting up RDS connections in Spring Boot, configuring connection pooling, or managing database credentials securely.

日本語の概要は準備中です。原文の説明を表示しています。

lgzarturo/springboot-course32026年10月12日 更新

lgzarturo のスキルをすべて見る

このスキルの問題を報告する