/hypequery:hypequery-onboardfrom hypequery
Walks through onboarding a ClickHouse database onto hypequery: schema inspection, dataset creation, validation, and optional cloud deployment. Use when asked to add analytics, a semantic layer, or MCP access over ClickHouse tables.
Ships in hypequery. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You turn the user's ClickHouse tables into hypequery datasets that answer their business questions, with evidence from the data instead of guesses. The CLI does the analysis; you ask the user what only they know, write the datasets, and check them until the checks are clean.
Rules:
tenantKey (or tenant_key) unless the user named the column.
The analysis lists possible tenant columns; they are questions, not answers.
Record the user's answer verbatim in analytics/onboarding/plan.md.Every command below is the TypeScript CLI, run as npx --no-install hypequery …
after step 1 installs @hypequery/cli in the project. --no-install matters:
the unscoped npm name hypequery is not this CLI, and without a terminal npx
would download whatever has that name instead of failing. Python projects run
the CLI through npx with the analysis engine alongside it (Node.js 20+), naming
both packages so npx can't fall back to the unscoped name:
npx -y -p @hypequery/cli -p '@hypequery/onboard-engine@^0.1' hypequery onboard analyze --json
Read that form wherever a step says npx --no-install hypequery in a Python
project. Add --json to read results as data: one JSON document on stdout,
logs on stderr. Exit code 1 means something to correct (the hint says what),
4 means retry. The commands never prompt under --json.
CLICKHOUSE_URL, CLICKHOUSE_DATABASE,
CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD in the environment or .env.
Ask the user for the URL, database and user name if they are missing. Never
ask for the password in the chat: ask the user to add CLICKHOUSE_PASSWORD
to .env (or export it in their shell) themselves, and tell you when it is
done. Never print, echo or read back the password or .env; check that
.env is in .gitignore.npm i -D @hypequery/cli '@hypequery/onboard-engine@^0.1' (the
CLI, and the analysis engine it loads at runtime) and
npm i @hypequery/clickhouse @hypequery/datasets.
Python: pip install hypequery.ONBOARD_ENGINE_MISSING or ONBOARD_ENGINE_INCOMPATIBLE: the engine isn't
installed in a supported version; run the command in the hint.CONNECTION_FAILED or CLICKHOUSE_ACCESS_DENIED: fix the connection with the
user before going on.npx --no-install hypequery schema inspect --json # tables, columns, engine metadata
npx --no-install hypequery onboard analyze --json # the evidence for the model
From onboard analyze, read:
findings and questions: traps such as aggregate-state tables, versioned
rows (ReplacingMergeTree needs row resolution), status columns, mixed
scales. Questions with askBeforeDraft: true change a number: ask them.grainChecks: what one row means, and duplicates.joinCandidates: measured relationships (proposed ones are candidates, not
facts; confirm with the user before modelling them).columnRoles: likely time, status, currency and key columns.queryHistory: which tables, joins and filters existing queries use.
skipped with a QUERY_HISTORY_UNAVAILABLE warning is fine; mention the
grant in the hint once and move on.connection.risks / profileFix: tell the user if the ClickHouse user can
write or has no limits.tenantKeyCandidates: questions for step 5.Save what you will rely on in analytics/onboarding/state.json (tables chosen,
answers, check status) so a later session can resume. Never record sampled
values, example rows, credentials or other secrets in it: table and column
names, answers and statuses only. Ask the user before committing it.
Show the user the tables with row counts and what each seems to hold. Ask which ones matter. Don't model staging, backup or materialized-view source tables unless asked; prefer the table that holds the facts the questions need.
Ask which questions people should be able to answer ("revenue by plan per month", "active users by country"). Each question names measures (revenue, active users), dimensions (plan, country) and a time grain. Write them down.
Ask: "Do your customers each see only their own data? If so, which column
identifies the customer in each table?" Show tenantKeyCandidates as options,
plus "none". Record the answer word for word. Set a tenant key only for tables
the user named a column for.
Write analytics/onboarding/plan.md: tables, each question with the measure,
dimensions and grain that answer it, the tenancy answer verbatim, the answers
to questions, and joins the user confirmed. Show it and get a yes.
Generate a starting point, then edit it to the plan:
npx --no-install hypequery generate:datasets --tables orders,customers
writes analytics/datasets.ts. Add --tenant-column <column> only with the
column the user named.hypequery generate datasets writes datasets.py (or write it by hand).Then edit: rename fields to the product's language, delete meaningless
measures (sums of ids), add description to every dataset, dimension and
measure, set timeKey, add confirmed relationships (belongsTo), and handle
each finding (for example row resolution for versioned tables). The
hypequery-datasets skill has the API.
// analytics/datasets.ts
import { belongsTo, dataset, dimension, measure } from '@hypequery/datasets';
export const Customers = dataset('customers', {
source: 'customers',
description: 'One row per customer account.',
dimensions: { id: dimension.number(), plan: dimension.string({ description: 'Billing plan' }) },
measures: { customers: measure.count('id', { description: 'Customer accounts' }) },
});
export const Orders = dataset('orders', {
source: 'orders',
timeKey: 'created_at',
// tenantKey: 'account_id', // only if the user named this column
description: 'Paid and refunded orders.',
dimensions: { customer_id: dimension.number(), createdAt: dimension.timestamp({ column: 'created_at' }) },
measures: { revenue: measure.sum('amount', { description: 'Order value in USD' }) },
relationships: { customer: belongsTo(() => Customers, { from: 'customer_id', to: 'id' }) },
});
Python projects check a deployment bundle, written with the SDK next to
datasets.py:
# hypequery_bundle.py
from hypequery.datasets import create_dataset_registry, write_dataset_bundle
from datasets import customers, orders
write_dataset_bundle("analytics/hypequery-deployment", create_dataset_registry(orders, customers))
Run python hypequery_bundle.py after each edit, deleting
analytics/hypequery-deployment first (it refuses to replace a bundle).
npx tsc --noEmit # TypeScript: datasets typecheck
npx --no-install hypequery onboard check analytics/datasets.ts --json # TypeScript
# Python bundle:
npx -y -p @hypequery/cli -p '@hypequery/onboard-engine@^0.1' hypequery onboard check analytics/hypequery-deployment --json
onboard check runs every measure through an independent second route and
measures each declared relationship (add --join child.col=parent.col for
others). Exit 1 with ONBOARD_CHECK_FAILED lists each problem in
error.issues: fix the dataset (wrong column, missing row resolution, a join
that fans out) or ask the user where the data is ambiguous, then rerun.
skipped checks are not failures, but say which numbers were not verified.
Then answer each business question once through the datasets, not SQL (a short
script calling analytics.execute(...) or client.execute(...), or
npx --no-install hypequery mcp with the hypequery-query skill when the
project serves an API), and show the user the numbers.
When a hint doesn't fix a failure, tell the user what you tried; don't loop.
Only when the user wants hypequery Cloud:
npx --no-install hypequery login: the user approves sign-in in their
browser. It needs a person; run it in their terminal, or use
HYPEQUERY_API_TOKEN with --endpoint in CI.
TypeScript: export a publication and deploy it. Ask which roles and scopes may query it.
// analytics/cloud.ts
import { publishToCloud } from '@hypequery/datasets';
import { Customers, Orders } from './datasets';
export const cloud = publishToCloud({ datasets: { Orders, Customers }, access: { roles: ['analyst'], scopes: [] } });
npx --no-install hypequery deploy analytics/cloud.ts --mcp-config
Python: write the bundle with endpoints= (see
https://hypequery.com/docs/cloud/deploy-python), then
npx -y -p @hypequery/cli hypequery deployment:release analytics/hypequery-deployment
and npx -y -p @hypequery/cli hypequery deployment:submit analytics/hypequery-deployment --release analytics/hypequery-deployment.release.json.
npx --no-install hypequery deployment:status --mcp-config prints the
hosted MCP URL and the client configuration to give the user.
Docs: https://hypequery.com/docs/reference/api/cli (all commands, exit codes and error codes) and https://hypequery.com/llms.txt.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/hypequery-datasetsAuthor and change hypequery semantic-layer datasets for ClickHouse in TypeScript (@hypequery/datasets) or Python (hypequery). Use when defining or editing dimensions, measures, derived measures, metrics, relationships, tenant keys or time grains, scaffolding datasets from a ClickHouse schema, or exposing them over HTTP or MCP./hypequery-queryAnswer analytics questions with hypequery's MCP tools or HTTP endpoints instead of writing SQL. Use when hypequery MCP tools (list_datasets, get_dataset_schema, query_dataset, query_metric) are available, or when calling a hypequery dataset or metric endpoint, to choose dimensions, measures, filters, time grains and pagination.npx claudepluginhub hypequery/hypequery --plugin hypequeryOther plugins' skills for the same job