codexkit-sql-query-builder

codexkit-sql-query-builder is a skill for Claude Code, Codex from hoavdc/CodexKit. It costs 61 tokens per session (1,407 once invoked), scanned A, original, MIT.

A tool for turning business questions into documented analytical SQL queries. SQL is the language used to retrieve and transform data in databases; the queries may use joins, common table expressions, window functions, and aggregations.

In plain words
What is it for?
Use it for reports, data-pipeline transformations, ad-hoc analysis, slow-query refactoring, and questions involving trends, rankings, or grouped results.
Why use it?
It reduces ambiguity between what stakeholders ask and what the data query must calculate. It also helps organize table relationships, filters, time periods, output columns, and query performance.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/hoavdc/codexkit/codexkit-sql-query-builder
Any agent
npx skills add hoavdc/CodexKit --skill codexkit-sql-query-builder
Clone the repo
git clone --depth 1 https://github.com/hoavdc/CodexKit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codexkit-sql-query-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoavdc/codexkit/codexkit-sql-query-builder.svg)](https://agentmods.dev/skills/hoavdc/codexkit/codexkit-sql-query-builder)
Your own site
<a href="https://agentmods.dev/skills/hoavdc/codexkit/codexkit-sql-query-builder"><img src="https://agentmods.dev/badge/skills/hoavdc/codexkit/codexkit-sql-query-builder.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,407 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00061 $0.01407
Opus 5 $0.00030 $0.00704
Sonnet 5 $0.00012 $0.00281
Haiku 4.5 $0.00006 $0.00141

Measured yesterday against content hash f066244347bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codexkit-sql-query-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/codexkit-sql-query-builder/SKILL.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SQL Query Builder

When to Use

  • When a business question needs to be answered with data
  • When building reporting queries or data pipeline transformations
  • When optimizing slow queries or refactoring complex SQL
  • When translating stakeholder requirements into analytical SQL

Procedure

Step 1 — Clarify the Question

Translate the business question into a precise data question:

  • Business: "How are our sales trending?"
  • Data: "Monthly revenue by product category for the last 12 months, with month-over-month growth rate"

Document:

  • Expected output columns and format
  • Filters and date ranges
  • Granularity (daily, weekly, monthly)
  • Sort order

Step 2 — Identify Tables & Joins

Map the data model:

Table Role Key Columns Join
orders Fact order_id, customer_id, order_date, total Primary
products Dimension product_id, category, name orders.product_id = products.id
customers Dimension customer_id, region, segment orders.customer_id = customers.id

Join type selection:

  • INNER when both sides must exist
  • LEFT when the left side may have no match (preserve all orders even without customer data)
  • Never use RIGHT JOIN — rewrite as LEFT JOIN for clarity

Step 3 — Build CTE Pipeline

Structure complex queries as a pipeline of CTEs:

WITH
-- Step 1: Filter and clean base data
base AS (
    SELECT ...
    FROM orders
    WHERE order_date >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '12 months')
),

-- Step 2: Aggregate to desired granularity
monthly AS (
    SELECT
        DATE_TRUNC('month', order_date) AS month,
        category,
        SUM(total) AS revenue,
        COUNT(DISTINCT customer_id) AS unique_customers
    FROM base
    JOIN products USING (product_id)
    GROUP BY 1, 2
),

-- Step 3: Add calculations (window functions)
with_growth AS (
    SELECT *,
        LAG(revenue) OVER (PARTITION BY category ORDER BY month) AS prev_revenue,
        ROUND(100.0 * (revenue - LAG(revenue) OVER (PARTITION BY category ORDER BY month))
              / NULLIF(LAG(revenue) OVER (PARTITION BY category ORDER BY month), 0), 1) AS mom_growth_pct
    FROM monthly
)

-- Final output
SELECT month, category, revenue, unique_customers, mom_growth_pct
FROM with_growth
ORDER BY category, month;

Read the full file on GitHub · 177 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 177 lines · 61 tokens per session scan A f066244347bc

Subscribe to this mod's changes

codexkit-sql-query-builder is a skill published in the GitHub repository hoavdc/CodexKit (21 stars, last pushed 3mo ago), licensed MIT. It adds 61 tokens to every session and 1,407 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

build-with-tinybase

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, configuring browser or database persistence, configuring MergeableStore…

tinyplex/tinybase · 76 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

vellum-migration-checklist

Validate Vellum Assistant database and workspace migrations. Use when adding, editing, reviewing, or testing migrations, release-note migrations, persisted schemas, workspace file formats, or data backfills.

vellum-ai/vellum-assistant · 45 tokens

neo4j-snowflake-graph-analytics-skill

Run Neo4j Graph Analytics algorithms (PageRank, Louvain, WCC, Dijkstra, KNN, Node2Vec, FastRP, GraphSAGE) directly inside Snowflake without moving data. Use when running graph algorithms against Snowflake tables via the Neo4j Snowflake Native App ("GDS Snowflake", "graph algorithms in Snowflake", "Neo4j Graph…

neo4j-contrib/neo4j-skills · 222 tokens

neo4j-agent-memory-skill

Authoritative reference for the neo4j-agent-memory Python package — a graph-native memory system for AI agents built on Neo4j — and for the hosted service (NAMS) at memory.neo4jlabs.com. Use this skill whenever the user mentions neo4j-agent-memory, agent memory with Neo4j, context graphs, the POLE+O model…

neo4j-contrib/neo4j-skills · 223 tokens

neo4j-cypher-skill

Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x. Use when writing new Cypher queries, optimizing slow queries, graph pattern matching, vector or fulltext search, subqueries, or batch writes. Covers MATCH, MERGE, CREATE, WITH, RETURN, CALL, UNWIND, FOREACH, LOAD CSV, SEARCH…

neo4j-contrib/neo4j-skills · 137 tokens