cohort-analysis
Skill3 starsChanged 5 months agoMITView on GitHub
Build a full SaaS cohort analysis from a CRM (Attio/Stripe/CSV) joined to revenue (Stripe/Attio/CSV). Outputs a styled Excel workbook with conditional formatting (Customer Churn, MRR Churn, CAC Payback) plus per-section CSVs. Use when the user says "/cohort-analysis", "build a cohort table", "cohort analysis for <client>", "retention by signup month", or "show me NRR by cohort". One-shot, no warehouse, no cron.
- Reads credentials
20 other projects use a version of this.
Adopted by
Most recently taken up by
- About-Intelligence/awesome-marketing-skillstheir own version, first seen Nov 8, 2026
- yuusakuri/agent-skillstheir own version, first seen Nov 1, 2026
- vijaysuperpositionist/skillstheir own version, first seen Nov 1, 2026
- brainbytes-dev/everything-claude-marketingtheir own version, first seen Nov 1, 2026
- daviszhen/agent-skillstheir own version, first seen Oct 25, 2026
- The-Utopia-Studio/skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use positioning-ideas, gtm-motions and 10 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.
About-IntelligenceSkillpositioning-ideas
Brainstorm product positioning ideas differentiated from competitors.
Also in 5 projects that use this
About-IntelligenceSkillgtm-motions
Identify the best GTM motions and tools across 7 motion types: Inbound, Outbound, Paid Digital, Community, Partners, ABM, and PLG.
Also in 5 projects that use this
skytiger6724Skillbrainstorm-experiments-existing
Design experiments to test assumptions for an existing product — prototypes, A/B tests, spikes, and other low-effort validation methods. Use when validating assumptions, testing feature ideas cheaply, or planning product experiments.
Also in 4 projects that use this
skytiger6724Skillbrainstorm-ideas-new
Brainstorm feature ideas for a new product in initial discovery from PM, Designer, and Engineer perspectives. Use when starting product discovery for a new product, exploring features for a startup idea, or doing initial ideation.
Also in 4 projects that use this
45ckSkillpestle-analysis
Also in 4 projects that use this
- +3 more from About-Intelligence
- +4 more from skytiger6724
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- indranilbanerjee/digital-marketing-pro★ 934same name
- jshsakura/awesome-opencode-skills★ 30same name
- About-Intelligence/awesome-marketing-skills★ 14same name
- brainbytes-dev/everything-claude-marketing★ 9same name
- The-Utopia-Studio/skills★ 6same name
- Adhamxon/claude-code-skills★ 2same name
- gmanch94/claude-code-aidlc-template★ 2same name
- risadams/ink-and-agency★ 2same name
- skytiger6724/qwen-skills★ 2same name
- yuusakuri/agent-skills★ 2same name
10 more not listed
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 repository7 other files it gives its agents.
- attio-deepline-enrichSkill
- call-coachSkill
- cfo-skillSkill
- disco-prepSkill
- gsc-lighthouseSkill
- linkedin-self-improvement-loopSkill
- ltv-cacSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Ask in order. Don't skip. Don't pick defaults silently.
- Very specific: line 29
Default is 0.8 (80%). Most SaaS companies are 70-85%.
- Distinctive: line 40
If they picked Attio for money, STOP and show this verbatim before going further:
- Very specific: line 52
Wait for them to give you the 3 slugs (or 2, if they're skipping date_churned).
- Very specific: line 62
Run python skills/cohort-analysis/run.py --check-env --crm <X> --money <Y> to validate.
- Distinctive: line 87
Every run produces these metrics for every cohort × lifetime month:
- Very specific: line 117
Default output (--output all) writes to /tmp/cohort-<client>-<date>/:
- Distinctive: line 131
If CACs were given: how many cohorts have paid back, how many haven't.
- Very specific: line 166
No data is sent anywhere. Everything stays local in /tmp/cohort-<client>-<date>/.
“Common” is measured: kept by at least 6 in 10 of the 14 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.
Files
Cohort Analysis
Builds the full SaaS cohort suite from a CRM + money source: 11 sub-tables across 3 sections (Customer Churn, MRR Churn, CAC Payback) in a single Excel workbook with green→red conditional formatting, plus per-section CSVs for SQL/raw consumption.
Step 1: Ask the user 3 questions (5 if they want CAC payback)
Ask in order. Don't skip. Don't pick defaults silently.
- Where do your clients live? (CRM source)
attio, Attio Persons or Companies,created_atis the cohort keystripe, Stripe Customers themselves (no separate CRM)csv, paste a path to a CSV with columnscustomer_id,email,signup_date
- Where's the money? (revenue source)
stripe, Stripe Invoices (paid)attio, currency attribute on a CRM record (requires extra info, see Step 1b)csv, path to CSV with columnscustomer_id(oremail),event_date,amount
- Want CAC payback analysis? (optional)
yes, they paste a path to acohort,cac_amountCSV. Section 3 of the workbook will show cumulative gross profit vs CAC and flag the lifetime month each cohort breaks even.no / skip, workbook will only include the first two sections.
- Gross margin? (only if they said yes to #3)
- Default is
0.8(80%). Most SaaS companies are 70-85%.
- Default is
- Output format?
all(default, xlsx workbook + per-section CSVs)xlsx, workbook onlycsv, per-section CSVs onlysql, also dump SQL DDL+insertsevidence, also bootstrap a DuckDB+Evidence project
Step 1b: Attio money source disclaimer (IMPORTANT)
If they picked Attio for money, STOP and show this verbatim before going further:
⚠️ Heads up, Attio doesn't store revenue history natively. It only holds current attribute values, so we have to reconstruct the timeline from date attributes on each customer record. To do that I need three attribute slugs:
- Amount per period: the recurring amount (e.g.
mrr,arr,subscription_amount,monthly_value)- Date paid / first invoice: when they started paying (e.g.
date_paid,subscription_start,first_invoice_date)- Date churned: optional. When they stopped paying. Leave blank and we'll assume they're still active today.
Each customer becomes one event per month between date-paid and date-churned at the amount you give. This works for steady-state subscriptions but won't capture mid-cycle upgrades, downgrades, partial refunds, or one-off charges. For real revenue accuracy, point me at Stripe instead, or export your billing data to CSV.
What are the three Attio attribute slugs? (paste them as
amount=mrr date_paid=date_paid date_churned=date_churned)
Wait for them to give you the 3 slugs (or 2, if they're skipping date_churned).
Step 2: Confirm env vars are set
| Source | Env var |
| Attio (CRM or money) | ATTIO_API_KEY |
| Stripe (CRM or money) | STRIPE_SECRET_KEY |
| CSV | none, just a path |
Run python skills/cohort-analysis/run.py --check-env --crm <X> --money <Y> to validate. If a key is missing, stop and tell the user to add it.
Step 3: Run
python skills/cohort-analysis/run.py \
--crm <attio|stripe|csv> \
--money <stripe|attio|csv> \
--cacs <path-to-cacs.csv> \ # optional, enables CAC payback section
--gross-margin 0.8 \ # default 0.8
--output <all|xlsx|csv|sql|evidence> \
--out-dir /tmp/cohort-<client>-<date>Optional flags:
--attio-object companies|people(defaultcompanies)--attio-amount-attr <slug>(required if--money attio)--attio-date-paid-attr <slug>(required if--money attio)--attio-date-churned-attr <slug>(optional, only if--money attio)--csv-customers <path>(only if--crm csv)--csv-revenue <path>(only if--money csv)--cohort-grain month|quarter(defaultmonth)
Step 4: KPIs the user gets
Every run produces these metrics for every cohort × lifetime month:
Customer-side (Section 1 of the workbook, 5 sub-tables)
- Retained customers: count of cohort C still paying at lifetime month M
- Churned customers: count who churned that specific period
- % retained customers: customer retention curve (the "GRR shape")
- % churned vs base: monthly churn rate normalized to cohort starting size
- % churned vs previous month: period-over-period churn rate
Revenue-side (Section 2 of the workbook, 5 sub-tables)
- Retained MRR: dollars each cohort is paying every month since signup
- MRR churn: signed: positive = lost dollars, negative = expansion
- % retained MRR: NRR (Net Revenue Retention), the headline VC metric
- % MRR churn vs base: monthly dollar churn normalized to M0 MRR
- % MRR churn vs previous month: period-over-period dollar churn
Unit economics (Section 3 of the workbook, only if --cacs given)
- Cumulative gross profit per cohort, month by month (
retained_mrr × gross_margin, accumulated) - CAC payback period: first lifetime month each cohort's cumulative GP exceeds its CAC
- "Profitable since M_n" flag, or "Not yet profitable"
Per-cohort base stats (in 00_summary.csv and the workbook headers)
- Cohort base size: # of customers signed up that month
- M0 MRR: initial cohort revenue
- CAC (if provided)
- Profitable since: computed
- Max observable lifetime month: per-cohort cutoff inferred from your data
Step 5: Output files
Default output (--output all) writes to /tmp/cohort-<client>-<date>/:
cohort_workbook.xlsx: the styled Excel file (open in Excel/Numbers/Sheets). Three stacked sections with conditional formatting: Customer Churn, MRR Churn, CAC Payback (only if CACs given).cohort_table.csv, headline retained-MRR matrix (familiar shape, opens directly)00_summary.csv, one row per cohort: base counts, base MRR, CAC, profitable-since01_retained_customers.csvthrough11_cac_payback_cumulative_gross_profit.csv, every sub-table as its own CSVaudit_customers.csv+audit_revenue.csv, everything that fed the join, for traceability
Step 6: After running
Show a 4-line summary:
- N customers, N revenue events, N cohorts
- Path to
cohort_workbook.xlsx - One-line read of the matrix (
quick_summaryoutput: e.g. "Jan-2026 cohort: 80 customers @ $7,851 MRR → M9: 64 customers, 81% MRR retained") - If CACs were given: how many cohorts have paid back, how many haven't.
When to use
- User says
/cohort-analysisor "cohort analysis for<client>" - A client asks for retention/NRR by signup month, gross profit per cohort, or CAC payback
- Quarterly review of a SaaS book of business
- A founder is preparing investor materials and needs to show NRR + payback
When NOT to use
- The client wants a continuously refreshing dashboard → recommend ChartMogul or Baremetrics, don't build this.
- The client has <10 customers per cohort → cohorts aren't statistically useful, just show a churn list instead.
Try it without API keys
The examples/ folder ships with a richer fixture (8 cohorts, ~12 months of history, CAC values). Run end-to-end:
python skills/cohort-analysis/run.py \
--crm csv --money csv \
--csv-customers skills/cohort-analysis/examples/customers.csv \
--csv-revenue skills/cohort-analysis/examples/revenue.csv \
--cacs skills/cohort-analysis/examples/cacs.csv \
--gross-margin 0.8 \
--output all \
--out-dir /tmp/cohort-demo
open /tmp/cohort-demo/cohort_workbook.xlsxNotes
- Joins are on
email(lowercased) by default. Stripe customers usually carry email; Attio Persons too. For Companies → Stripe, falls back todomainmatch. - CSV mode is the universal escape hatch, if the user has an "alternative" billing system (Qonto, Chargebee, custom), they export to CSV and we ingest it.
- No data is sent anywhere. Everything stays local in
/tmp/cohort-<client>-<date>/. - The xlsx writer requires
openpyxl. If it's not installed, the skill still produces all the CSVs; the .xlsx is skipped with a friendly message.
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
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.

