cohort-analysis-builder

Generate PostgreSQL cohort analysis SQL for retention, revenue, and churn.

3|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/anthril/official-claude-plugins --skill cohort-analysis-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cohort-analysis-builder
Source: https://github.com/anthril/official-claude-plugins/tree/main/plugins/data-analysis/skills/cohort-analysis-builder
Command: npx skills add https://github.com/anthril/official-claude-plugins --skill cohort-analysis-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Design and implement cohort analysis frameworks that translate user activity into actionable retention, revenue, and churn insights.

Core Features & Use Cases

  • Generate production-ready SQL with CTEs for time-based and behavior-based cohorts.
  • Produce visualization-ready outputs for retention and lifetime value (LTV) analyses across multiple cohorts.
  • Real-world use cases include SaaS onboarding optimization, ecommerce repeat-purchase analysis, and marketplace activity tracking.

Quick Start

Copy and adapt the provided cohort SQL templates to your schema and run them against your database to generate your first cohort report.

Frequently Asked Questions about cohort-analysis-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write SQL for cohort analysis to measure user retention?

Cohort analysis SQL uses standard CTE structures to group users by activity time, measuring retention across subsequent periods. This framework generates production-ready PostgreSQL queries with timezone handling and cohort sizing rules for accurate retention tracking.

Can I calculate cumulative LTV and churn using SQL queries?

You can calculate cumulative LTV and churn using SQL query variants designed for cohort analysis. The framework delivers specific PostgreSQL-compatible SQL templates that translate user activity logs into revenue retention and churn metrics.

Does this cohort analysis SQL work for ecommerce and SaaS data?

Cohort analysis SQL is applicable across SaaS, ecommerce, marketplaces, and service businesses. The templates adapt to different user activity data structures to produce time-based and behavior-based cohorts for repeat-purchase or onboarding analysis.

What is the best way to visualize cohort retention data?

Visualizing cohort retention data requires structured SQL outputs formatted for visualization frameworks. This approach delivers visualization specifications alongside the SQL queries, ensuring retention and LTV outputs are ready for reporting dashboards.

How do I handle timezone issues in cohort retention SQL?

Timezone handling in cohort retention SQL ensures users are grouped accurately by their local activity time rather than server time. The generated PostgreSQL queries include standard CTE structures with explicit timezone rules to prevent cohort sizing errors.