/advpl-specialist:query-builderfrom advpl-specialist
Builds, selects patterns for, and optimizes SQL queries on Protheus ERP tables. Covers DbSeek vs Embedded SQL vs TCSqlExec, mandatory filters, indexes, and FWPreparedStatement parameterization.
Ships in advpl-specialist. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill helps build correct, safe, and optimized SQL against Protheus ERP tables, respecting the platform's database conventions: mandatory soft-delete (D_E_L_E_T_) and multi-branch (xFilial) filters, Hungarian-notation field names, dictionary-driven physical schemas (RetSqlName()), and SIX index alignment. It guides the agent to choose the right access pattern -- Workarea navigation vs Embedded SQL vs raw TCSqlExec -- enforce mandatory filters, order WHERE clauses to match available indexes, and parameterize every dynamic value with FWPreparedStatement to eliminate injection risk.
Activate this skill when building any query against Protheus tables (standard SA*/SE*/SF* or custom Z*), deciding between DbSelectArea/DbSeek and Embedded SQL, reviewing code for missing mandatory filters, adding parameterized queries, diagnosing slow queries via index misalignment, or writing cross-database code. It does not cover BeginSQL/EndSQL macro syntax itself (see embedded-sql, its companion skill for macro details), nor record locking semantics during writes (see protheus-locks-deadlocks).
| Reference file | Read when |
|---|---|
| reference.md | Always -- database conventions, table/field naming, mandatory filters, pattern-choice overview |
| patterns-workarea.md | Generating record-by-record code with DbSelectArea + DbSeek + RecLock |
| patterns-fwpreparedstatement.md | Building parameterized TCQuery/TCSqlExec, LIKE clauses, INSERT/UPDATE/DELETE |
| index-awareness.md | Choosing/validating an index, ordering WHERE clauses, common SIX key expressions |
| cross-database.md | Using ChangeQuery(), TCGetDB(), DBAccess macros, MSSQL/PostgreSQL/Oracle equivalents |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
protheus, erp, sql-optimization, query-patterns, database-conventions
npx claudepluginhub thalysjuvenal/advpl-specialist --plugin advpl-specialist19 skills in this plugin
/advpl-code-generationGenerate or scaffold ADVPL/TLPP code - User Functions, TLPP classes, MVC, REST, SOAP, entry points, reports, jobs. "gerar codigo", "criar rotina", "novo ponto de entrada", "criar classe tlpp", "gerar api rest"./advpl-code-reviewReview or audit ADVPL/TLPP code for best practices, performance, security and SonarQube rules (CA/BG/CS). "revisar codigo", "auditar rotina", "checar boas praticas", "code review advpl"./advpl-debuggingDebug ADVPL/TLPP errors - compilation, runtime (NIL, type mismatch), slow queries, locks, AppServer logs and stack traces. "erro de compilacao", "travou o lock", "performance lenta", "analisar log"./advpl-refactoringRefactor or clean up ADVPL/TLPP without changing behavior - extract functions, simplify conditionals, remove dead code. "refatorar rotina", "extrair funcao", "remover codigo morto", "God function"./advpl-to-tlpp-migrationMigrate or modernize procedural ADVPL (.prw) to TLPP classes with namespaces, keeping compatible wrappers. "migrar para tlpp", "converter prw para tlpp", "compatibilizar fonte", "transformar em classe"./advpr-test-automationWrite, run or troubleshoot ADVPR (Advanced Protheus Robot) automated tests - FWTestHelper, TestSuite, FwExecSuite. "teste automatizado", "robo de testes", "GPS de testes", "rodar suite de testes".Other plugins' skills for the same job