# modeling-product-usage-metrics

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

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 175 installs · ★ 101 repo stars
- Author: PostHog
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/modeling-product-usage-metrics/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/modeling-product-usage-metrics

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/modeling-product-usage-metrics/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/modeling-product-usage-metrics/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/modeling-product-usage-metrics/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/modeling-product-usage-metrics/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/ai-plugin skills/modeling-product-usage-metrics
```

2. **Manually: put the files in place**
- File: `.github/skills/modeling-product-usage-metrics/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/ai-plugin --path skills/modeling-product-usage-metrics
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/modeling-product-usage-metrics/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-product-usage-metrics -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/modeling-product-usage-metrics/SKILL.md

## When to use it
- 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
- 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

## Similar
- [querying-posthog-data](https://affpapa.org/en/nevibecode/skills/querying-posthog-data.md) — skill · 890 installs
- [signals-scout-replay-vision](https://affpapa.org/en/nevibecode/skills/signals-scout-replay-vision.md) — skill · 316 installs
- [seo-posthog](https://affpapa.org/en/nevibecode/skills/seo-posthog.md) — skill · 141 installs
- [posthog-webhooks-events](https://affpapa.org/en/nevibecode/skills/posthog-webhooks-events.md) — skill · 1 install
- [posthog](https://affpapa.org/en/nevibecode/skills/posthog.md) — skill · ★ 8052 repo stars
- [dbt-transformation-patterns](https://affpapa.org/en/nevibecode/skills/dbt-transformation-patterns.md) — skill · 11000 installs

From the same set: [posthog/ai-plugin](https://affpapa.org/en/nevibecode/by/posthog/ai-plugin.md) — 82 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
