# Data Analytics Features in pm-data-analytics: SQL Generation, Cohort Analysis, and A/B Testing

> Discover pm-data-analytics features like natural language SQL generation, cohort analysis, and A/B testing. This plugin offers powerful data analysis tools.

- Repository: [Pawel Huryn/pm-skills](https://github.com/phuryn/pm-skills)
- Tags: deep-dive
- Published: 2026-06-29

---

**The pm-data-analytics plugin provides three primary data analytics features—natural language SQL generation, automated cohort analysis, and statistical A/B test evaluation—implemented as reusable skills and exposed through slash commands that accept file uploads and natural language prompts.**

The `pm-data-analytics` plugin is a core component of the PM Skills Marketplace (`phuryn/pm-skills`), offering product managers automated data analytics capabilities without requiring manual coding or statistical expertise. This plugin implements three specialized skills that transform raw data and natural language requests into production-ready outputs, visualizations, and statistical verdicts.

## Core Data Analytics Skills

The plugin bundles three distinct skills defined in [`SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/SKILL.md) files, each targeting specific product management data workflows.

### SQL Query Generation

The **SQL Query Generation** skill, defined in [`pm-data-analytics/skills/sql-queries/SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/skills/sql-queries/SKILL.md), converts plain-language requests into production-ready SQL for BigQuery, PostgreSQL, MySQL, Snowflake, and other databases. This skill reads database schema files, optimizes query performance, and can generate accompanying test scripts to validate the output.

### Cohort Analysis

The **Cohort Analysis** skill, located at [`pm-data-analytics/skills/cohort-analysis/SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/skills/cohort-analysis/SKILL.md), processes CSV, Excel, or JSON data to compute retention curves and adoption trends. It generates heat-maps, line charts, and reproducible Python scripts that allow PMs to analyze why specific user cohorts exhibit different behaviors over time.

### A/B Test Analysis

The **A/B Test Analysis** skill, documented in [`pm-data-analytics/skills/ab-test-analysis/SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/skills/ab-test-analysis/SKILL.md), calculates statistical significance, verifies sample size adequacy, and delivers actionable recommendations. The skill outputs p-values, confidence intervals, and specific next-step directives—**ship**, **extend**, or **stop**—based on the experimental results.

## Slash Commands for Data Analytics

Each skill maps to a dedicated slash command that provides a simplified interface for invoking the underlying analytics capabilities.

### /write-query

The `/write-query` command, defined in [`pm-data-analytics/commands/write-query.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/commands/write-query.md), serves as a wrapper for the SQL generation skill. Users describe the report they need in natural language, and the command returns a formatted SQL query with execution notes and optional performance optimizations.

### /analyze-cohorts

The `/analyze-cohorts` command, found in [`pm-data-analytics/commands/analyze-cohorts.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/commands/analyze-cohorts.md), triggers the cohort analysis skill. This command accepts uploaded data files or schema descriptions, then returns retention visualizations, metric tables, and behavioral hypotheses for follow-up research.

### /analyze-test

The `/analyze-test` command, specified in [`pm-data-analytics/commands/analyze-test.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/commands/analyze-test.md), invokes the A/B test analysis skill. After receiving CSV results or pasted data from control and variant groups, it provides statistical assessments, data quality checks, and concrete recommendations on whether to ship the variant.

## Plugin Architecture

The `pm-data-analytics` plugin follows the standard PM Skills Marketplace structure, separating reusable logic from user-facing interfaces. **Skills** defined in [`SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/SKILL.md) files contain front-matter metadata (including `name` and `description`) and multi-step workflows that the runtime loads when user prompts match their purpose. **Commands** in the `commands/` directory act as thin wrappers that pass context—including uploaded files and parameters—to these skills. This decoupled architecture allows multiple commands to reuse the same skill, and enables direct skill invocation via `/plugin-name:skill-name` syntax for ad-hoc queries without command overhead.

## Practical Usage Examples

### Generating SQL Queries

To create a production SQL query without writing code:

```markdown
/write-query
Show me monthly active users by country for Q4 2025 (BigQuery)

```

This command returns a formatted BigQuery SQL query, execution explanation, and optional performance notes.

### Analyzing User Cohorts

To investigate retention patterns across user segments:

```markdown
/analyze-cohorts
Upload cohort_engagement.csv
Request: "Identify why the Jan 2025 cohort churned faster than the Dec 2024 cohort."

```

The output includes a retention heat-map, key metrics table, and prioritized hypotheses for product investigation.

### Evaluating A/B Test Results

To determine statistical significance and next steps:

```markdown
/analyze-test
Here are the CSV results from our checkout-flow experiment (control vs. variant):
[attach checkout_test.csv]

Please tell me whether the variant is statistically significant and if we should ship.

```

This returns the p-value, confidence interval, recommended action (ship/extend/stop), and a data quality assessment.

## Summary

- **SQL Query Generation** transforms natural language into optimized database queries for multiple SQL dialects, complete with schema awareness and test scripts.
- **Cohort Analysis** converts raw engagement data into retention visualizations and Python scripts, identifying behavioral trends across user segments.
- **A/B Test Analysis** delivers statistical significance calculations, sample size validation, and actionable ship/extend/stop recommendations.
- All features are accessible via **slash commands** (`/write-query`, `/analyze-cohorts`, `/analyze-test`) that wrap the underlying skills defined in `pm-data-analytics/skills/`.
- The architecture decouples skills from commands, enabling flexible reuse and direct skill invocation without command overhead.

## Frequently Asked Questions

### What databases does the SQL generation skill support?

The SQL generation skill supports BigQuery, PostgreSQL, MySQL, Snowflake, and other major SQL dialects according to the `phuryn/pm-skills` source code. The skill reads database schema files to generate optimized, syntactically correct queries specific to your target platform. It also produces test scripts to validate query accuracy before production deployment.

### Can I use the cohort analysis skill without uploading a CSV file?

Yes, the `/analyze-cohorts` command accepts natural language descriptions of your data structure in addition to CSV, Excel, and JSON uploads. The skill processes either input format to generate retention curves, heat-maps, and reproducible Python scripts. This flexibility allows analysis without requiring file attachments when working with summarized data.

### How does the A/B test analysis determine whether to ship or stop an experiment?

The A/B test analysis skill calculates p-values and confidence intervals to assess statistical significance against predefined thresholds. It evaluates sample size adequacy to ensure the experiment reached sufficient statistical power for reliable conclusions. Based on these calculations, it issues concrete **ship**, **extend**, or **stop** recommendations grounded in statistical rigor.

### Where are the skill definitions and command configurations stored in the repository?

Skill definitions reside in `pm-data-analytics/skills/<skill-name>/SKILL.md` files, while command configurations are stored in `pm-data-analytics/commands/<command-name>.md` as implemented in `phuryn/pm-skills`. The plugin overview and installation instructions are available in [`pm-data-analytics/README.md`](https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/README.md) at the root of the plugin directory. This structure follows the standard PM Skills Marketplace pattern of decoupling skills from commands.