advpl-code-generation
Use when the user asks to generate, create, or scaffold ADVPL/TLPP code for TOTVS Protheus -- User Functions, Static Functions,…
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
Claude Code
$ npx -y skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring --agent claude-code
Codex
$ npx skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring -a codex -y
Cursor
$ npx skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring -a cursor -y
Gemini CLI
$ npx skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring -a gemini-cli -y
GitHub Copilot
$ npx skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring -a github-copilot -y
OpenCode
$ npx skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring -a opencode -y
Windsurf
$ npx skills add thalysjuvenal/advpl-specialist --skill advpl-refactoring -a windsurf -y
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.
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:
Use when the user asks to generate, create, or scaffold ADVPL/TLPP code for TOTVS Protheus -- User Functions, Static Functions,…
Use when the user asks to review, audit, or check the quality of ADVPL/TLPP code for TOTVS Protheus before merge or deploy --…
Use when the user asks to debug, diagnose, or fix an ADVPL/TLPP error on TOTVS Protheus -- compilation errors (syntax, missing…
Use when the user asks to migrate, convert, compatibilize, or modernize legacy ADVPL procedural code to TLPP object-oriented…
Use when the user wants to write, run, or troubleshoot automated regression tests for Protheus routines with ADVPR (Advanced…
Use when the user asks to generate a changelog, release notes, or delivery notes from ADVPL/TLPP code changes on TOTVS Protheus…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.