Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ website:
- section: Coordinate systems
contents:
- auto: syntax/coord/*
- text: Agent Skill
href: syntax/skill.qmd
- id: get_started
title: Get started
style: "floating"
Expand Down
16 changes: 16 additions & 0 deletions doc/faq.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ ggsql integrates very deeply with the database backends and handles all statisti
ggsql does not yet support interactive functionality like tool tips and zooming. This is a point of focus for us and we will rather get the syntax and implementation right than rush to it.
:::

## AI assistance

::: {.callout-note collapse="true"}
## How do I get my AI assistant to write ggsql?

We maintain a [skill](syntax/skill.qmd) — a compact syntax reference designed for LLMs. You can install it with:

```sh
npx skills add posit-dev/skills --skill ggsql
```

This works with any AI coding assistant that supports the [skills](https://github.com/posit-dev/skills) framework. Once installed, your assistant can write and modify ggsql queries using the full syntax.

Alternatively, the same reference is available via `ggsql skill` on the command line.
:::

## Troubleshooting

::: {.callout-note collapse="true"}
Expand Down
2 changes: 1 addition & 1 deletion doc/get_started/tooling/cli.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ visualisation. A layer is a single instance of a visual representation of a data
[...]
```

A ggsql skill, a usage guide intended for AI assistants and humans, can also be output using the `ggsql skill` command.
A ggsql [skill](../../syntax/skill.qmd), a usage guide intended for AI assistants and humans, can also be output using the `ggsql skill` command (also available as `ggsql agent-info`).

```bash
$ ggsql skill
Expand Down
15 changes: 15 additions & 0 deletions doc/syntax/skill.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "Skill"
description: "A complete ggsql syntax reference designed for AI coding assistants and humans alike."
title-block-style: none
---

The ggsql skill is a self-contained reference designed for AI coding assistants. It documents the full query syntax in a compact format that can be consumed by LLMs or read by humans as a quick-reference.

The same content is available via the CLI with `ggsql skill`, or can be installed as an [AI skill](https://github.com/posit-dev/skills) with `npx skills add posit-dev/skills --skill ggsql`.

[Raw source](https://github.com/posit-dev/skills/blob/main/ggsql/ggsql/SKILL.md)

---

{{< include ../vendor/SKILL.md >}}
1 change: 1 addition & 0 deletions ggsql-cli/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The binary name is `ggsql` (not `ggsql-cli`) — that's what release artifacts a
| `validate` | Syntax + semantic check without executing SQL |
| `docs` | Render embedded ggsql syntax docs (TTY → ANSI via termimad, pipe → markdown, `--format json` → structured) |
| `skill` | Render the AI-assistant skill from `/doc/vendor/SKILL.md` |
| `agent-info` | Alias for `skill` |

Only public `ggsql::*` API is used (`reader`, `writer`, `validate`, `parser`, `VERSION`) — this crate has no awareness of internal modules.

Expand Down
10 changes: 9 additions & 1 deletion ggsql-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ pub enum Commands {
#[arg(long, value_enum)]
format: Option<DocsFormat>,
},

/// Alias for `skill` — show the ggsql usage guide for AI assistants
#[command(name = "agent-info")]
AgentInfo {
/// Output format. Defaults to rendered text on a TTY, raw markdown when piped.
#[arg(long, value_enum)]
format: Option<DocsFormat>,
},
}

#[derive(ValueEnum, Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -178,7 +186,7 @@ fn main() -> anyhow::Result<()> {
cmd_docs(first, second, format);
}

Commands::Skill { format } => {
Commands::Skill { format } | Commands::AgentInfo { format } => {
cmd_skill(format);
}
}
Expand Down
Loading