---
name: "sqlfluff-modular-sql-linter"
description: "Enforce consistent SQL styling, capitalizations, and dialect rules across large teams."
metadata:
  author: "SQLFluff"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "lint sql with sqlfluff"
  - "fix sql formatting sqlfluff"
  - "configure .sqlfluff dialect"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# SQLFluff Modular SQL Linter & Auto-Formatter

Configures SQLFluff: setting dialect (snowflake, bigquery, postgres, mysql), linting complex jinja/dbt templates, tuning rule sets (capitalization, indentation, alias formatting), and integrating into pre-commit hooks.

## When to Invoke
Invoke this skill whenever you need to:
- lint sql with sqlfluff
- fix sql formatting sqlfluff
- configure .sqlfluff dialect

## Execution SOP & Rules
1. Create .sqlfluff specifying dialect = snowflake and templater = dbt.
2. Run sqlfluff lint models/ to identify non-compliant SQL syntax and styling rule violations.
3. Execute sqlfluff fix models/ to automatically apply safe formatting fixes.
4. Add --ignore=parsing,templating flags when working with non-standard proprietary SQL macros.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
