sql-format

Format SQL queries with lowercase keywords, line-start commas, and CTE formatting.

7|Updated Jan 30, 2019
One-click install
npx skills add https://github.com/fkubota/dotfiles --skill sql-format
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-format
Source: https://github.com/fkubota/dotfiles/tree/main/claude/skills/sql-format
Command: npx skills add https://github.com/fkubota/dotfiles --skill sql-format

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQL formatting guidelines to ensure queries are consistently structured, readable, and easy to learn from.

Core Features & Use Cases

  • All lowercase keywords: enforce lowercase SQL keywords (select, from, where, join, etc).
  • Comma-at-line-start: place subsequent columns on a new line starting with a leading comma.
  • CTE formatting: standardize the first CTE as with xxx as ( and subsequent CTEs as , xxx as ( with blank lines between CTEs.
  • Quick-start templates: provide ready-to-use formatting templates and examples.

Quick Start

Provide an SQL file you want formatted and I will apply the format rules to generate a clean, consistent query.

Frequently Asked Questions about sql-format

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format SQL queries for consistent readability?

Format SQL queries by applying a consistent style guide that enforces lowercase keywords, line-start commas, and standardized CTE formatting to generate clean, readable queries.

What is the comma-at-line-start style in SQL formatting?

Comma-at-line-start formatting places subsequent selected columns on a new line beginning with a leading comma, ensuring structured readability and easier debugging of complex SQL queries.

How do I format CTEs in a SQL query?

Format CTEs by standardizing the first expression as 'with xxx as (' and subsequent expressions as ', xxx as (', maintaining blank lines between each CTE for clear visual separation.

Does SQL formatting enforce lowercase keywords?

SQL formatting enforces all lowercase keywords, converting statements like select, from, where, and join to lowercase to maintain a consistent style guide across saved SQL files.

What is the best way to standardize SQL files for documentation?

Standardize SQL files for documentation by applying a consistent formatting style with a clear header, lowercase keywords, and structured CTE spacing to create easy-to-read query examples.

Can I use SQL formatting templates for teaching scenarios?

SQL formatting templates provide ready-to-use examples that enforce consistent rules like lowercase keywords and CTE formatting, making them ideal for teaching query creation and documentation.