agentleFS
vermapragyavermapragya/analytics-skill/skills/cohort-analysis/SKILL.md

cohort-analysis

Skill0 starsChanged 6 months agoMITView on GitHub

Builds cohort retention tables and retention curves with a single consistent denominator policy. Use when the user mentions cohort, retention, retention curve, "by signup month", "by acquisition channel", N-day retention, churn over time, or lifecycle analysis.

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use value-proposition, north-star-metric and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • skytiger6724Skill

    value-proposition

    Design a detailed value proposition using a 6-part JTBD template — Who, Why, What before, How, What after, Alternatives. Use when creating a value proposition, analyzing customer value delivery, or articulating why customers should choose your product.

    Also in 3 projects that use this

  • nandanosqlSkill

    north-star-metric

    Define the single metric that best captures the core value your product delivers to customers. Covers selection, decomposition into input metrics, and common traps.

    Also in 3 projects that use this

  • nandanosqlSkill

    swot-analysis

    Conduct a structured SWOT analysis — Strengths, Weaknesses, Opportunities, Threats — that connects internal capabilities to external forces for strategic decision-making.

    Also in 3 projects that use this

  • AnthropicSkill

    stakeholder-map

    Map the people in a deal or account - roles, influence, sentiment, who's missing, and your best access path to the people you haven't reached. Use when the user asks "who are the players at [account]", "who's my way in", "am I single-threaded on [deal]", "map the stakeholders", or "who else should I be talking to".

    Also in 3 projects that use this

  • silvainfmSkill

    pricing-strategy

    When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' or 'monetization.' This skill covers pricing research, tier structure, and packaging strategy.

    Also in 4 projects that use this

  • silvainfmSkill

    marketing-ideas

    When the user needs marketing ideas, inspiration, or strategies for their SaaS or software product. Also use when the user asks for 'marketing ideas,' 'growth ideas,' 'how to market,' 'marketing strategies,' 'marketing tactics,' 'ways to promote,' or 'ideas to grow.' This skill provides 140 proven marketing approaches organized by category.

    Also in 3 projects that use this

  • +1 more from nandanosql

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when the user wants to understand how behavior changes over the lifecycle of users, segmented by when they entered.

    line 10
  2. Very specific:

    If the user wants step-by-step conversion within a single session/flow, use funnel-analysis instead.

    line 18
  3. Distinctive:

    Default to cohort-fixed: Only switch if there's a specific question about period-over-period stickiness.

    line 52
  4. Distinctive:

    Mid-week cohort start: if your cohort grain is "week" but anchor events occur all days, define week as Mon-Sun and align.

    line 111
  5. Distinctive:

    Re-engaging users: if a user goes dormant and comes back, are they in their original cohort or a new "reactivation" cohort?

    line 112
  6. Distinctive:

    Cohort size differences: if cohort sizes vary 10x, displaying raw percentages can mislead.

    line 114
  7. Distinctive:

    Survivorship in subscription products: if users *can't* churn within a billing cycle, "retention" before cycle end is meaningless.

    line 115

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “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

Cohort Analysis

When to use this skill

Use when the user wants to understand how behavior changes over the lifecycle of users, segmented by when they entered. Triggers:

  • "Show retention by signup cohort…"
  • "Build a cohort table…"
  • "N-day retention for…"
  • "Compare cohorts by acquisition channel"
  • "Is retention improving?"

If the user wants step-by-step conversion within a single session/flow, use funnel-analysis instead.

Required inputs

InputWhy it matters
Cohort anchor eventDefines when a user enters the cohort (signup, first purchase, install)
Cohort grainDay, week, or month
Retention eventWhat action defines "retained" (any session, key feature use, purchase)
Time window per periodDaily / weekly / monthly columns
Lookback windowHow many periods to display

Workflow

  1. Confirm the anchor event. A user belongs to exactly one cohort. If they could be re-anchored (e.g., resubscribe), pre-specify the rule (first only, latest, both as separate cohorts).
  2. Pick the cohort grain.
    • Daily: short time-scale features, fast-moving products
    • Weekly: most product analytics defaults — smooths weekday/weekend variance
    • Monthly: long sales/subscription cycles
  3. Define "retained" precisely. Most common definitions:

    • Any-activity: at least one logged event in period
    • Key-action: specific event (e.g., completed_order)
    • N-day: active on day N exactly (rolling vs absolute matters)
    • N-day-bracket: active anywhere in days [N, N+window)

    Pick one. Document it in the readout.

  4. Pick the denominator policy. This is the most common source of misleading cohort charts:

    • Cohort-fixed: divide by original cohort size every period. Curves only go down.
    • Active-base: divide by users active in previous period. Shows period-over-period stickiness, but can hide leaky retention.
    • Eligible-base: divide by users who had the opportunity to retain (e.g., still on the platform). Use when accounts can churn permanently.

    Default to cohort-fixed. Only switch if there's a specific question about period-over-period stickiness.

  5. Generate cohort matrix using scripts/cohort_table.sql (Snowflake) or scripts/cohort_table.py (pandas).
  6. Compute key summary stats:
    • D1, D7, D30 retention by cohort
    • "Smile curve" check (does retention stabilize after some N?)
    • Cohort-over-cohort delta (is the latest cohort retaining better than 4 cohorts ago?)
  7. Write the readout with the matrix, summary stats, and interpretation.

Output format

# Cohort Analysis: <product/segment>

## Definitions
- Cohort anchor: <event> on <grain>
- Retention event: <event>
- Denominator: cohort-fixed (original cohort size)
- Lookback: <N> periods

## Summary
- Latest cohort D7 retention: <X%> (vs <Y%> 4 weeks ago, <delta>pp)
- D30 retention asymptote: <Z%>
- Retention "stabilizes" around day <N>

## Cohort table
| Cohort | Size | D1 | D7 | D14 | D30 | D60 | D90 |
|---|---|---|---|---|---|---|---|
| 2026-01 | 12,400 | 48.2% | 22.1% | 16.4% | 12.0% | 9.8% | 8.5% |
| 2026-02 | 14,100 | 51.0% | 24.8% | 18.2% | 13.5% | 10.4% | — |
| ...    | ... | ... | ... | ... | ... | ... | ... |

## Interpretation
- <Are recent cohorts improving, flat, or declining?>
- <What's the asymptote? Is the long-term retained base stable?>
- <Any anomalies — single bad cohort, missing data?>

## Caveats
- Recent cohorts have incomplete data through the latest periods (mark provisional)
- Cohort assignment uses <rule>; users who re-anchored are <treated as>
- <late-arriving events caveat if applicable>

## Next steps
- <e.g., investigate the drop in 2026-03 cohort>
- <e.g., segment by acquisition channel to find a driver>

Validation checks

  • Each user appears in exactly one cohort
  • Denominator policy stated and consistent across all cells
  • Recent incomplete cohorts flagged as provisional
  • Period boundaries aligned (Mon-Sun or 1st-end-of-month, not mid-week)
  • Late-arriving events caveat if data has > 24h pipeline lag

Edge cases & failure modes

  • Mid-week cohort start: if your cohort grain is "week" but anchor events occur all days, define week as Mon-Sun and align. Don't let cohort #1 be 3 days long.
  • Re-engaging users: if a user goes dormant and comes back, are they in their original cohort or a new "reactivation" cohort? Pre-specify.
  • Sparse recent cohorts: the last 1-2 periods of the matrix have <100% observation. Mark cells as "—" (no data) rather than 0% (no retention).
  • Cohort size differences: if cohort sizes vary 10x, displaying raw percentages can mislead. Add absolute counts or use rolling averages.
  • Survivorship in subscription products: if users can't churn within a billing cycle, "retention" before cycle end is meaningless. Use eligible-base denominator.

Scripts

  • scripts/cohort_table.sql — Snowflake template producing a cohort matrix
  • scripts/cohort_table.py — pandas implementation for in-memory data
python scripts/cohort_table.py \
    --input events.csv \
    --user-col user_id \
    --event-time-col event_at \
    --cohort-grain week \
    --periods 12

Related skills

  • funnel-analysis — for within-session/within-flow conversion
  • survival-analysis — when you need time-to-churn distribution with censoring
  • metric-definition — write a clean retention metric spec
  • stakeholder-readout — for packaging cohort findings

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.