Agent skill
protheus-business
Use when consulting Protheus ERP business processes, module workflows, routines, integrations, or understanding how business operations work in TOTVS Protheus
Install this agent skill to your Project
npx add-skill https://github.com/thalysjuvenal/advpl-specialist/tree/main/skills/protheus-business
SKILL.md
Protheus Business Processes
Overview
Reference guide for TOTVS Protheus ERP business processes. Provides understanding of how each module works, its routines, tables, business rules, and how modules integrate with each other.
When to Use
- Understanding business processes within a Protheus module
- Looking up module functions, routines, and workflows
- Finding which tables and fields a process uses
- Understanding ERP integrations between modules
- Questions like "how does faturamento work?", "what tables does compras use?", "how do compras and estoque integrate?"
Module Index
| Module | Prefix | Reference File |
|---|---|---|
| Compras | COM | modulo-compras.md |
| Estoque | EST | modulo-estoque.md |
| Faturamento | FAT | modulo-faturamento.md |
| Financeiro | FIN | modulo-financeiro.md |
| Contabilidade | CTB | modulo-contabilidade.md |
| Fiscal | FIS | modulo-fiscal.md |
| PCP | PCP | modulo-pcp.md |
| Manutencao de Ativos | MNT | modulo-manutencao.md |
Lookup Strategy
digraph lookup {
"Business process query?" [shape=diamond];
"Identify module(s)" [shape=box];
"Check module reference file" [shape=box];
"Found?" [shape=diamond];
"Return result" [shape=box];
"Search TDN online" [shape=box];
"WebSearch: site:tdn.totvs.com <term>" [shape=box];
"Fetch failed?" [shape=diamond];
"Playwright fallback" [shape=box];
"Business process query?" -> "Identify module(s)";
"Identify module(s)" -> "Check module reference file";
"Check module reference file" -> "Found?";
"Found?" -> "Return result" [label="yes"];
"Found?" -> "Search TDN online" [label="no"];
"Search TDN online" -> "WebSearch: site:tdn.totvs.com <term>";
"WebSearch: site:tdn.totvs.com <term>" -> "Fetch failed?";
"Fetch failed?" -> "Return result" [label="no"];
"Fetch failed?" -> "Playwright fallback" [label="yes"];
"Playwright fallback" -> "Return result";
}
- Identify module(s): Determine which module(s) the query relates to using the Module Index above
- Local first: Check the corresponding module reference file (e.g., modulo-compras.md)
- Online fallback: Search TDN with
WebSearchusing query:site:tdn.totvs.com <module> <process> protheus - WebFetch TDN page: If URL found, use
WebFetchto extract details - Playwright fallback: Se
WebSearchouWebFetchfalhar, use Playwright MCP:browser_navigatepara a URL do TDN (se disponivel) ou buscar emhttps://tdn.totvs.combrowser_snapshotpara extrair texto; se insuficiente,browser_take_screenshotpara captura visualbrowser_closeao finalizar para liberar recursos
Response Format
Adaptive based on query type:
| Query Type | Response Structure |
|---|---|
| Process | Description -> Routines -> Tables/Fields -> Step-by-step flow -> Integrations -> Entry points |
| Routine | What it does -> Tables it moves -> Parameters -> Process it belongs to |
| Module | Overview -> Main tables -> Main routines -> Key processes -> Integrations |
| Integration | Flow between modules -> Linking tables -> Routines involved |
Online Search Tips
When searching TDN (TOTVS Developer Network):
- Use
WebSearchwith query:site:tdn.totvs.com <module> <process> protheus - For routine docs:
site:tdn.totvs.com <routine_name> advpl protheus - For module integration:
site:tdn.totvs.com integracao <module_a> <module_b> protheus - TDN base URL:
https://tdn.totvs.com
Cross-References
- protheus-reference — for native function details (syntax, parameters, return values)
- advpl-code-generation — for code patterns and templates
- embedded-sql — for query examples using Embedded SQL
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
advpl-to-tlpp-migration
Use when migrating ADVPL procedural code to TLPP object-oriented code, converting functions to classes, or modernizing legacy Protheus code
protheus-reference
Use when looking up Protheus native functions, SX data dictionary tables, REST API endpoints, MV parameters, or TOTVS framework documentation
documentation-patterns
Use when generating technical documentation for ADVPL/TLPP code - Protheus.doc headers, routine docs, API docs
embedded-sql
Use when writing SQL queries in ADVPL/TLPP using BeginSQL/EndSQL blocks, %table%, %notDel%, %xfilial%, %exp% macros, or when choosing between Embedded SQL and TCQuery string concatenation
advpl-refactoring
Use when refactoring ADVPL/TLPP code - extract functions, simplify logic, remove dead code, improve naming
code-explanation
Use when explaining ADVPL/TLPP code in plain language for developers and functional consultants
Didn't find tool you were looking for?