Skip to content

hoavdc/CodexKit / skills/codexkit-sql-query-builder

codexkit-sql-query-builder

Unverified

Build production-ready analytical SQL queries using CTEs, window functions, aggregations, and data transformations. Translates business questions into well-documented, performant queries. Use when writing reporting queries, building data pipelines, or answering ad-hoc business questions with SQL.

FileKindSize
SKILL.mdskill md6.0 KB
agents/openai.yamlconfig168 B
examples/common-mistakes.mdmarkdown842 B
examples/good-output.mdmarkdown1.2 KB
scripts/query-validator.sqlother3.6 KB
verification/checklist.mdmarkdown1.4 KB

examples/good-output.md

View on GitHub
# Good Output Example - SQL Query Builder

## Scenario

The user needs monthly revenue by product category for the last 12 complete months in PostgreSQL.

## Good Output

```sql
WITH base_orders AS (
    SELECT
        o.order_id,
        o.order_date,
        o.total_amount,
        p.category
    FROM orders o
    JOIN products p
        ON o.product_id = p.product_id
    WHERE o.order_date >= date_trunc('month', current_date) - interval '12 months'
      AND o.order_date < date_trunc('month', current_date)
      AND o.status = 'paid'
),
monthly_revenue AS (
    SELECT
        date_trunc('month', order_date)::date AS revenue_month,
        category,
        sum(total_amount) AS revenue
    FROM base_orders
    GROUP BY 1, 2
)
SELECT
    revenue_month,
    category,
    revenue,
    lag(revenue) OVER (PARTITION BY category ORDER BY revenue_month) AS previous_month_revenue
FROM monthly_revenue
ORDER BY revenue_month, category;
```

## Why It Works

- It states and preserves monthly grain.
- It filters to paid orders and complete months.
- It uses CTEs to make the transformation readable.
- It avoids double-counting by joining orders to products at product ID.
- It exposes prior month revenue without hiding the calculation.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 318kUpdated Claude CodeCodexUnverifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 117kUpdated Claude CodeCodexUnverifiedInstall