How to Use the pm-data-analytics Plugin for SQL Queries and A/B Test Analysis
The pm-data-analytics plugin provides Claude with two specialized skills—sql-queries and ab-test-analysis—that transform natural language into production-ready SQL or statistical experiment reports through simple slash commands.
The pm-data-analytics plugin is a self-contained Claude plugin within the phuryn/pm-skills repository that enables product managers to generate database queries and evaluate experiments without leaving the chat interface. This guide explains how to use the pm-data-analytics plugin for SQL and A/B tests by leveraging its skill-based architecture and slash-command interface.
Understanding the Plugin Architecture
The plugin follows a three-layer architecture defined in the source code. At the entry point, pm-data-analytics/.claude-plugin/plugin.json registers the plugin with Claude and exposes the namespace. Skill definitions reside in Markdown files like pm-data-analytics/skills/sql-queries/SKILL.md and pm-data-analytics/skills/ab-test-analysis/SKILL.md, which contain YAML headers and step-by-step workflows. Finally, command wrappers in pm-data-analytics/commands/write-query.md and pm-data-analytics/commands/analyze-test.md map user inputs to these skills.
Generating SQL Queries with the sql-queries Skill
Using the /write-query Command
The /write-query command invokes the sql-queries skill defined in pm-data-analytics/skills/sql-queries/SKILL.md. When you provide a natural language request, Claude parses the intent and generates dialect-specific SQL for BigQuery, PostgreSQL, MySQL, Snowflake, or other supported databases.
Example usage:
/write-query Show me daily active users for the last 30 days, broken down by plan tier
Claude returns production-ready SQL with explanatory comments:
-- Daily Active Users per Plan Tier (BigQuery)
WITH events AS (
SELECT user_id, plan_tier, DATE(event_timestamp) AS event_date
FROM `project.dataset.events`
WHERE event_timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
)
SELECT event_date,
plan_tier,
COUNT(DISTINCT user_id) AS dau
FROM events
GROUP BY event_date, plan_tier
ORDER BY event_date;
Schema-Aware Query Generation
For complex queries, upload your schema before requesting SQL. The skill reads the schema context to map tables and relationships correctly.
Example workflow:
/upload database_schema.sql
/write-query Generate a query to compute monthly churn rate per product line.
Claude analyzes the uploaded schema and produces a query tailored to your specific table structure, following the workflow steps defined in the SQL skill file.
Analyzing A/B Tests with the ab-test-analysis Skill
Using the /analyze-test Command
The /analyze-test command triggers the ab-test-analysis skill documented in pm-data-analytics/skills/ab-test-analysis/SKILL.md. This skill validates experiment design, computes statistical significance, calculates confidence intervals, and outputs a clear ship/extend/stop recommendation.
Example usage with summary statistics:
/analyze-test Control: 4.2% conversion (n=5000), Variant: 4.8% conversion (n=5100)
Claude generates a comprehensive statistical report:
## A/B Test Analysis: Example Test
**Date**: 2026-06-20
**Test duration**: 14 days
**Total sample**: 10 100 users
### Results Summary
| Variant | Sample | Conversion | 95% CI |
|---------|--------|------------|--------|
| Control | 5 000 | 4.20% | 3.95%–4.45% |
| Variant | 5 100 | 4.80% | 4.55%–5.05% |
### Statistical Analysis
- **Relative lift**: +14.3% (0.60 % absolute)
- **p-value**: 0.013 (two-tailed z-test)
- **Statistically significant**: Yes (α = 0.05)
**Recommendation**: **SHIP** – lift is statistically and practically significant, and no guard-rail metrics were degraded.
Key Source Files in the Repository
Understanding the file structure helps when customizing or debugging the plugin:
pm-data-analytics/.claude-plugin/plugin.json– Registers the plugin metadata and namespace with Claude.pm-data-analytics/skills/sql-queries/SKILL.md– Defines the SQL generation workflow, including dialect handling and formatting rules.pm-data-analytics/skills/ab-test-analysis/SKILL.md– Defines the statistical analysis workflow, including power analysis and significance testing steps.pm-data-analytics/commands/write-query.md– Implements the/write-queryslash command interface.pm-data-analytics/commands/analyze-test.md– Implements the/analyze-testslash command interface.pm-data-analytics/README.md– Provides overview documentation for the plugin's capabilities.
Summary
- The pm-data-analytics plugin from
phuryn/pm-skillsadds SQL generation and A/B test analysis capabilities to Claude through a skill-based architecture. - Use
/write-queryto convert natural language into production-ready SQL for multiple database dialects. - Use
/analyze-testto receive statistical significance testing, confidence intervals, and ship recommendations from experiment data. - All skills run entirely within Claude's sandbox using Markdown-defined workflows in
SKILL.mdfiles, requiring no external binaries or API keys.
Frequently Asked Questions
What databases does the pm-data-analytics plugin support?
The sql-queries skill generates SQL for BigQuery, PostgreSQL, MySQL, Snowflake, and other major dialects. The specific syntax is automatically selected based on context clues in your request or explicit dialect hints provided in the natural language input.
How does the ab-test-analysis skill calculate statistical significance?
According to the workflow defined in pm-data-analytics/skills/ab-test-analysis/SKILL.md, the skill performs a two-tailed z-test to calculate p-values, constructs 95% confidence intervals, and evaluates practical significance against your defined minimum detectable effect. It returns a structured recommendation of SHIP, EXTEND, or STOP based on these calculations.
Can I use the pm-data-analytics plugin without uploading a schema?
Yes. While uploading a schema via /upload enables more accurate table and column references, the sql-queries skill can generate generic SQL based on standard naming conventions and your natural language description alone. The skill will mark assumptions clearly in the generated code comments.
Where are the skill definitions stored in the repository?
Skill definitions are stored as Markdown files in the pm-data-analytics/skills/ directory. The SQL skill logic resides in pm-data-analytics/skills/sql-queries/SKILL.md, while the A/B test analysis logic is in pm-data-analytics/skills/ab-test-analysis/SKILL.md. Each file contains a YAML header with metadata and a detailed workflow section that Claude follows when executing the skill.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →