@netoalmanca/advpl-sensei 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/agents/changelog-generator.md +63 -0
  2. package/agents/code-generator.md +215 -0
  3. package/agents/code-reviewer.md +145 -0
  4. package/agents/debugger.md +83 -0
  5. package/agents/doc-generator.md +67 -0
  6. package/agents/docs-reference.md +86 -0
  7. package/agents/migrator.md +84 -0
  8. package/agents/process-consultant.md +97 -0
  9. package/agents/refactorer.md +75 -0
  10. package/agents/sx-configurator.md +67 -0
  11. package/commands/changelog.md +66 -0
  12. package/commands/diagnose.md +67 -0
  13. package/commands/docs.md +81 -0
  14. package/commands/document.md +67 -0
  15. package/commands/explain.md +60 -0
  16. package/commands/generate.md +111 -0
  17. package/commands/migrate.md +81 -0
  18. package/commands/process.md +111 -0
  19. package/commands/refactor.md +65 -0
  20. package/commands/review.md +60 -0
  21. package/commands/sxgen.md +98 -0
  22. package/commands/test.md +103 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +143 -0
  26. package/dist/index.js.map +1 -0
  27. package/package.json +30 -0
  28. package/skills/advpl-code-generation/SKILL.md +163 -0
  29. package/skills/advpl-code-generation/patterns-fwformbrowse.md +485 -0
  30. package/skills/advpl-code-generation/patterns-jobs.md +519 -0
  31. package/skills/advpl-code-generation/patterns-mvc.md +765 -0
  32. package/skills/advpl-code-generation/patterns-pontos-entrada.md +708 -0
  33. package/skills/advpl-code-generation/patterns-rest.md +974 -0
  34. package/skills/advpl-code-generation/patterns-soap.md +639 -0
  35. package/skills/advpl-code-generation/patterns-treport.md +481 -0
  36. package/skills/advpl-code-generation/patterns-workflow.md +779 -0
  37. package/skills/advpl-code-generation/templates-classes.md +1096 -0
  38. package/skills/advpl-code-review/SKILL.md +72 -0
  39. package/skills/advpl-code-review/rules-best-practices.md +444 -0
  40. package/skills/advpl-code-review/rules-modernization.md +290 -0
  41. package/skills/advpl-code-review/rules-performance.md +333 -0
  42. package/skills/advpl-code-review/rules-security.md +302 -0
  43. package/skills/advpl-debugging/SKILL.md +265 -0
  44. package/skills/advpl-debugging/common-errors.md +1124 -0
  45. package/skills/advpl-debugging/performance-tips.md +768 -0
  46. package/skills/advpl-refactoring/SKILL.md +139 -0
  47. package/skills/advpl-to-tlpp-migration/SKILL.md +293 -0
  48. package/skills/advpl-to-tlpp-migration/migration-checklist.md +122 -0
  49. package/skills/advpl-to-tlpp-migration/migration-rules.md +265 -0
  50. package/skills/changelog-patterns/SKILL.md +99 -0
  51. package/skills/code-explanation/SKILL.md +66 -0
  52. package/skills/documentation-patterns/SKILL.md +172 -0
  53. package/skills/embedded-sql/SKILL.md +379 -0
  54. package/skills/probat-testing/SKILL.md +226 -0
  55. package/skills/probat-testing/patterns-unit-tests.md +614 -0
  56. package/skills/protheus-business/SKILL.md +92 -0
  57. package/skills/protheus-business/modulo-compras.md +780 -0
  58. package/skills/protheus-business/modulo-contabilidade.md +874 -0
  59. package/skills/protheus-business/modulo-estoque.md +876 -0
  60. package/skills/protheus-business/modulo-faturamento.md +800 -0
  61. package/skills/protheus-business/modulo-financeiro.md +1015 -0
  62. package/skills/protheus-business/modulo-fiscal.md +749 -0
  63. package/skills/protheus-business/modulo-manutencao.md +848 -0
  64. package/skills/protheus-business/modulo-pcp.md +743 -0
  65. package/skills/protheus-reference/SKILL.md +119 -0
  66. package/skills/protheus-reference/native-functions.md +7029 -0
  67. package/skills/protheus-reference/rest-api-reference.md +1758 -0
  68. package/skills/protheus-reference/restricted-functions.md +265 -0
  69. package/skills/protheus-reference/sx-dictionary.md +854 -0
  70. package/skills/sx-configuration/SKILL.md +184 -0
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: protheus-reference
3
+ description: Use when looking up Protheus native functions, SX data dictionary tables, REST API endpoints, MV parameters, or TOTVS framework documentation
4
+ ---
5
+
6
+ # Protheus Reference
7
+
8
+ ## Overview
9
+
10
+ Reference guide for the TOTVS Protheus ecosystem. Provides quick access to native functions, data dictionary (SX tables), REST API endpoints, and system parameters (MV_*).
11
+
12
+ ## When to Use
13
+
14
+ - Looking up native function syntax, parameters, or return values
15
+ - Understanding SX data dictionary structure (SX1 through SX9, SIX)
16
+ - Finding REST API endpoints for Protheus integration
17
+ - Checking MV_* parameter purpose and default values
18
+ - Understanding .ini configuration files (appserver.ini, smartclient.ini)
19
+
20
+ ## Lookup Strategy
21
+
22
+ ```dot
23
+ digraph lookup {
24
+ "Need function/API info?" [shape=diamond];
25
+ "Check native-functions.md" [shape=box];
26
+ "Found?" [shape=diamond];
27
+ "Return result" [shape=box];
28
+ "Search TDN online" [shape=box];
29
+ "WebSearch: site:tdn.totvs.com <term>" [shape=box];
30
+ "Fetch failed?" [shape=diamond];
31
+ "Playwright fallback" [shape=box];
32
+
33
+ "Need function/API info?" -> "Check native-functions.md";
34
+ "Check native-functions.md" -> "Found?";
35
+ "Found?" -> "Return result" [label="yes"];
36
+ "Found?" -> "Search TDN online" [label="no"];
37
+ "Search TDN online" -> "WebSearch: site:tdn.totvs.com <term>";
38
+ "WebSearch: site:tdn.totvs.com <term>" -> "Fetch failed?";
39
+ "Fetch failed?" -> "Return result" [label="no"];
40
+ "Fetch failed?" -> "Playwright fallback" [label="yes"];
41
+ "Playwright fallback" -> "Return result";
42
+ }
43
+ ```
44
+
45
+ 1. **Local first:** Check supporting files (native-functions.md, sx-dictionary.md, rest-api-reference.md)
46
+ 2. **Online fallback:** Search TDN with `WebSearch` using query: `site:tdn.totvs.com <function_name>`
47
+ 3. **WebFetch TDN page:** If URL found, use `WebFetch` to extract details
48
+ 4. **Playwright fallback:** Se `WebSearch` ou `WebFetch` falhar, use Playwright MCP:
49
+ - `browser_navigate` para a URL do TDN (se disponível) ou buscar em `https://tdn.totvs.com`
50
+ - `browser_snapshot` para extrair texto; se insuficiente, `browser_take_screenshot` para captura visual
51
+ - `browser_close` ao finalizar para liberar recursos
52
+
53
+ ## CRITICAL: Restricted Functions Check
54
+
55
+ **Before recommending any function, ALWAYS check if it appears in `restricted-functions.md`.** TOTVS maintains a list of 195+ functions/classes that are internal property and MUST NOT be used in custom code. Some have their compilation blocked since release 12.1.33.
56
+
57
+ See `restricted-functions.md` for the complete list and supported alternatives.
58
+
59
+ ## Function Categories
60
+
61
+ | Category | Common Functions | File Reference |
62
+ |----------|-----------------|----------------|
63
+ | String | Alltrim, SubStr, StrTran, Pad*, Upper, Lower | native-functions.md |
64
+ | Date/Time | dDataBase, DtoS, StoD, Day, Month, Year | native-functions.md |
65
+ | Array | aAdd, aDel, aSize, aScan, aSort, aClone | native-functions.md |
66
+ | Database | DbSelectArea, DbSetOrder, DbSeek, RecLock, MsUnlock | native-functions.md |
67
+ | Interface | MsgInfo, MsgYesNo, MsgAlert, FWExecView, Enchoice | native-functions.md |
68
+ | File I/O | FOpen, FRead, FWrite, FClose, FErase, Directory | native-functions.md |
69
+ | Network | HttpGet, HttpPost, FWRest, WsRestFul | native-functions.md |
70
+ | System | GetMV, PutMV, SuperGetMV, Conout, FWLogMsg | native-functions.md |
71
+ | Company/Branch | FWCodFil, FWCodEmp, FWFilial, FWCompany, xFilial | native-functions.md |
72
+ | JsonObject | New, FromJSON, toJSON, GetNames, HasProperty, GetJsonObject, GetJsonText, GetJsonValue, DelName, Set | native-functions.md |
73
+ | TWsdlManager | New, ParseURL, ParseFile, SetOperation, SendSoapMsg, GetParsedResponse, GetSoapResponse, GetSoapMsg, ListOperations, SetPort, SetValue | native-functions.md |
74
+ | Browse/UI | FwBrowse, FWMarkBrowse, FWBrwColumn, FWBrwRelation, FWLegend, FWCalendar, FWSimpEdit | native-functions.md |
75
+ | Process | FWGridProcess, tNewProcess | native-functions.md |
76
+ | WorkArea | FwGetArea, FwRestArea | native-functions.md |
77
+ | User | FwGetUserName, UsrRetName | native-functions.md |
78
+ | Dialog | FWMsgRun, FWInputBox | native-functions.md |
79
+ | Memory | FWFreeObj, FWFreeVar | native-functions.md |
80
+ | Date ISO | Fw8601ToDate, FWDateTo8601 | native-functions.md |
81
+ | URL Encode | FWHttpEncode, FWURIDecode | native-functions.md |
82
+ | Semaphore | MayIUseCode, MPCriaNumS | native-functions.md |
83
+ | Dictionary | FWX3Titulo, FWX2CHAVE, FWX2Unico | native-functions.md |
84
+ | Interface | SaveInter, RestInter | native-functions.md |
85
+ | ExecAuto | MsGetDAuto, MsExecAuto, FWMVCRotAuto | native-functions.md |
86
+ | Restricted | StaticCall, PTInternal, PARAMBOX, etc. | restricted-functions.md |
87
+
88
+ ## Data Dictionary Quick Reference
89
+
90
+ | Table | Purpose |
91
+ |-------|---------|
92
+ | SX1 | Perguntas (parameters for reports/routines) |
93
+ | SX2 | Tabelas (table definitions) |
94
+ | SX3 | Campos (field definitions) |
95
+ | SX5 | Tabelas genericas (generic lookup tables) |
96
+ | SX6 | Parametros (MV_* system parameters) |
97
+ | SX7 | Gatilhos (field triggers) |
98
+ | SX9 | Relacionamentos (table relationships) |
99
+ | SXB | Consultas padrao (standard queries) |
100
+ | SIX | Indices (index definitions) |
101
+
102
+ See `sx-dictionary.md` for complete structure with field descriptions.
103
+
104
+ ## REST API Patterns
105
+
106
+ Protheus REST APIs follow two main patterns:
107
+
108
+ 1. **FWRest Framework** (newer): Annotation-based with `@Get`, `@Post`, `@Put`, `@Delete`
109
+ 2. **WsRestFul** (legacy): Class-based with `wsmethod`
110
+
111
+ See `rest-api-reference.md` for endpoint patterns and authentication.
112
+
113
+ ## Online Search Tips
114
+
115
+ When searching TDN (TOTVS Developer Network):
116
+ - Use `WebSearch` with query: `site:tdn.totvs.com <function_name> advpl`
117
+ - For API docs: `site:tdn.totvs.com rest api <endpoint_name>`
118
+ - For release notes: `site:tdn.totvs.com <feature> release notes`
119
+ - TDN base URL: `https://tdn.totvs.com`