/advpl-refactoring
Use when the user asks to refactor, clean up, or restructure existing ADVPL/TLPP code on TOTVS Protheus without changing its behavior -- extracting long functions (>100 lines), simplifying deeply nested conditionals, removing dead code, improving variable naming (Hungarian
$ npx -y skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/advpl-refactoring
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user asks to refactor, clean up, or restructure existing ADVPL/TLPP code on TOTVS Protheus without changing its behavior -- extracting long functions (>100 lines), simplifying deeply nested conditionals, removing dead code, improving variable naming (Hungarian
SKILL.md
advpl-refactoring.SKILL.mdname: advpl-refactoring
description: Use when the user asks to refactor, clean up, or restructure existing ADVPL/TLPP code on TOTVS Protheus without changing its behavior -- extracting long functions (>100 lines), simplifying deeply nested conditionals, removing dead code, improving variable naming (Hungarian notation), eliminating duplicated logic, or reducing functions with too many parameters. Also triggers on Portuguese phrasing like "refatorar rotina", "melhorar esse fonte", "extrair funcao", "remover codigo morto", "simplificar condicional", "reduzir complexidade", or "God function" complaints.
ADVPL/TLPP Refactoring
This skill defines safe refactoring patterns (RF-001 through RF-006) for improving ADVPL/TLPP code structure without altering behavior: extract function, simplify conditionals with guard clauses, remove dead code, improve naming to Hungarian notation, eliminate duplication, and reduce function parameter count. 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, or functions with excessive parameters. 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 -- the only file in this skill; contains all refactoring patterns (RF-001 to RF-006), the refactoring process, and safety rules |
Read more
name: advpl-refactoring description: Use when the user asks to refactor, clean up, or restructure existing ADVPL/TLPP code on TOTVS Protheus without changing its behavior -- extracting long functions (>100 lines), simplifying deeply nested conditionals, removing dead code, improving variable naming (Hungarian notation), eliminating duplicated logic, or reducing functions with too many parameters. Also triggers on Portuguese phrasing like "refatorar rotina", "melhorar esse fonte", "extrair funcao", "remover codigo morto", "simplificar condicional", "reduzir complexidade", or "God function" complaints.
ADVPL/TLPP Refactoring
This skill defines safe refactoring patterns (RF-001 through RF-006) for improving ADVPL/TLPP code structure without altering behavior: extract function, simplify conditionals with guard clauses, remove dead code, improve naming to Hungarian notation, eliminate duplication, and reduce function parameter count. 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, or functions with excessive parameters. 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 -- the only file in this skill; contains all refactoring patterns (RF-001 to RF-006), the refactoring process, and safety rules |
Plugin para Claude Code especializado em ADVPL e TLPP para desenvolvimento no ecossistema TOTVS Protheus — para desenvolvedores e consultores funcionais. Documentacao completa:
Other skills on advpl-specialist.
- /advpl-code-generation
Use when the user asks to generate, create, or scaffold ADVPL/TLPP code for TOTVS Protheus -- User Functions, Static Functions, TLPP classes, MVC (Model/View/Controller), REST APIs, SOAP web services, entry points (pontos de entrada), TReport/FWMsPrinter reports, jobs, or
Open skill - /advpl-code-review
Use when the user asks to review, audit, or check the quality of ADVPL/TLPP code for TOTVS Protheus before merge or deploy -- covering best practices (RecLock/MsUnlock pairing, variable scope, area management, error handling), performance bottlenecks, security vulnerabilities
Open skill - /advpl-debugging
Use when the user asks to debug, diagnose, or fix an ADVPL/TLPP error on TOTVS Protheus -- compilation errors (syntax, missing includes, undeclared variables), runtime failures (NIL access, type mismatch, array bounds), performance issues (slow queries, memory leaks), database
Open skill - /advpl-to-tlpp-migration
Use when the user asks to migrate, convert, compatibilize, or modernize legacy ADVPL procedural code to TLPP object-oriented classes on TOTVS Protheus -- turning User Functions/Static Functions into namespaced classes with methods and data properties, replacing Private/Public
Open skill - /advpr-test-automation
Use when the user wants to write, run, or troubleshoot automated regression tests for Protheus routines with ADVPR (Advanced Protheus Robot) -- covering FWTestHelper API, TestSuite/GPS de Testes setup, headless execution via FwExecSuite, and per-pattern scripting (MVC,
Open skill - /changelog-patterns
Use when the user asks to generate a changelog, release notes, or delivery notes from ADVPL/TLPP code changes on TOTVS Protheus -- analyzing diffs or a list of changed files, classifying each change (NEW/FIX/CHANGE/REMOVE/REFACTOR), assessing business impact (ALTO/MEDIO/BAIXO),
Open skill

