modeling-revenue-metrics
できること
このスキルは、請求データや収益イベントから、月次経常収益(MRR)、ARR、解約、生涯価値などの経常的および総収益の指標をモデル化します。信頼できる収益の数字がほしい財務やグロースのチーム向けです。
使う場面
- ✓請求データから、月次または年次の経常収益を計算したいとき。
- ✓顧客ごとに、収益の解約、拡大、生涯価値を見たいとき。
- ✓PostHogの管理された収益ビューから得られる収益の数字がほしいとき。
スキルのリンク
https://github.com/PostHog/posthog/blob/master/products/data_modeling/skills/modeling-revenue-metrics/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Stripeのデータから、直近6か月の月次経常収益と解約率を計算してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、接続された請求プラットフォーム向けにPostHogの管理された収益ビューを使います。対応するプラットフォームがなければ、カスタムの収益イベントを使います。その後、選んだ指標を計算し、再利用できるモデルとして保存します。数字を一貫させるためです。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Modeling revenue metrics
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; copy-paste recipes in
references/posthog/ and references/dbt/.
Step 1 — find where revenue lives
Revenue reaches PostHog two ways; both feed the same managed revenue views:
- A payment platform as a warehouse source — Stripe today (Chargebee/Polar/RevenueCat coming). Best when
the business runs on a billing platform. Connect via
setting-up-a-data-warehouse-source. - Custom revenue events — you send events (e.g.
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.
Step 2 — model on the managed views, not raw tables
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:
- Warehouse source:
<source>.<prefix>.<kind>_revenue_view, for examplestripe.prod.mrr_revenue_view. The<prefix>.part is absent when the source has no prefix. - Custom revenue events:
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_name
If 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.
Rules before you model (revenue gotchas)
- MRR is empty without a subscription config. For event-based revenue, MRR only populates when a subscription property is configured. Empty MRR + populated gross revenue is expected behaviour, not a bug — say so instead of "fixing" it.
- **The
mrrmanag
よくある質問
Stripeが必要ですか?
現在、Stripeが請求データのソースとしてサポートされています。対応するプラットフォームがない場合は、収益をカスタムイベントとして送ることができます。
生の請求テーブルから収益を計算すべきですか?
いいえ。管理された収益ビューが収益の認識と通貨を処理するため、このスキルはそれを使います。
どの収益の指標を計算できますか?
MRRやARRなどの経常収益、新規、拡大、解約による収益、ユーザーあたりの平均収益、生涯価値を扱います。
詳細
作者による元の説明
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 event
repo: PostHog/posthog
人気
- GitHubのスター
- 41k
- ランキング
- #6852
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。