Cohort analysis tracks groups of users with shared characteristics over time, revealing patterns in retention, engagement, and lifetime value.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versioncohort-analysisExecute the skills CLI command in your project's root directory to begin installation:
Fetches cohort-analysis from aj-geddes/useful-ai-prompts and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate cohort-analysis. Access via /cohort-analysis in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
162
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
162
stars
Cohort analysis tracks groups of users with shared characteristics over time, revealing patterns in retention, engagement, and lifetime value.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Create sample user lifecycle data
np.random.seed(42)
# Generate user data
n_users = 5000
users = []
for user_id in range(n_users):
signup_month = np.random.choice(range(1, 13))
lifetime_months = np.random.poisson(6) + 1
for month in range(1, lifetime_months + 1):
users.append({
'user_id': user_id,
'signup_month': signup_month,
'month': month,
'active': 1,
})
df = pd.DataFrame(users)
# Add derived columns
df['cohort_month'] = df['signup_month']
df['cohort_age'] = df['month'] # Could be day, week, etc.
df['date'] = pd.to_datetime('2023-01-01') + pd.to_timedelta(df['signup_month'] * 30, unit='D')
print("User Data Summary:")
print(df.head(10))
# 1. Cohort Table (Retention Matrix)
cohort_data = df.groupby(['cohort_month', 'cohort_age']).agg({
'user_id': 'nunique'
}).reset_index()
cohort_data.columns = ['cohort_month', 'cohort_age', 'unique_users']
# Create pivot table
cohort_pivot = cohort_data.pivot(index='cohort_month', columns='cohort_age', values='unique_users')
print("\nCohort Sizes (Raw User Counts):")
print(cohort_pivot)
# 2. Cohort Retention (as percentage of cohort size)
cohort_size = cohort_pivot.iloc[:, 0]
retention_table = cohort_pivot.divide(cohort_size, axis=0) * 100
print("\nCohort Retention Rate (%):")
print(retention_table.round(1))
# 3. Visualize Retention Matrix
fig, axes = plt.subplots(2, 1, figsize=(14, 8))
# Heatmap of raw counts
sns.heatmap(cohort_pivot, annot=True, fmt='g', cmap='YlOrRd', ax=axes[0],
cbar_kws={'label': 'User Count'})
axes[0].set_title('Cohort Sizes - User Counts')
axes[0].set_xlabel('Cohort Age (Months)')
axes[0].set_ylabel('Cohort Month')
# Heatmap of retention rates
sns.heatmap(retention_table, annot=True, fmt='.0f', cmap='RdYlGn', vmin=0, vmax=100,
ax=axes[1], cbar_kws={'label': 'Retention %'})
axes[1].set_title('Cohort Retention Rates (%)')
axes[1].set_xlabel('Cohort Age (Months)')
axes[1].set_ylabel('Cohort Month')
plt.tight_layout()
plt.show()
# 4. Retention Curve
fig, ax = plt.subplots(figsize=(12, 6))
# Plot retention curves for each cohort
for cohort_month in cohort_pivot.index[:8]: # First 8 cohorts
cohort_retention = retention_table.loc[cohort_month]
ax.plot(cohort_retention.index, cohort_retention.values, marker='o', label=f'Cohort {cohort_month}')
ax.set_xlabel('Cohort Age (Months)')
ax.set_ylabel('Retention Rate (%)')
ax.set_title('Retention Curves by Cohort')
ax.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
ax.grid(True, alpha=0.3)
ax.set_ylim([0, 105])
plt.tight_layout()
plt.show()
# 5. Average Retention Curve
fig, ax = plt.subplots(figsize=(10, 6))
# Calculate average retention at each age
avg_retention = retention_table.mean()
ax.plot(avg_retention.index, avg_retention.values, marker='o', linewidth=2, markersizeMake data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
cohort-analysis reduced setup friction for our internal harness; good balance of opinion and flexibility.
Registry listing for cohort-analysis matched our evaluation — installs cleanly and behaves as described in the markdown.
Useful defaults in cohort-analysis — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend cohort-analysis for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
cohort-analysis reduced setup friction for our internal harness; good balance of opinion and flexibility.
cohort-analysis is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
I recommend cohort-analysis for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Useful defaults in cohort-analysis — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Registry listing for cohort-analysis matched our evaluation — installs cleanly and behaves as described in the markdown.
cohort-analysis reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 45