compose-state-holder-ui-split

compose-state-holder-ui-split is a skill for Claude Code, Codex from ashtanko/compose-android-template. It costs 43 tokens per session (1,557 once invoked), scanned A, original, MIT.

A Jetpack Compose design pattern that separates screen wiring from UI drawing. One composable connects to a ViewModel or other state holder, while another receives plain UI state and callbacks and renders the layout.

In plain words
What is it for?
Use it when a Compose screen collects state, handles navigation or side effects, or passes a ViewModel, controller, or service directly into layout code.
Why use it?
Separating these responsibilities makes screens easier to preview, test, reuse, and move across Android, Desktop, TV, or Kotlin Multiplatform targets. It avoids requiring the full app stack just to test a layout.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when a Compose screen collects state, handles navigation or side effects, or passes a ViewModel, controller, or service directly into layout code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashtanko/compose-android-template/compose-state-holder-ui-split
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashtanko/compose-android-template --skill compose-state-holder-ui-split
Clone the repo
git clone --depth 1 https://github.com/ashtanko/compose-android-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for compose-state-holder-ui-split

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-state-holder-ui-split/github.svg)](https://agentmods.dev/skills/ashtanko/compose-android-template/compose-state-holder-ui-split)
Your own site
<a href="https://agentmods.dev/skills/ashtanko/compose-android-template/compose-state-holder-ui-split"><img src="https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-state-holder-ui-split/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for compose-state-holder-ui-split

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashtanko/compose-android-template/compose-state-holder-ui-split"><img src="https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-state-holder-ui-split.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,557 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01557
Opus 5.5 $0.00017 $0.00623
Sonnet 5.5 $0.00009 $0.00311
Haiku 4.5 $0.00004 $0.00156

Measured 1mo ago against content hash 53df7528b7f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

compose-state-holder-ui-split scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/compose-state-holder-ui-split/SKILL.md · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Compose: state holder/UI split

Core principle

Separate state-holder wiring from UI rendering. The state-holder composable talks to ViewModels, components, flows, navigation, and side effects. The UI composable takes plain immutable UI state plus callbacks and describes layout.

This keeps screens previewable, testable, and easier to reuse across Android, Desktop, TV, and KMP/CMP targets.

When to use this skill

Use this when a Compose screen:

  • Takes a ViewModel, component, controller, navigator, repository, or service directly.
  • Collects app/business state or side effects in the same function that lays out most UI.
  • Passes a whole state holder into child composables instead of explicit state and callbacks.
  • Is hard to preview because it needs dependency injection, navigation, lifecycle, or fake services.
  • Has UI tests that must construct a full app stack to verify a simple layout branch.

The pattern

Use a small public state-holder composable:

@Composable
fun ProfileScreen(component: ProfileComponent, modifier: Modifier = Modifier) {
    val state by component.state.collectAsStateWithLifecycle()

    ProfileScreen(
        state = state,
        onNameChange = component::onNameChange,
        onSaveClick = component::save,
        onBackClick = component::back,
        modifier = modifier,
    )
}

Then put UI in a plain composable that knows nothing about the state holder:

@Composable
fun ProfileScreen(
    state: ProfileUiState,
    onNameChange: (String) -> Unit,
    onSaveClick: () -> Unit,
    onBackClick: () -> Unit,
    modifier: Modifier = Modifier,
) {
    ProfileContent(
        name = state.name,
        isSaving = state.isSaving,
        canSave = state.canSave,
        onNameChange = onNameChange,
        onSaveClick = onSaveClick,
        onBackClick = onBackClick,
        modifier = modifier,
    )
}

Private content functions can break up layout:

@Composable
private fun ProfileContent(
    name: String,
    isSaving: Boolean,
    canSave: Boolean,
    onNameChange: (String) -> Unit,
    onSaveClick: () -> Unit,
    onBackClick: () -> Unit,
    modifier: Modifier = Modifier,
) {
    // Layout only.
}

Read the full file on GitHub · 157 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 157 lines · 43 tokens per session scan A 53df7528b7f6

Subscribe to this mod's changes

compose-state-holder-ui-split is a skill published in the GitHub repository ashtanko/compose-android-template (13 stars, last pushed 10d ago), licensed MIT. It adds 43 tokens to every session and 1,557 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

sceneview

Build 3D and AR apps with the SceneView SDK in Jetpack Compose, SwiftUI (iOS/macOS/visionOS via SceneViewSwift), Web (Filament.js), Flutter and React Native. Use whenever the user asks for "3D in Compose", "AR with ARCore in Compose", a model viewer, or any cross-platform 3D/AR app where the dependency is…

sceneview/sceneview · 156 tokens

sceneview-ios

Build 3D and AR apps on Apple platforms (iOS, macOS, visionOS) with SceneViewSwift — the SwiftUI wrapper around RealityKit. Use whenever the user asks for "3D in SwiftUI", "AR with ARKit in SwiftUI", a model viewer for iOS, or any Apple-platform 3D/AR app where the dependency is the SceneViewSwift Swift Package from…

sceneview/sceneview · 148 tokens

compose-animations

Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animateAsState, rememberTransition, AnimatedContent, and Crossfade.

chrisbanes/skills · 64 tokens

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

chrisbanes/skills · 41 tokens

compose-state-and-effects

Use when writing or reviewing Jetpack Compose state ownership, remember state, state hoisting, screen state holders, LaunchedEffect, DisposableEffect, SideEffect, Flow collection, navigation, snackbar, analytics, or focus requests.

chrisbanes/skills · 50 tokens

android-benchmark-comparison

Use when comparing physical Android benchmark configurations, investigating inconsistent rankings, or selecting an Android default from measured results. Do not use for code-level Compose performance diagnosis without a configuration comparison.

chrisbanes/skills · 41 tokens