agentleFS
thalysjuvenalthalysjuvenal/advpl-specialist/.github/copilot-instructions.md

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.

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
  1. Very specific:

    Every RecLock needs a matching MsUnlock, including on error paths.

    line 11
  2. Very specific:

    Never access SX*/SM0/SIX tables via direct DbSelectArea — use framework APIs (FWSX3Util, GetMV, RetSqlName, Pergunte).

    line 13
  3. Very specific:

    Never use ConOut() (use FWLogMsg()), IIF() inline ternaries, or hardcoded credentials.

    line 14

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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:

  • .prw files: #include "totvs.ch" lowercase — never "protheus.ch".
  • .tlpp files: use .th includes (tlpp-core.th, tlpp-rest.th, etc.); no using namespace tlpp.*.
  • Hungarian notation for variables (c/n/d/l/a/o/b/x prefixes). Prefer Local over Private/Public, always declared at the top of the function.
  • Database queries: Embedded SQL only (BeginSQL/EndSQL with %table%, %xFilial%, %notDel%, %exp%) — never raw SQL strings or concatenated TCQuery.
  • Every RecLock needs a matching MsUnlock, including on error paths.
  • Automate MVC routines with FWMVCRotAuto; use MsExecAuto only for legacy non-MVC code.
  • Never access SX*/SM0/SIX tables via direct DbSelectArea — use framework APIs (FWSX3Util, GetMV, RetSqlName, Pergunte).
  • Never use ConOut() (use FWLogMsg()), IIF() inline ternaries, or hardcoded credentials.
  • Validate custom fields in SX3 before use (<prefix>_X* pattern); custom functions use the U_ 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.

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.