Tooluck logoTooluck
SKILL.md

metabase_ingest

Agent skill fromKaelio/ktx

Convert Metabase questions, models, and metrics into ktx Semantic Layer source definitions. Covers result-metadata to KSL column type mapping, FK/PK detection, near-duplicate deduplication, pre-aggregation decomposition, join-graph connectivity, and how to react to priorProvenance from earlier ingest syncs. Load when the WorkUnit contains `cards/<id>.json` files under a Metabase bundle.

How to install metabase_ingest

install metabase_ingest
# install the ktx pack with the skills CLI
npx skills add Kaelio/ktx

# or add only this skill to Claude Code: copy the folder

packages/cli/src/skills/metabase_ingest/

# into

~/.claude/skills/metabase_ingest/ (all projects)

.claude/skills/metabase_ingest/ (one project)

packages/cli/src/skills/metabase_ingest/SKILL.md

Apache-2.0Full file
1# Metabase to ktx Semantic Layer
2
3Each WorkUnit represents one Metabase collection's cards for one Metabase database (mapped to exactly one ktx connection). Every `cards/<id>.json` file carries the resolved SQL, result_metadata, card type, collection path, and referenced-card ids. The WU's `sync-config.json` tells you which sync mode is active and which selections apply. `databases/<id>.json` tells you the target ktx connection.
4
5## Context format
6
7Each card JSON looks like:
8```json
9{
10 "metabaseId": 7,
11 "name": "Daily orders",
12 "description": "Orders by day",
13 "type": "model",
14 "databaseId": 42,
15 "collectionId": 5,
16 "resolvedSql": "SELECT ...",
17 "templateTags": [{"name": "ref", "type": "card", "cardReference": 10}],
18 "resultMetadata": [
19 {"name": "day", "base_type": "type/DateTime", "semantic_type": "type/CreationTimestamp"},
20 {"name": "order_count", "base_type": "type/Integer"}
21 ],
22 "collectionPath": ["Data", "Orders Team"],
23 "referencedCardIds": [10]
24}
25```
26
27Use `resultMetadata` to:
28- Map `base_type` to KSL column type: `type/Integer`, `type/Float`, `type/Decimal`, `type/BigInteger` → `number`; `type/Text`, `type/TextLike` → `string`; `type/DateTime`, `type/Date`, `type/DateTimeWithTZ` → `time`; `type/Boolean` → `boolean`.
29- Identify grain candidates: columns with `semantic_type: type/PK`.
30- Identify join candidates: columns with `semantic_type: type/FK` plus `fk_target_field_id`.
31…

Excerpt shown under the repository's Apache-2.0 license.

More skills in ktx

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates