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
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a claude-codeWhat 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_stickinessmarts within an external dbt setup
Example prompts for the agent
- Generate a weekly cohort retention query in HogQL for the
workspace_createdevent - 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-code2Manually: put the files in place
~/.claude/skills/modeling-product-usage-metrics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/modeling-product-usage-metrics/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a codex2Manually: put the files in place
.agents/skills/modeling-product-usage-metrics/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a cursor2Manually: put the files in place
.cursor/skills/modeling-product-usage-metrics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install PostHog/ai-plugin skills/modeling-product-usage-metrics2Manually: put the files in place
.github/skills/modeling-product-usage-metrics/SKILL.md1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a gemini-cli2Platform CLI
gemini skills install https://github.com/PostHog/ai-plugin --path skills/modeling-product-usage-metricsManually: put the files in place
.devin/skills/modeling-product-usage-metrics/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.