MCPGateway: Skill for Claude Code

.agents/skills/sql-analyzer/SKILL.md

sql-analyzer is a skill for Claude Code, Codex from abdullah1854/MCPGateway. It costs 0 tokens per session (729 once invoked), scanned A, original, MIT.

A SQL query reviewer examines database commands for common mistakes and possible performance problems. SQL is the language used to read and change data in databases.

In plain words
What is it for?
Use it to review queries written for Microsoft SQL Server, PostgreSQL, or MySQL and receive issue reports with suggested fixes.
Why use it?
It can point out risky or inefficient patterns before a query is used, such as retrieving every column or changing rows without a filter.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is abdullah1854/MCPGateway's own configuration. It tells Claude Code and Codex how to work on MCPGateway itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything MCPGateway configures →

Reuse

Borrowing it

Nothing to install: this file belongs to abdullah1854/MCPGateway. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/abdullah1854/MCPGateway/main/.agents/skills/sql-analyzer/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/abdullah1854/MCPGateway

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/skills/abdullah1854/mcpgateway/sql-analyzer/github.svg)](https://agentmods.dev/skills/abdullah1854/mcpgateway/sql-analyzer)
Your own site
<a href="https://agentmods.dev/skills/abdullah1854/mcpgateway/sql-analyzer"><img src="https://agentmods.dev/badge/skills/abdullah1854/mcpgateway/sql-analyzer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-analyzer

Your own site · 80×15
<a href="https://agentmods.dev/skills/abdullah1854/mcpgateway/sql-analyzer"><img src="https://agentmods.dev/badge/skills/abdullah1854/mcpgateway/sql-analyzer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 729 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00729
Opus 5.5 $0.00000 $0.00292
Sonnet 5.5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

Measured 1mo ago against content hash 12b59b87198a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-analyzer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (index.ts, scripts/sql_analyzer.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/sql-analyzer/SKILL.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

sql-analyzer

Analyzes SQL queries for anti-patterns, performance issues, and suggests optimizations.

Metadata

  • Version: 1.0.0
  • Category: database
  • Source: workspace

Tags

sql, database, performance, optimization

MCP Dependencies

None specified

Inputs

  • query (string) (required): SQL query to analyze
  • dialect (string) (optional): SQL dialect: mssql, postgres, mysql

Workflow

No workflow defined

Anti-Hallucination Rules

None specified

Verification Checklist

None specified

Usage

// Execute via MCP Gateway:
gateway_execute_skill({ name: "sql-analyzer", inputs: { ... } })

// Or via REST API:
// POST /api/code/skills/sql-analyzer/execute
// Body: { "inputs": { ... } }

Code


const { query, dialect = 'mssql' } = inputs;
const upperQuery = query.toUpperCase();

const issues = [];

// Check for SELECT *
if (/SELECT\s+\*/.test(upperQuery)) {
  issues.push({ severity: 'medium', issue: 'SELECT * retrieves all columns', fix: 'List only needed columns' });
}

// Check for missing WHERE on UPDATE/DELETE
if (/(UPDATE|DELETE)\s+\w+/.test(upperQuery) && !/WHERE/.test(upperQuery)) {
  issues.push({ severity: 'critical', issue: 'UPDATE/DELETE without WHERE', fix: 'Add WHERE clause' });
}

// Check for leading wildcard LIKE
if (/LIKE\s+['"]%/.test(upperQuery)) {
  issues.push({ severity: 'high', issue: 'LIKE with leading wildcard prevents index usage', fix: 'Use full-text search or remove leading wildcard' });
}

// Check for ORDER BY ordinal
if (/ORDER\s+BY\s+\d+/.test(upperQuery)) {
  issues.push({ severity: 'low', issue: 'ORDER BY with ordinal position', fix: 'Use column names' });
}

// Complexity score
let score = 1;
const joinCount = (upperQuery.match(/\bJOIN\b/g) || []).length;
score += joinCount * 2;
const subqueryCount = (upperQuery.match(/SELECT/g) || []).length - 1;
score += subqueryCount * 3;

let result = `# SQL Analysis\n\n`;
result += `**Complexity**: ${score < 5 ? 'Low' : score < 10 ? 'Medium' : 'High'} (${score}/10)\n\n`;

if (issues.length === 0) {
  result += '✅ No significant issues found\n';
} else {
  result += `## Issues (${issues.length})\n\n`;
  for (const i of issues) {
    const icon = i.severity === 'critical' ? '🔴' : i.severity === 'high' ? '🟡' : '🟢';
    result += `${icon} **${i.severity.toUpperCase()}**: ${i.issue}\n   Fix: ${i.fix}\n\n`;
  }
}

console.log(result);

Read the full file on GitHub · 101 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 101 lines · 0 tokens per session scan A 12b59b87198a

Subscribe to this mod's changes

sql-analyzer is a skill published in the GitHub repository abdullah1854/MCPGateway (17 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 729 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

review-prs

Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…

googleapis/mcp-toolbox · 162 tokens

github-commenting

How to post clean, rich, deduplicated GitHub PR review comments — suggestion blocks, multi-line anchors, markers, formatting rules. Load before posting or fixing any PR comment.

juspay/neurolink · 41 tokens

table-api-reads

What a Table API read through this MCP actually returns — the 200-character truncation in snowquerytable, the three different displayvalue defaults, reference fields as {link, value} objects, why worknotes come back empty, and which reported totals are real counts and which are guesses.

serac-labs/serac · 63 tokens

cmdb-patterns

Create ServiceNow CIs and cmdbrelci relationships, walk upstream/downstream impact, detect orphan/stale CIs, and align discovered CIs with the proper sysclassname hierarchy.

serac-labs/serac · 43 tokens

transform-maps

Build ServiceNow transform maps — sysdatasource configurations (CSV/JDBC/REST), systransformmap field/reference/script entries, coalesce keys for update-vs-insert, and onBefore/onAfter/onComplete transform scripts.

serac-labs/serac · 49 tokens

data-policies

Manage ServiceNow dictionary (sysdictionary), table/field creation, choice lists, dictionary overrides, and sysdatapolicy2 rules that enforce mandatory/read-only/visible field behavior on the data layer.

serac-labs/serac · 43 tokens