ronjunevaldoz/kmp-agent-skills/kmp-feature-flags
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Feature flag evaluation for Kotlin Multiplatform — a FeatureFlag enum and FeatureFlagProvider interface in commonMain, Firebase Remote Config as the default backend, A/B variant types, offline fallback defaults, flag evaluation in the :domain layer, and kill-switch support for fast disablement.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-feature-flagsSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-feature-flags.
When to Use This Skill
Use when:
- Enabling or disabling a feature without a new app release
- Running an A/B experiment where users see variant A or B
- Adding a kill switch to roll back a buggy feature from the server
- Controlling feature rollout percentage (0–100%)
- Deferring a feature to a date-based or user-segment condition
Trigger keywords: feature flags, feature toggle, remote config, Firebase Remote Config, A/B test, experiment, kill switch, flag evaluation, FeatureFlagProvider, variant, rollout, LaunchDarkly KMP, feature flag KMP, flag provider, remote feature flag.
Freshness rule: Firebase Remote Config fetch interval is 12 hours in production; call activate() after fetchAndActivate() to apply fetched values in the current session. For LaunchDarkly or other providers, check the Kotlin SDK's KMP support status — as of 2026 LaunchDarkly's Kotlin SDK is JVM/Android only, not KMP; use a thin expect/actual wrapper if targeting iOS natively.
Recommendation First
Define flags as a FeatureFlag enum in commonMain with typed defaults. Evaluation happens in the :domain layer via FeatureFlagProvider — never read flags directly from a composable or ViewModel. This keeps flag-gated logic testable with a fake provider and decouples feature code from the backend (Firebase, LaunchDarkly, local overrides).
Feature flag definitions — commonMain
FeatureFlagProvider interface — commonMain
Firebase Remote Config implementation — Android
No-op / hardcoded provider for iOS and Desktop
Flag evaluation in use cases — never in composables
A/B variant example
Kill switch pattern
App startup — fetch on launch
Koin wiring
Testing with FakeFeatureFlagProvider
Common Anti-Patterns
- Reading flags in composables —
if (flags.isEnabled(FeatureFlag.X))in a@Composable
bypasses the ViewModel and cannot be tested; evaluate flags in use cases or ViewModels and pass the result as part of UiState
- No offline fallback — if
fetchAndActivate()fails silently, code using the flag
should fall back to the hardcoded default in FeatureFlag.defaultValue; never crash
- Adding flag keys as raw strings —
remoteConfig.getBoolean("new_checkout_flow")in
feature code creates hidden coupling; always read via the FeatureFlag enum
- Fetching on every ViewModel init —
fetchAndActivate()should be called once on
app startup and stored; fetching per ViewModel adds unnecessary latency and Firebase quota
- Not cleaning up stale flags — flags that are 100% enabled and will never roll back
should be removed from the enum, the remote config, and all call sites; stale flags accumulate and make the code harder to reason about
Related Skills
kmp-analytics— log which variant a user sees immediately after
fetchAndActivate() so the analytics team can correlate behavior with experiment buckets
kmp-dependency-injection—FeatureFlagProvideris a singleton in
the Koin module; it is injected into use cases and ViewModels via constructor
kmp-unit-testing—FakeFeatureFlagProviderallows testing both
branches of any flag-gated use case without a Firebase connection
Output Style
When implementing feature flags, respond in this order:
- FeatureFlag enum — key + typed default for each flag in scope
- FeatureFlagProvider interface — standard methods
- Firebase implementation — Android; defaults-only stub for iOS/Desktop
- Flag evaluation — use case or ViewModel that branches on the flag
- Startup fetch —
fetchAndActivate()on app launch - Koin wiring — platform modules
- FakeFeatureFlagProvider + test — both branches covered
Changelog
| Date | Change | |
|---|---|---|
| 2026-06-21 | Initial release. |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-feature-flags/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ronjunevaldoz/kmp-agent-skills/kmp-feature-flags)