Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

query-pipelines

БесплатноБез исполняемых скриптовНе проверен

Rules and examples for building node pipelines with the `query` tool (`semanticLayer`, `merge`, `duckdb`, `python`, `sql`, `external`), covering node choice…

lightdashот lightdash★ 6 265 звёзд на GitHub

Об этом скилле

Building query pipelines

  • Query each explore with one semanticLayer node.
  • Combine semanticLayer nodes that meet on dimensions they share at the same grain (both by month, both by customer) with a merge node. It keeps each governed metric's label, format and description, and refuses a join that would count a metric twice. Each source node selects its join-key dimensions and metrics.
  • Compute everything over a merge's columns in its table calculations: ratios across sources, year on year, shares of total, lags, conditional labels. They keep the result governed.
  • When a merge is refused, fix the merge: narrow a source with a filter, raise its limit, or add the missing join key. If you answer another way instead, your answer says so and why.
  • Combine results any other way with a duckdb node: a join key that has to be computed or truncated to a shared grain, a union, or filtering and aggregating after the join.
  • Compute a metric the explore lacks as a custom metric on its semanticLayer node, with a filter when it covers only some rows (completed orders among all orders), and a metric in an earlier period as a period comparison there. The warehouse computes them in the same query, so the user gets the answer sooner and over every row.
  • Explores are governed and reusable, so use a sql node only when the user points you at a raw table or asks for SQL, or when the semantic layer cannot produce the result: a table outside every explore, a join key no explore exposes as a dimension, a computation whose row-level inputs would exceed a node's row limit, or warehouse-specific syntax.
  • When no explore covers the request and the user names no warehouse table, say so and offer alternatives when there are any. When they ask for raw SQL without the table or column names it needs, ask for them.
  • Compute what neither a metric query nor a merge calculation expresses in a duckdb node: over one semanticLayer node's results, arithmetic across metrics, % of total, the change between a metric and its period comparison, running totals, moving averages and ranking; over any node, aggregates of aggregated metrics, top N per group, cohort comparisons and reshaping.
  • Run statistics, forecasts and other algorithms that SQL expresses poorly in a python node.
  • Build an answer that takes several queries, or a computation over their results, as one pipeline in one query call, whose terminal node is the result that answers the question.
  • When a follow-up needs a new query, plan its pipeline as for a first question: the fewest nodes from source to result, counting the earlier nodes it reads, and among such plans the one that reads earlier nodes unchanged.
  • For a follow-up that changes an earlier result, change only what the user asked for and keep the rest: metrics, filters, period, grouping, sort and the rows shown, zero and small values included. Claim a change only after the call succeeds. When the requested field is not among the carried-forward candidates, discover it rather than binding its value to an unrelated existing dimension.

Field usage

  • Use only field IDs returned by discovery, plus the IDs of your own custom metrics.
  • Field hints are written for you and override the field description.
  • For date dimensions, pick the granularity the user asked for (order_date_month over order_date for "by month").
  • When base and joined tables have similar field names, use the one at the node's semantic level.

Examples

Every call takes projectUuid (from get_context). Every node takes sourceType, nodeId, title and description; limit is optional. Names below are placeholders.

Two semanticLayer nodes → merge → python:

{"terminalNodeId": "rate_trend", "queries": [
  {"sourceType":"semanticLayer","nodeId":"inv_mo","title":"Invoices by month","description":"Monthly invoiced amount, prior-year amount, paid count.","exploreName":"invoices","dimensions":["invoices_date_month"],"metrics":["invoices_amount"],"customMetrics":[{"table":"invoices","name":"paid_count","label":"Paid invoices","aggregation":"count_distinct","dimensionFieldId":"invoices_id","filter":"invoices_status equals=\"paid\""}],"periodComparisons":[{"metricFieldId":"invoices_amount","timeDimensionFieldId":"invoices_date_month","periodOffset":12}],"filters":{"dimensions":"invoices_date_month inThePast=12{unit:months,completed:true}","metrics":null}},
  {"sourceType":"semanticLayer","nodeId":"tkt_mo","title":"Tickets by month","description":"Counts tickets opened per month.","exploreName":"tickets","dimensions":["tickets_date_month"],"metrics":["tickets_count"]},
  {"sourceType":"merge","nodeId":"inv_tkt","title":"Monthly ticket rate","description":"Joins invoices and tickets by month with rate.","sources":[{"nodeId":"inv_mo"},{"nodeId":"tkt_mo"}],"joinKey":[{"name":"month","fields":[{"nodeId":"inv_mo","fieldId":"invoices_date_month"},{"nodeId":"tkt_mo","fieldId":"
Полный SKILL.md на GitHub

Установить query-pipelines в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл query-pipelines?

Rules and examples for building node pipelines with the `query` tool (`semanticLayer`, `merge`, `duckdb`, `python`, `sql`, `external`), covering node choice, merges, custom metrics, period comparisons, field selection and follow-ups. For sessions that have the `query` tool; read it before the first `query` call.

Как установить скилл query-pipelines?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл query-pipelines запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить query-pipelines с