Agent skill

Android Compose Patterns

by makifbaysal in makifbaysal/tasktrooper

A skill your agent uses when building native Android with Jetpack Compose - stateless composables, state hoisting, ViewModel-owned state, edge-to-edge, predictive back, adaptive layout, atomic…

Apache-2.0Auto-check passedMobile

Install Android Compose Patterns

skills CLI
$ npx skills add makifbaysal/tasktrooper --skill android-compose-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install makifbaysal/tasktrooper android-compose-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/makifbaysal/tasktrooper.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/agents/mobile-developer/skills/android-compose-patterns .claude/skills/android-compose-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
android-compose-patterns
GitHub stars
109
Token cost
~1.9k tokens
SKILL.md length
730 words
Files
1
Skills in repo
99
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when building native Android with Jetpack Compose - stateless composables, state hoisting, ViewModel-owned state, edge-to-edge, predictive back, adaptive layout, atomic…

  • Building native Android with Jetpack Compose - stateless composables
  • SKILL.md covers Overview, Rules, Edge-to-edge (enforced from… and Predictive back (default at…, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • ViewModel-owned state

What it does

Android Compose Patterns is an agent skill from makifbaysal/tasktrooper. Use when building native Android with Jetpack Compose - stateless composables, state hoisting, ViewModel-owned state, edge-to-edge, predictive back, adaptive layout, atomic components, and Material theming over hardcoded values

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Android development, Responsive design and Theming and dark mode. It works with Android and Jetpack Compose. The repository describes itself as: Local-first agent platform: board + role agents + agent CLI runs (Claude Code, Cursor, Antigravity, OpenCode) or local and API models (Ollama, LM Studio), all on your own Mac. The licence is Apache-2.0.

When your agent uses it

  • Building native Android with Jetpack Compose - stateless composables
  • ViewModel-owned state
  • Predictive back
  • Adaptive layout

Example prompts

  • “/android-compose-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit f3d59b5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Android Compose Patterns loads about 1.9k tokens when it runs. Until then it costs about 63 tokens; SKILL.md has 730 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from makifbaysal/tasktrooper at commit f3d59b5, republished under its Apache-2.0 licence (© makifbaysal). 730 words, ~1,897 tokens.

Download SKILL.mdSave it as .claude/skills/android-compose-patterns/SKILL.md (or your agent's skills folder).
name
android-compose-patterns
description
Use when building native Android with Jetpack Compose - stateless composables, state hoisting, ViewModel-owned state, edge-to-edge, predictive back, adaptive layout, atomic components, and Material theming over hardcoded values
category
architecture
tech_stack
Kotlin
source
android/skills (Apache-2.0), skydoves/android-testing-skills (Apache-2.0), adapted

Jetpack Compose Patterns

Overview

Native Android (Jetpack Compose) is chosen when a task needs deep Android integration or the app is already native (see native-vs-flutter-decision). Same discipline as Flutter/SwiftUI: small stateless composables, state hoisted out, reusable atomic components.

Core principle: Composables are stateless functions of state. State is hoisted to a ViewModel; composables emit events upward.

Rules

  • Stateless composables + state hoisting. A composable takes its state as parameters and exposes callbacks (onXxx) — it does not own app state. The screen-level composable connects a ViewModel to the stateless UI.
  • ViewModel owns state and logic, exposed as StateFlow/UiState; the composable collects it with collectAsStateWithLifecycle(). Networking/business rules live in the ViewModel + repository, never in the composable.
  • Model UI state as a sealed hierarchy: Loading | Data | Empty | Error — when over it renders every branch. No happy-path-only screens.
  • Atomic components: shared library of reusable composables (atoms → molecules → organisms). Reuse before building; grep before adding.
  • Material theme, not hardcoded values: MaterialTheme.colorScheme / typography / a spacing tokens object (MaterialTheme.spacing, see mobile-design-system-foundation) — never scattered Color(0xFF...) and magic dp. Support dark theme + dynamic color.
  • remember/derivedStateOf to avoid recomputation; hoist remembered state only when it's genuinely local (scroll, text field).
  • @Preview reusable composables in their key states, and across the matrix (see below).

Edge-to-edge (enforced from targetSdk 35)

  • Call enableEdgeToEdge() before setContent in the activity — the opt-out is gone at targetSdk 35+.
  • Consume insets at the Scaffold: use its innerPadding and Modifier.consumeWindowInsets(innerPadding) on the content so a nested scrollable doesn't double-apply it.
  • IME padding: apply Modifier.imePadding() once, at the container that should move with the keyboard — applying it a second time further down the tree produces extra empty space.
  • android:windowSoftInputMode="adjustResize" in the manifest for screens with text input.
  • NavigationSuiteScaffold does not automatically propagate its padding to the content slot — apply insets explicitly inside it, don't assume it's handled.

Predictive back (default at targetSdk 36)

  • onBackPressed() / OnBackPressedCallback without isEnabled toggling is not called the same way once predictive back is the default — use BackHandler (simple) or PredictiveBackHandler (custom transition) in Compose, or Navigation 3's built-in handling.
  • Verify back navigation in this run rather than assuming the old override still fires.

Adaptive layout

  • currentWindowAdaptiveInfo().windowSizeClass to branch layout by available width/height — never by Configuration.orientation or a hardcoded device check.
  • NavigationSuiteScaffold switches a bottom nav bar to a nav rail automatically at the window-size-class breakpoint — prefer it over hand-rolling the switch.
  • GridCells.Adaptive(minWidth) for grids that should reflow by available width.
  • Android 16 (opt-out via PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY) and Android 17/API 37 (no opt-out) ignore screenOrientation/resizeableActivity restrictions on screens ≥600dp — design every screen to work in both orientations and at tablet width; don't rely on an orientation lock to avoid building the wider layout.
Show full SKILL.md (294 more words)Show less

Previews and tests across the matrix

  • @PreviewScreenSizes, @PreviewFontScale, @PreviewLightDark, or a custom multi-preview with Devices.PHONE/Devices.TABLET — see mobile-visual-self-review for the full size/text-scale/dark matrix.
  • DeviceConfigurationOverride(ForcedSize(...) then FontScale(...) then DarkMode(...)) for instrumented matrix tests.
  • rule.enableAccessibilityChecks() on an API 34+ device/emulator before UI-mutating test actions (inconclusive on Robolectric — say so if that's all you ran); see mobile-accessibility.
  • "Run screenshot tests but do not update reference images" to "fix" a failure — a changed golden is a visual regression until a human confirms it's intended.

Semantics

  • contentDescription on every Image/Icon that carries meaning; null explicitly for a purely decorative one.
  • Modifier.semantics(mergeDescendants = true) on a composite row so a screen reader announces it once.
  • Touch targets ≥48dp — Modifier.size/minimumInteractiveComponentSize().

Worked Example

kotlin
// ViewModel owns state + logic (unit-testable, no Compose)
class TaskListViewModel(private val repo: TaskRepository) : ViewModel() {
    private val _state = MutableStateFlow<UiState<List<Task>>>(UiState.Loading)
    val state: StateFlow<UiState<List<Task>>> = _state
    fun load() = viewModelScope.launch {
        _state.value = UiState.Loading
        _state.value = try {
            val items = repo.list()
            if (items.isEmpty()) UiState.Empty else UiState.Data(items)
        } catch (e: CancellationException) {
            throw e                              // never swallow cancellation
        } catch (e: Exception) {
            UiState.Error(e)
        }
    }
}

// stateless composable renders state, emits events
@Composable
fun TaskListScreen(state: UiState<List<Task>>, onRetry: () -> Unit) = when (state) {
    is UiState.Loading -> AppSpinner()
    is UiState.Error   -> AppErrorView(message = state.cause.message, onRetry = onRetry)
    is UiState.Data    -> TaskList(tasks = state.value)
    is UiState.Empty   -> EmptyView()
}

The fix from the previous version: runCatching { } wrapped around a suspend call inside viewModelScope.launch catches CancellationException along with real errors, which breaks structured concurrency (a cancelled screen keeps "loading" instead of stopping) — use try/catch and rethrow CancellationException explicitly. The Empty branch is now actually emitted when the list comes back empty, not just declared and never reached.

Testing

  • Unit-test the ViewModel with a fake/mockk repository and a test dispatcher — no Compose.
  • Compose UI tests (createComposeRule) assert visible behavior and clicks. Test-first.

Common Mistakes

  • A composable holding app state or calling the repository.
  • Business logic in the composable instead of the ViewModel.
  • Hardcoded colors/dp instead of MaterialTheme + tokens.
  • Collecting flows without collectAsStateWithLifecycle (leaks/waste).
  • Only the data branch rendered — Empty declared but never emitted.
  • runCatching around a suspend call, swallowing CancellationException.
  • Assuming edge-to-edge/predictive back still behave like targetSdk <35/<36 after a target bump.

Red Flags

  • A @Composable that imports a repository or Retrofit service.
  • Color(0xFF...)/magic dp outside the theme.
  • No error/empty branch in the when.
  • enableEdgeToEdge() missing from a new or recently targetSdk-bumped activity.
  • A screen that only renders correctly in one orientation.

© makifbaysal, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in catalog/agents/mobile-developer/skills/android-compose-patterns of makifbaysal/tasktrooper.

Open the folder on GitHubat commit f3d59b5

Compare with similar skills

Android Compose Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Android Compose Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Android Compose Patterns this skillmakifbaysal/tasktrooper109—~1.9kAutomated safety check: PassApache-2.0
Material 3hamen/material-3-skill1.5k2 repos~7.8kAutomated safety check: PassMIT
Compose Multiplatform Patternsmonta-app/ocpp-emulator1795 repos~2kAutomated safety check: PassApache-2.0
Android Material Guidelineszoonk/zoonk157—~1.1kAutomated safety check: PassMIT
Migrate XML Views To Jetpack Composearindamxd/camerax-android1325 repos~1.4kAutomated safety check: PassApache-2.0
Hz Metavrx Layout SDKmeta-quest/agentic-tools213—~855Automated safety check: PassApache-2.0

Similar skills

  • Material 3

    hamen/material-3-skill

    Implement Google's Material Design 3 (Material You) UI system.

    1.5k GitHub starsUsed in 2 repos~7.8k tokens
    Frontend & DesignAuto-check passed
  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    179 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • A skill your agent uses when designing, reviewing, or implementing Android UI or features for phones, tablets, foldables, ChromeOS, desktop windowing, Wear OS, Android TV, Android for Cars, Android…

    157 GitHub stars~1.1k tokensUpdated 5 days ago
    MobileAuto-check passed
  • Migrate XML Views To Jetpack Compose

    arindamxd/camerax-android

    Provides a structured workflow for migrating an Android XML View to Jetpack Compose.

    132 GitHub starsUsed in 5 repos~1.4k tokens
    MobileAuto-check passed
  • Hz Metavrx Layout SDK

    meta-quest/agentic-tools

    Build multi-window Meta Horizon OS experiences with the MetaVrx Layout SDK in Jetpack Compose or React Native.

    213 GitHub stars~855 tokensUpdated 13 days ago
    MobileAuto-check passed
  • STS Amethyst Launcher Design System

    ModinMobileSTS/SlayTheAmethystModded

    Design system imported from the SlayTheAmethyst Android Jetpack Compose launcher: Material 3 surfaces, user-selected seed colors, light and dark themes and typography rules.

    400 GitHub stars~1.7k tokensUpdated 8 days ago
    Frontend & DesignAuto-check passed

More from makifbaysal/tasktrooper

All 99 skills in this repo
  • API Contract Testing

    makifbaysal/tasktrooper

    A skill your agent uses when a task adds or changes an HTTP endpoint, its request/response shape, status codes, auth or error format - the request matrix, curl templates and what counts as a…

    109 GitHub starsUsed in 1 repo~754 tokens
    Auto-check passed
  • Acceptance Criteria Gwt

    makifbaysal/tasktrooper

    A skill your agent uses when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases

    109 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Accessibility Check

    makifbaysal/tasktrooper

    A skill your agent uses when a task changes any screen, form, dialog, menu or control - Lighthouse/axe scan of the changed screens, a keyboard walk, and the thresholds that fail a task

    109 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Analiz Gate

    makifbaysal/tasktrooper

    A skill your agent uses when deciding whether a request needs an analiz task before implementation - the conditions that require the architect's analysis versus going straight to implementation

    109 GitHub stars~641 tokensUpdated yesterday
    Auto-check passed
  • Analiz HTML Report

    makifbaysal/tasktrooper

    A skill your agent uses when you write or revise the analiz deliverable - the ONE self-contained HTML report (spec and plan as sections) a human reviews passage by passage

    109 GitHub stars~3.9k tokensUpdated yesterday
    Auto-check passed
  • Analiz Human Review Gate

    makifbaysal/tasktrooper

    A skill your agent uses when you finish an analiz report - the human must approve the analysis before any implementation task is created, via the analizreview column

    109 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed

Questions about Android Compose Patterns

What does Android Compose Patterns do?

A skill your agent uses when building native Android with Jetpack Compose - stateless composables, state hoisting, ViewModel-owned state, edge-to-edge, predictive back, adaptive layout, atomic…. Android Compose Patterns is an agent skill from makifbaysal/tasktrooper.

When should I use Android Compose Patterns?

Android Compose Patterns fits situations like: building native Android with Jetpack Compose - stateless composables; viewModel-owned state; predictive back; adaptive layout.

How do I install Android Compose Patterns in Claude Code?

Run `npx skills add makifbaysal/tasktrooper --skill android-compose-patterns -a claude-code`. Or copy the skill folder (catalog/agents/mobile-developer/skills/android-compose-patterns in makifbaysal/tasktrooper) into .claude/skills/android-compose-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Android Compose Patterns in Codex?

Run `npx skills add makifbaysal/tasktrooper --skill android-compose-patterns -a codex`. Or copy the skill folder (catalog/agents/mobile-developer/skills/android-compose-patterns in makifbaysal/tasktrooper) into .agents/skills/android-compose-patterns in your project. Codex loads it when a task matches its description.

Can I use Android Compose Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add makifbaysal/tasktrooper --skill android-compose-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/android-compose-patterns, .gemini/skills/android-compose-patterns, .github/skills/android-compose-patterns and .opencode/skills/android-compose-patterns in your project.

What does Android Compose Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Android Compose Patterns is instructions for the agent only.

Does Android Compose Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Android Compose Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Android Compose Patterns use?

Android Compose Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Android Compose Patterns use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Android Compose Patterns?

Skills that share tags, products or a category with Android Compose Patterns: Material 3 (hamen/material-3-skill, 1.5k stars), Compose Multiplatform Patterns (monta-app/ocpp-emulator, 179 stars), Android Material Guidelines (zoonk/zoonk, 157 stars) and Migrate XML Views To Jetpack Compose (arindamxd/camerax-android, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Android Compose Patterns?

makifbaysal (a GitHub user) maintains it in makifbaysal/tasktrooper, which has 109 GitHub stars. The repository holds 99 skills in this directory. The repository was last updated on October 6, 2026.

Source: makifbaysal/tasktrooper on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.