Build optimized and safe SQL queries for Protheus tables. Automatically includes mandatory filters (D_E_L_E_T_, branch), suggests appropriate indexes from SIX patterns, generates both Embedded SQL (preferring FWExecStatement) and Workarea (DBSelectArea/DBSeek) versions, and warns about common Protheus SQL pitfalls. Use when user says 'build query', 'SQL for Protheus table', 'FWExecStatement', 'TCQuery', 'Workarea vs SQL'.
$npx -y skills add totvs/engpro-advpl-tlpp-skills --skill query-builderInstalls into the current project.
Run `npx skills use "https://github.com/totvs/engpro-advpl-tlpp-skills" --skill "totvs/engpro-advpl-tlpp-skills/query-builder"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/totvs/engpro-advpl-tlpp-skills" that are relevant to the current task. Run `npx skills add "https://github.com/totvs/engpro-advpl-tlpp-skills"` and select the relevant skills, then follow their instructions.