---
name: ADVPL Refactoring
slug: advpl-refactoring
category: Quality
description: ADVPL Refactoring helps restructure existing ADVPL/TLPP code without changing behavior. Use it to extract long functions, simplify nested conditionals, remove dead code, improve naming, and reduce duplication or parameter bloat.
github: "https://github.com/thalysjuvenal/advpl-specialist/tree/main/skills/advpl-refactoring"
language: Shell
stars: 186
forks: 37
install: "npx degit https://github.com/thalysjuvenal/advpl-specialist/tree/main/skills/advpl-refactoring ~/.claude/skills/advpl-refactoring"
installs_to: ~/.claude/skills/advpl-refactoring
source_path: skills/advpl-refactoring/SKILL.md
collection_size: 18
category_size: 1745
collection_url: "https://dirskills.com/collections/thalysjuvenal/advpl-specialist"
added: 2026-09-06T05:20:27.432Z
last_synced: 2026-09-06T05:20:27.432Z
canonical_url: "https://dirskills.com/skills/advpl-refactoring"
---

# ADVPL Refactoring

ADVPL Refactoring helps restructure existing ADVPL/TLPP code without changing behavior. Use it to extract long functions, simplify nested conditionals, remove dead code, improve naming, and reduce duplication or parameter bloat.

**Install:**

```bash
npx degit https://github.com/thalysjuvenal/advpl-specialist/tree/main/skills/advpl-refactoring ~/.claude/skills/advpl-refactoring
```

## README

# 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 |
