CO

compose-state-holder-ui-split

Refactors Jetpack Compose screens to separate business logic and state management from rendering UI.

Install

mkdir -p .claude/skills/compose-state-holder-ui-split && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16133" && unzip -o skill.zip -d .claude/skills/compose-state-holder-ui-split && rm skill.zip

Installs to .claude/skills/compose-state-holder-ui-split

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when a Jetpack Compose screen-level composable takes a ViewModel/component/controller, collects state or effects, handles navigation/snackbars, or wires callbacks while also rendering layout.
195 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Separate state-holder wiring from UI rendering
  • Collect app or business state and side effects
  • Wire callbacks for user events
  • Own UI-local state like scroll or focus
  • Handle effects near the state holder
  • Pass immutable UI state to UI composables

How it works

This skill separates state-holder wiring from UI rendering by creating a state-holder composable that interacts with ViewModels and side effects, and a UI composable that takes immutable UI state and callbacks for layout.

Inputs & outputs

You give it
A Jetpack Compose screen-level composable that mixes state logic and UI layout
You get back
A small public state-holder composable and a plain UI composable

When to use compose-state-holder-ui-split

  • Refactor Compose UI
  • Improve screen previewability
  • Decouple state from layout

About compose-state-holder-ui-split

Moves navigation, side effects, and state collection from UI functions into dedicated state-holder components to improve testability and preview support.

Use when a Jetpack Compose screen-level composable takes a ViewModel/component/controller, collects state or effects, handles navigation/snackbars, or wires callbacks while also rendering layout.

When not to use it

  • For tiny one-off composables that already take plain values and callbacks
  • For design-system primitives like Button or Card
  • When the state-holder composable would only forward one primitive

Limitations

  • Not suitable for design-system primitives
  • Not suitable for tiny one-off composables
  • Not suitable when a state-holder would only forward a single primitive

How it compares

This approach improves testability and preview support by decoupling state management from UI presentation, unlike a single composable that handles both.

Compared to similar skills

compose-state-holder-ui-split side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
compose-state-holder-ui-split (this skill)03moNo flagsIntermediate
android-kotlin74moNo flagsIntermediate
reviewing-changes13moNo flagsIntermediate
kmp-cmp-app-builder05moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry