pm-data-analytics Plugin Skills and Commands: Complete Technical Reference

The pm-data-analytics plugin exposes three markdown-driven skills—sql-queries, cohort-analysis, and ab-test-analysis—through the CLI commands write-query, analyze-cohorts, and analyze-test.

The pm-data-analytics plugin is a self-contained analytics toolkit within the phuryn/pm-skills repository that enables product-focused LLM agents to generate SQL, perform cohort retention analysis, and evaluate A/B test results. The plugin follows a declarative architecture where each skill is defined in a markdown file with YAML front-matter, parsed at runtime to construct LLM prompts.

Plugin Architecture and File Structure

The plugin uses a three-layer architecture separating registration metadata, skill definitions, and command interfaces:

Component Role File Path
Plugin Registration Registers the plugin with the Claude/Opus ecosystem, declares available commands and skill mappings pm-data-analytics/.claude-plugin/plugin.json
Skill Specifications Markdown files containing workflow descriptions, capabilities, and output formats parsed by the agent runtime pm-data-analytics/skills/sql-queries/SKILL.md, pm-data-analytics/skills/cohort-analysis/SKILL.md, pm-data-analytics/skills/ab-test-analysis/SKILL.md
Command Definitions Minimal CLI documentation mapping command verbs to specific skills pm-data-analytics/commands/write-query.md, pm-data-analytics/commands/analyze-cohorts.md, pm-data-analytics/commands/analyze-test.md

Each skill file begins with a standardized front-matter block (---\nname: …\ndescription: …\n---) followed by a detailed "How It Works" section that the runtime transforms into executable prompts.

Core Skills Overview

SQL Query Generation (sql-queries)

The sql-queries skill, defined in pm-data-analytics/skills/sql-queries/SKILL.md, handles natural-language-to-SQL translation across multiple dialects. The skill guides the LLM through schema parsing, query construction, and optimization while respecting dialect-specific syntax (BigQuery, PostgreSQL, etc.).

Cohort Analysis (cohort-analysis)

Located at pm-data-analytics/skills/cohort-analysis/SKILL.md, this skill orchestrates retention analysis workflows. It instructs the LLM to validate CSV data, calculate retention metrics, identify drop-off points, and generate visualization recommendations for user cohorts.

A/B Test Analysis (ab-test-analysis)

The ab-test-analysis skill in pm-data-analytics/skills/ab-test-analysis/SKILL.md encodes statistical validation logic. It directs the LLM to compute sample sizes, p-values, confidence intervals, and statistical significance while providing decision recommendations based on the configured confidence level.

CLI Commands and Usage

The plugin exposes skills through the pm-data-analytics CLI. Each command maps a user-facing verb to its corresponding skill file:

Generate SQL from natural language:

pm-data-analytics write-query \
  --dialect bigquery \
  --schema ./schemas/ecommerce.sql \
  "Give me the total revenue per country for the last 30 days, broken down by device type."

Analyze cohort retention from CSV data:

pm-data-analytics analyze-cohorts \
  --data ./data/cohort_engagement.csv \
  --description "Analyze retention for Jan-Mar 2025 cohorts and highlight any drop-offs."

Evaluate A/B test statistical significance:

pm-data-analytics analyze-test \
  --experiment "Homepage CTA colour test" \
  --data ./data/ab_test_results.xlsx \
  --confidence 95

Runtime Execution Flow

When a user executes a command, the pm-data-analytics runtime performs three distinct operations:

  1. CLI Parsing: The command-line interface parses flags and forwards the raw request to the Claude runtime
  2. Skill Loading: The runtime locates and loads the matching SKILL.md file (e.g., sql-queries/SKILL.md for the write-query command)
  3. Prompt Construction: The skill's step-by-step guide is transformed into a prompt instructing the LLM to parse schema/data files, compute the requested artefact (SQL query, pandas script, or statistical summary), and return a structured markdown response containing the artefact, explanation, and performance notes

Because skills are pure markdown, they can be updated without code changes or redeployment.

Key Files Reference

Understanding these critical files enables effective customization and debugging:

Summary

  • The pm-data-analytics plugin provides three specialized skills: sql-queries, cohort-analysis, and ab-test-analysis
  • Skills are defined in markdown files (SKILL.md) with YAML front-matter, parsed at runtime by the Claude agent
  • Commands (write-query, analyze-cohorts, analyze-test) are thin wrappers that map CLI verbs to skill files in pm-data-analytics/commands/
  • The plugin architecture enables updating analytics workflows without code changes
  • All skill files follow the path pattern pm-data-analytics/skills/{skill-name}/SKILL.md

Frequently Asked Questions

How does the pm-data-analytics plugin register with the Claude runtime?

The plugin registers through pm-data-analytics/.claude-plugin/plugin.json, which declares the plugin metadata and maps command names to their respective skill entry points. This JSON file tells the Claude/Opus ecosystem which skills are available and how to invoke them.

Can I modify the pm-data-analytics skills without changing source code?

Yes. Because skills are pure markdown documents with front-matter blocks, you can edit the SKILL.md files directly to adjust workflows, output formats, or analytical requirements. Changes take effect immediately without recompilation since the runtime parses these files at execution time.

What data formats does the analyze-cohorts command support?

According to the skill definition in pm-data-analytics/skills/cohort-analysis/SKILL.md, the command accepts CSV files for cohort data ingestion. The skill instructs the LLM to validate the CSV structure before performing retention calculations and identifying drop-off patterns.

How does the write-query command handle different SQL dialects?

The write-query command accepts a --dialect parameter (e.g., bigquery, postgresql) that the runtime passes to the sql-queries skill. The SKILL.md file contains dialect-specific guidance that instructs the LLM to generate syntax-compliant SQL for the specified database engine.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →