Data analysis workflows

From infometa/workbuddyskills · View interactive version

Data analysis workflows is an AI agent skill from the GitHub repository infometa/workbuddyskills. Comprehensive data analysis workflows including answering data questions, exploring datasets, writing SQL queries, creating visualizations, building dashboards, and validating analyses. Use when conducting data analysis tasks, from quick lookups to comprehensive reports.

How to use this skill

Skill file

Data Analysis Workflows

Complete workflows for common data analysis tasks. Covers the full process from understanding requirements to delivering validated results.

Workflow 1: Answer Data Questions

Answer a data question, from a quick lookup to a full analysis to a formal report.

1. Understand the Question

Parse the user's question and determine:

2. Gather Data

Options for data access:

  1. Ask the user to provide data:
  1. If writing queries for manual execution, use the \sql-queries\ skill for dialect-specific best practices
  2. Once data is provided, proceed with analysis

3. Analyze

4. Validate Before Presenting

Before sharing results, run through validation checks:

If any check raises concerns, investigate and note caveats.

5. Present Findings

For quick answers:

For full analyses:

For formal reports:


Workflow 2: Explore and Profile Datasets

Generate a comprehensive data profile for a table or uploaded file. Understand its shape, quality, and patterns before diving into analysis.

1. Access the Data

If a file is provided (CSV, Excel, Parquet, JSON):

  1. Read the file and load into a working dataset
  2. If the file is large, sample it for profiling

If user describes a table:

  1. Ask for sample data or schema information
  2. Generate profiling queries for the user to run

2. Profile the Dataset

Generate a report covering:

Basic Statistics
Column-Level Analysis

For each column, report:

Data Quality Flags

Automatically identify potential issues:

3. Recommend Next Steps

Based on profiling results, suggest:


Workflow 3: Write Optimized SQL

Write a SQL query from a natural language description, optimized for your specific SQL dialect and following best practices.

1. Understand the Request

Parse the user's description to identify:

2. Determine SQL Dialect

Ask the user which database they're using if not specified:

Each dialect has syntax differences for date functions, string operations, and window functions.

3. Write the Query

Use CTEs (Common Table Expressions) for complex queries:

\\\`sql

WITH base_data AS (

-- First CTE: Get the base dataset

SELECT ...

),

aggregated AS (

-- Second CTE: Perform aggregations

SELECT ...

)

-- Final SELECT from CTEs

SELECT * FROM aggregated;

\\\`

Best practices:

4. Add Context

Include with the query:


Workflow 4: Create Visualizations

Create publication-quality data visualizations using Python. Generates charts from data with best practices for clarity, accuracy, and design.

1. Understand the Request

Determine:

2. Get the Data

If data is not yet provided:

3. Choose the Right Chart Type

Select visualization based on what you're showing:

| What You're Showing | Best Chart | When to Use |

|---------------------|------------|-------------|

| Trend over time | Line chart | Continuous time series, shows change |

| Comparison across categories | Bar chart | Comparing discrete categories |

| Part-to-whole | Stacked bar / Pie | Composition, relative sizes |

| Distribution | Histogram / Box plot | Understanding spread and outliers |

| Correlation | Scatter plot | Relationship between two variables |

| Ranking | Horizontal bar | Ordered list, easy to read labels |

4. Generate Python Code

Use \plotly\ for interactive charts, \seaborn\ or \matplotlib\ for static charts.

Chart template pattern:

\\\`python

import matplotlib.pyplot as plt

import pandas as pd

Load data

df = pd.DataFrame({...})

Create figure

fig, ax = plt.subplots(figsize=(10, 6))

Plot

ax.plot(df['x'], df['y']) # or .bar(), .scatter(), etc.

Style

ax.set_title('Clear, Descriptive Title', fontsize=14, fontweight='bold')

ax.set_xlabel('X Axis Label')

ax.set_ylabel('Y Axis Label')

ax.grid(axis='y', alpha=0.3)

Show

plt.tight_layout()

plt.show()

\\\`

5. Apply Design Principles


Workflow 5: Build Interactive Dashboards

Build a self-contained interactive HTML dashboard with charts, filters, tables, and professional styling. Opens directly in a browser -- no server or dependencies required.

1. Understand Dashboard Requirements

Determine:

2. Gather the Data

If data needs to be queried, use the SQL workflow.

If data is provided, ensure it's in a structured format (CSV or JSON).

3. Design Dashboard Layout

Organize into sections:

  1. Header: Title, date range, key filters
  2. KPI cards: 3-5 big numbers that matter most
  3. Primary charts: 2-3 main visualizations (trends, comparisons)
  4. Details section: Tables or secondary charts for drill-down
  5. Footer: Methodology notes, data source, last updated

4. Generate HTML/JS Code

Use this template structure:

\\\`html

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Dashboard Title</title>

<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>

<style>

/* CSS styling */

</style>

</head>

<body>

<div class="container">

<!-- Dashboard content -->

</div>

<script>

// Data

const data = { /* embed data here */ };

// Charts

// Filters

// Interactivity

</script>

</body>

</html>

\\\`

5. Add Interactivity

Implement:


Workflow 6: Validate Analysis Before Sharing

Review an analysis for accuracy, methodology, and potential biases before sharing with stakeholders. Generates a confidence assessment and improvement suggestions.

1. Review Methodology and Assumptions

Examine:

Data selection:

Aggregation logic:

Statistical methods:

2. Check for Common Pitfalls

Survivorship bias:

Selection bias:

Simpson's paradox:

Correlation vs. causation:

3. Sanity Check Results

Compare results to expectations:

If something looks off:

4. Assess Confidence Level

Rate confidence as:

5. Document Limitations

Every analysis has limits. Document:

Example caveat:

"This analysis excludes trial users, which may overstate conversion rate by ~5pp compared to total signups."


When to Use Each Workflow

Use these workflows in combination for complex projects. For example:

  1. Explore data → 2. Write SQL → 3. Create visualization → 4. Validate → 5. Share
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.