Claude-skill-registry Android Legacy State
Standards for State integration with Views using Coroutines and Lifecycle
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/legacy-state" ~/.claude/skills/majiayu000-claude-skill-registry-android-legacy-state && rm -rf "$T"
manifest:
skills/data/legacy-state/SKILL.mdsource content
Android Legacy State Standards
Priority: P1
Implementation Guidelines
Flow Consumption
- Rule: ALWAYS use
to collect flows in Views.repeatOnLifecycle(Lifecycle.State.STARTED) - Why: Prevents crashes (collecting while view is destroyed) and saves resources (stops collecting in background).
LiveData vs Flow
- New Code: Use
exclusively.StateFlow - Legacy: If using LiveData, observe with
(Fragment), NOTviewLifecycleOwner
.this
Anti-Patterns
- launchWhenX:
**Deprecated**: Use repeatOnLifecycle. - observe(this):
**Leak Risk**: Use viewLifecycleOwner in Fragments.