sql-lint

SQL code style check - Use SQLFluff to check SQL statement style and syntax (supports PostgreSQL, MySQL, SQLite, etc.)

23 stars

Best use case

sql-lint is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

SQL code style check - Use SQLFluff to check SQL statement style and syntax (supports PostgreSQL, MySQL, SQLite, etc.)

Teams using sql-lint should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sql-lint/SKILL.md --create-dirs "https://raw.githubusercontent.com/wangjianjq/Skill/main/.agents/skills/sql-lint/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sql-lint/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sql-lint Compares

Feature / Agentsql-lintStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

SQL code style check - Use SQLFluff to check SQL statement style and syntax (supports PostgreSQL, MySQL, SQLite, etc.)

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# SQL Lint Skill

## 📋 Overview

Use **SQLFluff** to check SQL code quality, supporting multiple database dialects:

- PostgreSQL, MySQL, MariaDB
- SQLite, BigQuery, Snowflake
- Redshift, TSQL, Oracle, etc.

## 🔧 Prerequisites

| Tool | Installation |
|------|--------------|
| Python 3.8+ | [python.org](https://python.org) |
| SQLFluff | `pip install sqlfluff` |

## 🚀 Usage

**Check single file:**

```bash
.\.agent\skills\sql-lint\scripts\lint.ps1 -File query.sql
```

**Specify database dialect:**

```bash
.\.agent\skills\sql-lint\scripts\lint.ps1 -Dialect postgres
```

**Auto-fix:**

```bash
.\.agent\skills\sql-lint\scripts\lint.ps1 -Fix
```

## 🎯 What It Checks

- ✅ SQL keyword case consistency
- ✅ Indentation and formatting standards
- ✅ JOIN type clarity
- ✅ Table alias usage standards
- ✅ WHERE condition safety

## 📊 Supported Database Dialects

| Dialect | Database |
|---------|----------|
| `postgres` | PostgreSQL |
| `mysql` | MySQL/MariaDB |
| `sqlite` | SQLite |
| `bigquery` | Google BigQuery |
| `snowflake` | Snowflake |
| `tsql` | SQL Server |

## ⚙️ Configuration Example

Create `.sqlfluff`:

```ini
[sqlfluff]
dialect = postgres
templater = jinja
exclude_rules = L003,L009

[sqlfluff:indentation]
indent_unit = space
tab_space_size = 2

[sqlfluff:rules:L010]
capitalisation_policy = upper
```

## 🔗 Related Resources

- [SQLFluff Documentation](https://docs.sqlfluff.com/)
- [SQL Style Guide](https://www.sqlstyle.guide/)