/ai-analyst-plus:compare-datasetsfrom ai-analyst-plus
Compares metrics, findings, and patterns across two or more datasets in the knowledge directory. Identifies cross-dataset commonalities, dataset-specific anomalies, and metric differences.
Ships in ai-analyst-plus. 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.
None: SKILL.md is the whole skill.
Compare metrics, findings, and patterns across two or more connected datasets. Helps identify cross-dataset patterns (e.g., "conversion funnel behavior is similar across both product lines") and dataset-specific anomalies.
/compare-datasets or "compare across datasets"/compare-datasets — compare active dataset with all others
/compare-datasets {id1} {id2} — compare two specific datasets
/compare-datasets metric={name} — compare a specific metric across datasets
Before running the full 6-step workflow, verify the comparison is possible:
Check minimum requirements:
.knowledge/datasets/)/connect-data to add another."For data-intensive comparisons (e.g., retention, conversion funnels):
If comparison is BLOCKED:
Rationale: This saves time and avoids misleading partial comparisons. Better to diagnose "why we can't compare" upfront than to discover data gaps in Step 4.
.knowledge/datasets/ to enumerate all connected datasets.For each dataset:
.knowledge/datasets/{id}/metrics/index.yamlWhy this matters: Knowing upfront that metric dictionaries are empty helps explain why definitions might differ (they were never formalized).
Before any pattern comparison, reconcile the exports mechanically, in Python:
For each metric that exists in 2+ datasets:
If no formal metrics exist: Reconstruct from schema and document the inferred definition. Show the reconstruction in the output so the user understands what was compared.
For each dataset:
.knowledge/analyses/index.yamlEdge case handling:
Write findings to .knowledge/global/cross_dataset_observations.yaml:
---
comparison_date: YYYY-MM-DD
datasets_compared: [dataset_a, dataset_b]
comparison_type: [full | metric-specific | feasibility-blocked]
shared_patterns:
- pattern: "Mobile conversion gap"
datasets: [dataset_a, dataset_b]
magnitude: "Desktop ~40% higher than mobile in both"
confidence: HIGH # HIGH | MEDIUM | LOW
divergences:
- metric: revenue_per_user
dataset_a_value: $313.64
dataset_b_value: $113.98
explanation: "Different business models (retail vs. wholesale) or dataset maturity"
confidence: MEDIUM
metric_alignment:
- metric: conversion_rate
aligned: false
discrepancy: "Different column names (order_total vs. total_amount)"
blockers:
- issue: "Insufficient temporal span in Dataset B"
severity: CRITICAL
resolution: "Wait 3-6 months for data maturity"
suggested_investigations:
- "Investigate why revenue_per_user differs by 175%"
- "Align conversion_rate definitions across datasets"
- "Profile analytics_prod and company_postgres to check for device tracking"
IMPORTANT: Actually write this file to disk using the Write tool. In previous tests, this file was mentioned but not saved — that's a gap to fix.
Why this file matters: It creates a persistent record of cross-dataset insights that future analyses can reference. If Dataset B matures later, we can re-run the comparison and see how findings evolved.
Display a comparison table in your response to the user:
Cross-Dataset Comparison: {dataset_a} vs {dataset_b}
Comparison Status: [COMPLETE | PARTIAL | BLOCKED]
[If BLOCKED or PARTIAL, explain why upfront]
Shared Metrics: {N} ({M} with matching definitions)
Metric Discrepancies: {list}
Shared Patterns:
- {pattern description} (seen in both datasets, confidence: HIGH/MEDIUM/LOW)
- [If sample size > 30 per group, report statistical significance: "p < 0.001" (highly significant)]
Divergences:
- {metric} is {direction} in {dataset_a} but {direction} in {dataset_b}
- Explanation: {why this might be real vs. artifact}
- [If applicable, estimate business impact: "Fixing this could recover ~$X/month or Y conversions"]
Data Quality Issues:
- {Any temporal inconsistencies, sample size issues, schema gaps}
Suggested Next:
- "Investigate why {pattern} differs between datasets"
- "Align {metric} definitions across datasets"
- "Wait for Dataset B to mature before re-comparing" [if applicable]
Statistical Significance Guidance: When comparing metrics across datasets, report statistical significance where applicable:
Business Impact Estimation: For shared friction points or significant divergences, estimate business impact when possible:
Comparison Status Line: Include this upfront. If BLOCKED or PARTIAL, explain why immediately so the user knows whether to trust the findings.
Standard response: Cannot compare — suggest connecting another via /connect-data.
Pragmatic alternative: If the active dataset has natural segments (product categories, regions, user cohorts), offer to compare those segments instead:
"Only 1 dataset is connected, but it has two main product categories (Electronics and Clothing). Would you like me to compare checkout conversion between these categories instead?"
This interpretation is valid when:
.knowledge/datasets/Rationale: Comparing segments within a dataset can answer the same business question (e.g., "is this pattern universal or product-specific?") even when multiple datasets don't exist.
Report this — datasets may serve different purposes. Focus comparison on analysis history and schema structure instead.
Compare schemas and metric definitions only. State: "Neither dataset has analysis history yet. This comparison is limited to structural alignment (schemas, metric definitions)."
Compare pairwise with the active dataset only. List all datasets but only run the 6-step workflow for active vs. each other dataset. Present results in a summary table at the end.
Example: User asks to compare retention curves but Dataset B has only 27 days of data vs. Dataset A's 12 months.
Response:
comparison_type: feasibility-blocked flagRationale: Better to clearly state "we can't compare yet" than to produce misleading partial results. This was the strongest output from Test Case 3 — the skill correctly identified that comparison was impossible and explained why.
Example: Dataset B has future-dated records, customer ID mismatches across tables, or temporal inconsistencies.
Response:
SELECT order_date, TYPEOF(order_date) FROM orders LIMIT 10;)Rationale: Data quality issues can make comparisons meaningless. Better to diagnose and fix the source data than to compare bad data.
Upfront feasibility check (Step 0): Prevents wasted work when comparison is impossible. Test Case 3 showed that clearly diagnosing "this comparison is blocked" is more valuable than attempting partial analysis.
Explicit handling of empty metric dictionaries: Test Cases 1 and 2 both encountered empty metric dictionaries. The skill should acknowledge this and explain that definitions are inferred rather than formal.
Actually writing cross_dataset_observations.yaml: This file was mentioned but not shown in outputs. Making it explicit ensures the knowledge artifact is created.
Comparison Status line in output: Helps the user immediately understand if they're looking at a full comparison, partial comparison, or diagnostic report explaining why comparison failed.
Data quality diagnostics: Test Case 3 revealed future-dated records in one dataset. The skill should surface these issues and recommend fixes.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ai-analyst-lab/ai-analyst-plugin --plugin ai-analyst-plus47 skills in this plugin
/always-compareNever present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available. Use every time you show a number: rates, counts, revenue, averages, query results, chart labels, summary stats. Trigger on output containing "the rate is", "we saw", "total", "average", "conversion", "revenue", "users", "sessions", "churn", "AOV", "NPS", or any figure pulled from data./analysis-designTurn a vague hunch or stakeholder request into a rigorous analysis plan via a staged pipeline (hypothesis sharpening, confound scan, V1, feedback, V2 redesign). Trigger on "I think X caused Y", "design an analysis for", "what's driving", "V2 after feedback", "stakeholder comments", "redesign the analysis". Vs question-framing (the lightweight framing gate before every analysis): use THIS only for a real hunch, confound scan, or V1 to V2 redesign./analyst-coreOperating rules for every data analysis. Apply for ANY data-analysis intent: "analyze", "investigate", "why did X change", "compare", "report on", "dashboard", "metrics", "funnel", "retention", "revenue", "conversion", "trend", "segment", "forecast", "how are we doing", "dig into", "break down", or any question about data, a metric, a CSV, or a table. Sets the method and routes to the other skills; load before any analytical question.Other plugins' skills for the same job