agentleFS
smitmartijnsmitmartijn/claude-skills/redash/SKILL.md

redash

Skill1 starsChanged 5 months agoMITView on GitHub

Create, run, and manage Redash queries, visualizations, and dashboards through the Redash REST API. Use when the user says "create a Redash query", "build a Redash dashboard", "run this SQL in Redash", "add a chart to a dashboard", "what tables are in my data source", or any variant of working with Redash programmatically.

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. mozilla-platform-ops/agent-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the instance sits behind Cloudflare/a WAF, a 403 with error code: 1010 means the default agent is banned.

    line 23
  2. Distinctive:

    If the user hasn't given you a URL or key, ask for them.

    line 31
  3. Very specific:

    Run each from the skill directory, e.g.

    line 66
  4. Distinctive:

    Decide the visualization per query, then confirm: Look at the result columns and propose a fit (table / line / bar / counter) with the …

    line 91
  5. Distinctive:

    When unsure of a chart option's exact key, create the viz with a minimal options blob, then tell the user they can fine-tune it in the …

    line 141
  6. Very specific:

    If the SQL contains {{ param }} placeholders, declare them in query --options:

    line 145
  7. Very specific:

    Don't invent table/column names: Always pull schema first; Redash errors are opaque.

    line 156
  8. Very specific:

    Don't expect a query to have a chart automatically: Only an implicit TABLE viz exists.

    line 158
  9. Very specific:

    Don't add a widget with a stale viz id: Use the id returned by create-viz (or from get-query), not the query id.

    line 160
  10. Very specific:

    Don't hardcode secrets: Read REDASH_URL/REDASH_API_KEY from the environment.

    line 161
  11. Distinctive:

    Keep this skill focused: introspect, query, visualize, and assemble dashboards via the Redash API — leave deep chart styling to the UI.

    line 168

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Redash Agent

Drive a Redash instance over its REST API: introspect data sources, write and run queries, create visualizations, and assemble dashboards. A bundled zero-dependency Python helper (redash.py, stdlib only) wraps every endpoint and prints JSON so you can chain steps.

Prerequisites

Two environment variables must be set before any command:

export REDASH_URL="https://redash.example.com"   # your instance, no trailing slash
export REDASH_API_KEY="<user API key>"
  • Get the user API key from Redash → top-right avatar → Settings → Account → API Key. A user key inherits that user's permissions and is required to create or modify anything.
  • A per-query API key (shown on a query page) only reads that one query's results — not enough for this skill.
  • python3 must be on PATH (stdlib only — no pip install needed).
  • If the instance sits behind Cloudflare/a WAF, a 403 with error code: 1010 means the default agent is banned. The helper already sends a normal User-Agent; override it with REDASH_USER_AGENT (e.g. a browser string) if a stricter rule still blocks you.

Always run test first to confirm credentials before doing real work:

python3 redash.py test

If the user hasn't given you a URL or key, ask for them. Never hardcode them into files; they're secrets.

How Redash objects fit together

data source ──> query (SQL) ──> visualization(s) ──┐
                                                    ├─> widget ──> dashboard
                              text ─────────────────┘
  • A query holds SQL + a data source. Running it produces a query result.
  • A visualization is a view of a query's result (TABLE, CHART, COUNTER, …). A query can have several.
  • A dashboard is a grid of widgets. Each widget embeds one visualization (or is a free text/markdown box).
  • New queries and dashboards are created as drafts (is_draft: true) — invisible in lists until published.

The commands

CommandWhat it does
testVerify URL + key (GET /api/session)
data-sourcesList data sources and their numeric ids
dashboardsList dashboards (id, slug, name) — use to resolve a slug to its id
schema --data-source-id NList tables and columns for a data source
exec-sql --data-source-id N --sql "..."Run ad-hoc SQL without saving; returns rows. Use to explore/validate before saving.
create-query --name --sql --data-source-id [--publish] [--description] [--options JSON]Create a saved query
update-query --id [--name] [--sql] [--options] [--publish]Edit a query / publish it
get-query --idFetch a query (includes its visualizations array with their ids)
run-query --id [--max-age N]Execute a saved query, return rows (--max-age 0 = always fresh; default 0)
create-viz --query-id --type --name [--options JSON] [--description]Add a visualization to a query
create-dashboard --nameCreate an empty draft dashboard (returns id and slug)
add-widget --dashboard-id [--viz-id] [--text] [--col --row --size-x --size-y]Place a widget on the grid
publish-dashboard --idClear is_draft so it's visible
get-dashboard --idFetch a dashboard by numeric id (preferred) or slug
delete-query --id / delete-dashboard --idArchive a query / dashboard

Run each from the skill directory, e.g. python3 redash.py data-sources.


Workflow A — write and run a query

  1. Find the data source. data-sources → note the id the user means. If unsure which, ask.
  2. Learn the schema. schema --data-source-id N → use real table/column names. Don't guess.
  3. Validate the SQL with exec-sql (nothing saved yet) so you catch errors before committing:
    python3 redash.py exec-sql --data-source-id 1 --sql "SELECT count(*) FROM users"
  4. Save it once it works:
    python3 redash.py create-query --name "Active users" \
      --sql "SELECT date, count(*) FROM users GROUP BY 1" \
      --data-source-id 1 --publish
    Capture the returned id — you need it for visualizations and widgets.

Workflow B — build a dashboard

A widget needs a visualization id, and a query has no chart visualization by default (only an implicit table). So the order is: query → visualization → dashboard → widgets → publish.

  1. Create + publish each query (Workflow A). Keep each query id.
  2. Decide the visualization per query, then confirm. Look at the result columns and propose a fit (table / line / bar / counter) with the intended axis mapping, and confirm with the user before creating it — don't silently pick. Then create it, capturing each returned id:
    python3 redash.py create-viz --query-id 42 --type CHART --name "Signups over time" \
      --options '{"globalSeriesType":"line","columnMapping":{"date":"x","count":"y"}}'
    For a plain table widget, you can reuse the query's built-in table viz — get-query --id 42 and read visualizations[].id (the one with "type":"TABLE").
  3. Create the dashboard and capture id + slug:
    python3 redash.py create-dashboard --name "Growth"
  4. Add a widget per visualization, laying them out on the grid (check its width first — see the note below):
    python3 redash.py add-widget --dashboard-id 7 --viz-id 99 \
      --col 0 --row 0 --size-x 3 --size-y 8
    python3 redash.py add-widget --dashboard-id 7 --viz-id 100 \
      --col 3 --row 0 --size-x 3 --size-y 8
    • Check the grid width first. It's not fixed — Redash dashboards are commonly 6 or 12 columns. When adding to an existing dashboard, get-dashboard --id and read the largest sizeX/col+sizeX among current widgets to learn the width, then match it (a full-width widget = that width). For a brand-new dashboard, 6 is the safe default.
    • Place new widgets below existing ones. Compute the next free row as max(row + sizeY) over current widgets so you don't overlap.
    • Increment row (by the previous size-y) to start a new row.
    • Text/markdown box: omit --viz-id, pass --text "## Section".
  5. Publish so it appears for others:
    python3 redash.py publish-dashboard --id 7
  6. Report the dashboard URL: $REDASH_URL/dashboards/<id>-<slug> (the URL path is the id followed by the slug, e.g. /dashboards/7-growth).

Visualization --options reference

create-viz takes a --type and a JSON --options blob whose shape depends on the type. Common ones:

  • TABLE — {} works (Redash auto-derives columns). Every query already has a table viz, so you rarely need to create one.
  • CHART — set the chart kind and map result columns to axes:
    {
      "globalSeriesType": "line",
      "columnMapping": {"<x_column>": "x", "<y_column>": "y"},
      "seriesOptions": {},
      "legend": {"enabled": true}
    }
    globalSeriesType ∈ line column area pie scatter bubble heatmap. For a grouped series add the grouping column with "series" in columnMapping.
  • COUNTER — a single big number:
    {"counterColName": "<value_column>", "rowNumber": 1, "counterLabel": "Total"}
  • PIVOT — {}; configure in UI, or pass pivot config if known.

When unsure of a chart option's exact key, create the viz with a minimal options blob, then tell the user they can fine-tune it in the Redash UI — the API and UI edit the same object.

Parameterized queries

If the SQL contains {{ param }} placeholders, declare them in query --options:

{"parameters": [{"name": "country", "type": "text", "title": "Country"}]}

Then run-query accepts values — extend the helper or run via the UI for parameter entry. For ad-hoc runs, inline the value instead.


Pitfalls — don't repeat these

  • Don't skip test. A wrong URL or a per-query key (vs. user key) fails confusingly later. Verify first.
  • Don't invent table/column names. Always pull schema first; Redash errors are opaque.
  • Don't forget to publish. Freshly created queries and dashboards are drafts and won't show in lists until --publish / publish-dashboard.
  • Don't expect a query to have a chart automatically. Only an implicit TABLE viz exists; you must create-viz for any chart before it can go in a widget.
  • Don't overflow the grid width. col + size-x must stay ≤ the dashboard's column count (6 or 12 — read it off existing widgets; see Workflow B step 4), or widgets overlap.
  • Don't add a widget with a stale viz id. Use the id returned by create-viz (or from get-query), not the query id.
  • Don't hardcode secrets. Read REDASH_URL/REDASH_API_KEY from the environment; if missing, ask the user.
  • Don't poll yourself. run-query/exec-sql/schema already poll the job to completion and return final data. (schema returns a refresh job on a cold cache — the helper waits and re-fetches.)
  • Fetch dashboards by numeric id, not slug. On 26.x a slug passed to get-dashboard returns HTTP 500 (id-only routing). Run dashboards to resolve a name/slug to its id first. (The id is also the leading number in a dashboard URL like /dashboards/7-growth.)
  • Don't assume a 6-column grid. Width varies per dashboard (6 or 12 are both common). Read it off existing widgets before placing new ones, or they'll overlap or leave gaps.

Verified end-to-end against Redash 26.3.0 (MySQL data source): data-sources → schema → exec-sql → create-query → run-query → create-viz (CHART) → create-dashboard → add-widget → publish → delete all succeeded.

Keep this skill focused: introspect, query, visualize, and assemble dashboards via the Redash API — leave deep chart styling to the UI.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.