In short.
Historic SQL Patterns is an agent skill for data teams documenting recurring SQL analyses, but it depends on host-provided tools and warehouse access. It directs a memory_agent to extract repeated cross-table intents from one historic-sql input shard, verify database identifiers and emit structured pattern records for downstream wiki generation. Its instructions provide specific boundaries, but the referenced validation schemas and runtime implementations are absent from the supplied files. Nothing was executed, so accuracy, compatibility and downstream behavior remain unassessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is limited to packages/cli/src/skills/historic_sql_patterns at revision 49a4ae6f5b28c904da921afc0ee72da6db7ac202, represented by its SKILL.md, plus the accompanying repository-root LICENSE. The supplied manifest reports complete coverage of that selected folder. Parent runtime code, historic-sql adapter implementation, validation schemas, other skills, warehouse data and downstream wiki projection are outside the supplied evidence. Nothing was executed; compatibility, enforcement, accuracy, costs and generated outputs were not assessed.
The overview
Identity
historic_sql_patterns is an instruction-based skill in Kaelio/ktx at packages/cli/src/skills/historic_sql_patterns/SKILL.md. Its declared caller is memory_agent, and its stated purpose is to produce typed evidence about recurring analytical intents across database tables.
The original resource folder is [https://github.com/Kaelio/ktx/tree/main/packages/cli/src/skills/historic_sql_patterns]. The supplied implementation consists of the skill instructions; a standalone application or command-line entry point is not established.
Assessment
This is a focused fit for an existing agent workflow that turns query history into data documentation. Its useful distinction is combining repeated usage signals with checks against actual warehouse metadata before emitting patterns.
Adoption requires integration work unless the host already supplies the named tools and input format. The instructions are specific enough to explain the intended behavior, but they do not establish extraction accuracy, schema enforcement or successful wiki generation.
Users
The most direct users are developers maintaining memory_agent or a compatible data-documentation agent. Analysts and data platform teams could use its output to describe recurring business questions reflected in SQL history.
It assumes familiarity with SQL joins, warehouse connections and structured records. Beginners would need help configuring the host environment and judging whether a proposed pattern accurately describes its SQL.
Capabilities
The skill instructs the agent to identify durable analytical intents involving at least two tables and repeated usage. It prefers templates with executionsBucket of at least 10-100 and distinctUsersBucket above solo usage; these are selection preferences, not documented hard cutoffs.
It specifies one emitted record per intent, with a stable slug, title, narrative, representative SQL, involved tables, source references and constituent template IDs. Templates should be merged only when their business intent matches. It explicitly prohibits writing wiki pages, editing SL sources, creating context candidates and producing single-table pattern pages.
Using it
Requirements
The host must provide WorkUnit notes and rawFiles metadata, a historic-sql pattern input file, read_raw_file and emit_historic_sql_evidence. Join verification requires entity_details with a warehouse connectionId. The identifier protocol also names discover_data and sql_execution for discovery and additional checks.
The instructions reference patternOutputSchema and patternsArraySchema, but their definitions are not supplied. Required model, runtime version, authentication configuration, database permissions and supported warehouse systems are unknown.
Mechanism
The prescribed sequence is to read the WorkUnit notes, locate its single pattern input file, read that exact file, identify recurring cross-table intents and emit pattern evidence. Each shard is handled independently; peer shard files must not be read.
Every join column mentioned in a pattern description must be checked through entity_details on both sides. The broader identifier protocol describes checking literal values against samples, using SQL probes when needed and marking unresolved identifiers rather than presenting them as confirmed. The skill produces evidence intended for downstream deterministic wiki projection; the projection implementation is not included.
Setup
Integration would require making the skill available to its host agent, connecting the named tools and supplying the referenced output schemas. The input should be the exact raw file listed by the WorkUnit, typically a patterns-input/part-0001.json-style shard. Older bundles may instead use a root patterns-input.json file.
The supplied file does not document an installation command, dependency list or complete host configuration. Simply downloading SKILL.md does not establish that its tool calls or inputs are available.
Example
The source includes an illustrative Order Lifecycle Analysis pattern using public.orders and public.customers. Its representative SQL joins c.id to o.customer_id and counts rows grouped by o.status. The record also includes slRefs of orders and customers and constituentTemplateIds of pg:1 and pg:2.
These are example identifiers, not verified tables or observed results. The narrative mentions customer segments, but the SQL selects no segment field and groups only by order status. The example therefore demonstrates the record shape more clearly than it demonstrates the stated analytical intent.
Assessment & evidence
Limitations
Independent shard processing limits the information available to each invocation. As an inference from that boundary, the skill cannot itself establish whether another shard contains the same intent or additional supporting usage. Single-table analysis is expressly outside its remit.
The referenced schemas, input examples, tool implementations and downstream projection code are unavailable in the supplied scope. Instructions to exclude credentials, tokens, user emails and unredacted literals are present, but enforcement is unassessed. Nothing was executed, and no accuracy, performance or privacy outcome is established.
Reasoning
The design uses repeated execution and multiple-user signals to favor recurring work over isolated queries. Preserving constituent template IDs gives each proposed pattern a reference back to its supporting templates, while stable intent-based slugs support consistent downstream naming.
Metadata verification can help catch invented identifiers, but it does not by itself establish correct business interpretation or aggregation behavior. That distinction matters here because the example narrative describes more than its SQL expresses. These are conclusions about the documented design, not measured results.
Alternatives
Manual review of query history and database metadata is a plausible alternative for occasional documentation work. Cross-shard synthesis requires combining information across shards; this skill does not document how to do that. These comparisons are inferred from this skill's stated boundaries.
The supplied files identify no competing product or comparative results. Relative accuracy, cost and ease of integration are unknown.
Evidence
The available source consists of the selected SKILL.md and the repository-level LICENSE. The immutable skill source is [https://raw.githubusercontent.com/Kaelio/ktx/49a4ae6f5b28c904da921afc0ee72da6db7ac202/packages/cli/src/skills/historic_sql_patterns/SKILL.md].
These files establish the intended workflow, record example, boundaries and licence terms. They contain no actual query-history shard, warehouse response, emitted pattern result or execution receipt. Operational behavior and analytical quality remain unassessed.
Access & freshness
Costs
The accompanying Apache License 2.0 grants rights without licence royalties. That does not establish the cost of operating the skill.
Model usage, warehouse query charges, hosting and integration effort are unknown. The instructions allow metadata lookups and SQL probes, but provide no usage measurements, pricing or cost estimates.
Rights
The accompanying repository LICENSE is Apache License 2.0. It permits reproduction, modification, sublicensing and redistribution, including commercial distribution, subject to its conditions. Redistribution requires providing the licence, marking modified files and retaining applicable notices. If a distribution includes a NOTICE file, its applicable attribution notices must also be preserved.
The licence includes a contributor patent grant with termination conditions for specified patent litigation. It does not generally grant trademark rights and provides the work without warranty. The licence source is [https://raw.githubusercontent.com/Kaelio/ktx/49a4ae6f5b28c904da921afc0ee72da6db7ac202/LICENSE].
Freshness
The supplied snapshot is pinned to commit 49a4ae6f5b28c904da921afc0ee72da6db7ac202 and was captured on 2026-11-16 at 01:22:45.481 UTC. Findings apply to that revision; the folder URL using main may later differ.
No release number, compatibility matrix or last-maintenance date is established by these files. The capture date establishes when this snapshot was obtained, not when the skill was last changed.
Actions
Before adoption, obtain the referenced schemas and confirm that the host supplies the named tools, WorkUnit structure and warehouse connection. Check that your documentation task can accept independent shard processing and excludes single-table patterns.
Evaluate it with sanitized query-history examples whose expected intents and joins are known. Check narrative-to-SQL agreement, grouping decisions, identifier verification, handling of unresolved references and exclusion of sensitive values. Verify downstream projection separately; no such evaluation has been performed here.
