entry-point-designer
Skill138 starsChanged 6 months agoMITView on GitHub
Design and document Protheus Entry Points (Pontos de Entrada). Always generates TLPP by default; only generates AdvPL (.prw) when the user explicitly requests AdvPL. Covers User Function signatures, PARAMIXB parameter layouts, return value specifications, and ProtheusDOC documentation. Use when user says 'create entry point', 'ponto de entrada', 'PARAMIXB', 'User Function hook', 'ponto de entrada TLPP', 'ponto de entrada ADVPL'.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- instructions/AGENTS.mdAGENTS.md
- instructions/CLAUDE.mdCLAUDE.md
- advpl-tlpp-compileSkill
- advpl-tlpp-sddSkill
- advpl-to-tlpp-migrationSkill
- code-reviewSkill
- context-mapSkill
- create-implementation-planSkill
- data-dictionary-lookupSkill
- documentation-writerSkill
- fwmsexcelxlsx-generatorSkill
- fwrest-client-generatorSkill
- mvc-generatorSkill
- query-builderSkill
- refactor-method-complexity-reduceSkill
- refactorSkill
- sql-code-reviewSkill
- sql-optimizationSkill
- tir-test-generatorSkill
- tlpp-rest-endpoint-generatorSkill
- utf8-to-cp1252-conversionSkill
- brainstormingSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Default: generate .tlpp with #include "tlpp-core.th", type annotations, Try-Catch, and namespaced helpers when applicable
- Very specific: line 39
If a User Function with the matching name exists in the RPO, it is executed
- Distinctive: line 78
Document each parameter using the standard table format in PARAMIXB & Return Types.
- Distinctive: line 82
Default: use the TLPP Template.
- Distinctive: line 84
Only use the AdvPL Template when the user explicitly requested AdvPL.
- Very specific: line 87
Document the Entry Point with a /*/{Protheus.doc} block (@type user function, @param, @return, @obs)
- Very specific: line 88
Always validate PARAMIXB existence (Type("PARAMIXB") == "A") and length defensively
- Very specific: line 90
Use Try-Catch for error handling — never ErrorBlock
- Distinctive: line 91
Default return value must be fail-safe (must not block the standard routine)
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Protheus Entry Point Designer
Overview
Design, implement, and document Protheus Entry Points (Pontos de Entrada). Entry Points are the standard extensibility mechanism in TOTVS Protheus, allowing customization of standard ERP routines without modifying the original source code.
Language Priority — TLPP First
TLPP is the default and mandatory output language for every new Entry Point. Only generate AdvPL (.prw) when the user explicitly requests it (e.g., "em AdvPL", "como .prw", "legacy AdvPL", "sem TLPP").
- Default: generate
.tlppwith#include "tlpp-core.th", type annotations,Try-Catch, and namespaced helpers when applicable - Opt-in AdvPL: only when the user is explicit. If the request is ambiguous (e.g., the project still has many
.prwfiles), confirm before falling back to AdvPL - Migrating an existing
.prwEntry Point: prefer rewriting in TLPP unless the user requires keeping the original extension
When to Use
- Creating a new Entry Point to customize standard Protheus behavior
- Documenting existing Entry Points
- Designing the PARAMIXB interface for custom Entry Points
- Migrating legacy Entry Points to TLPP
How Entry Points Work
- A standard TOTVS routine (e.g., MATA010, FINA010) calls
ExistBlock("PE_NAME")at predefined extension points - If a
User Functionwith the matching name exists in the RPO, it is executed - The standard routine passes parameters via the
PARAMIXBarray (Private variable) - The Entry Point returns a value that influences the standard routine's behavior
MANDATORY Rules
Function Naming — NEVER use the U_ prefix
The compiler resolves U_ automatically at runtime. Adding it manually causes the Entry Point to never be triggered.
| ✅ Correct | ❌ Wrong |
User Function MT410INC() | User Function U_MT410INC() |
User Function A010TOK() | User Function U_A010TOK() |
File Naming — match the Entry Point name exactly
File name must be the Entry Point name in uppercase + language extension. No namespaces, no prefixes, no suffixes.
| Entry Point | AdvPL | TLPP |
| MT410INC | MT410INC.prw | MT410INC.tlpp |
| FA080BUT | FA080BUT.prw | FA080BUT.tlpp |
Workflow
Step 1 — Identify the Entry Point
- Confirm the Entry Point name (e.g.,
MT410INC,A010TOK) - Identify the standard routine and module (e.g., MATA410, SIGAFAT)
- Determine the trigger moment (before validation, after save, grid processing, etc.)
- Consult TDN to confirm PARAMIXB layout and return type
Step 2 — Design the PARAMIXB Interface
Document each parameter using the standard table format in PARAMIXB & Return Types.
Step 3 — Implement the Entry Point
Default: use the TLPP Template.
Only use the AdvPL Template when the user explicitly requested AdvPL.
Key implementation rules:
- Document the Entry Point with a
/*/{Protheus.doc}block (@type user function,@param,@return,@obs) - Always validate PARAMIXB existence (
Type("PARAMIXB") == "A") and length defensively - Extract business logic to
Static Functionhelpers - Use
Try-Catchfor error handling — neverErrorBlock - Default return value must be fail-safe (must not block the standard routine)
Step 4 — Validate
Apply the Entry Point Design Checklist before delivering.
Quick Reference
| Resource | Contents |
| Templates | AdvPL and TLPP code templates |
| PARAMIXB & Return Types | PARAMIXB layout format, return types, common EP categories |
| Design Checklist | Interface, defensive programming, code quality, SonarQube compliance |
| Troubleshooting | Common issues and fixes |
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
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.

