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/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.
<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="Reviewed on agentmods" width="80" 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.03363 |
| Opus 5.5 | $0.00034 | $0.01345 |
| Sonnet 5.5 | $0.00017 | $0.00673 |
| Haiku 4.5 | $0.00009 | $0.00336 |
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 16d 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.
- 16d ago Changed 8d6cb5b83c24
- 1mo 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 (163 stars, last pushed 8d ago), licensed MIT. It adds 86 tokens to every session and 3,363 once invoked, about $0.0003 per session on Opus 5.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
triage-contributor-pr
Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…
review-implement-phase
Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.
no-bare-casts
Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.
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.
product-direction
Judges feature requests, feature pull requests and your own proposals against a repository's written product direction, gives a cited verdict, and records each new no. Use when triaging, labelling or replying to a feature request or a feature pull request, including as an autonomous triage agent; when asked whether a…