Skip to main content
skill CX Codex

modeling-product-usage-metrics — Claude Code skill: setup guide

modeling-product-usage-metrics builds retention, frequency, and lifecycle models using PostHog HogQL views or dbt data marts with built-in tests.

no license 175 installs ★ 101 updated 2026-10-24

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a claude-code
Open on GitHub

What modeling-product-usage-metrics does

This skill guides metrics modeling across retention, user stickiness, and customer lifecycle. It structures calculations around three required inputs: a specific value-bearing action, an analysis timeframe such as daily or weekly intervals, and an aggregation level per person or group.

For PostHog setups, it generates HogQL views that mirror standard analytics queries. Teams running dbt receive structured marts like fct_retention, fct_stickiness, and fct_lifecycle accompanied by data tests. The documentation advises reviewing modeling-warehouse-foundations before running these templates.

Event names originating from client telemetry are treated as untrusted strings. You must verify chosen events and quote them properly before executing a persistent view-create step.

What it helps with

  • build user cohort retention tables across chosen time intervals
  • measure interaction frequency and calculate DAU to MAU ratios
  • segment active accounts into new, resurrecting, and churned buckets
  • set up tested fct_stickiness marts within an external dbt setup

Example prompts for the agent

  • Generate a weekly cohort retention query in HogQL for the workspace_created event
  • Build dbt mart models for user lifecycle stages with standard tests
  • Calculate stickiness distribution across monthly activity windows

How to install modeling-product-usage-metrics

1Skills CLI (Vercel)

npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a claude-code

2Manually: put the files in place

~/.claude/skills/modeling-product-usage-metrics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/modeling-product-usage-metrics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about modeling-product-usage-metrics

How to install modeling-product-usage-metrics in Claude Code?

Run npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a claude-code.

What does modeling-product-usage-metrics do?

It provides SQL blueprints for computing retention matrices, stickiness ratios, and user lifecycle states in HogQL or dbt.

What inputs are needed before creating metrics?

You must define an action reflecting actual product value, choose an interval cadence, and pick whether metrics aggregate by individual person or company group.

Similar skills

All skills for Data and databases →

From the same set82

The whole set →
modeling-activation-metrics modeling-activation-metrics builds an activation model: a per-user or per-account activated flag plus an activation-rate metric. Useful while the “aha moment” is still a guess. CX Codex +1 178installs modeling-conversion-metrics modeling-conversion-metrics builds a reusable conversion model: funnel steps, a conversion window, drop-off and time to convert. Works on PostHog warehouse views in HogQL or in a dbt project. CX Codex +1 178installs writing-streamlit-apps The writing-streamlit-apps skill guides Python code for Streamlit apps that read PostHog data inside a sandbox. Use it when building or debugging dashboards with tables and charts. CX Codex +1 177installs modeling-revenue-metrics modeling-revenue-metrics builds reusable revenue models for MRR, ARR, churn, ARPU and LTV from PostHog views or dbt. Use it for revenue analysis by customer, product or period. CX Codex +1 175installs modeling-dimension-tables modeling-dimension-tables builds star-schema dimension tables in PostHog HogQL views or dbt projects so you avoid repetitive joins across your metrics. CX Codex +1 174installs modeling-warehouse-foundations modeling-warehouse-foundations sets core guidelines for building PostHog data models via native HogQL views or an external dbt setup. CX Codex +1 172installs instrument-metrics The instrument-metrics Claude Code skill adds PostHog metric capture to a codebase. It runs after feature work or PR review, and when a request calls for counters or other metrics. CX Codex +1 154installs debugging-experiments debugging-experiments — a Claude Code skill for investigating PostHog experiment results. It checks uneven or missing exposures against the experiment’s data and known causes. CX Codex +1 150installs

Project sponsors

Companies that keep this analytics open