
Sl Capture
This teaches Claude when to extract reusable patterns into ktx's semantic layer and how to write them so they stay compact over time. It's loaded only by the post-turn memory agent after a successful query, never by the research agent that does the actual work. The core tension is generalization: you want one revenue measure with query-time filters, not twenty hardcoded variants for every region and time window. The guidance is opinionated about overlay versus standalone sources, when to use segments versus inlining predicates, and matching SQL dialect to the warehouse. If you're building a semantic layer that needs to survive contact with real analysts, the rules about what not to capture are more valuable than the capture mechanics themselves.
- GitHub stars
- 1.1K
- last updated
- Jun 11, 2026
Install
$ npx -y skills add kaelio/ktx --skill sl_capture --agent claude-codeInstalls into .claude/skills of the current project.
Files
Semantic Layer - Capture
This skill covers when and how to capture new patterns into the semantic layer. For schema reference and query grammar, load the sl skill first.
When the current turn produces a reusable pattern (business metric, derived view, join pattern, computed dimension), capture it so future queries can reach for it instead of rediscovering it.
SQL dialect
The user-facing prompt includes a Warehouse: line under the SL Sources index
(e.g. Warehouse: BIGQUERY). All expr strings - measure expressions, segment
predicates, computed-column SQL - execute on that warehouse and must use its
syntax. Date arithmetic in particular varies by dialect:
- BigQuery:
transaction_date >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 90 DAY)(when the column isTIMESTAMP);event_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY)(whenDATE). - Postgres / Redshift:
transaction_date >= current_date - interval '90 days'. - Snowflake:
transaction_date >= dateadd(day, -90, current_timestamp()).
Sponsors
Details
- Repository
- github.com/kaelio/ktx
- Categories
- AI & Agent Building, Data Science & ML
- License
- Apache-2.0
- First seen
- Jun 11, 2026