query-builder

query-builder is a skill for Claude Code from clidey/whodb. It costs 40 tokens per session (941 once invoked), scanned A, original, Apache-2.0.

A tool that turns plain-English data questions into SQL queries, using the database tables and columns to build the query.

In plain words
What is it for?
Use it for requests such as finding recent sign-ups, filtering expensive orders, counting records, or ranking customers by spending.
Why use it?
It reduces the need to remember table names, column names, joins, filters, grouping, and sorting when asking for database results.

Skill for Claude Code

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

Part of the whodb plugin — 2 skills shipped together

Good fit Use it for requests such as finding recent sign-ups, filtering expensive orders, counting records, or ranking customers by spending.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/clidey/whodb/query-builder
About the project

WhoDB is a self-hosted workspace for exploring and managing databases through a browser, desktop app, or terminal interface. Developers and data teams use it to browse and edit data, run queries, inspect table relationships, move data, and optionally ask questions through an AI provider. The catalogue includes add-ons for operating WhoDB and working with its database tools.

clidey/whodb · 5,039 stars · on GitHub · whodb.com

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 clidey/whodb --skill query-builder
Clone the repo
git clone --depth 1 https://github.com/clidey/whodb

Made for: Claude Code.

Or install whodb, the plugin that ships this one along with the rest of its 2 skills.

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 query-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/clidey/whodb/query-builder/github.svg)](https://agentmods.dev/skills/clidey/whodb/query-builder)
Your own site
<a href="https://agentmods.dev/skills/clidey/whodb/query-builder"><img src="https://agentmods.dev/badge/skills/clidey/whodb/query-builder/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 query-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/clidey/whodb/query-builder"><img src="https://agentmods.dev/badge/skills/clidey/whodb/query-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 941 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
  • 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.00040 $0.00941
Opus 5.5 $0.00016 $0.00376
Sonnet 5.5 $0.00008 $0.00188
Haiku 4.5 $0.00004 $0.00094

Measured 13d ago against content hash ec479e2475a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

query-builder 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 13d 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.

cli/external-plugin/whodb/skills/query-builder/SKILL.md · 133 lines

How it starts

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

Query Builder

Convert natural language questions into SQL queries using the database schema.

These database-only MCP tools require the database module enabled through whodb setup. Keep the MCP command at whodb mcp serve. For platform resources, use the WhoDB skill and discover available whodb_platform_* tools instead.

When to Use

Activate when user asks questions like:

  • "Show me all users who signed up last month"
  • "Find orders greater than $100"
  • "Which products have low inventory?"
  • "Get the top 10 customers by total spend"

Workflow

1. Understand the Schema

Before generating SQL, always check the table structure:

whodb_tables(connection="...") → Get available tables
whodb_columns(table="relevant_table") → Get column names and types

2. Identify Intent

Parse the natural language request:

  • Subject: What entity? (users, orders, products)
  • Filter: What conditions? (last month, > $100, active)
  • Aggregation: Count, sum, average, max, min?
  • Grouping: By what dimension?
  • Ordering: Sort by what? Ascending/descending?
  • Limit: How many results?

3. Map to Schema

  • Match entities to table names
  • Match attributes to column names
  • Identify foreign key joins needed

4. Generate SQL

Build the query following SQL best practices:

SELECT columns
FROM table
[JOIN other_table ON condition]
WHERE filters
[GROUP BY columns]
[HAVING aggregate_condition]
ORDER BY column [ASC|DESC]
LIMIT n;

5. Execute and Present

whodb_query(query="generated SQL")

Translation Patterns

Natural Language SQL Pattern
"last week/month/year" WHERE date_col >= DATE_SUB(NOW(), INTERVAL 1 WEEK)
"more than X" / "greater than X" WHERE col > X
"top N" ORDER BY col DESC LIMIT N
"how many" SELECT COUNT(*)
"total" / "sum of" SELECT SUM(col)
"average" SELECT AVG(col)
"for each" / "by" GROUP BY col
"between X and Y" WHERE col BETWEEN X AND Y
"contains" / "like" WHERE col LIKE '%term%'
"starts with" WHERE col LIKE 'term%'
"is empty" / "is null" WHERE col IS NULL
"is not empty" WHERE col IS NOT NULL

Read the full file on GitHub · 133 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. 13d ago Changed · +2 lines ec479e2475a5
  2. 1mo ago First seen · 131 lines · 40 tokens per session scan A 747b7b9166a3

Subscribe to this mod's changes

query-builder is a skill published in the GitHub repository clidey/whodb (5,039 stars, last pushed yesterday), licensed Apache-2.0. It adds 40 tokens to every session and 941 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

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

graphjin-env

Use when setting up a training or evaluation loop against a GraphJin agent environment — running the container, reading /health, driving episodes hosted or step-by-step or with your own agent over MCP, splitting train from eval, exporting trajectories, and deciding whether two rewards can be compared.

dosco/graphjin · 61 tokens

Drizzle ORM Testing

Testing patterns for Drizzle ORM covering migration testing, query builder testing, transaction testing, and database integration testing with PostgreSQL, SQLite, and MySQL.

PramodDutta/qaskills · 36 tokens

banco-de-dados-ops

Operações de banco de dados: queries otimizadas, migrations versionadas, estratégia de indexação, modelagem relacional e NoSQL, backup e recovery. Foco em PostgreSQL e MySQL com contexto de dados brasileiros.

ricneves-ai/flowgrammers-skills · 55 tokens

sql-expert

Expert-level SQL database design, querying, optimization, and administration across PostgreSQL, MySQL, and SQL Server. Use when the user mentions database, PostgreSQL, MySQL, or query optimization, or when the task involves Database Design, Advanced Queries, Indexes and Performance, or Transactions and Concurrency.

personamanagmentlayer/pcl · 66 tokens

database-query

Natural language database queries with multi-database support, query optimization, and visual results.

glincker/claude-code-marketplace · 19 tokens