advpl-code-generation
ADVPL/TLPP Code Generation
This skill provides patterns, templates, and mandatory structural rules for generating new ADVPL (.prw) and TLPP (.tlpp) code for TOTVS Protheus. It covers naming conventions (module prefixes, Hungarian notation), the mandatory User Function skeleton with Protheus.doc headers and error handling, variable scope rules, TLPP namespace conventions (custom.<agrupador>.<servico>), and the 8/10/255-character identifier length limits per construct type.
Activate this skill whenever the user requests new code creation: a new function, a TLPP class, an MVC screen, a REST endpoint, a SOAP web service, an entry point, a report, a batch job, or any new .prw/.tlpp file. It does not cover reviewing existing code (see advpl-code-review), fixing errors in existing code (see advpl-debugging), improving existing code structure without adding features (see advpl-refactoring), or converting legacy .prw to .tlpp (see advpl-to-tlpp-migration).
The reference and pattern files below hold the concrete templates -- read the specific pattern file that matches the type of code being generated instead of relying on memory.