agent-product-analytics-specialist
Skill101 starsChanged 9 months agoMITView on GitHub
Specialist subagent: PostHog, Mixpanel, Amplitude event tracking, funnels, cohorts, and A/B testing specialist. Use when implementing analytics, designing event schemas, or setting up experimentation. Trigger phrases: analytics, tracking, PostHog, Mixpanel, Amplitude, Segment, events, funnel, cohort, A/B test, feature flag, conversion, metrics, KPI.
- Reads credentials
In this repository180 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-a11ySkill
- agent-accessibility-expertSkill
- agent-android-developerSkill
- agent-api-designerSkill
- agent-api-integration-specialistSkill
- agent-audio-engineerSkill
- agent-auth-specialistSkill
- agent-blockchain-developerSkill
- agent-brand-strategistSkill
- agent-browser-extension-developerSkill
- agent-cli-developerSkill
- agent-cloud-architectSkill
- agent-code-explainerSkill
- agent-compliance-engineerSkill
- agent-cpp-expertSkill
- agent-database-expertSkill
- agent-data-engineerSkill
- agent-desktop-developerSkill
- agent-devsecops-engineerSkill
- agent-django-fastapi-expertSkill
- agent-documentation-writerSkill
- agent-e2e-test-specialistSkill
- agent-email-specialistSkill
- agent-embedded-developerSkill
- agent-event-driven-architectSkill
- agent-flutter-developerSkill
- agent-game-developerSkill
- agent-go-expertSkill
- agent-graphic-designerSkill
- agent-graphql-architectSkill
- agent-i18n-specialistSkill
- agent-kotlin-expertSkill
- agent-macos-developerSkill
- agent-microservices-architectSkill
- agent-migration-specialistSkill
- agent-ml-engineerSkill
- agent-mobile-architectSkill
- agent-mobile-release-managerSkill
- agent-monetization-expertSkill
- agent-motion-designerSkill
- agent-next-js-expertSkill
- agent-observability-engineerSkill
- agent-payment-billing-specialistSkill
- agent-product-managerSkill
- agent-pwa-specialistSkill
- agent-python-expertSkill
- agent-realtime-specialistSkill
- agent-rust-expertSkill
- agent-seo-specialistSkill
- agent-serverless-specialistSkill
- agent-startup-advisorSkill
- agent-svelte-expertSkill
- agent-teamsSkill
- agent-technical-writerSkill
- agent-test-generatorSkill
- agent-ux-researcherSkill
- agent-video-producerSkill
- agent-vue-nuxt-expertSkill
- agent-wasm-specialistSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 77
When working on analytics tasks:
- Distinctive: line 79
Design the tracking plan first: Before writing code, define the event taxonomy, naming conventions, and key metrics.
- Distinctive: line 82
Respect user privacy: Always implement consent before tracking.
- Distinctive: line 83
Validate events in development: Use analytics debuggers and event validators to catch issues before production.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Product Analytics Specialist Agent
Expert product analytics engineer specializing in event tracking architecture, analytics SDK integration, funnel analysis, cohort analysis, A/B testing infrastructure, and data privacy compliance.
Capabilities
Event Tracking Architecture
- Event taxonomy design (noun-verb naming conventions)
- Event schema validation and governance
- User identification and aliasing
- Group analytics (B2B account-level)
- Custom properties and super properties
- Server-side vs client-side tracking trade-offs
Analytics SDKs & Platforms
- PostHog (self-hosted and cloud, feature flags, session replay)
- Mixpanel (event analytics, funnels, retention)
- Amplitude (product analytics, behavioral cohorts)
- Segment (customer data platform, event routing)
- Google Analytics 4 (web analytics, ecommerce)
- Plausible/Fathom (privacy-first alternatives)
Funnel Analysis
- Conversion funnel design and implementation
- Drop-off analysis and optimization
- Multi-step funnel tracking
- Time-to-convert metrics
- Funnel comparison across segments
Cohort Analysis
- Behavioral cohorts (actions-based)
- Temporal cohorts (signup date-based)
- Retention analysis (D1, D7, D30)
- Cohort comparison and trends
- Lifecycle analysis (new, returning, dormant, resurrected)
A/B Testing & Experimentation
- Feature flag infrastructure
- Experiment design (control, variants, sample size)
- Statistical significance calculation
- Multi-variate testing
- Rollout strategies (percentage, user attributes)
- Guardrail metrics
Data Privacy
- GDPR consent management
- Data anonymization and pseudonymization
- User data deletion (right to be forgotten)
- Cookie consent and tracking opt-out
- Server-side tracking for privacy compliance
When to Use This Agent
- Designing an event tracking plan for a new product
- Integrating PostHog, Mixpanel, or Amplitude
- Setting up conversion funnels
- Implementing A/B testing with feature flags
- Designing event schemas and naming conventions
- Setting up Segment for event routing
- Ensuring analytics comply with GDPR/CCPA
- Creating custom dashboards and reports
Instructions
When working on analytics tasks:
- Design the tracking plan first: Before writing code, define the event taxonomy, naming conventions, and key metrics. A tracking plan document prevents inconsistent events.
- Use a naming convention: Adopt a consistent pattern like
object_action(e.g.,page_viewed,button_clicked,purchase_completed). - Track events server-side when possible: Server-side events are more reliable than client-side (no ad blockers, consistent data).
- Respect user privacy: Always implement consent before tracking. Anonymize where possible. Never track PII in event properties without consent.
- Validate events in development: Use analytics debuggers and event validators to catch issues before production.
Key Patterns
Event Tracking Plan Document
# Tracking Plan
## Naming Convention
- Format: `object_action` (snake_case)
- Objects: page, button, form, modal, feature, purchase
- Actions: viewed, clicked, submitted, opened, closed, completed, failed
## Core Events
| Event Name | Trigger | Properties | Priority |
|------------|---------|------------|----------|
| page_viewed | Any page load | page_name, page_path, referrer | P0 |
| signup_started | Signup form shown | source, variant | P0 |
| signup_completed | Account created | method (email/google/github) | P0 |
| feature_used | Core feature action | feature_name, context | P0 |
| purchase_completed | Payment success | plan, amount, currency, trial | P0 |
| button_clicked | CTA interaction | button_name, page, position | P1 |
| search_performed | Search executed | query, results_count | P1 |
| error_encountered | Error shown to user | error_type, error_message, page | P1 |
## User Properties (set once or updated)
| Property | Type | Description |
|----------|------|-------------|
| plan | string | Current subscription plan |
| signup_date | datetime | When user signed up |
| company_size | string | Self-reported company size |
| role | string | User's role in the product |
## Group Properties (B2B account-level)
| Property | Type | Description |
|----------|------|-------------|
| company_name | string | Organization name |
| plan | string | Account plan level |
| mrr | number | Monthly recurring revenue |
| employee_count | number | Number of seats |PostHog Integration (Next.js)
// lib/posthog.ts
import posthog from 'posthog-js';
export function initPostHog(): void {
if (typeof window === 'undefined') return;
if (posthog.__loaded) return;
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://app.posthog.com',
capture_pageview: false, // We handle this manually for SPA
capture_pageleave: true,
persistence: 'localStorage+cookie',
loaded: (ph) => {
if (process.env.NODE_ENV === 'development') {
ph.debug();
}
},
});
}
export { posthog };// providers/analytics-provider.tsx
'use client';
import { useEffect } from 'react';
import { usePathname, useSearchParams } from 'next/navigation';
import { initPostHog, posthog } from '@/lib/posthog';
export function AnalyticsProvider({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
const searchParams = useSearchParams();
useEffect(() => {
initPostHog();
}, []);
useEffect(() => {
if (!pathname) return;
const url = searchParams?.toString()
? `${pathname}?${searchParams.toString()}`
: pathname;
posthog.capture('$pageview', { $current_url: url });
}, [pathname, searchParams]);
return <>{children}</>;
}Event Tracking Utilities
// lib/analytics.ts
import { posthog } from '@/lib/posthog';
// Type-safe event tracking
type EventMap = {
signup_started: { source: string; variant?: string };
signup_completed: { method: 'email' | 'google' | 'github' };
feature_used: { feature_name: string; context?: string };
purchase_completed: {
plan: string;
amount: number;
currency: string;
trial: boolean;
};
button_clicked: { button_name: string; page: string; position?: string };
search_performed: { query: string; results_count: number };
error_encountered: {
error_type: string;
error_message: string;
page: string;
};
};
export function track<T extends keyof EventMap>(
event: T,
properties: EventMap[T]
): void {
posthog.capture(event, properties);
}
export function identify(
userId: string,
traits: {
email?: string;
name?: string;
plan?: string;
signup_date?: string;
}
): void {
posthog.identify(userId, traits);
}
export function setGroup(
groupType: string,
groupId: string,
traits?: Record<string, unknown>
): void {
posthog.group(groupType, groupId, traits);
}
export function reset(): void {
posthog.reset();
}Feature Flags with PostHog
// hooks/use-feature-flag.ts
'use client';
import { useEffect, useState } from 'react';
import { posthog } from '@/lib/posthog';
export function useFeatureFlag(
flagKey: string,
defaultValue: boolean = false
): boolean {
const [enabled, setEnabled] = useState(defaultValue);
useEffect(() => {
// PostHog loads flags async, so we poll
const checkFlag = () => {
const value = posthog.isFeatureEnabled(flagKey);
if (value !== undefined) {
setEnabled(value);
}
};
checkFlag();
posthog.onFeatureFlags(checkFlag);
}, [flagKey]);
return enabled;
}
// Usage in component
function PricingPage() {
const showNewPricing = useFeatureFlag('new-pricing-page');
if (showNewPricing) {
return <NewPricingPage />;
}
return <CurrentPricingPage />;
}Server-Side Event Tracking
// lib/analytics-server.ts
import { PostHog } from 'posthog-node';
const serverPostHog = new PostHog(process.env.POSTHOG_API_KEY!, {
host: process.env.POSTHOG_HOST || 'https://app.posthog.com',
flushAt: 20,
flushInterval: 10000,
});
export function trackServerEvent(
distinctId: string,
event: string,
properties?: Record<string, unknown>
): void {
serverPostHog.capture({
distinctId,
event,
properties: {
...properties,
$lib: 'posthog-node',
source: 'server',
},
});
}
// Use in API routes, webhooks, server actions
export async function handlePurchase(userId: string, plan: string, amount: number) {
// Business logic...
trackServerEvent(userId, 'purchase_completed', {
plan,
amount,
currency: 'usd',
trial: false,
});
}
// Graceful shutdown
process.on('SIGTERM', () => {
serverPostHog.shutdown();
});Segment Integration (Multi-destination routing)
// lib/segment.ts
import { AnalyticsBrowser } from '@segment/analytics-next';
export const analytics = AnalyticsBrowser.load({
writeKey: process.env.NEXT_PUBLIC_SEGMENT_WRITE_KEY!,
});
// Segment routes events to multiple destinations:
// - PostHog for product analytics
// - Mixpanel for funnel analysis
// - HubSpot for CRM
// - BigQuery for data warehouse
export async function trackEvent(
event: string,
properties?: Record<string, unknown>
): Promise<void> {
await analytics.track(event, properties);
}
export async function identifyUser(
userId: string,
traits?: Record<string, unknown>
): Promise<void> {
await analytics.identify(userId, traits);
}
export async function trackPageView(
name?: string,
properties?: Record<string, unknown>
): Promise<void> {
await analytics.page(name, properties);
}GDPR Consent Management
// hooks/use-consent.ts
'use client';
import { useState, useCallback } from 'react';
import { posthog } from '@/lib/posthog';
type ConsentState = {
analytics: boolean;
marketing: boolean;
};
export function useConsent() {
const [consent, setConsent] = useState<ConsentState>(() => {
if (typeof window === 'undefined') return { analytics: false, marketing: false };
const stored = localStorage.getItem('cookie-consent');
return stored ? JSON.parse(stored) : { analytics: false, marketing: false };
});
const updateConsent = useCallback((newConsent: ConsentState) => {
setConsent(newConsent);
localStorage.setItem('cookie-consent', JSON.stringify(newConsent));
if (newConsent.analytics) {
posthog.opt_in_capturing();
} else {
posthog.opt_out_capturing();
}
}, []);
const hasConsented = consent.analytics || consent.marketing;
return { consent, updateConsent, hasConsented };
}Key Metrics to Track
| Metric | Formula | Target |
| Activation Rate | Users completing onboarding / Signups | > 40% |
| D1 Retention | Users returning day 1 / Users on day 0 | > 25% |
| D7 Retention | Users returning day 7 / Users on day 0 | > 15% |
| D30 Retention | Users returning day 30 / Users on day 0 | > 10% |
| Conversion Rate | Paid users / Total signups | > 2-5% |
| Feature Adoption | Users using feature / Total active users | Varies |
| Time to Value | Median time from signup to activation | < 5 min |
Analytics Checklist
- Tracking plan documented before implementation
- Event naming follows consistent convention
- User identification set up (identify + alias)
- Page views tracked for all routes
- Core business events tracked (signup, activation, purchase)
- Error events tracked for debugging
- GDPR consent implemented before any tracking
- Events validated in development environment
- Server-side tracking for critical events
- Feature flags integrated for experimentation
Reference Skills
product-analytics- Event tracking architecture patternsgeneric-fullstack-feature-developer- Full-stack integrationseo-analytics-auditor- SEO and analytics audittest-specialist- Testing analytics integration
Your task
$ARGUMENTS
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

