
Historic Sql Patterns
Surfaces cross-table SQL patterns from historic query logs, specifically hunting for analytical intents that span at least two tables and show repeated usage. It reads sharded pattern input files, verifies every join column through entity_details, and emits typed evidence records with slugs, narratives, and constituent template IDs. The workflow is strict: read the shard, identify durable cross-table intents, emit one pattern per intent, then stop. It won't write wikis or semantic layer sources itself, just produces the pattern evidence for downstream projection. The identifier verification protocol is thorough, requiring entity_details checks and sometimes SQL probes to confirm literals exist before committing anything to output. Good for mining institutional analytical knowledge from logs without inventing tables that don't exist.
- GitHub stars
- 1.1K
- last updated
- Jun 11, 2026
Install
$ npx -y skills add kaelio/ktx --skill historic_sql_patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Historic SQL Patterns
Use this skill when the WorkUnit raw file is a patterns-input/part-0001.json style shard from the historic-sql adapter. Older staged bundles may still provide root patterns-input.json; when that is the WorkUnit raw file, read it the same way.
Required Workflow
- Read the WorkUnit notes first.
- Find the single pattern input file listed under the WorkUnit
rawFilessection. - Call
read_raw_filefor that exact raw file path. - Identify recurring analytical intents that span at least two tables and have repeated usage signal.
- Emit one
patternevidence object per durable cross-table intent by callingemit_historic_sql_evidence. - Stop after all pattern evidence has been emitted.
Every join column mentioned in pattern descriptions must be verified via entity_details for both sides of the join.
Identifier Verification Protocol
Before writing a wiki page or SL source on any topic:
discover_data({query: "<topic>"})- see what wikis, SL sources, and raw tables already exist. Prefer updating existing pages over creating new ones.
Sponsors
Details
- Repository
- github.com/kaelio/ktx
- Categories
- Documentation, Databases
- License
- Apache-2.0
- First seen
- Jun 11, 2026