sql-queries

sql-queries is a skill for Claude Code from phuryn/pm-skills. It costs 55 tokens per session (784 once invoked), scanned A, original, MIT.

A tool that turns plain-language data questions into SQL, the language used to retrieve and analyze information in databases. It can work across database dialects such as BigQuery, PostgreSQL, MySQL, and others when the needed details are provided.

In plain words
What is it for?
Use it to write queries for reports, data exploration, business questions, and database analysis from a schema and a description of the information needed.
Why use it?
It removes much of the manual SQL syntax work and uses a supplied schema to reference tables, columns, and relationships more accurately. It also explains the query and suggests ways to validate or improve it.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the pm-data-analytics plugin — 3 skills, 3 commands shipped together

not rated 27krepo +258 4d ago A scan Socket: passSnyk: passSkillSpector: pass 55 tokens original MIT

Good fit Use it to write queries for reports, data exploration, business questions, and database analysis from a schema and a description of the information needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/phuryn/pm-skills/sql-queries
About the project

phuryn/pm-skills is a marketplace of reusable skills, commands, and plugins that guide AI assistants through product-management work such as discovery, strategy, planning, metrics, launches, and growth. It is for product managers and teams using Claude Code, Cowork, or compatible assistants. The catalogue entries are the project's own workflows and extensions.

phuryn/pm-skills · 27,222 stars · on GitHub · productcompass.pm

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add phuryn/pm-skills --skill sql-queries
Clone the repo
git clone --depth 1 https://github.com/phuryn/pm-skills

Made for: Claude Code.

Or install pm-data-analytics, the plugin that ships this one along with the rest of its 3 skills, 3 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-queries

README.md
[![agentmods](https://agentmods.dev/badge/skills/phuryn/pm-skills/sql-queries/github.svg)](https://agentmods.dev/skills/phuryn/pm-skills/sql-queries)
Your own site
<a href="https://agentmods.dev/skills/phuryn/pm-skills/sql-queries"><img src="https://agentmods.dev/badge/skills/phuryn/pm-skills/sql-queries/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-queries

Your own site · 80×15
<a href="https://agentmods.dev/skills/phuryn/pm-skills/sql-queries"><img src="https://agentmods.dev/badge/skills/phuryn/pm-skills/sql-queries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 784 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.00784
Opus 5.5 $0.00022 $0.00314
Sonnet 5.5 $0.00011 $0.00157
Haiku 4.5 $0.00006 $0.00078

Measured 1mo ago against content hash 18da062d5171, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-queries scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

pm-data-analytics/skills/sql-queries/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SQL Query Generator

Purpose

Transform natural language requirements into optimized SQL queries across multiple database platforms. This skill helps product managers, analysts, and engineers generate accurate queries without manual syntax work.

How It Works

Step 1: Understand Your Database Schema

  • If you provide a schema file (SQL, documentation, or diagram description), I will read and analyze it
  • Extract table names, column definitions, data types, and relationships
  • Identify primary keys, foreign keys, and indexing strategies

Step 2: Process Your Request

  • Clarify the exact data you need to retrieve or analyze
  • Confirm the SQL dialect (BigQuery, PostgreSQL, MySQL, Snowflake, etc.)
  • Ask for any additional requirements (filters, aggregations, sorting)

Step 3: Generate Optimized Query

  • Write efficient SQL that leverages your database structure
  • Include comments explaining complex logic
  • Add performance considerations for large datasets
  • Provide alternative approaches if applicable

Step 4: Explain and Test

  • Explain the query logic in plain English
  • Suggest how to test or validate results
  • Offer tips for performance optimization
  • If you want, generate a test script or sample data

Usage Examples

Example 1: Query from Schema File

Upload your database_schema.sql file and say:
"Generate a query to find users who signed up in the last 30 days
and had at least 5 active sessions"

Example 2: Query from Diagram Description

"Here's my database: Users table (id, email, created_at), Sessions table
(id, user_id, timestamp, duration). Generate a query for average session
duration per user in January 2026."

Example 3: Complex Analysis Query

"Create a BigQuery query to analyze our revenue by region and customer tier,
including year-over-year growth rates."

Key Capabilities

  • Multi-Dialect Support: Works with BigQuery, PostgreSQL, MySQL, Snowflake, SQL Server
  • File Reading: Reads schema files, SQL dumps, and data documentation
  • Query Optimization: Suggests indexes, partitioning, and performance improvements
  • Explanation: Breaks down queries for learning and documentation
  • Testing: Can generate test queries and sample data scripts
  • Script Execution: Create executable SQL scripts for your database

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 88 lines · 55 tokens per session scan A 18da062d5171

Subscribe to this mod's changes

sql-queries is a skill published in the GitHub repository phuryn/pm-skills (27,222 stars, last pushed 4d ago), licensed MIT. It adds 55 tokens to every session and 784 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

error-analysis

Use this skill when the user asks to "analyze AI errors", "error analysis for our AI feature", "open coding", "axial coding", "analyze model failures", "categorize AI mistakes", "find patterns in bad AI outputs", "what's wrong with our AI", or has a set of bad AI outputs and wants to understand what's failing and why.…

Productfculty-aipm/PM-Copilot-by-Product-Faculty · 101 tokens

eval-suite-design

Use this skill when the user asks to "design an eval suite", "build evals for my AI feature", "create an evaluation framework", "how do I evaluate my AI", "what evals should I run", "build an eval system", or wants to create a systematic evaluation framework for an AI-powered product feature. Typically run after…

Productfculty-aipm/PM-Copilot-by-Product-Faculty · 83 tokens

human-eval-design

Use this skill when the user asks to "design a human evaluation", "human eval process", "annotation guidelines", "how to set up human review of AI outputs", "how to get humans to evaluate AI quality", "build a labeling process", "create annotation criteria", or wants to set up a structured process for humans to…

Productfculty-aipm/PM-Copilot-by-Product-Faculty · 76 tokens

sql-generation

Use this skill when the user asks to "write a SQL query", "help me query this data", "how do I get this metric from the database", "generate SQL for", "query for retention", "SQL to find churned users", "write a query for my analytics", or needs SQL to answer a specific product analytics question. This skill generates…

Productfculty-aipm/PM-Copilot-by-Product-Faculty · 92 tokens

competitor-deep-dive

Builds a long-form, fully sourced deep-dive on one competitor for a named decision (strategy call, RFP, pricing change, roadmap bet), with dated reviews, deal evidence, a head-to-head per offering and where they win. Triggers: "deep-dive on [competitor]", "full competitor write-up", "what do users really say about…

stefanoskarakasis/Product-Marketing-Skills · 107 tokens

pmm-resume

Reviews and tailors a PMM resume (IC to VP, including AI PMM roles): dissects the job description, ranks bullets by impact fit and rebuilds the complete resume in one pass. Trigger on: resume + JD paste, "tailor this", "which bullets for this role", "rebuild for [company]", "review my PMM resume", "reframe for…

stefanoskarakasis/Product-Marketing-Skills · 98 tokens