<< All versions

Skill v1.0.0

currentAutomated scan100/100
ajitpratap0/gosqlx/sql-linting
──Details
PublishedOctober 23, 2026 at 03:33 AM
Content Hashsha256:3623bab73cc4e29f...
Git SHA326fdd1576a1
──Files
Files (1 file, 3.6 KB)
SKILL.md3.6 KBactive
SKILL.md · 75 lines · 3.6 KB

version: "1.0.0" name: sql-linting description: Lint SQL with GoSQLX and explain its rules L001-L030 (whitespace, keyword case, comma placement, aliasing, plus safety, performance and naming rules), including which rules each entry point applies and which can be auto-fixed. Use when the user asks to lint SQL, enforce SQL style, explains a GoSQLX rule ID like L007 or L019, or sets up SQL linting in CI. argument-hint: "[SQL string, .sql file, or rule ID like L016]" allowed-tools: mcp__plugin_gosqlx_gosqlx__lint_sql Read Bash(gosqlx lint:*)


SQL linting with GoSQLX

Input: $ARGUMENTS - SQL, a .sql file, or a rule ID to explain.

Which rules run where

Entry pointRules applied
MCP lint_sql (mcp__plugin_gosqlx_gosqlx__lint_sql)L001-L010 (style). Keyword case expected UPPER, trailing commas, max line 100
gosqlx lint CLIL001-L010; --auto-fix fixes L001, L002, L003, L007, L010
gosqlx.Lint() Go libraryAll 30 rules, L001-L030

L011-L030 are not returned by lint_sql or the CLI. When you spot one of those patterns yourself, cite the rule ID as guidance and say it comes from the Go library's rule set.

Rules

IDRuleSeverityAuto-fix
L001Trailing whitespaceWarningYes
L002Mixed indentation (tabs and spaces)ErrorYes
L003Consecutive blank linesWarningYes
L004Indentation depth (excessive nesting)WarningNo
L005Long linesInfoNo
L006Column alignment in SELECT listsInfoNo
L007Keyword case consistencyWarningYes
L008Comma placement (trailing vs leading)InfoNo
L009Aliasing consistencyWarningNo
L010Redundant whitespaceInfoYes
L011DELETE without WHEREErrorNo
L012UPDATE without WHEREErrorNo
L013DROP without IF EXISTSWarningNo
L014TRUNCATE TABLEWarningNo
L015SELECT ... INTO OUTFILE / DUMPFILEErrorNo
L016SELECT *WarningNo
L017Missing WHERE on full scan (no WHERE or LIMIT)WarningNo
L018Leading wildcard LIKE ('%x')WarningNo
L019NOT IN with NULL risk (prefer NOT EXISTS)WarningNo
L020Correlated subquery in SELECT list (N+1)WarningNo
L021OR chain instead of INWarningNo
L022Function on indexed column in WHEREWarningNo
L023Implicit cross join (comma joins)WarningNo
L024Table alias requiredWarningNo
L025Reserved keyword used as identifierWarningNo
L026INSERT without explicit column listWarningNo
L027UNION instead of UNION ALLWarningNo
L028LIMIT without ORDER BYWarningNo
L029Subquery that can be a JOINWarningNo
L030DISTINCT on many columnsWarningNo

Full reference with examples: https://github.com/ajitpratap0/GoSQLX/blob/main/docs/LINTING_RULES.md

Steps

  1. Call lint_sql with {"sql": "..."}. Each violation has rule, rule_name, severity, message, line, column and suggestion.
  2. Group violations by rule, show the offending line, and give the fix. For auto-fixable rules, mention gosqlx lint --auto-fix.
  3. For a rule-ID question, explain the rule from the table above and show a before/after example.

Fallback when the MCP tools are unavailable

sh
gosqlx lint query.sql
gosqlx lint -r ./queries/ # recurse into a directory
gosqlx lint --auto-fix query.sql # rewrites the file - only when asked
gosqlx lint --fail-on-warn query.sql # non-zero exit on warnings (CI)
gosqlx lint --max-length 120 query.sql
All versions