kaelio avatar

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-code

Installs 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 is TIMESTAMP); event_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY) (when DATE).
  • 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

More from kaelio/ktx

All 15
1kaelio avatarwiki_capturekaelio/ktxktx's knowledge base - wiki pages for durable, reusable business knowledge. Covers capture workflow for user preferences, metric definitions, organizational con0skills.sh installs
2kostard avatarforgecad-model-graderkostard/forgecad-public-kitAnalyze, verify, and grade ForgeCAD or CAD-as-code models against a user requirement, design brief, prompt, reference, or acceptance criteria. Use when asked to0skills.sh installs
3malob avatarAI SDK Documentationmalob/nix-configIf you're working with Vercel's AI SDK, this gives Claude direct access to the current documentation at ai-sdk.dev instead of relying on...0skills.sh installs
4malob avatarmalo-find-skillsmalob/nix-configHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int0skills.sh installs
5masharratt avatarcfn-error-managementmasharratt/claude-flow-noviceUnified error handling, batching, and logging for CFN Loop. Use when you need to capture agent errors, batch multiple errors for processing, log structured erro0skills.sh installs
6mcpware avatarorganizemcpware/cross-code-organizerOpen the Cross-Code Organizer (CCO) dashboard — view and manage all memories, skills, MCP servers, hooks, and configs across scopes0skills.sh installs