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.
git clone --depth 1 https://github.com/totvs/engpro-advpl-tlpp-skillsnpx agentmods add skills/totvs/engpro-advpl-tlpp-skills/sql-code-reviewWrote 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.
[](https://agentmods.dev/skills/totvs/engpro-advpl-tlpp-skills/sql-code-review)<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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 callsChangeQuery()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) |
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.
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.
- 7d ago First seen · 304 lines · 86 tokens per session scan A 9324fb7a6a76
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.
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…
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.
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…
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…
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…
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.