/advpl-specialist:advpl-refactoringfrom advpl-specialist
Refactors ADVPL/TLPP code without changing behavior: extract functions, simplify conditionals, remove dead code, modernize legacy APIs. Activates on long functions, deep nesting, unclear names, or legacy API patterns.
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 defines safe refactoring patterns for improving ADVPL/TLPP code without altering behavior. RF-001 through RF-006 cover structure: extract function, simplify conditionals with guard clauses, remove dead code, improve naming to Hungarian notation, eliminate duplication, and reduce function parameter count. RF-007 through RF-012 modernize legacy APIs found by the advpl-code-review lint engine: concatenated TCQuery to FWPreparedStatement/BeginSQL, ErrorBlock + Begin Sequence to Try/Catch (TLPP only), ConOut to FWLogMsg, CriaTrab/DbCreate to FWTemporaryTable, IIf to If/Else, and direct SX access to framework APIs. It also defines the mandatory process -- analyze, prioritize, present a before/after plan, wait for user approval, apply one change at a time, verify -- and hard safety rules (never change business logic, never rename externally-used symbols without a caller check).
Activate this skill when the user wants existing, working code restructured for readability or maintainability: long functions, deep nesting, unclear names, copy-pasted blocks, functions with excessive parameters, or legacy APIs to be replaced by their modern equivalents without changing behavior. It does not cover fixing bugs or errors (see advpl-debugging), generating brand-new functionality (see advpl-code-generation), a formal quality/security audit (see advpl-code-review), or converting procedural .prw to object-oriented .tlpp (see advpl-to-tlpp-migration, which is a structural paradigm change rather than a behavior-preserving cleanup).
| Reference file | Read when |
|---|---|
| reference.md | Always -- structural patterns RF-001 to RF-006 with before/after, the index of RF-007 to RF-012, the refactoring process, and safety rules |
| patterns-modernization.md | Replacing legacy APIs flagged by the lint engine (ADV003, ADV008, ADV009, ADV010, ADV011, ADV015) or ErrorBlock + Begin Sequence in .tlpp -- RF-007 to RF-012 with before/after, risk, how to prove the same behavior, lint rule and CA code, and when not to apply |
AIs without hooks (Copilot, Cursor, Gemini CLI and others) must verify the file themselves, in this order, before delivering. Paths are relative to this skill folder; the scripts belong to the named skills.
advpl-code-review skill's scripts/advpl-lint.sh (../advpl-code-review/scripts/advpl-lint.sh --scope all <file>). Exit 1 means errors..advpl-specialist-ignore (rule <ID>, path <glob>, field <FIELD>, function <NAME>).advpl-code-generation skill's scripts/convert-encoding.sh (../advpl-code-generation/scripts/convert-encoding.sh <file>, strict). On failed: ... (incompatible char), remove or replace the character; or re-run with --translit and tell the user which characters became ?. Do not edit the file after converting: a tool that assumes UTF-8 corrupts the accents. If it needs another edit, convert it back with --to-utf8 first and repeat steps 1 to 3..ps1 twins with pwsh -NoProfile -ExecutionPolicy Bypass -File (or powershell -NoProfile -ExecutionPolicy Bypass -File on Windows PowerShell 5.1)./advpl-specialist:validate to lint whole files on demand.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
advpl, tlpp, refactoring, code-cleanup, legacy-modernization
19 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".npx claudepluginhub thalysjuvenal/advpl-specialist --plugin advpl-specialistOther plugins' skills for the same job