What problem does it solve?
Metabase instances accumulate hundreds of questions, models, and metrics whose business logic stays locked inside the BI tool. This Skill migrates that logic into ktx Semantic Layer (KSL) source definitions so data agents can query the warehouse using approved, reusable metric definitions instead of re-deriving SQL from scratch.
Core Features & Use Cases
- SQL translation and cleanup: Inlines cross-card
{{#N}} references, drops dummy-substituted template placeholders and optional [[ ]] clauses, and validates the result as a standalone subquery.
- Type and join mapping: Maps Metabase
result_metadata base types to KSL column types, detects PK/FK grain and join candidates, and enforces key-only join rules to prevent broken joins.
- Deduplication and decomposition: Collapses near-duplicate cards into one generalized source and decomposes pre-aggregated GROUP BY queries into row-level columns plus KSL measures.
- Use Case: Given a WorkUnit of staged
cards/<id>.json files from a Metabase collection, produce overlay or standalone semantic-layer sources with measures, joins, provenance tags, and skip/fallback records for trivial or untranslatable cards.
Quick Start
Load this Skill when a WorkUnit contains Metabase card JSON files and ask the agent to ingest the staged cards into ktx semantic layer sources.