Omnibus
Skill 113 of 200
Build reusable revenue models — MRR, ARR, gross revenue, new/expansion/contraction/churn, ARPU, LTV, and per-customer/per-account revenue — on either PostHog data-warehouse views…
3 minutes · 639 words · 6 sections
Install
npx skills add PostHog/skills --skill modeling-revenue-metricsnpx skills add PostHog/skills/plugin marketplace add PostHog/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Turn payment/subscription data into durable revenue models. Read modeling-warehouse-foundations first for
the view-vs-dbt decision, the view-* workflow, and convertCurrency(); this skill is the revenue-specific
layer on top. Metric definitions live in
references/revenue-metric-definitions.md (opens in a new tab); copy-paste recipes in
references/posthog/ (opens in a new tab) and references/dbt/ (opens in a new tab).
Revenue reaches PostHog two ways; both feed the same managed revenue views:
setting-up-a-data-warehouse-source.purchase_completed) with a revenue property. Best when
there’s no supported platform or you already track revenue in-product.If neither exists yet, use suggesting-data-imports to recommend a source. In dbt, the equivalent is
staging whichever billing tables landed in the warehouse.
PostHog auto-generates a curated set of views per source. Do not re-derive revenue from raw Stripe tables — the managed views already handle deferred-revenue recognition, currency, and a stable schema.
Each source gets its own views. There is no cross-source view. Names depend on the source type:
<source>.<prefix>.<kind>_revenue_view, for example stripe.prod.mrr_revenue_view. The
<prefix>. part is absent when the source has no prefix.revenue_analytics.events.<event_name>.<kind>_events_revenue_view, where every
non-alphanumeric character in the event name becomes _.<kind> is one of the managed views in the table below. Discover the exact names. Do not search for
revenue_analytics, because it does not match warehouse source views:
SELECT table_name FROM system.information_schema.tables
WHERE position(table_name, 'revenue_view') > 0 ORDER BY table_nameIf this returns nothing, the project has no revenue source configured yet. Check the governed mrr metric
(metric-list) or discover warehouse billing tables, and read their columns before modeling. Do not guess
view names.
| Managed view | Grain | Use for |
|---|---|---|
revenue_item (start here) | 1 / invoice line item | Gross revenue, monthly recurring revenue, revenue by product/customer/period. Implements deferred revenue + currency. |
mrr | 1 / (customer, subscription) | Live snapshot of current MRR — not a time series. |
customer | 1 / customer | dim_customer: email, country, cohort, metadata. |
subscription | 1 / subscription | Subscription state for churn/expansion logic. |
charge | 1 / charge | Raw charges; prefer revenue_item unless you specifically need charges. |
product | 1 / product | Product dimension. |
Key revenue_item columns: amount (already converted to the project base currency), currency (that
base currency), original_amount / original_currency (as charged), is_recurring, customer_id,
subscription_id, product_id, group_0_key…group_4_key (B2B account keys), timestamp.
mrr managed view is a current snapshot, not history (“MRR at the current time”). For MRR over
time, sum recurring amount per month from revenue_item (see the recipe), or materialize a monthly
snapshot of the mrr view on a schedule.amount is already in base currency. Use it directly for reporting. Only call
convertCurrency(original_currency, 'XXX', original_amount, timestamp) when you need a different target
currency, or when working from raw events.posthog_person_distinct_id metadata on the Stripe customer (or the person join). Without it, revenue is
customer-level only.filter_test_accounts behaviour so QA/internal charges don’t inflate
revenue.PostHog: write the HogQL (alias every column), view-create, verify with view-get, then
view-materialize the expensive monthly rollups (a daily sync_frequency is usually right for revenue).
Recipes: references/posthog/ (opens in a new tab) — mrr_and_arr.sql, gross_revenue_by_month.sql,
revenue_by_customer.sql.
dbt: stage the billing source → fct_revenue_item, fct_mrr, dim_customer marts with tests.
Recipes: references/dbt/ (opens in a new tab). Note dbt has no convertCurrency() — supply a rate seed.
Then register the model (references/governance.md in foundations): annotate columns and, if MRR/ARR is a
headline number, propose it to the semantic layer.
| File | Read when |
|---|---|
references/revenue-metric-definitions.md (opens in a new tab) | Precise definitions: MRR, ARR, gross, new/expansion/contraction/churn, ARPU, LTV. |
references/posthog/ (opens in a new tab) | HogQL view recipes on the managed views. |
references/dbt/ (opens in a new tab) | dbt staging + fct_*/dim_* marts + schema.yml tests. |
modeling-warehouse-foundations (mechanics), setting-up-a-data-warehouse-source +
suggesting-data-imports (get Stripe/revenue data in), modeling-dimension-tables (currency/plan
dimensions), querying-posthog-data (HogQL + the semantic-layer metric check).
Build reusable revenue models — MRR, ARR, gross revenue, new/expansion/contraction/churn, ARPU, LTV, and per-customer/per-account revenue — on either PostHog data-warehouse views (HogQL) or an external dbt project. Use when the user wants to model, define, or compute recurring revenue, monthly/annual recurring revenue, churn or retention of revenue, lifetime value, average revenue per user, or revenue by customer, cohort, product, or currency. On PostHog, build on the managed *_revenue_view views (revenue_item, mrr, customer, subscription, charge, product) fed by Stripe or custom revenue events — not raw Stripe tables — and normalize money with convertCurrency(). In dbt, stage the payment source and compute fct_mrr / fct_revenue_item / dim_customer marts with tests. Covers picking the right source, the subscription-config gotcha that leaves MRR empty, currency handling, and linking revenue to persons/groups. Read modeling-warehouse-foundations first for the view-vs-dbt mechanics.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 8 November 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: skills/omnibus/*/SKILL.md, skills/posthog/all/skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by PostHog, declaring 6 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./PostHog/skills.md, and each skill at its own .md URL.9 files · 15 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 113.
Documentation the agent loads on demand, rather than up front.