ronjunevaldoz/kmp-agent-skills/kmp-analytics
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Shared Analytics interface for Kotlin Multiplatform — sealed event types in commonMain, platform implementations for Firebase Analytics (Android) and equivalent (iOS/Desktop), automatic screen tracking, Koin wiring with platform modules, and testing with a fake analytics recorder.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-analyticsSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-analytics.
When to Use This Skill
Use when:
- Adding event tracking, screen views, or user property recording to a KMP project
- Defining a shared event schema that multiple platforms report identically
- Swapping analytics backends (Firebase → Amplitude → custom) without changing feature code
- Testing feature code that fires analytics events
Trigger keywords: analytics, event tracking, Firebase Analytics, screen tracking, track event, log event, user properties, AnalyticsTracker, event schema, KMP analytics, analytics interface, analytics facade, mixpanel KMP, amplitude KMP.
Freshness rule: Firebase BoM version changes frequently — recheck com.google.firebase:firebase-bom before pinning. iOS Firebase SDK version must match the Android BoM equivalent. For non-Firebase backends recheck the SDK's KMP support status.
Recommendation First
Define a sealed AnalyticsEvent hierarchy in commonMain and a single Analytics interface. Platform modules provide the implementation — feature code never imports a platform SDK directly.
Event schema — commonMain
Analytics interface — commonMain
Android implementation — Firebase
iOS implementation
Desktop / no-op stub
Koin wiring
Inject into ViewModels or use cases:
Automatic screen tracking
Wire screen tracking in the NavHost using DisposableEffect:
Testing with FakeAnalytics
Common Anti-Patterns
- Platform SDK imports in feature code —
import com.google.firebase.analytics.FirebaseAnalyticsin a ViewModel couples feature code to Android; always import onlyAnalyticsfromcommonMain - String event names scattered in feature code —
analytics.track("login_success", ...)with raw strings diverges across platforms; define all events as sealed subclasses - Tracking inside composables — analytics calls belong in the ViewModel
onIntenthandler, not inside@Composablefunctions; composables recompose and would double-fire - No no-op implementation — Desktop and test environments without a no-op crash; always provide a
NoOpAnalyticsand use it in tests and non-production targets
Related Skills
kmp-mvi— analytics calls go inonIntentafter state updates, not in composableskmp-dependency-injection— platformanalyticsModulewired in platform-specific Koin setupkmp-unit-testing—FakeAnalyticsis the canonical fake; test event names and params, not SDK calls
Output Style
When implementing analytics, respond in this order:
- Event schema — sealed
AnalyticsEventhierarchy for all events in scope - Interface —
AnalyticsincommonMain - Platform impls — Android (Firebase), iOS (FIRAnalytics), Desktop (no-op)
- Koin wiring — platform modules
- ViewModel integration — where
analytics.track(...)is called - Screen tracking —
DisposableEffectin NavHost - FakeAnalytics — for unit tests
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-analytics/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-analytics)