agentleFS
vndeevndee/engineering-skills/.claude/skills/analytics/SKILL.md

analytics

Skill3 starsChanged 8 months agoMITView on GitHub

Use when implementing product analytics, event tracking, user metrics, funnels, or A/B testing in Go, Python, or React applications

41 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use popups, co-marketing and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CesarjoquinSkill

    popups

    When the user wants to create or optimize popups, modals, overlays, slide-ins, or banners for conversion purposes. Also use when the user mentions "exit intent," "popup conversions," "modal optimization," "lead capture popup," "email popup," "announcement banner," "overlay," "collect emails with a popup," "exit popup," "scroll trigger," "sticky bar," or "notification bar." Use this for any overlay or interrupt-style conversion element. For forms outside of popups, see cro. For general page conversion optimization, see cro.

    Also in 15 projects that use this

  • CesarjoquinSkill

    co-marketing

    When the user wants to find co-marketing partners, plan joint campaigns, or brainstorm partnership opportunities. Use when the user says 'co-marketing,' 'partner marketing,' 'joint campaign,' 'who should we partner with,' 'integration marketing,' 'cross-promotion,' 'collaborate with another company,' 'partnership ideas,' or 'co-brand.' For customer referral programs, see referrals. For launch-specific partnerships, see launch.

    Also in 14 projects that use this

  • coreyhaines31Skill

    marketing-council

    When the user wants multiple expert perspectives on a marketing question — a simulated board of advisors staffed by legendary marketers (Seth Godin, David Ogilvy, Eugene Schwartz, April Dunford, Rory Sutherland, Alex Hormozi, Byron Sharp, and more). Also use when the user mentions 'marketing council,' 'board of advisors,' 'advisory board,' 'what would Seth Godin say,' 'what would Ogilvy think,' 'channel Hormozi,' 'get multiple perspectives,' 'debate this,' 'have the council review,' 'marketing mentors,' or asks how a famous marketer would approach their problem. The council gives each advisor's take through their documented frameworks, surfaces where they disagree, and synthesizes a recommendation. For executing the winning direction, hand off to positioning, offers, copywriting, ads, or the relevant skill.

    Also in 8 projects that use this

  • ukunal91appSkill

    community-marketing

    Build and leverage online communities to drive product growth and brand loyalty. Use when the user wants to create a community strategy, grow a Discord or Slack community, manage a forum or subreddit, build brand advocates, increase word-of-mouth, drive community-led growth, engage users post-signup, or turn customers into evangelists. Trigger phrases: "build a community," "community strategy," "Discord community," "Slack community," "community-led growth," "brand advocates," "user community," "forum strategy," "community engagement," "grow our community," "ambassador program," "community flywheel.

    Also in 16 projects that use this

  • ScaleBrickSkill

    competitors

    Audit competitors using ScaleBrick's 3-surface framework (social, web/pages, SEO). Categorizes their pricing, features, and landing pages. Identifies gaps you can exploit, positioning angles no one is claiming, and specific moves you can make this week.

    Also in 14 projects that use this

  • roerohanSkill

    emails

    When the user wants to create or optimize an email sequence, drip campaign, automated email flow, or lifecycle email program. Also use when the user mentions "email sequence," "drip campaign," "nurture sequence," "onboarding emails," "welcome sequence," "re-engagement emails," "email automation," "lifecycle emails," "trigger-based emails," "email funnel," "email workflow," "what emails should I send," "welcome series," or "email cadence." Use this for any multi-email automated flow. For cold outreach emails, see cold-email. For in-app onboarding, see onboarding.

    Also in 13 projects that use this

  • +6 more from Cesarjoquin

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 37 edited versions we read keep these.

  • 1

    Distinctive

    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
  1. Distinctive:

    Core principle: If you can't measure it, you can't improve it.

    line 12

“Common” is measured: kept by at least 6 in 10 of the 37 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Product Analytics

Overview

Instrument your product to understand user behavior. Track what matters, ignore vanity metrics.

Core principle: If you can't measure it, you can't improve it. But tracking everything is as bad as tracking nothing — be intentional.

When to Use

  • Launching a new product or feature
  • Need to understand user behavior
  • Setting up conversion funnels
  • Implementing A/B tests
  • Defining success metrics for a product spec

Event Taxonomy

Naming Convention

[object]_[action] — past tense, snake_case

Examples:
  user_signed_up
  post_created
  payment_completed
  invitation_sent
  feature_activated

Event Structure

interface AnalyticsEvent {
  event: string           // "user_signed_up"
  user_id?: string        // authenticated user
  anonymous_id?: string   // pre-auth (cookie/device)
  timestamp: string       // ISO 8601
  properties: {
    // Event-specific data
    [key: string]: any
  }
  context: {
    page_url?: string
    referrer?: string
    utm_source?: string
    utm_medium?: string
    utm_campaign?: string
    device_type?: string  // mobile, desktop, tablet
    app_version?: string
  }
}

Event Categories

CategoryEventsWhy
Acquisitionpage_viewed, signup_started, user_signed_upWhere do users come from?
Activationonboarding_completed, first_action_taken, feature_activatedDo users get value?
Engagementsession_started, feature_used, content_createdAre users active?
Retentionuser_returned (daily/weekly), subscription_renewedDo users come back?
Revenuepayment_completed, plan_upgraded, plan_downgradedDo users pay?
Referralinvitation_sent, invitation_accepted, share_clickedDo users invite others?

Implementation

React (Frontend Tracking)

// src/shared/analytics.ts
type EventProperties = Record<string, string | number | boolean>

class Analytics {
  private provider: AnalyticsProvider // PostHog, Mixpanel, or custom

  track(event: string, properties?: EventProperties): void {
    this.provider.track(event, {
      ...properties,
      page_url: window.location.href,
      timestamp: new Date().toISOString(),
    })
  }

  identify(userId: string, traits?: Record<string, any>): void {
    this.provider.identify(userId, traits)
  }

  page(name?: string): void {
    this.provider.page(name)
  }
}

export const analytics = new Analytics(provider)

Usage in components:

function SignupForm() {
  const handleSubmit = async (data: SignupData) => {
    analytics.track('signup_started', { method: 'email' })
    try {
      await signup(data)
      analytics.track('user_signed_up', { method: 'email', plan: 'free' })
      analytics.identify(user.id, { email: user.email, plan: 'free' })
    } catch (err) {
      analytics.track('signup_failed', { error: err.message })
    }
  }
}

Track page views:

// In router
useEffect(() => {
  analytics.page()
}, [location.pathname])

Go (Backend Tracking)

type AnalyticsService struct {
    client AnalyticsClient // PostHog, Segment, or custom
}

func (s *AnalyticsService) Track(ctx context.Context, userID uuid.UUID, event string, properties map[string]any) {
    if err := s.client.Enqueue(analytics.Track{
        UserId:     userID.String(),
        Event:      event,
        Properties: properties,
        Timestamp:  time.Now(),
    }); err != nil {
        slog.Error("analytics track failed", "event", event, "error", err)
    }
}

// Usage in use case
func (uc *CreateUserUseCase) Execute(ctx context.Context, input CreateUserInput) (*User, error) {
    user, err := uc.repo.Create(ctx, input)
    if err != nil {
        return nil, err
    }
    uc.analytics.Track(ctx, user.ID, "user_signed_up", map[string]any{
        "method": input.SignupMethod,
        "plan":   "free",
    })
    return user, nil
}

Python (Backend Tracking)

class AnalyticsService:
    def __init__(self, client: AnalyticsClient) -> None:
        self._client = client

    def track(self, user_id: UUID, event: str, properties: dict[str, Any] | None = None) -> None:
        try:
            self._client.track(
                user_id=str(user_id),
                event=event,
                properties=properties or {},
                timestamp=datetime.utcnow(),
            )
        except Exception as e:
            logger.error("analytics_track_failed", event=event, error=str(e))

Key Metrics Framework

For Every Product

MetricDefinitionHow to Measure
DAU/MAUDaily/Monthly active usersUnique users with session_started per day/month
Activation rate% of signups who complete key actionusers with first_action_taken / user_signed_up
Retention (D1/D7/D30)% of users returning after N daysUsers active on day N / users who signed up N days ago
Churn rate% of users who stop usingUsers inactive for 30 days / total active users
Conversion rate% of users who paypayment_completed / user_signed_up
ARPUAverage revenue per userTotal revenue / active users

Funnel Analysis

Page View → Signup Started → Signup Completed → Onboarding → First Value Action → Paid
  1000         200 (20%)        150 (75%)        100 (67%)     60 (60%)          15 (25%)

Track drop-off at each step. The biggest drop-off is your biggest opportunity.

A/B Testing

// Simple feature flag approach
function useFeatureFlag(flag: string): boolean {
  const user = useCurrentUser()
  // Hash user ID to get deterministic assignment
  const hash = hashCode(`${flag}:${user.id}`) % 100
  return hash < 50 // 50/50 split
}

// Usage
function PricingPage() {
  const showNewPricing = useFeatureFlag('new-pricing-v2')
  analytics.track('pricing_page_viewed', { variant: showNewPricing ? 'new' : 'control' })
  return showNewPricing ? <NewPricing /> : <OldPricing />
}

Rules

  • Track actions, not page views (page views are supplementary)
  • Track on the backend for critical events (payment, signup — can't be blocked by ad blockers)
  • Track on the frontend for UX events (clicks, form interactions, page navigation)
  • Never track PII in properties (no emails, names, IPs in event properties)
  • Keep event names stable — changing names breaks dashboards and funnels
  • Document every event — maintain an event catalog

Chains

  • Defined in: product-spec (success metrics)
  • Instrumented during: go-feature / py-feature / react-feature

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.