Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

ktx Analytics Workflow

Enforces a discover → inspect → plan → query → validate workflow for any data question against a ktx-connected database, with a deep set of correct-SQL heuristics.

Data & AnalyticsAdvanced1,601107AI score 8/10Last updated: Sep 11, 2026

What it does

  • Fires on any data-analysis request ("how many", "show me", "what's the breakdown", period comparisons) and forces discover_data first instead of guessing table names.
  • Walks wiki pages, semantic-layer sources/measures/dimensions, and raw tables/columns; prefers sl_query over raw SQL, and treats sql_execution as read-only.
  • Before raw SQL, pulls engine conventions from sql_dialect_notes and applies a large catalogue of silent-bug guards: fan-out joins inflating SUMs, enrichment INNER JOINs dropping fact rows, integer division truncation, RANGE vs ROWS window frames, text-encoded numerics ('1.2K', '$1,200'), calendar-based rolling windows, macro vs micro averages.
  • Requires writing the exact output-column contract before the SQL, plus a final completeness check (every metric, both id and name per entity, derived-value inputs, correct grain).
  • Persists durable learnings via memory_ingest so future discovery gets smarter.

Who it's for

  • Data analysts and analytics engineers already running the ktx CLI/MCP against a warehouse.
  • Teams burned by LLM SQL that runs fine but returns quietly wrong numbers.
  • Orgs maintaining both a semantic layer and ad-hoc SQL who want one consistent querying standard.

Examples

  1. "Orders per region containing a returned item" → pre-aggregate order_lines to one row per order so no order is counted twice.
  2. "Each customer's first order, limited to 2024+" → rank the full partition in a CTE, then filter outside so "first" isn't measured on a shrunken set.
  3. A value column stored as '1.2K' / '$1,200' / '-' → an early CTE strips symbols, scales K/M/B, maps sentinels, and casts once so the SUM is right.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/Kaelio/ktx/HEAD/packages/cli/src/skills/analytics/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the packages/cli/src/skills/analytics folder from the GitHub repo Kaelio/ktx into my ~/.claude/skills/ktx-analytics/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/Kaelio/ktx.git && mkdir -p ~/.claude/skills/ktx-analytics && cp -r ktx/packages/cli/src/skills/analytics/* ~/.claude/skills/ktx-analytics/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and clone the repo: git clone https://github.com/Kaelio/ktx.git
  2. Create the skill folder: mkdir -p ~/.claude/skills/ktx-analytics
  3. Copy the skill in: cp -r ktx/packages/cli/src/skills/analytics/* ~/.claude/skills/ktx-analytics/
  4. This skill depends on the ktx MCP server. Install the ktx CLI, configure the database connection(s) you want to analyze, then register the ktx MCP server in your Claude Code MCP config.
  5. Restart Claude Code and confirm ktx-analytics appears in your skills list.
  6. Test with something like "show orders by region for the last 30 days" and verify Claude calls discover_data before writing SQL.
View source on GitHubLicense: Apache-2.0