Tooluck logoTooluck
SKILL.md

sl_capture

Agent skill fromKaelio/ktx

How to capture new reusable patterns into ktx's semantic layer - when a measure, segment, or join belongs in the catalog and how to write it generically so it stays small and useful over time. Loaded by the post-turn memory-agent only. The research agent does not write to the SL.

How to install sl_capture

install sl_capture
# 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/sl_capture/

# into

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

.claude/skills/sl_capture/ (one project)

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

Apache-2.0Full file
1# Semantic Layer - Capture
2
3This skill covers **when** and **how** to capture new patterns into the semantic layer. For schema reference and query grammar, load the `sl` skill first.
4
5When 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.
6
7## SQL dialect
8
9The user-facing prompt includes a `Warehouse:` line under the SL Sources index
10(e.g. `Warehouse: BIGQUERY`). All `expr` strings - measure expressions, segment
11predicates, computed-column SQL - execute on that warehouse and must use its
12syntax. Date arithmetic in particular varies by dialect:
13
14- **BigQuery**: `transaction_date >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 90 DAY)` (when the column is `TIMESTAMP`); `event_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY)` (when `DATE`).
15- **Postgres / Redshift**: `transaction_date >= current_date - interval '90 days'`.
16- **Snowflake**: `transaction_date >= dateadd(day, -90, current_timestamp())`.
17
18Match the column's manifest type (`type: time` → TIMESTAMP/DATETIME on the
19warehouse) - comparing TIMESTAMP to a DATE-arithmetic result fails on
20BigQuery. After every `sl_edit_source`/`sl_write_source`, the inline validator runs a
21`LIMIT 1` warehouse probe per measure and surfaces dialect mismatches; if
22you see an error trailer, fix the expression and retry rather than leaving
23the source for the post-squash gate to revert.
24…

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