analytics-setup
Generates protocol-based analytics infrastructure with swappable providers (TelemetryDeck, Firebase, Mixpanel). Use to add tracking, events, or telemetry to iOS/macOS apps.
Introduction
This skill acts as an automated generator for building a modular, protocol-oriented analytics layer within Swift-based Apple platform projects. It is designed for developers, architects, and technical project managers who need to integrate telemetry or event tracking without tightly coupling the application logic to a specific third-party analytics SDK. By utilizing a protocol-based architecture, the skill ensures that business logic remains clean, testable, and capable of swapping analytics providers like TelemetryDeck, Firebase Analytics, or Mixpanel by changing a single line of code.
-
Generates a robust core protocol defined as AnalyticsService to standardize tracking across the entire codebase.
-
Automates the creation of strongly-typed event enums to ensure type safety when recording user interactions, app lifecycle events, screen views, and custom properties.
-
Implements a NoOpAnalytics provider to facilitate safe testing environments and support privacy-friendly workflows without triggering external network calls.
-
Provides setup for dependency injection, including SwiftUI environment keys, to make analytics accessible globally throughout the view hierarchy.
-
Detects existing analytics implementations or conflicting dependencies in package managers like Swift Package Manager or CocoaPods to prevent configuration errors.
-
Facilitates easy migration from legacy tracking systems by providing a clear path to replace or extend existing infrastructure.
-
When invoking, specify the target analytics providers such as Firebase or TelemetryDeck to receive tailored boilerplate code and dependency configuration instructions.
-
Always include context about the app's architectural preferences, such as preferred file locations (e.g., Sources/Analytics/) or specific tracking requirements like user properties and subscription status.
-
The generator produces stable, production-ready Swift code that includes configuration methods, track calls, and reset functionality for logout or privacy-focused cleanup.
-
Input requirements include basic project configuration details; output results in a directory-ready structure with protocol declarations, provider implementation files, and integration guidance for the app delegate or App entry point.
Repository Stats
- Stars
- 287
- Forks
- 22
- Open Issues
- 0
- Language
- Swift
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 1, 2026, 07:41 AM