← Back to Skills Marketplace
johnnywang2001

Sql Formatter

by John Wang · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
163
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install sql-formatter
Description
Format, minify, and lint SQL queries from the command line. Formats SQL with proper indentation and keyword casing, minifies by removing whitespace and comme...
README (SKILL.md)

SQL Formatter

Format, minify, and lint SQL with zero dependencies.

Commands

All commands use scripts/sql_format.py.

Format SQL

python3 scripts/sql_format.py format --sql "SELECT id, name FROM users WHERE active = true"
python3 scripts/sql_format.py format --input query.sql
python3 scripts/sql_format.py format --input query.sql --output formatted.sql
python3 scripts/sql_format.py format --input query.sql --indent 4 --lowercase
echo "SELECT * FROM t" | python3 scripts/sql_format.py format --input -

Adds line breaks before major clauses (SELECT, FROM, WHERE, JOIN, ORDER BY, etc.), indents AND/OR/ON, and uppercases keywords by default.

Minify SQL

python3 scripts/sql_format.py minify --sql "SELECT  id,  name  FROM  users  -- comment"
python3 scripts/sql_format.py minify --input query.sql

Strips comments, collapses whitespace, removes unnecessary spaces around parentheses and commas.

Lint SQL

python3 scripts/sql_format.py lint --input query.sql
python3 scripts/sql_format.py lint --sql "SELECT * FROM users WHERE 1=1" --json

Checks for: SELECT *, multiple spaces, tabs, != vs \x3C>, double commas, WHERE 1=1, long lines (>120 chars), trailing whitespace, missing semicolons, inconsistent keyword casing.

Supported SQL

Handles SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, WITH (CTEs), JOINs (all types), subqueries, string literals, double-quoted identifiers, single-line and multi-line comments.

Usage Guidance
This skill appears to be a local, dependency-free SQL formatter/linter and is internally consistent with that purpose. Before installing or running it, (1) review the full scripts/sql_format.py file (the prompt showed a truncated tail) to ensure there are no hidden network calls or file-system operations you don't expect; (2) run the script on non-sensitive sample files first or inside a sandbox if you are unsure of the source; and (3) prefer installing only skills from authors you trust or with a published homepage/repository if you plan to run them on sensitive data.
Capability Analysis
Type: OpenClaw Skill Name: sql-formatter Version: 1.0.0 The skill is a standard SQL utility for formatting, minifying, and linting SQL queries. The Python script `scripts/sql_format.py` uses only the standard library and contains no network calls, shell execution, or data exfiltration logic. The instructions in `SKILL.md` are well-aligned with the stated functionality and do not contain any prompt injection attempts or suspicious commands.
Capability Assessment
Purpose & Capability
Name/description match the included Python script and SKILL.md. The skill formats, minifies, and lints SQL using a local Python script; no unexpected services, credentials, or binaries are required.
Instruction Scope
SKILL.md instructs the agent/user to run scripts/sql_format.py against provided SQL (files or stdin). The instructions reference only input/output paths and formatting options — they do not ask the agent to read unrelated files, environment variables, or contact external endpoints.
Install Mechanism
No install spec; this is instruction-only with an included Python script. That is proportionate for a pure-Python, zero-dependency tool.
Credentials
No environment variables, credentials, or config paths are requested. The script imports only standard-library modules (argparse, re, sys, json) and processes supplied files/STDIN — proportional to the stated functionality.
Persistence & Privilege
Skill does not request always:true and does not modify other skills or system settings. It runs on-demand using a local script, which is appropriate.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install sql-formatter
  3. After installation, invoke the skill by name or use /sql-formatter
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of SQL Formatter: - Format, minify, and lint SQL queries directly from the command line. - Provides formatting with indentation and configurable keyword casing. - Minifies SQL by removing comments and collapsing whitespace. - Lints for common SQL anti-patterns (e.g., SELECT *, missing semicolons, long lines). - No external dependencies; implemented in pure Python. - Supports major SQL statement types, including SELECT, INSERT, UPDATE, DELETE, CTEs, and various JOINs.
Metadata
Slug sql-formatter
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Sql Formatter?

Format, minify, and lint SQL queries from the command line. Formats SQL with proper indentation and keyword casing, minifies by removing whitespace and comme... It is an AI Agent Skill for Claude Code / OpenClaw, with 163 downloads so far.

How do I install Sql Formatter?

Run "/install sql-formatter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Sql Formatter free?

Yes, Sql Formatter is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Sql Formatter support?

Sql Formatter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Sql Formatter?

It is built and maintained by John Wang (@johnnywang2001); the current version is v1.0.0.

💬 Comments