/ Annuaire / Playground / jetpack-compose-skills
● Communauté anhvt52 ⚡ Instantané

jetpack-compose-skills

par anhvt52 · anhvt52/jetpack-compose-skills

Make Claude an Android Compose dev — idiomatic @Composable, state hoisting, Material 3, proper previews.

jetpack-compose-skills encodes modern Android development patterns for Jetpack Compose: state hoisting, @Composable scoping, Modifier order rules, Material 3 theming, ViewModel + StateFlow wiring, navigation-compose, and Compose-compliant testing. Good for both greenfield Compose projects and migrating Views-based screens.

Pourquoi l'utiliser

Fonctionnalités clés

Démo en direct

Aperçu en pratique

jetpack-compose-skill.replay ▶ prêt
0/0

Installation

Dépôt de l’auteur · Documentation officielle des Skills Claude

Cas d'usage

Usages concrets : jetpack-compose-skills

How to build a new Compose screen with state hoisting

👤 Android developers writing Compose UI ⏱ ~30 min intermediate

Quand l'utiliser : New screen in a Compose app — get it right the first time rather than refactoring later.

Déroulement
  1. Describe the screen
    Build a Profile screen: avatar, name, bio, follow button. State comes from a ProfileViewModel.✓ Copié
    → Stateless composable + stateful wrapper + preview
  2. Wire the ViewModel
    Hook up the ViewModel using collectAsStateWithLifecycle.✓ Copié
    → Lifecycle-aware state collection
  3. Add a preview
    Add @Preview variants for empty, loaded, and error states.✓ Copié
    → Three previews rendering without a live ViewModel

Résultat : A clean Compose screen with previews and a testable structure.

Pièges
  • Stateful composables you can't preview — Keep the composable stateless; hoist state to a wrapper
  • Wrong Modifier order — Skill prompts the order rule — padding before background for a padded background, etc.
Combiner avec : filesystem

Migrate a Views-based screen to Compose

👤 Teams converting legacy Android screens ⏱ ~90 min advanced

Quand l'utiliser : You want to convert one screen at a time without rewriting the whole app.

Déroulement
  1. Map the XML
    Here's fragment_profile.xml. Map each widget to a Compose equivalent with notes on behaviors to preserve.✓ Copié
    → XML → Compose mapping with behavior notes
  2. Rewrite
    Produce the Compose screen. Keep state + actions identical to the Fragment.✓ Copié
    → Composable file + ViewModel untouched
  3. Keep the navigation hybrid if needed
    Swap only this screen, leave the rest on Fragments using ComposeView.✓ Copié
    → Hybrid navigation continues to work

Résultat : One screen cleanly ported without destabilizing the rest.

Pièges
  • Observer leaks when mixing with Fragment lifecycle — Use viewLifecycleOwner with ComposeView; release on destroy
Combiner avec : android

Combinaisons

Associez-le à d'autres MCPs pour un effet X10

jetpack-compose-skill + android

Run the resulting screen in an emulator and iterate

Build the app, launch in the emulator, and show me the Profile screen.✓ Copié
jetpack-compose-skill + filesystem

Work across modules in a Compose project

Read feature/profile/ and add a Profile screen in ui/.✓ Copié

Outils

Ce que ce MCP expose

OutilEntréesQuand appelerCoût
compose-authoring screen intent + state Any new Compose UI 0
state-hoisting-review existing composable When a composable is hard to preview 0
view-to-compose-migration XML + behaviors Screen-by-screen migrations 0

Coût et limites

Coût d'exécution

Quota d'API
none
Tokens par appel
3–15k per screen
Monétaire
free
Astuce
Scope to one screen + its ViewModel at a time

Sécurité

Permissions, secrets, portée

Stockage des identifiants : none at skill level
Sortie de données : none

Dépannage

Erreurs courantes et correctifs

Preview fails to render

Make composables stateless; drop the ViewModel from the preview path.

StateFlow not collecting on background

Use collectAsStateWithLifecycle, not collectAsState, on screens that may be backgrounded.

Alternatives

jetpack-compose-skills vs autres

AlternativeQuand l'utiliserCompromis
apple-hig-designer-skillYou're on iOS SwiftUI instead of Android ComposeDifferent platform
claude-android-skillYou need broader Android help beyond UILess Compose-specific

Plus

Ressources

📖 Lire le README officiel sur GitHub

🐙 Voir les issues ouvertes

🔍 Parcourir les 400+ serveurs MCP et Skills