/analytics

An event plan with metric contracts, plus error tracking and health checks wired in.

Grow·Events → Measures·MIT
$npx skills add tushaarmehtaa/tushar-skills --skill analytics -g -a claude-code -y

Then type /analytics in Claude Code, or describe the task and let it pick the skill.

What you get back recorded run · 10 Oct 2026

claude · tallyroom

Using /analytics
  • Query strings scrubbed
  • Local dev not counted
  • Tracing off to keep costs down
Pricing visits, plan clicks and app errors are wired up for launch.
Claude Code 2.1.295·2m 20s·9 files changed
  • PostHog and Sentry are set up and the production build passes, but nothing has reached either service yet. The values in .env.local are marked as fake fixture values, so no real events or errors were sent and I haven't confirmed anything in the PostHog or Sentry dashboards.
  • Plan clicks: a new plan_selected event with a plan property (plus or household), sent from the two "Choose" buttons.
  • Funnel: in PostHog, build a funnel of page view on /pricing → plan_selected, counting unique users.
  • Set up a Sentry alert rule (email or Slack) for new issues. Errors are only collected, not sent to you, until you do.
CaveatRan with test keys; no event or error reached a real PostHog or Sentry project.

Input → output from the run

app/pricing/CheckoutButton.jsx before
"use client";
import { checkoutUrl } from "../../lib/checkout";

export default function CheckoutButton({ plan, children }) {
  return (
    <a className="mini-btn" href={checkoutUrl(plan)}>
      {children}
    </a>
  );
}
app/pricing/CheckoutButton.jsx after
"use client";
import { checkoutUrl } from "../../lib/checkout";
import { trackPlanSelected } from "../../lib/analytics";

export default function CheckoutButton({ plan, children }) {
  return (
    <a className="mini-btn" href={checkoutUrl(plan)} onClick={() => trackPlanSelected(plan)}>
      {children}
    </a>
  );
}

When to use it

Use when

Use when designing events, consent-aware tracking, error monitoring, health checks or dashboards.

Skip it when

Skip it for A/B tests and staged rollouts; product-experiments owns assignment and exposure.

The thinking behind it

You can't improve what you don't measure. Define the events that matter, wire them correctly, and decisions start from real numbers.

Output contract from the skill's Output section

Report:

  • questions the system now answers and the event/monitoring plan;
  • metric contracts for activation, retention, or other implemented measures;
  • providers reused, added, or deliberately omitted;
  • files and environment-variable names changed;
  • dashboard routes/components, aggregate queries, access policy, freshness, and rendered states when applicable;
  • privacy, consent, identity, sampling, and retention decisions;
  • verification performed with event IDs or observed responses;
  • dashboard, DNS, token, alerting, and production checks still required.

How it checks its own work from the instructions

  • Event names and properties confirmed in the provider
  • Logout reset never merges the wrong people
  • Test errors are redacted, tagged, and source-mapped
  • Anything needing production credentials is reported as manual setup

Requirements what it needs

Works in
Codex, Claude Code, Cursor
Needs
project files, terminal commands, network access

The instructions SKILL.md · 54 lines

Instructions & references

Back to overview ↑
On this page 4 sections
SKILL.md · MIT

Analytics

Build the smallest measurement system that answers explicit product or operational questions. Preserve existing providers and schemas unless a migration is part of the request.

Workflow

  1. Inspect the framework, router/runtime, deployment target, auth model, existing analytics and monitoring packages, environment-variable examples, privacy controls, and current event calls.
  2. Define the decisions the data must support: acquisition, activation, retention, adoption, revenue, reliability, or incident response. For every metric, record its unit, eligible population and exclusions, numerator/event, denominator, cohort anchor where relevant, observation window, maturity/censoring rule, timezone, owner, and decision threshold. Record event names, required properties, identity rules, retention needs, and sensitive fields to exclude.
  3. Separate four concerns before choosing tools:
    • traffic analytics;
    • product analytics and experimentation;
    • errors, traces, and logs;
    • liveness, readiness, and business reporting.
  4. Reuse an installed provider. If none exists, recommend the minimum stack and explain the tradeoff. Ask only for unresolved choices that materially affect implementation, such as consent requirements, data residency, provider preference, or whether a database dependency belongs in readiness checks. Never ask the user to paste secrets into chat; scaffold names in .env.example and let the user set values in the deployment environment.
  5. Create or update a measurement plan before adding calls. Use stable event names, typed properties, server-side capture for authoritative outcomes, and a documented anonymous-to-authenticated identity transition.
  6. Implement only the selected paths:
    • Read PostHog before changing PostHog browser/server setup, identity, page views, or events.
    • Read Sentry before changing Sentry initialization, boundaries, logging, replay, tracing, or source maps.
    • Read health endpoints before adding liveness/readiness routes or uptime monitoring.
  7. When an internal dashboard is requested, implement it as an authenticated product surface, not a public health endpoint. Use server-owned aggregate queries; define freshness and caching; reconcile each tile to its metric contract; enforce role/tenant access; suppress or coarsen small sensitive groups; and cover loading, empty, stale, partial, and error states. Keep operational status separate from product metrics even when they share a page.
  8. Apply privacy controls before capture: minimize properties, exclude credentials/payment data/content by default, avoid URLs or query strings that contain personal data, honor applicable consent/opt-out rules, and review replay masking and log scrubbing.
  9. Preserve secrets and deployment boundaries. Public ingestion tokens may be exposed only when the provider defines them as public; source-map tokens, service-role keys, and personal API keys stay server-side and out of logs and git.

Verification

Verify only systems actually implemented:

  • Trigger a known page view and typed product event; confirm exact names/properties in the provider.
  • Test anonymous activity, sign-in identification, account switching, and logout reset without merging the wrong people.
  • Trigger a controlled client and server error; record event IDs, verify redaction, environment/release tags, and resolved source maps, then remove the test path.
  • Test liveness independently from dependencies. Test readiness with a forced dependency failure, a short timeout, and the expected non-2xx response.
  • For dashboards, test authorization and tenant boundaries, reconcile aggregate queries to source fixtures, verify timezone/window/maturity behavior, and render loading, empty, stale, partial, error, and populated states.
  • Run the project’s lint/type/test/build commands and test in the target runtime when serverless or edge behavior matters.
  • Record anything that requires dashboard access or production credentials as manual setup, not as verified.

Output

Report:

  • questions the system now answers and the event/monitoring plan;
  • metric contracts for activation, retention, or other implemented measures;
  • providers reused, added, or deliberately omitted;
  • files and environment-variable names changed;
  • dashboard routes/components, aggregate queries, access policy, freshness, and rendered states when applicable;
  • privacy, consent, identity, sampling, and retention decisions;
  • verification performed with event IDs or observed responses;
  • dashboard, DNS, token, alerting, and production checks still required.
View on GitHub ↗
Claude app, ChatGPT and ZIP download

local coding agent required

This skill requires project files, terminal commands, and network access. Uploading it to a chat app does not provide equivalent execution.

ChatGPT Skills

This workflow needs a local coding environment or capabilities that a chat-only Skills upload does not provide.

Package details
Package
analytics/SKILL.md
Author
@tushaarmehtaa
Added
7 Mar 2026
Tags
analyticsposthoggoogle-analyticssentryhealth-checkdashboard