/data-analytics-skills:business-intelligencefrom data-analytics-skills
Scores KPIs against targets, validates metric definitions, designs dashboards, and reviews specs for overload and chart misuse. Use when building or auditing BI dashboards.
Ships in data-analytics-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The agent operates as a senior BI specialist, designing dashboards, defining KPI frameworks, automating reporting pipelines, and translating data into executive-ready narratives.
Designing a dashboard, defining or validating KPIs, scoring actuals against targets, reviewing an existing dashboard before launch, or automating reports. Not for warehouse or ETL work.
Before designing the dashboard, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
metric_validator.py require).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
# Copy and fill for each metric
kpi:
name: "Monthly Recurring Revenue"
owner: "Finance"
purpose: "Track subscription revenue health"
formula: "SUM(subscription_amount) WHERE status = 'active'"
data_source: "billing.subscriptions"
granularity: "monthly"
target: 1200000
warning_pct: 0.9 # YELLOW below 90% of target (fraction, not absolute)
critical_pct: 0.8 # RED below 80% of target
aggregation: "sum" # sum | mean | count | min | max ...; drives kpi_tracker.py
column: "subscription_amount"
higher_is_better: true # boolean
dimensions: ["region", "plan_tier", "cohort_month"]
caveats:
- "Excludes one-time setup fees"
- "Currency normalized to USD at month-end rate"
Visual hierarchy:
#28A745 | Yellow #FFC107 | Red #DC3545 | Gray #6C757DChart selection matrix:
| Data question | Chart type | Alternative |
|---|---|---|
| Trend over time | Line | Area |
| Part of whole | Donut / Treemap | Stacked bar |
| Comparison across categories | Bar / Column | Bullet |
| Distribution | Histogram | Box plot |
| Relationship | Scatter | Bubble |
| Geographic | Choropleth | Filled map |
Illustrative layout only; all figures below are made-up placeholders.
+------------------------------------------------------------+
| EXECUTIVE SUMMARY |
| Revenue: $12.4M (+15% YoY) Pipeline: $45.2M (+22% QoQ) |
| Customers: 2,847 (+340 MTD) NPS: 72 (+5 pts) |
+------------------------------------------------------------+
| REVENUE TREND (12-mo line) | REVENUE BY SEGMENT (donut) |
+-------------------------------+-----------------------------+
| TOP 10 ACCOUNTS (table) | KPI STATUS (RAG cards) |
+-------------------------------+-----------------------------+
Scheduled report (cron-style):
report:
name: Weekly Sales Report
schedule: "0 8 * * MON"
recipients: [[email protected], [email protected]]
format: PDF
pages: [Executive Summary, Pipeline Analysis, Rep Performance]
Threshold alert:
alert:
name: Revenue Below Target
metric: daily_revenue
condition: "actual < target * 0.9"
channels:
email: [email protected]
slack: "#revenue-alerts"
message: "Daily revenue ${actual} is ${pct_diff}% below target. Top factors: ${top_factors}"
Automated generation workflow (Python):
def generate_report(config: dict) -> str:
"""Generate and distribute a scheduled report."""
# 1. Refresh data sources
refresh_data_sources(config["sources"])
# 2. Calculate metrics
metrics = calculate_metrics(config["metrics"])
# 3. Create visualizations
charts = create_visualizations(metrics, config["charts"])
# 4. Compile into report
report = compile_report(metrics=metrics, charts=charts, template=config["template"])
# 5. Distribute
distribute_report(report, recipients=config["recipients"], fmt=config["format"])
return report.path
| Level | Capability | Users can... |
|---|---|---|
| 1 - Consumers | View & filter | Open dashboards, apply filters, export data |
| 2 - Explorers | Ad-hoc queries | Write simple queries, create basic charts, share findings |
| 3 - Builders | Design dashboards | Combine data sources, create calculated fields, publish reports |
| 4 - Modelers | Define data models | Create semantic models, define metrics, optimize performance |
Query optimization example:
-- Before: full table scan
SELECT * FROM large_table WHERE date >= '2024-01-01';
-- After: partitioned, filtered, and column-pruned
SELECT order_id, customer_id, amount
FROM large_table
WHERE partition_date >= '2024-01-01'
AND status = 'active'
LIMIT 10000;
The agent frames every insight using Situation-Complication-Resolution:
security_model:
row_level_security:
- rule: region_access
filter: "region = user.region"
object_permissions:
- role: viewer
permissions: [view, export]
- role: editor
permissions: [view, export, edit]
- role: admin
permissions: [view, export, edit, delete, publish]
All four read your files, use only the standard library, support --format text|json (--json still works) and --input as an alias of --definitions.
python3 scripts/kpi_tracker.py --definitions assets/flawed_kpis.json --data assets/sales.csv
python3 scripts/metric_validator.py --definitions assets/flawed_metrics.json --strict
python3 scripts/dashboard_spec_generator.py --definitions assets/sample_dashboard_kpis.json --title "Sales Dashboard" --layout 3-column --format json
Real output of the first command (excerpt):
Read 8 data rows, 4 KPI definitions.
GREEN 0 YELLOW 0 RED 3 ERROR 1 NO_TARGET 0
[RED] Monthly Revenue: sum(revenue) = 102,000.00 target 900,000.00 (-88.7%) [8/8 rows used]
fix: Monthly Revenue: 102,000.00 is below the 90% line (810,000.00); raise it by 798,000.00 to hit target 900,000.00
[ERROR] Refund Rate: column 'refund_rate' not in data
fix: use one of the data columns: order_id, region, response_hours, revenue
FIX 4 KPI(s)
| Tool | Purpose | Key flags |
|---|---|---|
kpi_tracker.py | Aggregate a column per KPI (sum, mean, count, count_distinct, min, max, median), compare to target, report rows used/skipped | --definitions, --data (.csv/.json) |
metric_validator.py | Check required fields, names, aggregation, threshold order/range, formula vs aggregation, duplicates | --definitions, --strict |
dashboard_spec_generator.py | Rule-based chart type, grid position and filters per KPI (chart_hint overrides) | --definitions, --title, --layout 2-column/3-column |
dashboard_reviewer.py | Review an existing dashboard spec (tiles, definitions, charts) | positional spec JSON, --max-tiles |
warning_pct (default 0.9) and critical_pct (default 0.8) are tolerance heuristics, set per KPI. Higher is better: GREEN at or above target x warning_pct, YELLOW at or above target x critical_pct, else RED. Lower is better: GREEN at or below target / warning_pct, YELLOW at or below target / critical_pct, else RED. Missing columns and non-numeric cells are reported, never scored as zero.
| Code | Meaning |
|---|---|
| 0 | Clean: all KPIs GREEN / no validation issues / spec generated |
| 1 | Findings: any KPI YELLOW, RED or ERROR; any validator error or warning |
| 2 | Unusable input: missing/unreadable file, wrong shape, empty array (one-line message on stderr) |
Sample inputs live in assets/ (sample_* exit 0, flawed_* exit 1, malformed_* exit 2); assets/contract.json lists the runs.
dashboard_spec_generator.py designs a new dashboard from KPI definitions. dashboard_reviewer.py is the other direction: it reads a dashboard that already exists, described as a spec JSON, and flags what will make people ignore or misread it. Different input, different job; use the generator first, the reviewer before launch and at each quarterly review.
Spec fields: title, audience, decision, refresh, and tiles (each with metric, definition, chart_type, has_target, comparison_period, filters, refresh; optional slices, dual_axis, three_d, axis_starts_at_zero).
python3 scripts/dashboard_reviewer.py assets/flawed_dashboard_review.json
Real output (excerpt, exit 1):
Read dashboard 'Everything Board': 9 tiles from assets/flawed_dashboard_review.json.
missing: tile 7 'Leads': axis_starts_at_zero not stated for a bar chart, truncation not checked
3. [high] dashboard: KPI_OVERLOAD
Problem: 9 tiles (limit 8); beyond the limit: Tickets
Fix: cut to 8 or move Tickets to a drill-down page
9. [high] tiles 1, 2: DUPLICATE_METRIC_DIFFERENT_DEFINITION
Problem: 'Revenue' appears 2 times with different definitions: tile 1 says 'SUM(invoice_amount)'; tile 2 says 'SUM(invoice_amount) - SUM(refunds)'
Fix: keep one definition of 'Revenue' in the semantic layer and point every tile at it, or rename the variants
FIX 14 issue(s)
Checks: no stated audience or decision; more than 8 tiles; tile with no definition, has_target: false, or no comparison period; pie or donut over 5 slices; dual-axis; 3D; bar or column axis not starting at zero; same metric name with different definitions; no refresh cadence. Facts the spec does not state (slice count, axis start, target) are listed as missing, never assumed. All limits are internal heuristics; change the tile limit with --max-tiles.
Mistake: Putting 15 tiles on one page so every stakeholder finds "their" number. Readers stop scanning and the decision the page was for is never made. Cap at 8 and push the rest to drill-downs.
Mistake: Showing "Revenue" gross on one tile and net of refunds on another. Two numbers for one name destroys trust faster than any outage. Define each metric once in the semantic layer.
Mistake: Tiles with no target and no comparison period. A figure alone cannot be good or bad. Add a target and a prior-period comparison to every tile, or mark it context-only.
| Problem | Likely Cause | Resolution |
|---|---|---|
| Dashboard loads slowly (> 5 s) | Too many visualizations or live-connection queries hitting raw tables | Reduce widgets to 5-8 per page; switch to extracts or materialized views for heavy dashboards |
| KPI values differ between dashboard and source query | Dashboard applies additional filters, currency conversion, or calculated fields not in the semantic layer | Centralize all metric logic in the semantic layer; remove dashboard-level computed fields |
| RAG thresholds trigger false alerts | Warning/critical percentages are miscalibrated for seasonal patterns | Adjust thresholds per season or use rolling baselines; validate with metric_validator.py --strict |
| Stakeholders ignore dashboards | Dashboard answers the wrong questions or lacks actionable context | Redesign using the Situation-Complication-Resolution storytelling framework; add annotations and targets |
| Row-level security hides data unexpectedly | Security rules are too broad or user-role mapping is incorrect | Audit RLS rules; test with a sample user from each role; log filtered row counts |
| Scheduled report emails land in spam | Large PDF attachments or sender reputation issues | Reduce attachment size; switch to embedded links; work with IT to whitelist the sender domain |
metric_validator.py reports formula-aggregation mismatch | The formula field (e.g., "SUM(...)") does not match the declared aggregation | Align the two fields; the aggregation field drives the tool while the formula documents intent |
metric_validator.py --strict with zero errors before production deployment.In scope: Dashboard design and layout, KPI framework definition, report automation patterns, data storytelling, self-service BI enablement, row-level security configuration, and visualization best practices.
Out of scope: Data warehouse infrastructure, ETL/ELT pipeline development, raw data ingestion, machine learning model building, and BI tool installation or licensing.
Limitations: The Python tools (kpi_tracker.py, dashboard_spec_generator.py, metric_validator.py, dashboard_reviewer.py) operate on local JSON and CSV files only -- they do not connect to live databases or BI platforms. All scripts use the Python standard library with no external dependencies. dashboard_reviewer.py judges only what the spec states: it cannot see the rendered dashboard, colours or layout. Dashboard specifications are platform-agnostic and require manual translation to specific BI tools (Tableau, Power BI, Looker, etc.).
data-analytics/analytics-engineer): Provides the mart models and semantic-layer metrics that dashboards consume; schema changes require dashboard updates.data-analytics/data-analyst): Creates ad-hoc analyses that may evolve into repeatable dashboards; shares visualization standards.product-team/): Defines product KPIs and user-facing analytics requirements.c-level-advisor/): Executive dashboards translate strategic objectives into measurable KPIs.finance/): Financial KPIs (MRR, CAC, LTV) require alignment between BI dashboards and finance team definitions.README.md (opens in a new tab)assets/contract.json (opens in a new tab)assets/flawed_dashboard_review.json (opens in a new tab)assets/flawed_kpis.json (opens in a new tab)assets/flawed_metrics.json (opens in a new tab)assets/malformed_dashboard_kpis.json (opens in a new tab)assets/malformed_dashboard_review.json (opens in a new tab)assets/malformed_kpis.json (opens in a new tab)assets/malformed_metrics.json (opens in a new tab)assets/sales.csv (opens in a new tab)assets/sample_dashboard_kpis.json (opens in a new tab)assets/sample_dashboard_review.json (opens in a new tab)assets/sample_kpis.json (opens in a new tab)assets/sample_metrics.json (opens in a new tab)scripts/dashboard_reviewer.py (opens in a new tab)scripts/dashboard_spec_generator.py (opens in a new tab)scripts/kpi_tracker.py (opens in a new tab)scripts/metric_validator.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/analytics-engineerAnalytics engineering across data modeling, dbt, transformation, and semantic layers, with tools that check a dbt manifest/catalog (model quality, downstream impact, schema drift, model docs). Use when building dbt models, designing star schemas, writing staging or mart SQL, configuring data tests, optimizing warehouse queries, or before merging a dbt change that may break dashboards.
/data-analystProfiles CSV/JSON exports for data-quality problems (with the fix per column), checks SQL for correctness traps and slow patterns, and builds a paste-ready summary report. Use when someone shares a data export or a query and asks what it says, whether it can be trusted, or how to fix it; also for cohort, funnel and dashboard work.
/data-scientistExperiment design and A/B readouts (sample size, sample-ratio and contamination checks, tests with intervals), feature screening for leakage, model evaluation against a no-skill baseline, and fair experiment comparison. Use when sizing or reading out an A/B test, choosing features, judging a model from its predictions, or picking between training runs.
/data-storytellingCheck that an analysis write-up says what the data says: figures traced to the results file, headline and caveats, chart choices. Use when reviewing a report, dashboard narrative or findings memo before it goes out.
/ml-ops-engineerMLOps across model deployment, ML pipelines, monitoring, and feature stores, with three offline tools: a PSI/KS drift check on two CSV files, a pipeline definition validator, and a local model registry with regression-aware version comparison. Use when deploying models to production, validating a training pipeline definition, checking a production dataset for drift against training data, promoting or comparing model versions, setting up a feature store, or automating ML CI/CD workflows.
/statistical-analystApplied statistics for business and product questions — test selection, assumption checks, power planning, effect sizes with intervals, multiplicity correction. Use when interpreting an experiment, sizing a study, or vetting a claim.
npx claudepluginhub borghei/claude-skills --plugin data-analytics-skillsOther plugins' skills for the same job