Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

ggsql Query Writer

Turns plain-language chart requests into valid ggsql queries — SQL plus a grammar-of-graphics visualization syntax.

Data & AnalyticsIntermediate48646AI score 8/10Last updated: Aug 28, 2026

What it does

  • Converts a described chart into a complete ggsql query (optional SQL/CTE part plus the required VISUALISE part).
  • Embeds a full syntax reference for DRAW, PLACE, SCALE, FACET, PROJECT, and LABEL, with a hard rule against inventing clauses, settings, aesthetics, layers, or palette names.
  • Picks the right layer type (point, line, path, bar, histogram, density, boxplot, violin, smooth, area, ribbon, segment, rule, text, rect, polygon, range) with its required aesthetics and stats.
  • Covers coordinate systems (cartesian/polar), axis transforms (log, date, sqrt...), named color palettes, faceting, and label overrides.
  • Tells you how to check the result with ggsql validate or render it with ggsql exec.

Who it's for

  • Data analysts and engineers using ggsql over DuckDB or another SQL backend.
  • ggplot2 users who know the grammar of graphics but not yet ggsql's exact syntax.
  • Anyone producing many chart queries for reports or dashboards.

Examples

  1. "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.
  2. "Monthly revenue as a donut chart" → aggregation CTE + DRAW bar + PROJECT TO polar SETTING inner => 0.5.
  3. "Temperature and ozone as two lines with a date x-axis" → multiple DRAW line layers + SCALE x VIA date + LABEL title, then verified with ggsql validate.

· · · 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download 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.

  1. Open a terminal.
  2. Clone the repo: git clone https://github.com/posit-dev/skills.git /tmp/posit-skills
  3. Create the skills folder: mkdir -p ~/.claude/skills
  4. Copy just this skill: cp -r /tmp/posit-skills/ggsql/ggsql ~/.claude/skills/ggsql
  5. Install the ggsql CLI and make sure it is on your PATH (ggsql --help should work) if you want validation and rendering.
  6. Restart Claude Code and try a prompt like "write a ggsql query for a stacked bar chart" to confirm the skill triggers.