product-analytics-audit
Audit product growth, funnel, retention, and monetization metrics from analytics APIs such as PostHog and RevenueCat without exposing secrets. Use for DAU/MAU and growth readouts, retention cohorts, funnel drop-off diagnosis, HogQL queries, RevenueCat entitlement checks, attribution gaps, or "how is my app doing" analytics questions.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 13
- Forks
- 4
01 前言 Front Matter
- name
- product-analytics-audit
- description
- Audit product growth, funnel, retention, and monetization metrics from analytics APIs such as PostHog and RevenueCat without exposing secrets. Use for DAU/MAU and growth readouts, retention cohorts, funnel drop-off diagnosis, HogQL queries, RevenueCat entitlement checks, attribution gaps, or "how is my app doing" analytics questions.
02 资源文件 2
03 SKILL.md 正文
Product Analytics Audit
Use this skill when the user asks to analyze how an app/product is doing: DAU/MAU, growth, retention, drop-offs, funnel conversion, attribution, subscriptions, purchases, or monetization using analytics tools and business APIs.
Principles
- Never print secret values. If reading
.env, list variable names and load values into process env only. - Prefer complete days. Current-day data is often partial; label it as partial or exclude from trend calculations.
- Separate instrumentation health from product health. Broken identity merges, missing purchase events, or disconnected billing can make funnels look worse/different than reality.
- Use raw counts + interpretation. Provide crisp metrics first, then explain the likely product/business meaning.
- Save raw API outputs to
/tmp/...jsonfor local summarization, not to user-visible chat, unless requested.
Workflow
-
Discover credentials safely
- Locate the project's env file (
.env/.env.local) or shared credential store. - Parse variable names matching likely services/app names, but never print values.
- Common patterns:
YOUR_APP_POSTHOG_PERSONAL_API_KEY,YOUR_APP_POSTHOG_PROJECT_ID,YOUR_APP_POSTHOG_HOST,YOUR_APP_REVENUECAT_V2_SECRET_KEY.
- Locate the project's env file (
-
Query PostHog via HogQL
- Endpoint:
POST {POSTHOG_HOST}/api/projects/{PROJECT_ID}/query/ - Header:
Authorization: Bearer {personal_api_key} - Payload shape:
{"query":{"kind":"HogQLQuery","query":"SELECT ..."}} - Core queries:
- DAU for last 60 days: group by
toDate(timestamp), count distinctperson_id. - MAU for last 12 months: group by
toStartOfMonth(timestamp). - Top events for last 7/30 days: event count and distinct users.
- Last-seen distribution: bucket users by max timestamp.
- Retention cohorts: cohort by first event week and active week age.
- Entry/exit events:
argMin(event, timestamp)/argMax(event, timestamp)perperson_id. - Funnel candidate events: exclude
$%system events and sort by distinct users. - Monetization event search: event names containing purchase/subscription/revenue/checkout/payment/trial/pro/ultra.
- DAU for last 60 days: group by
- Endpoint:
-
Query RevenueCat v2
- Endpoint root:
https://api.revenuecat.com/v2. - Header:
Authorization: Bearer {secret_key}. - Discover project:
GET /v2/projects. - Customers list:
GET /v2/projects/{project_id}/customersand follownext_page. - Active entitlements per customer:
GET /v2/projects/{project_id}/customers/{customer_id}/active_entitlements. - Product/config endpoints that usually work:
/products,/entitlements,/offerings,/apps. - Do not assume
/v1/subscribers,/v2/customers,/charts, or/metricsexist for the key/project; probe and handle 404/400 cleanly.
- Endpoint root:
-
Analyze
- DAU: compute latest complete day, 7-day average, 30-day average, and change vs prior periods.
- MAU: compare full prior month vs current month-to-date, clearly marking MTD.
- Activation: login/onboarding and the app's other key feature-event counts.
- Drop-off: compare key step distinct users; identify exits and events with high abandonment.
- Retention: convert cohort counts to percentages from week 0.
- Monetization: compare credit exhaustion/paywall/checkout/purchase/subscription/RevenueCat active entitlements.
- Attribution/geography: report top UTM sources and countries, and call out missing/null attribution.
-
Report format
- Lead with an executive snapshot.
- Use bullets/labeled metrics rather than wide tables when the report is delivered to a chat surface with poor table rendering.
- Include a short “My read” section and prioritized fixes.
- Explicitly call out tracking gaps before over-interpreting bad-looking funnels.
PostHog HogQL snippets
-- DAU last 60 days
SELECT toDate(timestamp) AS day, count(DISTINCT person_id) AS users, count() AS events
FROM events
WHERE timestamp >= now() - INTERVAL 60 DAY
GROUP BY day
ORDER BY day
-- MAU last 12 months
SELECT formatDateTime(toStartOfMonth(timestamp), '%Y-%m') AS month,
count(DISTINCT person_id) AS users,
count() AS events
FROM events
WHERE timestamp >= now() - INTERVAL 12 MONTH
GROUP BY month
ORDER BY month
-- Top product events, excluding PostHog system events
SELECT event, count() AS events, count(DISTINCT person_id) AS users
FROM events
WHERE timestamp >= now() - INTERVAL 30 DAY AND event NOT LIKE '$%'
GROUP BY event
ORDER BY users DESC
LIMIT 100
Pitfalls
- HogQL function/type errors can vary by PostHog version; if
toDateOrNullfails onDateTime64, usetoDate(first_seen)instead. - A funnel query requiring event order can produce nonsense if
minIfdefaults to epoch/zero for missing events. Safer first pass: compute boolean per-user event presence and pairwise overlaps. - Anonymous landing events and logged-in app events may not join unless
identify/aliasing is implemented correctly. Iflanding_ctaandlogin_completedcounts are high butlanding_and_loginis zero, suspect identity merge, cross-project instrumentation, or a cross-root-domain handoff gap. - For landing pages and apps on different root domains (e.g.
.ai->.app), browser cookies/localStorage cannot carry PostHog identity. Passposthog.get_distinct_id()through the CTA URL, persist it on app arrival, preserve it through OAuth callbacks, and alias/merge it to the logged-in user after auth. Also link in client identity sync for non-OAuth login methods. Seereferences/cross-domain-posthog-identity-handoff.md. - RevenueCat v2 secret keys may list customers/config but not expose dashboard-style revenue charts. Derive entitlement/customer health via API, or ask for Stripe/RevenueCat exports if revenue totals are required.
- Zero active entitlements means either no active subscribers or billing/entitlement sync is broken; check RevenueCat app/store configuration and webhook/backend purchase flow before concluding revenue is truly zero.
References
references/cross-domain-posthog-identity-handoff.md— implementation pattern for linking anonymous landing users to logged-in app users across different root domains.
04 同仓库更多 Skills
tailscale-generation-skill-authoring
This skill should be used when the user asks to "create a Tailscale generation skill", "add a local generation skill", "document a generation endpoint", "add an image generation provider", "add a TTS provider", "add video generation", "add 3D generation", or needs guidance on where HivemindOS Tailscale or local generation providers belong in the shared skills shelf.
localtts
This skill should be used when the user asks to "generate local TTS", "use local text to speech", "use remote TTS over Tailscale", "make speech audio", "add a TTS provider", "use Qwen3-TTS", or needs TTS endpoint setup through local or HivemindOS Tailscale routes.
karpathy-guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
comfyui-image-generation
This skill should be used when the user asks to "generate images", "generate images with ComfyUI", "use local ComfyUI", "use remote ComfyUI", "use Z-Image", "add an image generation provider", or needs image-generation endpoint setup through local or HivemindOS Tailscale routes.
wrangler
Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
workers-best-practices
Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.