advpl-specialist
Copilot instructions185 starsChanged 3 months agoMITView on GitHub
This repo is either the advpl-specialist knowledge plugin itself (skills in skills/, commands in commands/, agents in agents/) or a Protheus source tree that copied this file as a template. Full standards live in AGENTS.md at the repo root — read it first. Critical rules when suggesting or completing ADVPL/TLPP code: For task-specific guidance (code generation, review, debugging, migration, SQL, tests, locks, Smart X, SX dictionary), consult skills/<name>/SKILL.md per the map in AGENTS.md.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- advpl-code-generationSkill
- advpl-code-reviewSkill
- advpl-debuggingSkill
- advpl-refactoringSkill
- advpl-to-tlpp-migrationSkill
- advpr-test-automationSkill
- changelog-patternsSkill
- code-explanationSkill
- documentation-patternsSkill
- embedded-sqlSkill
- probat-testingSkill
- protheus-businessSkill
- protheus-locks-deadlocksSkill
- protheus-referenceSkill
- query-builderSkill
- smartview-developmentSkill
- smartx-developmentSkill
- sx-configurationSkill
- tdn-lookupSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Every RecLock needs a matching MsUnlock, including on error paths.
- Very specific: line 13
Never access SX*/SM0/SIX tables via direct DbSelectArea — use framework APIs (FWSX3Util, GetMV, RetSqlName, Pergunte).
- Very specific: line 14
Never use ConOut() (use FWLogMsg()), IIF() inline ternaries, or hardcoded credentials.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
Copilot Instructions — ADVPL/TLPP (TOTVS Protheus)
This repo is either the advpl-specialist knowledge plugin itself (skills in skills/, commands in commands/, agents in agents/) or a Protheus source tree that copied this file as a template. Full standards live in AGENTS.md at the repo root — read it first.
Critical rules when suggesting or completing ADVPL/TLPP code:
.prwfiles:#include "totvs.ch"lowercase — never"protheus.ch"..tlppfiles: use.thincludes (tlpp-core.th,tlpp-rest.th, etc.); nousing namespace tlpp.*.- Hungarian notation for variables (
c/n/d/l/a/o/b/xprefixes). PreferLocaloverPrivate/Public, always declared at the top of the function. - Database queries: Embedded SQL only (
BeginSQL/EndSQLwith%table%,%xFilial%,%notDel%,%exp%) — never raw SQL strings or concatenatedTCQuery. - Every
RecLockneeds a matchingMsUnlock, including on error paths. - Automate MVC routines with
FWMVCRotAuto; useMsExecAutoonly for legacy non-MVC code. - Never access SX*/SM0/SIX tables via direct
DbSelectArea— use framework APIs (FWSX3Util,GetMV,RetSqlName,Pergunte). - Never use
ConOut()(useFWLogMsg()),IIF()inline ternaries, or hardcoded credentials. - Validate custom fields in SX3 before use (
<prefix>_X*pattern); custom functions use theU_prefix. - ADVPL/TLPP source files are Windows-1252 encoded, not UTF-8.
- There is no ADVPL compiler in CI — never claim code is compiled/verified; that only happens in TDS/VS Code TOTVS extension.
For task-specific guidance (code generation, review, debugging, migration, SQL, tests, locks, Smart X, SX dictionary), consult skills/<name>/SKILL.md per the map in AGENTS.md.
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.

