agentleFS
thalysjuvenalthalysjuvenal/advpl-specialist/skills/advpl-code-generation/SKILL.md

advpl-code-generation

Skill183 starsChanged 2 months agoMITView on GitHub

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 workflows. Also triggers on Portuguese phrasing like "gerar codigo", "criar rotina", "criar fonte", "novo ponto de entrada", "criar classe tlpp", "gerar api rest", "criar mvc", or routine name patterns like FATA001/MATA010. Covers naming conventions, Hungarian notation, namespace rules, identifier length limits, and mandatory User Function/error-handling structure.

The file

Files
SKILL.md

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.

Reference fileRead when
reference.mdAlways -- overview, naming conventions, mandatory User Function structure, namespace rules, identifier length limits, common mistakes
templates-classes.mdGenerating a TLPP class (data, methods, constructor)
patterns-mvc.mdGenerating an MVC screen (ModelDef/ViewDef/MenuDef)
patterns-rest.mdGenerating a REST API endpoint (WsRestFul or TLPP @Get/@Post annotations)
patterns-soap.mdGenerating a SOAP Web Service
patterns-treport.mdGenerating a TReport-based report with embedded SQL
patterns-pontos-entrada.mdGenerating a legacy (non-MVC) entry point (ponto de entrada)
patterns-pontos-entrada-mvc.mdGenerating an MVC-based entry point
patterns-workflow.mdGenerating a Protheus workflow routine
patterns-jobs.mdGenerating a scheduled/background job
patterns-fwmsprinter.mdGenerating a coordinate-based PDF report with FWMsPrinter
patterns-fwformbrowse.mdGenerating a browse screen with FWFormBrowse
catalogo-top-50-pes.mdLooking up existing well-known entry points before creating a duplicate

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.