Cohort Analysis
Time-based cohort analysis with retention and behaviour tracking.
Install
npx skills add nimrodfisher/data-analytics-skills --skill cohort-analysis -g -a claude-code -y- Repository
- nimrodfisher/data-analytics-skills512
- Category
- Engineering
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Lightabout 595 tokens
- Runs scripts
- Yes, review before use
What it does
Time-based cohort analysis with retention and behaviour tracking. Activate when you need to measure how groups of users/customers behave over time, retention rates, revenue by cohort, or feature adoption curves.
When to use
- A stakeholder asks "are we retaining users better than last quarter?"
- You need to measure N-day, weekly, or monthly retention for a product or feature
- You want to compare how different acquisition cohorts (by channel, plan, or signup date) perform over their lifetime
- You're investigating churn and need to identify at which period users typically leave
Process
- Define the cohort and activity, clarify: cohort grouping (signup month, first purchase date, etc.) and retention event (login, purchase, feature use). Document in the report header.
- Pull or build the data, if starting from a database, use
scripts/cohort_query.sqlas the starting point. Adapt thecohort_dateandactivity_datecolumns to your schema. - Build the cohort table, run
scripts/cohort_builder.pyto produce a cohort × period membership table from event data. Output is a CSV withuser_id,cohort_period,activity_period. - Compute the retention matrix, run
scripts/retention_matrix.pyon the cohort table to generate the period-over-period retention rates. Output is an N×M matrix (cohort × period). - Visualise, run
scripts/cohort_visualizer.pyto render a heatmap of the retention matrix and a time-series of retention curves per cohort. - Interpret findings, consult
references/retention_metrics_glossary.mdfor metric definitions andreferences/cohort_definition_patterns.mdfor pattern recognition. - Write the report, fill
assets/cohort_report_template.md. For a visual deliverable, fill in theassets/retention_matrix.htmlheatmap template.
