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

- 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-revenue-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-revenue-metrics

## What it does

This skill helps choose a revenue source and turn it into models for MRR, ARR, gross revenue, new sales, expansion, contraction, churn, ARPU and LTV. In PostHog, it works with the managed `revenue_item`, `mrr`, `customer`, `subscription`, `charge` and `product` views and writes HogQL queries. Raw Stripe tables are not the modeling layer.

For an external warehouse, it describes a dbt flow that stages billing data and builds `fct_revenue_item`, `fct_mrr` and `dim_customer` marts with tests. Values in `revenue_item.amount` already use the project base currency; `convertCurrency()` is used when a different target currency is needed.

Event-based revenue does not populate MRR until a subscription property is configured, even when gross revenue is present. Check this before treating an empty MRR result as a query failure. Person- or group-level revenue also needs `posthog_person_distinct_id` metadata on the Stripe customer.

## Requirements
- Works with: Stripe

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

2. **Manually: put the files in place**
- File: `.cursor/skills/modeling-revenue-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-revenue-metrics
```

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-revenue-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-revenue-metrics/SKILL.md

## When to use it
- calculate MRR and ARR from revenue data
- separate new, expansion, contraction and churn revenue
- connect revenue with customers, cohorts and products
- convert amounts to a target currency
- build revenue marts in dbt

## Example prompts
- Build a monthly MRR and ARR model from the `revenue_item` view.
- Report gross revenue by customer and product in the project base currency.
- Check why `mrr` is empty while event-based revenue is populated.

## Similar
- [saas-revenue-growth-metrics](https://affpapa.org/en/nevibecode/skills/saas-revenue-growth-metrics.md) — skill · 2500 installs
- [signals-scout-revenue-analytics](https://affpapa.org/en/nevibecode/skills/signals-scout-revenue-analytics.md) — skill · 313 installs
- [revenuecat-forecasting](https://affpapa.org/en/nevibecode/skills/revenuecat-forecasting.md) — skill · 316 installs
- [revenue-product-segmentation](https://affpapa.org/en/nevibecode/skills/revenue-product-segmentation.md) — skill · 263 installs
- [Maxio MCP](https://affpapa.org/en/nevibecode/mcp/maxio-mcp.md) — MCP server · ★ 87 repo stars
- [saas-metrics](https://affpapa.org/en/nevibecode/skills/saas-metrics.md) — skill · 5100 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
