Skip to content

Commit 5935a41

Browse files
keydunovclaude
andauthored
docs: document Agent Skills for the Cube AI agent (#11007)
* docs: document Agent Skills for the Cube AI agent Add documentation for Agent Skills β€” reusable, named instruction packages the Cube AI agent runs on demand, authored as Markdown in the data model alongside rules and certified queries. Two pages, split by audience: - admin/ai/skills.mdx β€” authoring/config (developer-facing), parallel to rules and certified queries: file layout, frontmatter contract, YAML inlining, multi-agent space targeting, deploy/test flow, permissions. - docs/explore-analyze/skills.mdx β€” "Agent skills" (explorer/viewer-facing), next to Analytics Chat: skill buttons, the / menu, automatic matching, and the add-context-before-run UX. Wire both into docs.json, add a Skills card + bullet to the AI overview, and cross-link the two pages. Also establish docs-site guidance: /docs-mintlify is the active docs site and /docs is legacy/deprecated. Update root CLAUDE.md, add docs-mintlify/CLAUDE.md with Mintlify conventions, and mark docs/CLAUDE.md as deprecated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: refine Agent Skills pages after review - Describe skills as available across all agent surfaces (Analytics Chat, Workbooks, dashboards, IDE) instead of singling out Analytics Chat - Drop the viewer-page "How it works" progressive-disclosure internals - Remove the `instructions` frontmatter override row; the Markdown body is the sole source of instructions (instructions stay a YAML-inline-only key) - Soften the "no separate UI or database object" phrasing Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: add slash-menu screenshot to Agent skills page Embed the skill `/` menu screenshot (hosted on static.cube.dev) before the "Running a skill" section on the viewer-facing Agent skills page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d9a308f commit 5935a41

7 files changed

Lines changed: 304 additions & 8 deletions

File tree

β€ŽCLAUDE.mdβ€Ž

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,24 @@ yarn test
5050
```
5151

5252
### Documentation Development
53-
The documentation is in `/docs` directory:
53+
54+
**IMPORTANT: `/docs-mintlify` is the active documentation site. `/docs` is the legacy
55+
docs site and is deprecated β€” do NOT add or edit content there.** When asked to write or
56+
update documentation, work in `/docs-mintlify` unless the user explicitly says otherwise.
57+
5458
```bash
55-
cd docs
56-
yarn dev # Start development server
57-
yarn build # Build for production
59+
cd docs-mintlify
60+
yarn dev # Start the Mintlify dev server
5861
```
5962

63+
- Content is authored as `.mdx` under topic directories (e.g. `admin/ai/`, `docs/explore-analyze/`).
64+
- Frontmatter uses `title` and `description` keys.
65+
- Navigation is registered in `docs-mintlify/docs.json` (pages must be added to the
66+
relevant `group` to appear in the sidebar).
67+
- Use Mintlify components: `<Note>`, `<Warning>`, `<Info>`, `<Tip>`, `<Steps>`/`<Step>`,
68+
`<CardGroup>`/`<Card>`. Internal links are root-relative (e.g. `/admin/ai/rules`).
69+
- See `docs-mintlify/CLAUDE.md` for full conventions.
70+
6071
## Architecture Overview
6172

6273
### Monorepo Structure
@@ -66,7 +77,8 @@ yarn build # Build for production
6677
- Database drivers: `cubejs-postgres-driver`, `cubejs-bigquery-driver`, etc.
6778
- API layer: `cubejs-api-gateway`
6879
- **`/rust`**: Rust components including CubeSQL (SQL interface) and CubeStore (distributed storage)
69-
- **`/docs`**: Next.js documentation site
80+
- **`/docs-mintlify`**: Mintlify documentation site β€” **the active docs site** (author docs here)
81+
- **`/docs`**: Legacy Next.js/Nextra documentation site β€” **deprecated**, do not edit
7082
- **`/examples`**: Example implementations and recipes
7183

7284
### Key Components
@@ -133,7 +145,8 @@ Include scope in parentheses when applicable, e.g., `fix(tesseract):` or `feat(d
133145

134146
## Important Notes
135147

136-
- This is documentation for the old Cube docs site structure (the existing `/docs/CLAUDE.md` refers to the documentation site)
148+
- Documentation lives in `/docs-mintlify` (active, Mintlify). `/docs` is the legacy docs
149+
site and is deprecated β€” do not add or edit content there. See `docs-mintlify/CLAUDE.md`.
137150
- The main Cube application development happens in `/packages`
138151
- For data model changes, focus on `cubejs-schema-compiler` package
139152
- For query execution changes, focus on `cubejs-query-orchestrator` package

β€Ždocs-mintlify/CLAUDE.mdβ€Ž

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Cube Documentation (Mintlify)
2+
3+
This is the **active** Cube documentation site, built with [Mintlify](https://mintlify.com).
4+
All documentation work should happen here.
5+
6+
> The `/docs` directory at the repo root is the **legacy** Nextra docs site and is
7+
> **deprecated** β€” do not add or edit content there.
8+
9+
## Local development
10+
11+
```bash
12+
cd docs-mintlify
13+
yarn dev # Start the Mintlify dev server
14+
```
15+
16+
## Writing style
17+
18+
- **Tone**: professional, direct, instructive. Address the reader as "you" (second person).
19+
- **Headings**: one H1 is provided by the frontmatter `title` β€” start body sections at H2 (`##`).
20+
- **Code**: always specify a language fence (` ```yaml`, ` ```markdown`, ` ```text`). Use
21+
inline backticks for identifiers (`accessible_views`, `agents/rules/`).
22+
- **Paragraphs**: keep them short; use `-` bullet lists for multiple items.
23+
24+
## File and frontmatter conventions
25+
26+
- Content is `.mdx`, organized by topic directory (e.g. `admin/ai/`, `docs/explore-analyze/`).
27+
- The file path maps to the URL: `admin/ai/rules.mdx` β†’ `/admin/ai/rules`.
28+
- Every page starts with YAML frontmatter using `title` and `description`:
29+
30+
```mdx
31+
---
32+
title: Rules
33+
description: One-sentence summary used for SEO and navigation previews.
34+
---
35+
```
36+
37+
- **Do not** add an H1 in the body β€” the `title` is the page heading.
38+
39+
## Navigation
40+
41+
Navigation is defined in `docs-mintlify/docs.json`. A new page only appears in the sidebar
42+
once its path (without the `.mdx` extension) is added to the appropriate `group` in
43+
`docs.json`. After adding a page, update `docs.json` and verify it is still valid JSON.
44+
45+
## Components
46+
47+
Mintlify provides these components (used throughout the docs):
48+
49+
- Callouts: `<Note>`, `<Warning>`, `<Info>`, `<Tip>`, `<Check>`
50+
- `<Steps>` with nested `<Step title="...">` for sequential instructions
51+
- `<CardGroup cols={2}>` with nested `<Card title="..." icon="..." href="...">`
52+
- `<Tabs>` / `<Tab>`, `<Accordion>` / `<AccordionGroup>`, `<Frame>` for images
53+
54+
Content inside callouts and steps is plain MDX. Internal links are root-relative
55+
(`/admin/ai/skills`), not file paths.
56+
57+
## Images and screenshots
58+
59+
Wrap screenshots in `<Frame>` and store assets under `images/`. When a screenshot is
60+
needed but not yet available, leave an MDX comment placeholder: `{/* TODO: screenshot β€” ... */}`.
61+
62+
## AI / agent docs structure
63+
64+
The agent configuration (code-first, developer-facing) lives under `admin/ai/`:
65+
`rules.mdx`, `certified-queries.mdx`, `skills.mdx`, `memory-isolation.mdx`,
66+
`multi-agent.mdx`, `bring-your-own-model.mdx`. The end-user chat experience
67+
(explorer/viewer-facing) lives under `docs/explore-analyze/` (e.g. `analytics-chat.mdx`,
68+
`skills.mdx`). Keep authoring docs in `admin/ai/` and usage docs in `docs/explore-analyze/`,
69+
and cross-link the two.

β€Ždocs-mintlify/admin/ai/index.mdxβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Rules and certified queries have their own dedicated pages:
5959

6060
- [Rules](/admin/ai/rules) β€” instructions that guide the agent's behavior
6161
- [Certified queries](/admin/ai/certified-queries) β€” a library of trusted SQL examples for the agent
62+
- [Skills](/admin/ai/skills) β€” reusable, named agent workflows users can run on demand from chat
6263

6364
## LLM
6465

@@ -134,6 +135,9 @@ See [Memories](/admin/ai/memory-isolation) for details on how memories are store
134135
<Card title="Certified queries" icon="certificate" href="/admin/ai/certified-queries">
135136
Provide a library of trusted SQL queries for the agent to reference.
136137
</Card>
138+
<Card title="Skills" icon="wand-magic-sparkles" href="/admin/ai/skills">
139+
Package reusable, named agent workflows that users can run on demand from chat.
140+
</Card>
137141
<Card title="Bring your own model" icon="brain" href="/admin/ai/bring-your-own-model">
138142
Configure the agent to use your own LLM provider or model.
139143
</Card>
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Skills
3+
description: Package reusable, named agent workflows in your data model repository that users can run on demand from chat.
4+
---
5+
6+
Skills are reusable, named instruction packages for the agent β€” saved workflows a user
7+
can run on demand wherever they work with the agent, including
8+
[Analytics Chat](/docs/explore-analyze/analytics-chat), Workbooks, dashboards, and the
9+
IDE. Instead of re-typing the same multi-step request ("produce a weekly revenue report,
10+
broken down by region, with week-over-week trends…"), a user picks a skill and the agent
11+
follows the workflow you've defined.
12+
13+
Skills are configured as code in your [data model repository](/admin/ai#agent-configuration),
14+
alongside your cubes and views, so they're versioned, reviewed, and deployed like the rest
15+
of your Cube project.
16+
17+
<Note>
18+
A skill guides what the agent does using the same data access the agent already has. The
19+
first version of skills is instructions-only β€” `title`, `description`, and instructions.
20+
There is no per-skill data scoping or external actions yet.
21+
</Note>
22+
23+
## Defining skills
24+
25+
Skills are defined as Markdown files under `agents/skills/`. Each skill lives in its own
26+
file: the YAML frontmatter holds metadata, and the Markdown body is the instructions the
27+
agent follows.
28+
29+
```markdown
30+
<!-- agents/skills/weekly-revenue-report.md -->
31+
---
32+
title: "Weekly revenue report"
33+
description: "Use when the user asks for a weekly revenue summary, a weekly revenue report, or week-over-week revenue trends."
34+
---
35+
Produce a weekly revenue report:
36+
37+
1. Report total revenue for the requested week, alongside the prior week and the
38+
week-over-week percentage change.
39+
2. Break revenue down by region, sorted from highest to lowest.
40+
3. Highlight any region whose revenue changed by more than 10% week over week.
41+
4. If the user names a region or a time range, scope the report accordingly.
42+
```
43+
44+
Files placed under a `skills/` directory are treated as skills automatically β€” no `kind`
45+
property is required. The `name` is inferred from the file name (e.g.,
46+
`weekly-revenue-report.md` β†’ `weekly-revenue-report`). Nested folders are allowed for
47+
organization but do not namespace the skill β€” skill names must be unique across the
48+
entire `skills/` directory.
49+
50+
### Frontmatter properties
51+
52+
| Property | Type | Required | Description |
53+
|-----------------|--------|:--------:|-----------------------------------------------------------------------------------|
54+
| `title` | string | Yes | User-facing label shown on the skill button and in the `/` menu. |
55+
| `description` | string | Yes | What the agent matches free-text requests against to auto-select the skill. |
56+
| `name` | string | No | Unique identifier. Inferred from the file name if omitted. |
57+
58+
The Markdown body is the skill's instructions.
59+
60+
### Inlining skills in YAML
61+
62+
You can also inline skills directly in `agents/config.yml` under a `skills` key:
63+
64+
```yaml
65+
# agents/config.yml
66+
skills:
67+
- name: weekly-revenue-report
68+
title: "Weekly revenue report"
69+
description: "Use when the user asks for a weekly revenue summary or week-over-week trends."
70+
instructions: |
71+
Produce a weekly revenue report:
72+
1. Total revenue for the requested week, with the week-over-week change.
73+
2. A breakdown by region, sorted by revenue descending.
74+
3. Highlight any region that moved more than 10% week over week.
75+
```
76+
77+
Inline skills use the same `name`, `title` (required), and `description` (required) as
78+
Markdown skills. Since there is no Markdown body in YAML, provide the instructions inline
79+
via the `instructions` key.
80+
81+
<Note>
82+
Skills inlined at the root of `agents/config.yml` are attached to the implicit `auto`
83+
space and applied to the default agent in a [single-agent setup](/admin/ai). In a
84+
[multi-agent setup](/admin/ai/multi-agent), attach skills to a specific space by inlining
85+
them under that space's `skills` key (or by placing Markdown files under
86+
`agents/skills/<space-name>/`).
87+
</Note>
88+
89+
## How skills are surfaced
90+
91+
Skills use **progressive disclosure**. The agent is given a compact catalog of every
92+
available skill β€” just the `name`, `title`, and `description` β€” so it knows what each
93+
skill is for without carrying the full instructions. When a skill is run, the agent loads
94+
its complete instructions on demand.
95+
96+
- The chat UI only ever receives a skill's `name`, `title`, and `description`. The full
97+
instruction body stays server-side and is never sent to the browser.
98+
- Skills are surfaced through a viewer-accessible deployment endpoint, so they work for
99+
any configured agent as well as the default `auto` agent.
100+
- Because the agent matches against `description`, a well-written description makes
101+
automatic matching more reliable.
102+
103+
For how skills appear and run in chat β€” buttons, the `/` menu, and automatic matching β€”
104+
see [Agent skills](/docs/explore-analyze/skills).
105+
106+
## Deploying and testing
107+
108+
Skills ship through the normal Cube development flow: author the skill on a development
109+
branch, commit, and merge to your production branch. Because skills live on the branch, a
110+
skill on a development branch is testable before it reaches production β€” open chat against
111+
the dev branch and run the skill to confirm it behaves as intended.
112+
113+
## Permissions
114+
115+
Authoring skills requires data-model edit access β€” the same access needed to define
116+
[rules](/admin/ai/rules) and [certified queries](/admin/ai/certified-queries). In Cube
117+
Cloud's built-in roles, that means the **Admin** or **Developer**
118+
[roles](/admin/users-and-permissions/roles-and-permissions), or a custom role with
119+
semantic-model edit access.
120+
121+
Running skills is available to anyone with chat access, including **Explorer** and
122+
**Viewer** roles. In-product tips that promote authoring skills, rules, and certified
123+
queries are role-aware and shown only to developers.
124+
125+
## Writing effective skills
126+
127+
- **Phrase `description` as a "use when…" statement.** This is what the agent matches
128+
against incoming requests, so describe the situations the skill applies to.
129+
- **Write instructions as an explicit workflow.** Number the steps and state the output
130+
you expect, the same way you'd brief an analyst.
131+
- **Account for added context.** Users can add specifics after selecting a skill (e.g.,
132+
`/weekly-revenue-report for EMEA, last 6 weeks`), so instruct the agent to honor a
133+
named region or time range when provided.
134+
- **Keep each skill focused.** One skill should cover one well-defined workflow; create
135+
separate skills for distinct tasks.

β€Ždocs-mintlify/docs.jsonβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
}
9393
]
9494
},
95-
"docs/explore-analyze/analytics-chat"
95+
"docs/explore-analyze/analytics-chat",
96+
"docs/explore-analyze/skills"
9697
]
9798
},
9899
{
@@ -380,6 +381,7 @@
380381
"admin/ai/index",
381382
"admin/ai/rules",
382383
"admin/ai/certified-queries",
384+
"admin/ai/skills",
383385
"admin/ai/memory-isolation",
384386
"admin/ai/multi-agent",
385387
"admin/ai/bring-your-own-model"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: Agent skills
3+
description: Run saved agent workflows using skill buttons, the slash menu, or automatic matching.
4+
---
5+
6+
Skills are reusable, named workflows the agent can run on demand wherever you work with
7+
it β€” [Analytics Chat](/docs/explore-analyze/analytics-chat), Workbooks, dashboards, and
8+
the IDE. Instead of re-typing the same multi-step request every time, you pick a skill and
9+
the agent follows the workflow your team has already defined β€” for example, a
10+
**Weekly revenue report** that totals revenue, breaks it down by region, and calls out
11+
week-over-week trends.
12+
13+
Skills are authored by your data team as part of the semantic model. This page covers how
14+
to find and run them. To create skills, see [Skills](/admin/ai/skills) in the agent
15+
configuration docs.
16+
17+
<Frame>
18+
<img src="https://static.cube.dev/blog/2026/06/introducing-cube-agent-skills/slash-menu.png" alt="The slash menu in Analytics Chat listing available agent skills, each with a title and description" />
19+
</Frame>
20+
21+
## Running a skill
22+
23+
There are three ways to run a skill from the chat input.
24+
25+
<Steps>
26+
<Step title="Skill buttons">
27+
When skills are available, they appear as buttons in the chat empty state β€” one button
28+
per skill, labeled with the skill's title. Click a button to start the skill.
29+
30+
{/* TODO: screenshot β€” skill buttons in the chat empty state */}
31+
</Step>
32+
<Step title="Slash menu">
33+
Type `/` in the chat input to open the skill menu. The menu filters as you type and is
34+
keyboard-navigable. When skills are available, the input placeholder reads
35+
**"Type / for skills."**
36+
</Step>
37+
<Step title="Automatic matching">
38+
You don't always have to pick a skill explicitly. If a free-text request matches a
39+
skill's description, the agent recognizes the intent and runs the matching skill on
40+
its own β€” asking "can I get the weekly revenue summary?" may trigger a weekly revenue
41+
report skill.
42+
</Step>
43+
</Steps>
44+
45+
## Adding context before you run
46+
47+
Picking a skill β€” whether from a button or the `/` menu β€” does **not** send the message
48+
immediately. Instead, it inserts a styled `/skill-name` token into the chat input and
49+
keeps your cursor there.
50+
51+
{/* TODO: screenshot β€” the styled `/skill-name` token in the chat input */}
52+
53+
This lets you add specifics before running. Type any extra context after the token, then
54+
send. On send, the message becomes the skill invocation plus whatever you added. For
55+
example:
56+
57+
```text
58+
/weekly-revenue-report for EMEA, last 6 weeks
59+
```
60+
61+
runs the weekly revenue report skill, scoped to the EMEA region over the last six weeks.
62+
63+
<Note>
64+
Running skills is available to anyone with chat access, including **Explorer** and
65+
**Viewer** [roles](/admin/users-and-permissions/roles-and-permissions). Authoring skills
66+
requires data-model edit access β€” see [Skills](/admin/ai/skills) in the agent
67+
configuration docs.
68+
</Note>

β€Ždocs/CLAUDE.mdβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Cube Documentation
1+
# Cube Documentation (LEGACY β€” DEPRECATED)
2+
3+
> **This `/docs` site is deprecated. Do not add or edit content here.**
4+
> The active documentation site is `/docs-mintlify` (Mintlify). Write all new and updated
5+
> docs there β€” see `docs-mintlify/CLAUDE.md` for conventions. The guidance below is kept
6+
> only for reference to the legacy site.
27
38
This file provides guidance to Claude Code when working with the documentation site.
49

0 commit comments

Comments
Β (0)