Agent skill

State Hoister

by nekomangaorg in nekomangaorg/Neko

Hoists state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable.

Apache-2.0Auto-check passedMobile

Install State Hoister

skills CLI
$ npx skills add nekomangaorg/Neko --skill state-hoister -a claude-code

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

GitHub CLI
$ gh skill install nekomangaorg/Neko state-hoister --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/nekomangaorg/Neko.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/hoister .claude/skills/state-hoister && 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
state-hoister
GitHub stars
2.8k
Token cost
~1.7k tokens
SKILL.md length
821 words
Files
2
Skills in repo
15
Repo updated
First seen
Licence
Apache-2.0

At a glance

Hoists state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable.

  • Works in 5 steps: OBSERVE: Hunt for state coupling and… → SELECT & PROPOSE: Pick the BEST… → HOIST (Upon Approval): Refactor into… → …
  • Decouple child composables from ViewModels
  • SKILL.md covers ✅ Always do:, ⚠️ Ask first: and 🚫 Never do:
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

State Hoister is an agent skill from nekomangaorg/Neko. Hoists state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable. Use this skill to decouple child composables from ViewModels, replace internal mutableStateOf with hoisted state and event callbacks, expose stateless/stateful composable overloads, enforce unidirectional data flow (UDF), and make components @Preview-friendly.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `journal.md`).

It sits in Mobile, covering Android development. It works with Jetpack Compose. The repository describes itself as: Unofficial MangaDex Reader for Android 8+. The licence is Apache-2.0.

When your agent uses it

  • Decouple child composables from ViewModels
  • Replace internal mutableStateOf with hoisted state and event callbacks
  • Expose stateless/stateful composable overloads
  • Enforce unidirectional data flow (UDF)

Example prompts

  • “Use the state-hoister skill to hoist state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable”
  • “/state-hoister”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. OBSERVE: Hunt for state coupling and anti-patterns
  2. SELECT & PROPOSE: Pick the BEST opportunity where hoisting state directly improves reusability, enables @Preview, or decouples business…
  3. HOIST (Upon Approval): Refactor into stateless and stateful layers
  4. VERIFY: Run ./gradlew ktfmtFormat. Verify @Previews render cleanly. Run tests to confirm zero regressions in behavior.
  5. PRESENT: Create a PR using Conventional Commits with the ref: prefix (e.g., ref: hoist state from ChapterDownloadDialog to make component…

What it can do on your machine

Read from SKILL.md and the folder at commit e52cc82. 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.

    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

State Hoister loads about 1.7k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 821 words of instructions outside code blocks.

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

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 nekomangaorg/Neko at commit e52cc82, republished under its Apache-2.0 licence (© nekomangaorg). 821 words, ~1,732 tokens.

Download SKILL.mdSave it as .claude/skills/state-hoister/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
state-hoister
description
Hoists state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable. Use this skill to decouple child composables from ViewModels, replace internal mutableStateOf with hoisted state and event callbacks, expose stateless/stateful composable overloads, enforce unidirectional data flow (UDF), and make components @Preview-friendly.

Goal

You are "The Hoister" 🎛️ — a Jetpack Compose state-management and UI architecture specialist obsessed with state hoisting, unidirectional data flow (UDF), and decoupling UI components. Your mission is to identify and implement ONE state hoisting refactoring that transforms coupled or internally stateful composables into clean, stateless, and previewable components.

Philosophy:

  • Composables should accept state down and emit events up (Unidirectional Data Flow).
  • Reusable child composables must never be tightly coupled to a ViewModel.
  • Stateless composables are inherently reusable, testable, and previewable.
  • Single Source of Truth: state lives where it is controlled, not duplicated across UI layers.
  • Events describe what happened (e.g., onDismiss, onValueChange, onItemClick), not business side effects.

Journaling Rules (Read .agents/skills/hoister/journal.md before starting and write learnings to it): Your journal is NOT a log — only add entries for CRITICAL state-hoisting and Compose UI architecture learnings. Format as ## YYYY-MM-DD - [Title] \n **Learning:** [Insight] \n **Action:** [How to apply next time]. Ensure the date is the exact date of the run. ONLY log things like: specific patterns the codebase prefers for event callbacks (e.g., individual lambdas vs sealed UiAction interfaces), state-holder class conventions (e.g., rememberXState), or traps where hoisting state caused unexpected recomposition loops or lost transient animation states. DO NOT journal routine work like "Hoisted onClick lambda" or basic Compose definitions.

Constraints

✅ Always do:

  • Explain what coupled or stateful composable was identified and the proposed state hoisting plan, then wait for user approval before modifying code.
  • Run ./gradlew ktfmtFormat to ensure Compose code adheres to repo formatting standards.
  • Run ./gradlew lintDebug and ./gradlew testDebugUnitTest before creating a PR.
  • Separate stateful and stateless variants: keep the stateless composable public/internal for @Previews and testing, with a stateful container/caller that wires up the ViewModel or state holder.
  • Hoist state via immutable data models (data class with val properties) and emit events via lambda callbacks (e.g., onClick: () -> Unit, onValueChange: (String) -> Unit, onAction: (ScreenAction) -> Unit).
  • Use collectAsStateWithLifecycle() when collecting StateFlow or Flow streams inside screen-level composables.
  • Use Neko's org.nekomanga.presentation.theme.Size tokens (Size.small, Size.medium, Size.large, etc.) for any dimensions or paddings touched during refactoring.
  • Add @Preview annotations to newly extracted, stateless composables.
  • Keep changes cohesive and under ~200 lines.

⚠️ Ask first:

  • Refactoring entire screen architectures across multiple navigation graphs.
  • Replacing individual callback lambdas with a single sealed UiAction across a shared module if existing components use explicit lambdas.
  • Introducing custom state holder classes (rememberFooState()) that manage coroutine scopes or complex layout coordinates.

🚫 Never do:

  • Pass ViewModels directly into reusable leaf or child composables (e.g., fun MangaCard(viewModel: MangaViewModel) is strictly prohibited).
  • Pass MutableState<T> or MutableStateFlow<T> downwards as parameters for children to mutate directly.
  • Hoist transient UI-only state unnecessarily if it has zero external impact and complicates the caller (e.g., pure micro-animation ripple states or internal layout measurement caches that no parent needs).
  • Never use the prefix refactor: in PR titles or commits. Use ref: or feat: instead.
Show full SKILL.md (352 more words)Show less

Instructions

  1. OBSERVE: Hunt for state coupling and anti-patterns:
    • ViewModel Coupling: Child composables receiving ViewModel instances as parameters instead of plain data and callbacks.
    • Internal State Bloat: Leaf or intermediate composables using remember { mutableStateOf(...) } for state that parent composables or ViewModels need to observe, control, or test.
    • Missing Previews: Composables that cannot be previewed with @Preview because they require ViewModel or CoroutineScope injection.
    • Prop Drilling of State Holders: Passing MutableState<T> or StateFlow<T> directly down multiple levels instead of passing unwrapped values and event lambdas.
    • Duplicate State: Components maintaining local copies of state that get out of sync with the single source of truth.
  2. SELECT & PROPOSE: Pick the BEST opportunity where hoisting state directly improves reusability, enables @Preview, or decouples business logic from UI rendering. Explain what was identified and detail the planned stateful/stateless split, hoisted state, and event callbacks. Wait for user approval before modifying code.
  3. HOIST (Upon Approval): Refactor into stateless and stateful layers:
    • Extract the UI into a stateless Composable accepting explicit parameters (state: FooUiState or value: T) and event callbacks (onEvent: () -> Unit).
    • Retain or create a stateful wrapper at the screen level that collects state via collectAsStateWithLifecycle() and forwards events to the ViewModel.
    • Add @Preview (or @PreviewParameterProvider) for the stateless Composable.
    • Ensure all UI state models are immutable (data class with vals only).
  4. VERIFY: Run ./gradlew ktfmtFormat. Verify @Previews render cleanly. Run tests to confirm zero regressions in behavior.
  5. PRESENT: Create a PR using Conventional Commits with the ref: prefix (e.g., ref: hoist state from ChapterDownloadDialog to make component stateless and previewable). Include What, Why, Hoisted State & Events, and Preview verification in the description.

Examples

  • Decoupling a dialog composable from a ViewModel by passing UiState and onDismissRequest / onConfirm callbacks, and adding a @Preview.
  • Splitting LibraryFilterSheet(viewModel) into a stateful container and a stateless LibraryFilterSheet(filters: FilterState, onFilterSelected: (Filter) -> Unit).
  • Replacing remember { mutableStateOf(false) } inside a reusable item card with isExpanded: Boolean and onExpandToggle: () -> Unit hoisted to the parent list.
  • Hoisting TextField state (query: String, onQueryChange: (String) -> Unit) out of a search bar component to allow parent screen control.
  • Converting MutableStateFlow parameter pass-throughs into evaluated primitive/data models + callback lambdas.

© nekomangaorg, 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

SKILL.md and 1 other file in .agents/skills/hoister of nekomangaorg/Neko.

  • SKILL.md
  • journal.md

Open the folder on GitHubat commit e52cc82

Compare with similar skills

State Hoister 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.

State Hoister compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
State Hoister this skillnekomangaorg/Neko2.8k—~1.7kAutomated safety check: PassApache-2.0
Compose Multiplatform Patternsmonta-app/ocpp-emulator1805 repos~2kAutomated safety check: PassApache-2.0
Stylessreichholf/dreamDroid1165 repos~2.3kAutomated safety check: PassGPL-3.0
Compose UIMoustachauve/WLED-Android1693 repos~676Automated safety check: PassApache-2.0
Compose Animationschrisbanes/skills1.1k—~1.1kAutomated safety check: PassApache-2.0
Compose UI Testing Patternschrisbanes/skills1.1k—~1.8kAutomated safety check: PassApache-2.0

Similar skills

  • 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.

    180 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Styles

    sreichholf/dreamDroid

    A skill your agent uses to integrate the Jetpack Compose Styles API into an Android project.

    116 GitHub starsUsed in 5 repos~2.3k tokens
    MobileAuto-check passed
  • Compose UI

    Moustachauve/WLED-Android

    Best practices for building UI with Jetpack Compose, focusing on state hoisting, detailed performance optimizations, and theming.

    169 GitHub starsUsed in 3 repos~676 tokens
    MobileAuto-check passed
  • Compose Animations

    chrisbanes/skills

    A skill your agent uses when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one…

    1.1k GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • A skill your agent uses when writing or reviewing Jetpack Compose UI tests, screenshot tests or baseline-recording evidence, previews, semantics assertions, fake image loading, keyboard input, focus…

    1.1k GitHub stars~1.8k tokensUpdated today
    MobileAuto-check passed
  • Edge To Edge

    sreichholf/dreamDroid

    A skill your agent uses to migrate your Jetpack Compose app to add adaptive edge-to-edge support and troubleshoot common issues.

    116 GitHub starsUsed in 6 repos~3.6k tokens
    MobileAuto-check passed

More from nekomangaorg/Neko

All 15 skills in this repo
  • Architecture Overclock

    nekomangaorg/Neko

    Resolves deep, structural performance bottlenecks in the Kotlin Android codebase.

    2.8k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Architecture Renovator

    nekomangaorg/Neko

    Resolves deep architectural debt in the Kotlin Android codebase through macro-level refactoring.

    2.8k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Build Foreman

    nekomangaorg/Neko

    Optimizes Gradle build scripts, compilation times, and Android Studio sync performance.

    2.8k GitHub stars~807 tokensUpdated yesterday
    Auto-check passed
  • Code Steward

    nekomangaorg/Neko

    Maintains Kotlin codebase health, idiomatic style, and modern API usage.

    2.8k GitHub stars~977 tokensUpdated yesterday
    Auto-check passed
  • Domain Distiller

    nekomangaorg/Neko

    Extracts duplicated or tangled business logic from ViewModels, Repositories, or UI components into pure, highly testable Kotlin Use Cases (Interactors) following the Single Responsibility Principle.

    2.8k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Frontend Artisan

    nekomangaorg/Neko

    Elevates the Jetpack Compose user interface through micro-UX improvements, animations, accessibility (a11y) fixes, and UI structural polish.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about State Hoister

What does State Hoister do?

Hoists state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable. State Hoister is an agent skill from nekomangaorg/Neko. Hoists state in Jetpack Compose layouts to keep composables stateless, decoupled, and testable.

When should I use State Hoister?

State Hoister fits situations like: decouple child composables from ViewModels; replace internal mutableStateOf with hoisted state and event callbacks; expose stateless/stateful composable overloads; enforce unidirectional data flow (UDF).

How do I install State Hoister in Claude Code?

Run `npx skills add nekomangaorg/Neko --skill state-hoister -a claude-code`. Or copy the skill folder (.agents/skills/hoister in nekomangaorg/Neko) into .claude/skills/state-hoister in your project. Claude Code loads it when a task matches its description.

How do I install State Hoister in Codex?

Run `npx skills add nekomangaorg/Neko --skill state-hoister -a codex`. Or copy the skill folder (.agents/skills/hoister in nekomangaorg/Neko) into .agents/skills/state-hoister in your project. Codex loads it when a task matches its description.

Can I use State Hoister 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 nekomangaorg/Neko --skill state-hoister -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/state-hoister, .gemini/skills/state-hoister, .github/skills/state-hoister and .opencode/skills/state-hoister in your project.

What does State Hoister need to run?

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

Does State Hoister 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 State Hoister 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 State Hoister use?

State Hoister 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 State Hoister use?

About 1.7k tokens (SKILL.md is roughly 6.9k 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 State Hoister?

Skills that share tags, products or a category with State Hoister: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Styles (sreichholf/dreamDroid, 116 stars), Compose UI (Moustachauve/WLED-Android, 169 stars) and Compose Animations (chrisbanes/skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains State Hoister?

nekomangaorg (a GitHub organization) maintains it in nekomangaorg/Neko, which has 2,812 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 9, 2026.

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