Skill

Design and Implement Product Metrics Dashboards

A product metrics dashboard skill for tiered metric hierarchy, cohort retention SQL, z-score anomaly alerts, and Redis-cached dashboards.

Maintainer of this project? Claim this page to edit the listing.


91
Spark score
out of 100
Updated 7 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Leverage expert knowledge to design and implement comprehensive product metrics dashboards. Drive data-driven decision-making by translating raw data into actionable insights through strategic metric selection and clear visualization.

Outcomes

What it gets done

01

Define North Star, leading, and lagging indicators.

02

Structure dashboards with executive, operational, and diagnostic levels.

03

Generate SQL queries for key product metrics.

04

Provide guidance on chart selection and color coding for effective data visualization.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-product-metrics-dashboard | bash

Overview

Product Metrics Dashboard Expert

A product metrics dashboard skill covering a three-tier metric hierarchy (executive, operational, diagnostic), cohort retention SQL, and a chart-type/color-coding system matched to metric type. It includes z-score-based anomaly detection with alerting and a Redis-backed caching layer for performant dashboard loading. Use it when building a product metrics dashboard that needs a real metric hierarchy, automated anomaly alerting, and governed ownership - not a flat, ungoverned collection of charts.

What it does

This skill is expert in designing and implementing product metrics dashboards that drive actionable insights, covering the full lifecycle from metric selection to visualization design. Its metric hierarchy distinguishes North Star metrics (primary business outcomes like MAU or revenue), leading indicators (predictive of future performance), and lagging indicators (confirm historical trends), always with cohort/time/product-area segmentation. It structures dashboards in three tiers - an executive summary (North Star metric and trend, 3-5 max KPIs, health check status), operational metrics (acquisition, engagement, retention, revenue), and diagnostic deep-dives (funnel analysis, cohort analysis, feature usage, user behavior). It provides SQL for weekly active user growth rate with week-over-week comparison and N-day retention cohort analysis (M0/M1/M3 user counts and retention percentages), a chart-type mapping matching metric type to visualization (line charts for trends, bar charts for comparisons, pie/donut for parts-of-whole, scatter plots for correlations, funnel charts for conversion), a consistent color-coding CSS system (green for positive, red for negative, amber for warning), a z-score-based anomaly detection function that alerts on metric spikes or drops outside a rolling-window expected range, an interactive filtering/drill-down controller, and a Redis-backed metrics cache with TTL-based invalidation.

When to use - and when NOT to

Use this skill when building a product metrics dashboard that needs a real metric hierarchy, automated anomaly alerting, and performance-conscious data loading - not a flat collection of charts with no structure. Its dashboard governance guidance calls for clear metric ownership, refresh cadences matched to metric importance, role-based access control for sensitive metrics, and documented metric definitions and calculation methods. Its UX guidelines favor progressive disclosure (high-level first, drill-down for detail), mobile responsiveness, meaningful loading states, and graceful degradation on data unavailability. It is not meant for a one-off report - the skill defines dashboard success itself as a measured metric (adoption rate, time to insight, decision impact, data accuracy against source-of-truth validation), meaning the dashboard is expected to be an ongoing, governed product.

Inputs and outputs

### Example: Automated anomaly detection
import pandas as pd
from scipy import stats

def detect_metric_anomalies(df, metric_column, threshold=2.0):
    """
    Detect anomalies in metrics using z-score analysis
    """
    df['rolling_mean'] = df[metric_column].rolling(window=7).mean()
    df['rolling_std'] = df[metric_column].rolling(window=7).std()
    df['z_score'] = (df[metric_column] - df['rolling_mean']) / df['rolling_std']
    
    anomalies = df[abs(df['z_score']) > threshold]
    
    for _, row in anomalies.iterrows():
        alert_type = 'spike' if row['z_score'] > 0 else 'drop'
        send_alert({
            'metric': metric_column,
            'date': row['date'],
            'value': row[metric_column],
            'type': alert_type
        })

Given a product's metric set, the skill produces a three-tier dashboard structure, acquisition and retention SQL like the growth-rate and cohort queries, a chart-type mapping and color-coding system for consistent visualization, the z-score anomaly detector shown above wired to an alerting function, a filtering/drill-down controller class, and a Redis-backed caching layer for metric queries.

Who it's for

Product analytics and data teams building dashboards that need to go beyond static charts into a governed, alerting, performant system - clear metric ownership, automated anomaly detection, and cached data loading. It suits teams that measure the dashboard itself (adoption, time to insight, decision impact, data accuracy) and want progressive-disclosure UX with mobile support and graceful error handling built in from the start.

Source README

Product Metrics Dashboard Expert

You are an expert in designing and implementing product metrics dashboards that drive actionable insights and data-driven decision making. You understand the complete lifecycle from metric selection to visualization design, ensuring dashboards serve both strategic and operational needs.

Core Dashboard Principles

Metric Hierarchy and Selection

  • North Star Metrics: Primary business outcome metrics (e.g., Monthly Active Users, Revenue)
  • Leading Indicators: Predictive metrics that signal future performance
  • Lagging Indicators: Historical performance metrics that confirm trends
  • Segmentation: Always include ability to filter by user cohorts, time periods, and product areas

Dashboard Structure

Executive Summary (Top Level)
├── North Star Metric & Trend
├── Key Performance Indicators (3-5 max)
└── Health Check Status

Operational Metrics (Mid Level)
├── Acquisition Metrics
├── Engagement Metrics
├── Retention Metrics
└── Revenue Metrics

Diagnostic Deep-Dives (Bottom Level)
├── Funnel Analysis
├── Cohort Analysis
├── Feature Usage
└── User Behavior

Essential Product Metrics Framework

Acquisition Metrics

-- Example: Weekly Active User Growth Rate
SELECT 
  DATE_TRUNC('week', event_date) as week,
  COUNT(DISTINCT user_id) as weekly_active_users,
  LAG(COUNT(DISTINCT user_id)) OVER (ORDER BY DATE_TRUNC('week', event_date)) as prev_week_users,
  ROUND((COUNT(DISTINCT user_id) - LAG(COUNT(DISTINCT user_id)) OVER (ORDER BY DATE_TRUNC('week', event_date))) 
    / LAG(COUNT(DISTINCT user_id)) OVER (ORDER BY DATE_TRUNC('week', event_date)) * 100, 2) as growth_rate
FROM user_events 
WHERE event_date >= CURRENT_DATE - INTERVAL '12 weeks'
GROUP BY DATE_TRUNC('week', event_date)
ORDER BY week DESC;

Engagement & Retention Metrics

-- Example: N-Day Retention Cohort Analysis
WITH user_cohorts AS (
  SELECT 
    user_id,
    DATE_TRUNC('month', MIN(signup_date)) as cohort_month
  FROM users
  GROUP BY user_id
),
user_activities AS (
  SELECT 
    uc.user_id,
    uc.cohort_month,
    DATE_TRUNC('month', ua.activity_date) as activity_month,
    DATEDIFF('month', uc.cohort_month, DATE_TRUNC('month', ua.activity_date)) as month_number
  FROM user_cohorts uc
  LEFT JOIN user_activity ua ON uc.user_id = ua.user_id
)
SELECT 
  cohort_month,
  COUNT(DISTINCT CASE WHEN month_number = 0 THEN user_id END) as m0_users,
  COUNT(DISTINCT CASE WHEN month_number = 1 THEN user_id END) as m1_users,
  COUNT(DISTINCT CASE WHEN month_number = 3 THEN user_id END) as m3_users,
  ROUND(COUNT(DISTINCT CASE WHEN month_number = 1 THEN user_id END) * 100.0 / 
    COUNT(DISTINCT CASE WHEN month_number = 0 THEN user_id END), 2) as m1_retention,
  ROUND(COUNT(DISTINCT CASE WHEN month_number = 3 THEN user_id END) * 100.0 / 
    COUNT(DISTINCT CASE WHEN month_number = 0 THEN user_id END), 2) as m3_retention
FROM user_activities
GROUP BY cohort_month
ORDER BY cohort_month;

Dashboard Design Best Practices

Visual Hierarchy

  1. Primary Metrics: Large, prominent display with clear trend indicators
  2. Secondary Metrics: Smaller cards with sparklines or mini-charts
  3. Contextual Data: Supporting information in sidebars or expandable sections

Chart Selection Guidelines

// Example: Metric-appropriate visualization mapping
const chartTypeMapping = {
  // Trends over time
  'user_growth': 'line_chart',
  'revenue_trend': 'area_chart',
  
  // Comparisons
  'feature_adoption': 'bar_chart',
  'segment_performance': 'horizontal_bar',
  
  // Parts of whole
  'traffic_sources': 'pie_chart',
  'user_segments': 'donut_chart',
  
  // Correlations
  'engagement_vs_retention': 'scatter_plot',
  
  // Distributions
  'session_duration': 'histogram',
  
  // Funnels
  'conversion_funnel': 'funnel_chart'
};

Color Coding System

/* Consistent color palette for metrics */
:root {
  --metric-positive: #10B981; /* Green for growth, success */
  --metric-negative: #EF4444; /* Red for decline, issues */
  --metric-neutral: #6B7280;  /* Gray for stable, neutral */
  --metric-warning: #F59E0B;  /* Amber for attention needed */
  --primary-brand: #3B82F6;   /* Blue for primary metrics */
}

.metric-card {
  border-left: 4px solid var(--primary-brand);
}

.metric-trend.positive { color: var(--metric-positive); }
.metric-trend.negative { color: var(--metric-negative); }
.metric-alert.warning { background-color: var(--metric-warning); }

Advanced Dashboard Features

Real-time Alerting System

### Example: Automated anomaly detection
import pandas as pd
from scipy import stats

def detect_metric_anomalies(df, metric_column, threshold=2.0):
    """
    Detect anomalies in metrics using z-score analysis
    """
    df['rolling_mean'] = df[metric_column].rolling(window=7).mean()
    df['rolling_std'] = df[metric_column].rolling(window=7).std()
    df['z_score'] = (df[metric_column] - df['rolling_mean']) / df['rolling_std']
    
    anomalies = df[abs(df['z_score']) > threshold]
    
    for _, row in anomalies.iterrows():
        alert_type = 'spike' if row['z_score'] > 0 else 'drop'
        send_alert({
            'metric': metric_column,
            'date': row['date'],
            'value': row[metric_column],
            'expected_range': f"{row['rolling_mean'] - threshold * row['rolling_std']:.2f} - {row['rolling_mean'] + threshold * row['rolling_std']:.2f}",
            'type': alert_type
        })

Interactive Filtering and Drill-down

// Example: Dynamic dashboard filtering
class DashboardController {
  constructor() {
    this.filters = {
      dateRange: { start: '2024-01-01', end: '2024-12-31' },
      segment: 'all',
      platform: 'all'
    };
  }
  
  updateMetrics(filterChanges) {
    this.filters = { ...this.filters, ...filterChanges };
    
    // Update all dashboard components
    this.charts.forEach(chart => {
      chart.updateData(this.getFilteredData(chart.metric));
    });
    
    // Update summary statistics
    this.updateSummaryCards();
  }
  
  getFilteredData(metric) {
    return this.dataService.query({
      metric: metric,
      filters: this.filters,
      groupBy: this.getGroupingForMetric(metric)
    });
  }
}

Dashboard Performance Optimization

Data Loading Strategy

### Example: Efficient data caching and updates
class MetricsCache:
    def __init__(self, redis_client):
        self.redis = redis_client
        self.cache_ttl = 300  # 5 minutes
    
    def get_metric_data(self, metric_key, filters):
        cache_key = f"metrics:{metric_key}:{hash(str(filters))}"
        
        # Try cache first
        cached_data = self.redis.get(cache_key)
        if cached_data:
            return json.loads(cached_data)
        
        # Fetch fresh data
        data = self.fetch_from_database(metric_key, filters)
        
        # Cache for future requests
        self.redis.setex(
            cache_key, 
            self.cache_ttl, 
            json.dumps(data, default=str)
        )
        
        return data

Implementation Recommendations

Dashboard Governance

  1. Metric Ownership: Assign clear owners for each metric and dashboard section
  2. Update Cadence: Define refresh schedules based on metric importance and data freshness needs
  3. Access Control: Implement role-based access for sensitive business metrics
  4. Documentation: Maintain metric definitions, calculation methods, and business context

User Experience Guidelines

  1. Progressive Disclosure: Start with high-level metrics, allow drill-down for details
  2. Mobile Responsiveness: Ensure key metrics are accessible on mobile devices
  3. Loading States: Show meaningful loading indicators and skeleton screens
  4. Error Handling: Graceful degradation when data is unavailable

Success Metrics for Dashboards

  • Adoption Rate: Percentage of target users actively using the dashboard
  • Time to Insight: Average time users spend finding answers to their questions
  • Decision Impact: Number of product decisions influenced by dashboard insights
  • Data Accuracy: Percentage of metrics that match source-of-truth validation checks

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.