sql-code-review

sql-code-review is a skill for Claude Code, Codex from totvs/engpro-advpl-tlpp-skills. It costs 86 tokens per session (3,353 once invoked), scanned A, original, MIT.

A reviewer for SQL code used with PostgreSQL, SQL Server, or Oracle databases. SQL is the language used to query and manage database data.

In plain words
What is it for?
Use it to check protection against SQL injection, permissions, sensitive-data handling, indexes, joins, aggregation, naming, and schema design.
Why use it?
It finds security risks, slow query patterns, unclear formatting, access-control problems, and database design issues.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Also refer to [references/sonarqube-rules-reference.md](../references/sonarqube-rules-reference.md) for the complete SonarQube rules reference shared across ski.

Good fit Use it to check protection against SQL injection, permissions, sensitive-data handling, indexes, joins, aggregation, naming, and schema design.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/totvs/engpro-advpl-tlpp-skills
agentmods
npx agentmods add skills/totvs/engpro-advpl-tlpp-skills/sql-code-review

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-code-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/totvs/engpro-advpl-tlpp-skills/sql-code-review.svg)](https://agentmods.dev/skills/totvs/engpro-advpl-tlpp-skills/sql-code-review)
Your own site
<a href="https://agentmods.dev/skills/totvs/engpro-advpl-tlpp-skills/sql-code-review"><img src="https://agentmods.dev/badge/skills/totvs/engpro-advpl-tlpp-skills/sql-code-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,353 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00086 $0.03353
Opus 5 $0.00043 $0.01677
Sonnet 5 $0.00017 $0.00671
Haiku 4.5 $0.00009 $0.00335

Measured 7d ago against content hash 9324fb7a6a76, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

sql-code-review 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 7d ago.

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.

skills/advpl-tlpp/sql-code-review/SKILL.md · 304 lines

How it starts

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

SQL Code Review

Perform a thorough SQL code review of ${selection} (or entire project if no selection) focusing on security, performance, maintainability, and database best practices.

Review Categories

🔒 Security

  • SQL Injection Prevention — all user inputs must be parameterized; no string concatenation in queries
  • Access Control — principle of least privilege, role-based permissions, schema security
  • Data Protection — avoid SELECT * on sensitive tables, enforce audit logging and data masking

⚡ Performance

  • Query Structure — eliminate SELECT DISTINCT *, prefer explicit JOINs over comma-separated FROM
  • Index Strategy — verify indexes for WHERE/JOIN columns, flag over-indexing and unused indexes
  • Join Optimization — correct join types, optimal join order, no accidental Cartesian products
  • Aggregation — replace correlated subqueries with JOIN/GROUP BY when possible

🛠️ Code Quality

  • Formatting — consistent uppercase keywords, aligned columns, proper indentation
  • Naming — descriptive table/column names, no reserved words as identifiers, consistent casing
  • Schema Design — appropriate normalization, optimal data types, proper constraints and defaults

🗄️ Database Compatibility

  • ANSI SQL first — use COALESCE, CASE WHEN, ANSI JOINs, FETCH FIRST for portability
  • Database-specific idioms — leverage engine-specific features (JSONB, COLUMNSTORE, sequences) where appropriate

Protheus note: Use ChangeQuery() to automatically translate SQL syntax to the active database dialect. BeginSQL/EndSQL calls ChangeQuery() automatically.


Bundled Reference Files

This skill uses progressive disclosure. The SKILL.md body covers the review workflow, category definitions, checklist, and output format. Detailed code examples, anti-patterns, and database-specific best practices are in the references/ directory — read them on demand based on the scenario:

Reference File When to Read Content
references/sql-security-patterns.md Reviewing security concerns — SQL injection, access control, data protection, or dynamic SQL Injection examples, parameterization patterns, access control checklist, data masking examples
references/sql-performance-and-quality-patterns.md Reviewing query performance, code style, anti-patterns, or testing strategies Query optimization examples, JOIN/aggregation patterns, N+1 and DISTINCT anti-patterns, formatting standards, data integrity checks
references/database-specific-best-practices.md Reviewing SQL targeting a specific database (PostgreSQL, SQL Server, Oracle) or cross-database portability ANSI SQL cross-database patterns, PostgreSQL (JSONB, GIN), SQL Server (NVARCHAR, COLUMNSTORE), Oracle (sequences, VARCHAR2)

Read the full file on GitHub · 304 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. 7d ago First seen · 304 lines · 86 tokens per session scan A 9324fb7a6a76

Subscribe to this mod's changes

sql-code-review is a skill published in the GitHub repository totvs/engpro-advpl-tlpp-skills (127 stars, last pushed 23d ago), licensed MIT. It adds 86 tokens to every session and 3,353 once invoked, about $0.0004 per session on Opus 5. 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

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

migration-ready-schema

Data-model rules that make a schema importable from day one, so the migration-import-engineer is never blocked on missing columns. Every SMB Product-Builder product must let a customer bring their data from an incumbent (ServiceTitan/Toast/Mindbody/Shopify) — that requires provenance (sourceref) and rollback…

avelikiy/great_cto · 133 tokens

doris-repo-review

Review an Apache Doris PR from a local clone with the same multi-agent, shared-ledger convergence workflow as the CI Code Review Runner. Use when the user supplies a PR to /doris-repo-review, asks to review a Doris PR locally, or asks for the CI-style review flow. Safely align only the current worktree to the exact PR…

apache/doris-skills · 177 tokens

database-migration-service-expertise

AWS Database Migration Service (DMS) operational review and troubleshooting skill. Conducts best practices validation, health assessments, performance diagnostics, cost optimization reviews, and migration cutover guidance. Triggers on requests like "DMS review", "DMS health check", "DMS troubleshooting", "migration…

aws/tools-for-devops-agent · 99 tokens

malloy-lookml-review

Analyze LookML files as prior art for Malloy modeling. Used during Step 1 (DISCOVER) when .lkml files are present. Coordinates reference files that extract business logic, relationships, and curation decisions. Works with or without a database connection.

malloydata/publisher · 58 tokens