data-analysis
Executive-grade data analysis with pandas/polars and McKinsey-quality visualizations. Use when analyzing data, building dashboards, creating investor presentations, or calculating SaaS metrics.
What this skill does
<objective>
Enable executive-grade data analysis for VC, PE, and C-suite presentations. Covers data ingestion from any format, SaaS metrics calculations (MRR, LTV, CAC, churn), cohort retention analysis, McKinsey-quality visualizations with Plotly, and Streamlit dashboards.
</objective>
<quick_start>
**Universal data loader:**
```python
df = load_data("file.csv") # Supports CSV, Excel, JSON, Parquet, PDF, PPTX
```
**SaaS metrics:**
```python
metrics = calculate_saas_metrics(df) # MRR, ARR, LTV, CAC, churn
retention = cohort_retention_analysis(df) # Retention matrix
```
**McKinsey-style charts:** Action titles ("Q4 Revenue Exceeded Target by 23%"), not descriptive titles
</quick_start>
<success_criteria>
Analysis is successful when:
- Data loaded and cleaned (dropna, dedup, type conversion)
- Metrics calculated correctly (MRR, ARR, LTV:CAC, churn, cohort retention)
- Charts follow McKinsey principles: action titles, data-ink ratio >80%, one message per chart
- Executive colors used (#003366 primary, #2E7D32 positive, #C62828 negative)
- Streamlit dashboard runs without errors
- NO OPENAI: Use Claude for narrative generation if needed
</success_criteria>
<core_content>
Executive-grade data analysis for VC, PE, C-suite presentations using pandas, polars, Plotly, Altair, and Streamlit.
## Quick Reference
| Task | Tools | Output |
|------|-------|--------|
| Data ingestion | pandas, polars, pdfplumber, python-pptx | DataFrame |
| Wrangling | pandas/polars transforms | Clean dataset |
| Analysis | numpy, scipy, statsmodels | Insights |
| Visualization | Plotly, Altair, Seaborn | Charts |
| Dashboards | Streamlit, DuckDB | Interactive apps |
| Presentations | Plotly export, PDF generation | Investor-ready |
## Data Ingestion Patterns
### Universal Data Loader
```python
import pandas as pd
import polars as pl
from pathlib import Path
def load_data(file_path: str) -> pd.DataFrame:
"""Load data from any common format."""
path = Path(file_path)
suffix = path.suffix.lower()
loaders = {
'.csv': lambda p: pd.read_csv(p),
'.xlsx': lambda p: pd.read_excel(p, engine='openpyxl'),
'.xls': lambda p: pd.read_excel(p, engine='xlrd'),
'.json': lambda p: pd.read_json(p),
'.parquet': lambda p: pd.read_parquet(p),
'.sql': lambda p: pd.read_sql(open(p).read(), conn),
'.md': lambda p: parse_markdown_tables(p),
'.pdf': lambda p: extract_pdf_tables(p),
'.pptx': lambda p: extract_pptx_tables(p),
}
if suffix not in loaders:
raise ValueError(f"Unsupported format: {suffix}")
return loaders[suffix](path)
```
### PDF Table Extraction
```python
import pdfplumber
def extract_pdf_tables(pdf_path: str) -> pd.DataFrame:
"""Extract tables from PDF using pdfplumber."""
all_tables = []
with pdfplumber.open(pdf_path) as pdf:
for page in pdf.pages:
tables = page.extract_tables()
for table in tables:
if table and len(table) > 1:
df = pd.DataFrame(table[1:], columns=table[0])
all_tables.append(df)
return pd.concat(all_tables, ignore_index=True) if all_tables else pd.DataFrame()
```
### PowerPoint Data Extraction
```python
from pptx import Presentation
from pptx.util import Inches
def extract_pptx_tables(pptx_path: str) -> list[pd.DataFrame]:
"""Extract all tables from PowerPoint."""
prs = Presentation(pptx_path)
tables = []
for slide in prs.slides:
for shape in slide.shapes:
if shape.has_table:
table = shape.table
data = []
for row in table.rows:
data.append([cell.text for cell in row.cells])
df = pd.DataFrame(data[1:], columns=data[0])
tables.append(df)
return tables
```
## Data Wrangling Patterns
### Polars for Performance (30x faster than pandas)
```python
import polars as pl
# Lazy evaluation for large datasets
df = (
pl.scan_csv("large_file.csv")
.filter(pl.col("revenue") > 0)
.with_columns([
(pl.col("revenue") / pl.col("customers")).alias("arpu"),
pl.col("date").str.to_date().alias("date_parsed"),
])
.group_by("segment")
.agg([
pl.col("revenue").sum().alias("total_revenue"),
pl.col("customers").mean().alias("avg_customers"),
])
.collect()
)
```
### Common Transformations
```python
def prepare_for_analysis(df: pd.DataFrame) -> pd.DataFrame:
"""Standard data prep pipeline."""
return (df
.dropna(subset=['key_column'])
.drop_duplicates()
.assign(
date=lambda x: pd.to_datetime(x['date']),
revenue=lambda x: pd.to_numeric(x['revenue'], errors='coerce'),
month=lambda x: x['date'].dt.to_period('M'),
)
.sort_values('date')
.reset_index(drop=True)
)
```
## SaaS Metrics Calculations
### Core Metrics
```python
def calculate_saas_metrics(df: pd.DataFrame) -> dict:
"""Calculate key SaaS metrics for investor reporting."""
# MRR / ARR
mrr = df.groupby('month')['mrr'].sum()
arr = mrr.iloc[-1] * 12
# Growth rates
mrr_growth = mrr.pct_change().iloc[-1]
# Churn
churned = df[df['status'] == 'churned']['mrr'].sum()
total_mrr = df['mrr'].sum()
churn_rate = churned / total_mrr if total_mrr > 0 else 0
# CAC & LTV
total_sales_marketing = df['sales_cost'].sum() + df['marketing_cost'].sum()
new_customers = df[df['is_new']]['customer_id'].nunique()
cac = total_sales_marketing / new_customers if new_customers > 0 else 0
avg_revenue_per_customer = df.groupby('customer_id')['mrr'].mean().mean()
avg_lifespan_months = 1 / churn_rate if churn_rate > 0 else 36
ltv = avg_revenue_per_customer * avg_lifespan_months
ltv_cac_ratio = ltv / cac if cac > 0 else 0
cac_payback_months = cac / avg_revenue_per_customer if avg_revenue_per_customer > 0 else 0
return {
'mrr': mrr.iloc[-1],
'arr': arr,
'mrr_growth': mrr_growth,
'churn_rate': churn_rate,
'cac': cac,
'ltv': ltv,
'ltv_cac_ratio': ltv_cac_ratio,
'cac_payback_months': cac_payback_months,
}
```
### Cohort Analysis
```python
def cohort_retention_analysis(df: pd.DataFrame) -> pd.DataFrame:
"""Build cohort retention matrix for investor reporting."""
# Assign cohort (first purchase month)
df['cohort'] = df.groupby('customer_id')['date'].transform('min').dt.to_period('M')
df['period'] = df['date'].dt.to_period('M')
df['cohort_age'] = (df['period'] - df['cohort']).apply(lambda x: x.n)
# Build retention matrix
cohort_data = df.groupby(['cohort', 'cohort_age']).agg({
'customer_id': 'nunique',
'revenue': 'sum'
}).reset_index()
# Pivot for visualization
cohort_counts = cohort_data.pivot(
index='cohort',
columns='cohort_age',
values='customer_id'
)
# Calculate retention percentages
cohort_sizes = cohort_counts.iloc[:, 0]
retention = cohort_counts.divide(cohort_sizes, axis=0) * 100
return retention
```
## Executive Visualization
### McKinsey/BCG Chart Principles
```yaml
mckinsey_style:
colors:
primary: "#003366" # Deep blue
accent: "#0066CC" # Bright blue
positive: "#2E7D32" # Green
negative: "#C62828" # Red
neutral: "#757575" # Gray
typography:
title: "Georgia, serif"
body: "Arial, sans-serif"
size_title: 18
size_body: 12
principles:
- "One message per chart"
- "Action title (not descriptive)"
- "Data-ink ratio > 80%"
- "Remove chartjunk"
- "Label directly on chart"
```
### Plotly Executive Charts
```python
import plotly.express as px
import plotly.graph_objects as go
EXEC_COLORS = {
'primary': '#003366',
'secondary': '#0066CC',
'positive': '#2E7D32',
'negative': '#C62828',
'neutral': Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.