Skip to main content
skill CX Codex

text-to-sql — Claude Code skill: what it does, how to install

text-to-sql turns a plain-language request into a SQL query, checked against your database schema and built with placeholders instead of inlined values.

no license 158 installs ★ 45 updated 2026-07-14

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oimiragieo/agent-studio --skill text-to-sql -a claude-code
Open on GitHub

What text-to-sql does

Give it a question in ordinary words and the skill breaks the request down, checks names against your schema, writes the SQL and validates the syntax. No script ships with it: the whole thing is agent instructions, so it runs in the context of the sonnet model and reads files with Read, Write, Grep and Glob.

You bring the schema. Identifiers get checked against whatever you put in context, and with nothing there the validation has nothing to compare. Values arrive as placeholders (? or $N), SELECT statements carry LIMIT 100 unless you say otherwise, and DROP, DELETE, TRUNCATE or UPDATE sit waiting for your confirmation.

The repository also carries an evaluation path through promptfoo: a config such as text_to_sql_config.yaml plus npx promptfoo@latest eval -c text_to_sql_config.yaml. The guidance leans on sample queries, and on step-by-step reasoning once a query gets hard.

What it helps with

  • turn a plain-language request into runnable SQL
  • join orders and products to get revenue per item
  • spot duplicate rows in a table
  • check query syntax before it touches live data
  • compare prompt variants with promptfoo

Example prompts for the agent

  • Write the SQL for every user who signed up in the past month.
  • Build a query joining orders and products for revenue per product in Q4.
  • Find duplicate rows in users, keep a LIMIT, and walk me through what the query does.

How to install text-to-sql

1Skills CLI (Vercel)

npx skills add oimiragieo/agent-studio --skill text-to-sql -a claude-code

2Manually: put the files in place

~/.claude/skills/text-to-sql/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/text-to-sql/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about text-to-sql

How do I install text-to-sql in Claude Code?

Run npx skills add oimiragieo/agent-studio --skill text-to-sql -a claude-code. The skill file then lives at ~/.claude/skills/text-to-sql/SKILL.md.

What does text-to-sql do?

It converts a natural-language question into SQL, matching table and column names to your schema and returning the query with placeholders rather than baked-in values.

What limits should I know about?

Without a schema in context there is nothing to validate identifiers against. SELECT queries get LIMIT 100, and DROP, DELETE, TRUNCATE or UPDATE only run after you confirm.

Similar skills

All skills for Data and databases →

From the same set8

Project sponsors

Companies that keep this analytics open