Agent skill

Protheus Data Dictionary Lookup

by totvs in totvs/engpro-advpl-tlpp-skills

Queries the TOTVS Protheus ERP data dictionary for tables, fields, indexes, parameters, triggers and lookups, including impact checks during refactoring.

MITAuto-check passedDevelopment

Install Protheus Data Dictionary Lookup

skills CLI
$ npx skills add totvs/engpro-advpl-tlpp-skills --skill data-dictionary-lookup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install totvs/engpro-advpl-tlpp-skills data-dictionary-lookup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/totvs/engpro-advpl-tlpp-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/advpl-tlpp/data-dictionary-lookup .claude/skills/data-dictionary-lookup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
data-dictionary-lookup
GitHub stars
141
Token cost
~1.5k tokens
SKILL.md length
561 words
Files
3 (incl. references)
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Queries the TOTVS Protheus ERP data dictionary for tables, fields, indexes, parameters, triggers and lookups, including impact checks during refactoring.

  • Works in 4 steps: Always include d_e_l_e_t_ = ' '… → Columns are lowercase — never use… → Use TRIM() in character field… → …
  • Finding which fields and types a Protheus table has
  • SKILL.md covers Overview, When to Use, Bundled Reference Files and Data Dictionary Structure, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Searches the Protheus metadata held in SX tables: SX2 for tables, SX3 for fields, SIX for indexes, SX6 for MV_ parameters, SX5 for generic tables, SX7 for triggers, SX1 for parameterization questions, SX9 for relationships and SXB for standard lookups. Queries run through an execute-sql tool, with TDN documentation reached through search tools.

It also finds the sharing mode of a table, exclusive or shared, and supports impact validation, where a refactoring or migration is checked against the dictionary to see whether fields, triggers, indexes, parameters or relationships are affected. SQL queries and column meanings sit in two reference files loaded on demand, and mandatory rules for execute-sql include TRIM, d_e_l_e_t_ and lowercase.

When your agent uses it

  • Finding which fields and types a Protheus table has
  • Checking indexes or triggers on a field
  • Looking up what an MV_ parameter does
  • Validating dictionary impact before a migration

Example prompts

  • “What fields does SA1 have?”
  • “Show the index of SE1 and the triggers for field A1_COD.”
  • “Look up parameter MV_ESTADO and explain its purpose.”

Requirements

  • An execute-sql tool connected to the Protheus database

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Always include d_e_l_e_t_ = ' ' (soft-delete filter)
  2. Columns are lowercase — never use X3_CAMPO, always x3_campo
  3. Use TRIM() in character field comparisons (trailing spaces)
  4. Use base table without suffix: sx3, sx2, six — never sx3t10, sx2t10

What it can do on your machine

Read from SKILL.md and the folder at commit 3908e4e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Protheus Data Dictionary Lookup loads about 1.5k tokens when it runs, and up to ~6k if it reads all its reference files. Until then it costs about 161 tokens; SKILL.md has 561 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~161
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from totvs/engpro-advpl-tlpp-skills at commit 3908e4e, republished under its MIT licence (© totvs). 561 words, ~1,549 tokens.

Download SKILL.mdSave it as .claude/skills/data-dictionary-lookup/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
data-dictionary-lookup
description
Query the TOTVS Protheus ERP data dictionary (SX2 tables, SX3 fields, SIX indexes, SX6 parameters, SX5 generic tables, SX7 triggers, SX1 questions, SX9 relationships, SXB standard lookups, SXG/SXA groups). Use when the user asks 'what fields does SA1 have', 'what is the index of SE1', 'parameter MV_ESTADO', 'generic table 12', 'triggers for field A1_COD', 'standard lookup SA1', 'table structure', 'data dictionary'. Also use during refactoring, migration, or code improvements when dictionary impact validation is needed to confirm whether changes affect fields, triggers, indexes, parameters, or table relationships.
license
MIT
metadata.domain
Protheus
metadata.maintainer
Customizações ADVPL/TLPP
metadata.author
Thalion Starforge
metadata.version
4.1.0
metadata.category
Documentation

Protheus Data Dictionary Lookup

Overview

Structured querying of the TOTVS Protheus ERP data dictionary. Allows searching tables, fields, indexes, parameters, generic tables, triggers, parameterization questions, relationships, and standard lookups (SQL queries via execute-sql and TDN documentation via search tools).

When to Use

  • Discover which fields a table has and their types/sizes
  • Check available indexes for a table
  • Query the value and purpose of a parameter (MV_*)
  • Search generic table contents (SX5)
  • Check triggers associated with a field
  • Query parameterization questions (SX1)
  • Check relationships between tables (SX9)
  • Query standard lookups (SXB)
  • Find the sharing mode of a table (Exclusive/Shared)
  • Impact validation in the dictionary: during refactorings, migrations, or code improvements, consult the dictionary when necessary to confirm whether the changes affect fields, triggers, indexes, parameters, or relationships of the tables involved in the process

Bundled Reference Files

This skill uses progressive disclosure. The SKILL.md covers dictionary structure, query flow, and response format. SQL queries and detailed column reference are in the references/ directory — read on demand as needed:

Reference FileWhen to ReadContent
references/sql-queries.mdExecuting dictionary queries — listing fields, indexes, parameters, triggers, questions, relationships, standard lookups, or combining SX* tablesComplete SQL queries for all 9 dictionary tables (SX2, SX3, SIX, SX6, SX5, SX7, SX1, SX9, SXB), combined queries (full view, fields with triggers, mandatory fields), and mandatory execute-sql rules (TRIM, d_e_l_e_t_, lowercase)
references/column-reference.mdInterpreting results or needing to understand the meaning of specific columns from SX* tablesDetailed tables with all columns from SX2, SX3, SIX, SX6, SX5, SX7, SX1, SX9, and SXB, including type, possible values, and functional description

Data Dictionary Structure

Protheus organizes its metadata in SX* tables:

TableDescriptionPrimary Key
SX1Parameterization questions (reports/queries)X1_GRUPO + X1_ORDEM
SX2System tables registryX2_CHAVE (table alias)
SX3Table fieldsX3_ARQUIVO + X3_CAMPO
SX5Generic tables (lookup values)X5_TABELA + X5_CHAVE
SX6System parameters (MV_*)X6_VAR
SX7Field triggersX7_CAMPO + X7_SEQUENC
SX9Table relationshipsX9_DOM + X9_CDOM
SXAFolders and groupers-
SXBStandard lookups (F3)XB_ALIAS + XB_TIPO
SXGField groups-
SIXTable indexesINDICE + ORDEM

Show full SKILL.md (228 more words)Show less

Mandatory Rules for execute-sql Queries

  1. Always include d_e_l_e_t_ = ' ' (soft-delete filter)
  2. Columns are lowercase — never use X3_CAMPO, always x3_campo
  3. Use TRIM() in character field comparisons (trailing spaces)
  4. Use base table without suffix: sx3, sx2, six — never sx3t10, sx2t10

Query Flow by Scenario

Full table overview

Execute 3 queries in parallel (see queries in references/sql-queries.md):

  1. Metadata → SX2 filtering by x2_chave
  2. Fields → SX3 filtering by x3_arquivo
  3. Indexes → SIX filtering by indice
Parameter lookup
  1. Search by exact name (TRIM(x6_var) LIKE 'MV_NAME%') or by description (UPPER(x6_descric) LIKE '%TERM%')
  2. If additional context is needed, search TDN documentation via product-docs-search
Field triggers
  1. Query SX7 filtering by x7_campo
  2. Combine with SX3 to get field titles for involved fields

Response Format

When presenting results to the user, always:

  1. Title: Table name and description (from SX2)
  2. Sharing mode: E (Exclusive) or C (Shared) — indicate the meaning
  3. Formatted table: Fields in markdown table with relevant columns
  4. Indexes: List with composition and description
  5. Notes: Virtual fields, triggers, special validations
Response Example
markdown
## SA1 — Customer Registry

**Mode**: Shared (C/C/C)
**Unique key**: A1_FILIAL+A1_COD+A1_LOJA
**MVC Routine**: CRMA980

### Main Fields

| Field | Title | Type | Size | Dec | Required | Context |
|-------|-------|------|------|-----|----------|---------|
| A1_FILIAL | Branch | C | 8 | 0 | Yes | Real |
| A1_COD | Code | C | 6 | 0 | Yes | Real |
| A1_LOJA | Store | C | 2 | 0 | Yes | Real |
| A1_NOME | Name | C | 40 | 0 | Yes | Real |
...

### Indexes

| Order | Composition | Description |
|-------|-------------|-------------|
| 1 | A1_FILIAL+A1_COD+A1_LOJA | Customer Code+Store |
| 2 | A1_FILIAL+A1_NOME | Name |
...

Common Errors

ErrorCauseSolution
Query returns emptycharacter field has trailing spacesUse TRIM() in comparisons
Data not foundTable has enterprise suffix (sx3t10)Use base table without suffix: sx3, sx2, six
Field not foundAlias with spaces in x3_arquivoUse TRIM(x3_arquivo) = 'SA1'
Deleted records returnedMissing soft-delete filterAlways include d_e_l_e_t_ = ' '

© totvs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/advpl-tlpp/data-dictionary-lookup of totvs/engpro-advpl-tlpp-skills.

  • SKILL.md
  • references/column-reference.md
  • references/sql-queries.md

Open the folder on GitHubat commit 3908e4e

Compare with similar skills

Protheus Data Dictionary Lookup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Protheus Data Dictionary Lookup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Protheus Data Dictionary Lookup this skilltotvs/engpro-advpl-tlpp-skills141—~1.5kAutomated safety check: PassMIT
Coding Agentmastra-ai/mastra29k—~2.3kAutomated safety check: PassCustom licence
Rift Backend EffectCompound-inc/rift123—~1.8kAutomated safety check: PassCustom licence
Optimize Loopgaasher/Agent-Loop-Skills174—~2.4kAutomated safety check: WarnMIT
Effect TSpproenca/dot-skills214—~2kAutomated safety check: PassMIT
TasteTryCaspian/caspian-sdk971—~1.8kAutomated safety check: PassAGPL-3.0

Similar skills

  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Rift Backend Effect

    Compound-inc/rift

    A skill your agent uses when adding, reviewing, or refactoring backend code in Rift's TanStack Start app that should follow apps/start/BACKENDEFFECTPLAYBOOK.md.

    123 GitHub stars~1.8k tokensUpdated 9 days ago
    DevOps & CloudAuto-check passed
  • Optimize Loop

    gaasher/Agent-Loop-Skills

    A skill your agent uses when the user wants to iteratively improve an artifact under a hard correctness bound while minimizing a measured cost — refactoring a code module to cut complexity while its…

    174 GitHub stars~2.4k tokensUpdated 3 mo ago
    DatabasesAuto-check: warnings
  • Effect TS

    pproenca/dot-skills

    Effect-TS library usage in TypeScript — Effect.gen generators, Schema.Struct/Schema.Class definitions, Layer/Context.Tag/Service patterns, Effect.pipe pipelines, Data.TaggedError/Data.Class error…

    214 GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Taste

    TryCaspian/caspian-sdk

    Domain-first store/port design for any codebase: product-shaped APIs, swappable backends, schema at boundaries, one vocabulary catalog (derive don’t re-author), no infrastructure names on the domain…

    971 GitHub stars~1.8k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Code Nest Project Spec

    xiaou61/Code-Nest

    Code-Nest 多模块全栈项目协作规范与落点导航。Use when modifying this repository for feature development, bug fixing, refactor, API change, SQL migration, or frontend-backend联调 so changes land in the correct module…

    770 GitHub stars~1.3k tokensUpdated 27 days ago
    DevelopmentAuto-check passed

More from totvs/engpro-advpl-tlpp-skills

All 19 skills in this repo
  • AdvPL UTF-8 to CP1252 Converter

    totvs/engpro-advpl-tlpp-skills

    Converts AdvPL and TLPP source files from UTF-8 to Windows-1252 in place after code generation, because the Protheus compiler accepts only CP1252 files.

    141 GitHub stars~2.6k tokensUpdated 2 days ago
    Auto-check passed
  • AdvPL/TLPP Compile in VS Code

    totvs/engpro-advpl-tlpp-skills

    Compiles AdvPL and TLPP sources from VS Code with the TOTVS Developer Studio extension, handling server setup, connection and compile result reporting.

    141 GitHub stars~3.7k tokensUpdated 2 days ago
    Auto-check passed
  • Protheus Spec-Driven Development

    totvs/engpro-advpl-tlpp-skills

    Plans and builds Protheus AdvPL/TLPP features through Specify, Design, Tasks and Execute phases whose depth scales with the size of the change.

    141 GitHub stars~3.6k tokensUpdated 2 days ago
    Auto-check passed
  • AdvPL and TLPP Code Review

    totvs/engpro-advpl-tlpp-skills

    Reviews AdvPL and TLPP source against SonarQube rules, ProtheusDOC requirements, security, performance and Protheus conventions, and reports findings by severity.

    141 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Protheus MVC Generator

    totvs/engpro-advpl-tlpp-skills

    Generates Protheus MVC screens in ADVPL/TLPP, with ModelDef, ViewDef, MenuDef and Browse functions for single-entity and master-detail layouts.

    141 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed
  • Query Builder

    totvs/engpro-advpl-tlpp-skills

    Build optimized and safe SQL queries for Protheus tables. An agent skill from totvs/engpro-advpl-tlpp-skills.

    141 GitHub stars~4.7k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Protheus Data Dictionary Lookup

What does Protheus Data Dictionary Lookup do?

Queries the TOTVS Protheus ERP data dictionary for tables, fields, indexes, parameters, triggers and lookups, including impact checks during refactoring. Searches the Protheus metadata held in SX tables: SX2 for tables, SX3 for fields, SIX for indexes, SX6 for MV_ parameters, SX5 for generic tables, SX7 for triggers, SX1 for parameterization questions, SX9 for relationships and SXB for standard lookups. Queries run through an execute-sql tool, with TDN documentation reached through search tools.

When should I use Protheus Data Dictionary Lookup?

Protheus Data Dictionary Lookup fits situations like: finding which fields and types a Protheus table has; checking indexes or triggers on a field; looking up what an MV_ parameter does; validating dictionary impact before a migration.

How do I install Protheus Data Dictionary Lookup in Claude Code?

Run `npx skills add totvs/engpro-advpl-tlpp-skills --skill data-dictionary-lookup -a claude-code`. Or copy the skill folder (skills/advpl-tlpp/data-dictionary-lookup in totvs/engpro-advpl-tlpp-skills) into .claude/skills/data-dictionary-lookup in your project. Claude Code loads it when a task matches its description.

How do I install Protheus Data Dictionary Lookup in Codex?

Run `npx skills add totvs/engpro-advpl-tlpp-skills --skill data-dictionary-lookup -a codex`. Or copy the skill folder (skills/advpl-tlpp/data-dictionary-lookup in totvs/engpro-advpl-tlpp-skills) into .agents/skills/data-dictionary-lookup in your project. Codex loads it when a task matches its description.

Can I use Protheus Data Dictionary Lookup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add totvs/engpro-advpl-tlpp-skills --skill data-dictionary-lookup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/data-dictionary-lookup, .gemini/skills/data-dictionary-lookup, .github/skills/data-dictionary-lookup and .opencode/skills/data-dictionary-lookup in your project.

What does Protheus Data Dictionary Lookup need to run?

SKILL.md names no scripts, command-line tools or credentials: Protheus Data Dictionary Lookup is instructions for the agent only. Our summary lists: An execute-sql tool connected to the Protheus database.

Does Protheus Data Dictionary Lookup access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Protheus Data Dictionary Lookup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Protheus Data Dictionary Lookup use?

Protheus Data Dictionary Lookup is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Protheus Data Dictionary Lookup use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.

What are the alternatives to Protheus Data Dictionary Lookup?

Skills that share tags, products or a category with Protheus Data Dictionary Lookup: Coding Agent (mastra-ai/mastra, 29k stars), Rift Backend Effect (Compound-inc/rift, 123 stars), Optimize Loop (gaasher/Agent-Loop-Skills, 174 stars) and Effect TS (pproenca/dot-skills, 214 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Protheus Data Dictionary Lookup?

totvs (a GitHub organization) maintains it in totvs/engpro-advpl-tlpp-skills, which has 141 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 5, 2026.

Source: totvs/engpro-advpl-tlpp-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.