ggsql Query Writer
Writes and validates ggsql queries that fuse SQL with a grammar-of-graphics visualization spec.
Data & AnalyticsIntermediate★ 537⑂ 54AI score 8/10Last updated: Oct 7, 2026
What it does
- Loads the full ggsql syntax (SQL + grammar of graphics) into Claude so generated queries actually parse — with an explicit rule never to invent clauses, settings, aesthetics, or palette names.
- Covers
VISUALISE,DRAWlayers (point, line, path, bar, histogram, density, boxplot, violin, smooth, area, ribbon, segment, rule, text, rect, polygon, range), plusSCALE,FACET,PROJECT,LABEL, andPLACE. - Documents advanced aggregation (
SETTING aggregatewith reductions, positional functions, and band specs likemean+1.96sdev), explosion viaREMAPPING aggregate, and scale interaction rules. - Encodes CLI etiquette: validate with
ggsql validate, render withggsql exec ... -o chart.svg, and never call blockingggsql view.
Who it's for
- SQL/DuckDB users who want ggplot-style charts from a single query.
- Data analysts and engineers already running the ggsql binary.
- Anyone who'd rather describe a chart in plain language than hand-write a spec.
Examples
- "Scatter of bill length vs depth colored by species" →
VISUALISE bill_len AS x, bill_dep AS y, species AS fill FROM ggsql:penguins DRAW point - "Donut chart of revenue share by region from a CSV" → aggregate in a CTE, then
DRAW barwithPROJECT TO polar SETTING inner => 0.5 - "Monthly mean ±1.96 SD band" →
DRAW ribbon SETTING aggregate => ('mean-1.96sdev','mean+1.96sdev') PARTITION BY Month
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/posit-dev/skills/HEAD/ggsql/ggsql/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the ggsql/ggsql folder from the GitHub repo posit-dev/skills into my ~/.claude/skills/ggsql/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/posit-dev/skills.git /tmp/posit-skills && mkdir -p ~/.claude/skills && cp -r /tmp/posit-skills/ggsql/ggsql ~/.claude/skills/ggsql⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/posit-dev/skills.git /tmp/posit-skills - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill in:
cp -r /tmp/posit-skills/ggsql/ggsql ~/.claude/skills/ggsql - Install the ggsql CLI (see https://ggsql.org) and verify with
ggsql --version. - Restart Claude Code, then ask something like "write a ggsql query for a penguins scatter plot" to trigger the skill.
- For images, ask for
-o chart.svgor.pdfoutput — those writers need no GPU.
View source on GitHub ↗License: MIT