← ClaudeAtlas

android-feature-flagslisted

Feature flag patterns for Android - typed local flags with DataStore persistence, Firebase Remote Config fetch/activate lifecycle, wrapping remote config behind a FeatureFlagRepository interface, flag-gated navigation, environment-specific defaults, A/B testing user bucketing with exposure logging, and flag lifecycle naming conventions to prevent sprawl. Use this skill whenever adding feature toggles, kill switches, remote experiments, or A/B tests. Trigger on phrases like "feature flag", "remote config", "Firebase Remote Config", "A/B test", "feature toggle", "kill switch", "flag-gated", or "experiment".
lenorebreakneck630/claude-zero-to-hero-android-KMP · ★ 1 · Testing & QA · score 64
Install: claude install-skill lenorebreakneck630/claude-zero-to-hero-android-KMP
# Android Feature Flags ## Core Principles - Flags are temporary by default — every flag should have a defined retirement path. - The domain layer knows about flag values but never about Remote Config, Firebase, or DataStore. - Local flags are the floor; remote flags override them. - Never gate safety-critical behavior behind a remote flag with no safe default. - Exposure events must be logged at the moment the user is bucketed, not when they convert. --- ## Flag Types | Type | Source | Typical use | |---|---|---| | Local static | Hardcoded constant | Dev builds, test seams | | Local persisted | DataStore | Sideloaded overrides, offline defaults | | Remote | Firebase Remote Config | Server-controlled rollouts, A/B tests | All three should conform to the same `FeatureFlagRepository` interface. --- ## Typed Flag Model Use a sealed interface or enum so flags are always exhaustive and refactor-safe: ```kotlin sealed interface FeatureFlag { // Boolean flags data object NewCheckoutFlow : FeatureFlag data object OfflineMode : FeatureFlag // String/variant flags data object OnboardingVariant : FeatureFlag data object HomeFeedLayout : FeatureFlag } // Typed value wrappers sealed interface FlagValue { data class Bool(val value: Boolean) : FlagValue data class Str(val value: String) : FlagValue data class Num(val value: Long) : FlagValue } ``` Avoid stringly-typed flag name lookups outside the data layer — callers should reference `Featur