agentleFS
sarbaksarbak/strategy-skills/analytics-review/SKILL.md

analytics-review

Skill0 starsChanged 7 months agoMITView on GitHub

Pull PostHog funnel metrics and Supabase/Postgres usage data, compare against previous baselines, and surface actionable insights. Use when the user asks to check analytics, review funnel, compare metrics, or see how users are doing.

  • Reads credentials

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. henrique-simoes/Istara★ 15same name
    2. ApurvaMisra/claude-code-assistant★ 8same name
    3. m-binimran/creator-pack★ 3same name
    4. lohi-ai/babysit★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No arguments: full review (PostHog funnel + database usage + comparison)

    line 13
  2. Distinctive:

    Look for credentials in this order:

    line 21
  3. Very specific:

    Check project .envrc files

    line 25
  4. Distinctive:

    Check memory files for PostHog project ID and API key

    line 26
  5. Very specific:

    Check server/.env or .env.local for DATABASE_DSN, DATABASE_URL, POSTGRES_URL, or SUPABASE_URL

    line 32
  6. Very specific:

    Use the project's Python environment (uv run python3) with asyncpg to query

    line 34
  7. Distinctive:

    If credentials are missing, ask the user.

    line 36
  8. Very specific:

    Check the project's PostHog events doc (usually POSTHOG_EVENTS.md) or memory for the event architecture.

    line 40
  9. Distinctive:

    Use the HogQL query endpoint (legacy insight endpoints may be blocked):

    line 44
  10. Very specific:

    Run git log --oneline --since="<BASELINE_DATE>" --merges (or without --merges if no merge commits) to see what shipped since the last …

    line 117
  11. Distinctive:

    When comparing metrics, correlate timing: if a metric spiked on Mar 30 and PR #11 merged Mar 31, note the connection.

    line 130
  12. Very specific:

    Check memory for previous analytics snapshots (files matching *analytics* or *baseline*).

    line 134
  13. Distinctive:

    If no baseline exists, this IS the baseline — note that in the output.

    line 142
  14. Distinctive:

    Always structure output as:

    line 146
  15. Very specific:

    If the user passes save argument, or if no baseline exists in memory:

    line 171
  16. Very specific:

    Write a memory file (<project>_analytics_<date>.md) with:

    line 173
  17. Distinctive:

    Keep baselines concise — just the numbers needed for future comparison, not the full analysis.

    line 181
  18. Distinctive:

    Always calculate daily rates (events / days in period) for fair comparison across unequal periods

    line 185
  19. Very specific:

    If the project has a POSTHOG_EVENTS.md, read it first to understand the event architecture

    line 189

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analytics Review

Pull live data from PostHog and the project's database, compare against saved baselines in memory, and surface actionable insights.

Arguments

  • No arguments: full review (PostHog funnel + database usage + comparison)
  • funnel: PostHog funnel metrics only
  • usage: Database message/usage volume only
  • users: Per-user activity breakdown
  • save: Save current snapshot as a new baseline to memory

Step 1/8: Find credentials

Look for credentials in this order:

PostHog

  1. Check environment: env | grep POSTHOG
  2. Check project .envrc files
  3. Check memory files for PostHog project ID and API key
  4. The PostHog API key starts with phx_ (personal API key, not the project key phc_)

PostHog API base: https://us.i.posthog.com (US) or https://eu.i.posthog.com (EU)

Database

  1. Check server/.env or .env.local for DATABASE_DSN, DATABASE_URL, POSTGRES_URL, or SUPABASE_URL
  2. For Supabase projects, the DSN format is: postgresql://postgres:<password>@db.<project-ref>.supabase.co:5432/postgres
  3. Use the project's Python environment (uv run python3) with asyncpg to query

If credentials are missing, ask the user.

Step 2/8: Read event architecture

Check the project's PostHog events doc (usually POSTHOG_EVENTS.md) or memory for the event architecture. This tells you which events exist, what properties they carry, and what funnels they power.

Step 3/8: Pull PostHog data

Use the HogQL query endpoint (legacy insight endpoints may be blocked):

curl -s 'https://us.i.posthog.com/api/projects/<PROJECT_ID>/query/' \
  -H "Authorization: Bearer <POSTHOG_API_KEY>" \
  -H 'Content-Type: application/json' \
  -d '{"query": {"kind": "HogQLQuery", "query": "<HOGQL>"}}'

Queries to run

1. Event counts by period — Compare current period vs previous baseline:

SELECT event, count() as cnt, count(DISTINCT person_id) as users,
  multiIf(
    toDate(timestamp) < toDate('SPLIT_DATE_1'), 'period_1',
    toDate(timestamp) < toDate('SPLIT_DATE_2'), 'period_2',
    'period_3'
  ) as period
FROM events
WHERE timestamp >= toDateTime('START_DATE')
  AND event IN ('$pageview', 'cta_click', ... )
GROUP BY event, period
ORDER BY event, period

2. Pageview breakdown by path:

SELECT properties.$pathname as path, count() as cnt, count(DISTINCT person_id) as users
FROM events
WHERE timestamp >= toDateTime('START_DATE') AND event = '$pageview'
GROUP BY path ORDER BY cnt DESC LIMIT 25

3. All custom events (to check what's firing):

SELECT event, count() as cnt
FROM events
WHERE timestamp >= toDateTime('START_DATE')
  AND event NOT IN ('$pageview', '$pageleave', '$autocapture', '$feature_flag_called', '$web_vitals', '$identify', '$rageclick')
GROUP BY event ORDER BY cnt DESC LIMIT 30

Step 4/8: Pull database usage data

Query the project's database for:

  • Message/usage volume by period (daily, weekly)
  • Per-user activity (messages, actions, last active date)
  • New signups/subscriptions in the current period
  • Active vs churned users

Adapt queries to the project's schema. Common patterns:

-- Daily volume
SELECT DATE(created_at) as day, COUNT(*) as total, COUNT(DISTINCT user_id) as users
FROM <activity_table>
WHERE created_at >= '<START_DATE>'
GROUP BY DATE(created_at) ORDER BY day

-- Per-user breakdown
SELECT u.email, u.plan, u.status,
  COUNT(*) FILTER (WHERE a.created_at < '<SPLIT>') as before,
  COUNT(*) FILTER (WHERE a.created_at >= '<SPLIT>') as after,
  MAX(a.created_at) as last_active
FROM <users_table> u
JOIN <activity_table> a ON a.user_id = u.id
GROUP BY u.email, u.plan, u.status
ORDER BY after DESC

Step 5/8: Pull recent PRs and deploys

Run git log --oneline --since="<BASELINE_DATE>" --merges (or without --merges if no merge commits) to see what shipped since the last baseline. For each PR/commit that touched user-facing code:

  1. Note the merge date
  2. Summarize what changed (from commit message or PR title)
  3. Categorize: bug fix, new feature, SEO/content, UI change, pricing change, infrastructure

This becomes the "what changed" context for interpreting metric movements. Structure as:

### Changes since last baseline
| Date | PR/Commit | Category | Summary |

When comparing metrics, correlate timing: if a metric spiked on Mar 30 and PR #11 merged Mar 31, note the connection. Metric changes without a corresponding code change suggest external factors (marketing, organic growth, seasonality).

Step 6/8: Compare against baseline

Check memory for previous analytics snapshots (files matching *analytics* or *baseline*). If a baseline exists:

  1. Calculate daily rates for each metric in both periods
  2. Show percentage change and absolute change
  3. Flag metrics that moved significantly (>2x or <0.5x)
  4. Flag users who went silent (active before, zero activity now)
  5. Flag users who are ramping up (increasing activity)

If no baseline exists, this IS the baseline — note that in the output.

Step 7/8: Surface insights

Always structure output as:

Funnel Metrics (table)

  • Period comparison with daily rates and trend multipliers

Usage Analytics (table)

  • Volume, active users, per-user breakdown

PR Impact (table)

  • Which PRs shipped since last baseline, what category, what metric moved

Actionable Insights (numbered list)

Focus on:

  1. Conversion changes — Did any funnel step improve or degrade?
  2. Activation signals — Are new users actually using the product?
  3. Churn signals — Who went silent? How long ago?
  4. Power users — Who's approaching plan limits?
  5. New behavior — Events firing for the first time?
  6. Anomalies — Unexpected spikes, drops, or patterns?

Recommendations (numbered list)

Specific actions the user can take based on the data.

Step 8/8: Save baseline (if requested or if none exists)

If the user passes save argument, or if no baseline exists in memory:

  1. Write a memory file (<project>_analytics_<date>.md) with:
    • Snapshot date
    • Changes since last baseline (PRs merged, deploys)
    • Key metrics (user count, daily volume, conversion rates)
    • Per-user status summary
    • Top-line comparison vs previous baseline
  2. Update MEMORY.md index

Keep baselines concise — just the numbers needed for future comparison, not the full analysis.

Notes

  • Always calculate daily rates (events / days in period) for fair comparison across unequal periods
  • PostHog count(DISTINCT person_id) gives unique users, count() gives total events
  • For Supabase/Postgres: use uv run python3 with asyncpg in the server directory
  • Exclude internal/test accounts from user-facing metrics
  • If the project has a POSTHOG_EVENTS.md, read it first to understand the event architecture

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.