analytics
Use when answering a question that needs data from a ktx-connected database - investigating, analyzing, "how many", "show me", "what's the breakdown of",…
Installs and configures ktx, the open-source context layer for data agents — runs ktx setup non-interactively with hidden CLI flags, configures database connections and embeddings, installs agent integration, and verifies readiness. Use when the user asks an agent to add ktx to
$ npx -y skills add Kaelio/ktx --skill ktx --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ktxContext preview
The summary Claude sees to decide when to auto-load this skill.
Installs and configures ktx, the open-source context layer for data agents — runs ktx setup non-interactively with hidden CLI flags, configures database connections and embeddings, installs agent integration, and verifies readiness. Use when the user asks an agent to add ktx to
name: ktx description: Installs and configures ktx, the open-source context layer for data agents — runs ktx setup non-interactively with hidden CLI flags, configures database connections and embeddings, installs agent integration, and verifies readiness. Use when the user asks an agent to add ktx to a project, connect data sources, install agent rules, ingest schema, or troubleshoot a local ktx install.
Install and configure **ktx**, the open-source context layer for data agents. Use this skill when a user wants an agent to add **ktx** to a project, connect data sources, build initial context, install agent integration, or troubleshoot a local **ktx** setup.
The non-interactive scripted flow below is the canonical path — bare `ktx setup` is interactive (clack prompts) and an agent cannot drive it.
flags listed below; verify uncommon flags against the docs at `https://docs.kaelio.com/ktx/` or this skill — not against `--help` output.
credentials, account identifiers, and source selections.
re-resolved against the process environment on **every** `ktx` run, so a var exported only in the setup shell is gone when `ktx ingest` or `ktx mcp start` runs later — the secret silently resolves to empty and the connection fails. `file:` refs read from disk and survive across shells. The same caveat applies to `--*-api-key-env` flags: the named var must be present in every shell that runs `ktx`, including the `ktx mcp` daemon's environment.
into `.ktx/secrets/<id>-url` and rewrites `ktx.yaml` to a `file:` ref (see workflow step 2). Source credential refs are **not** auto-externalized: write the secret to a file under `.ktx/secrets/` (`chmod 600`) and pass a `file:` ref. Never ask the user to paste a secret when a `file:` or `env:` ref works.
longest), and from the outside a slow step looks identical to a stuck one. Don't go silent: say what's about to run and that it may take a while, then post brief progress/liveness updates while it runs (see step 4) so the user never has to wonder whether it stalled — otherwise they may kill it mid-run.
Before invoking `ktx setup`, collect in one round:
1. Project directory (default: current working directory). 2. LLM backend and key strategy. In `--no-input` mode the CLI defaults to `anthropic` and **requires an API key**. When the user is inside Claude Code, pass `--llm-backend claude-code` explicitly; otherwise pass `--llm-backend anthropic --anthropic-api-key-env ANTHROPIC_API_KEY`. 3. Embedding backend (`sentence-transformers` is the local default and needs no key; use `openai` only if the user already has a key, then pass `--embedding-api-key-env OPENAI_API_KEY`). 4. Database: driver, connection id, URL (or `env:` / `file:` ref), and one or more schemas. 5. Optional context sources (dbt, Metabase, Looker, LookML, MetricFlow, Notion). Add each one with a follow-up `ktx setup --source …` run (see [Add context sources](#add-context-sources)); use `--skip-sources` only when the user has none.
Do not discover these inputs across multiple setup runs.
1. **Detect the install path.** If the working directory contains `packages/cli/dist/bin.js` or `pnpm-workspace.yaml` referencing `@kaelio/ktx` you are inside the **ktx** monorepo — build and link the local CLI with `pnpm` and do **not** run `npm install -g`. Otherwise:
node --version # require >= 22; stop and ask the user if older ktx --version || npm install -g @kaelio/ktx
2. **Run scripted setup** (canonical path):
ktx setup --no-input --yes \
--project-dir <path> \
--llm-backend claude-code \
--embedding-backend sentence-transformers \
--database <driver> --database-connection-id <id> \
--database-url '<raw-url | file:/abs/path>' \
--database-schema <schema> \
--skip-sources \
--skip-agentsMySQL, ClickHouse, SQL Server, BigQuery, Snowflake) in `--no-input`: setup fails fast without it unless the connection already has scope in `ktx.yaml`. SQLite needs no scope.
connections, rerun setup once per connection.
into `.ktx/secrets/<connection-id>-url` and rewrites `ktx.yaml` to a `file:` ref automatically.
mode with neither `--target` nor `--skip-agents`, that step has no input, prints `Run in a TTY, or pass --target <target>.`, and the command exits non-zero **even though every database/LLM/embedding step succeeded**. Pass `--skip-agents` to defer agents to step 5 (as above), or `--target <agent>` to install them inline and exit 0. Judge data-layer success from `ktx status`, not from this exit code.
3. **Resumability and `--skip-*`.** Re-running `ktx setup` against an existing project resumes its config. Use `--skip-llm`, `--skip-databases`, `--skip-sources`, or `--skip-embeddings` to leave a slice unconfigured but let the rest complete instead of aborting on the first failure. **When resumi
ktx is an executable context layer for data and analytics agents 🐙 Allow Claude Code, Codex, or other AI agents to query analytical databases accurately and with full context of your company
Repo: Kaelio/ktx
Use when answering a question that needs data from a ktx-connected database - investigating, analyzing, "how many", "show me", "what's the breakdown of",…
Map dbt `schema.yml` / `properties.yml` models and sources into ktx semantic-layer overlays and column notes. Covers `sources:` vs `models:`, column…
Synthesize durable KTX wiki pages from staged Google Drive document pulls. Load when a WorkUnit contains Google Doc raw files from `docs/**`.
Identify recurring cross-table historic-SQL analytical intents from a bounded pattern shard and emit typed pattern evidence for deterministic wiki projection.
Convert one changed historic-SQL table usage bucket into typed table usage evidence for deterministic _schema projection.
Classify and resolve conflicts detected during bundle ingest (structural duplicates, definitional contradictions, near-duplicate clusters, re-ingest changes,…