advpl-specialist: Command for Claude Code

.cursor/commands/migrate.md

migrate is a command for Claude Code, Cursor from thalysjuvenal/advpl-specialist. It costs 0 tokens per session (630 once invoked), scanned A, original, MIT.

A command that converts procedural ADVPL source code into object-oriented TLPP code for TOTVS Protheus. ADVPL and TLPP are programming languages used in that business software platform.

In plain words
What is it for?
Use it to migrate `.prw` files, map functions to class methods, convert shared variables to properties, find affected callers, and validate the resulting TLPP structure.
Why use it?
It helps modernise older procedural code into classes, methods, namespaces, and other object-oriented structures. It also considers external callers and shared variables during the migration.

Command for Claude CodeCursor

Written for Claude Code and Cursor: shipped in a Claude Code plugin, but also installed under .cursor/.

This is thalysjuvenal/advpl-specialist's own configuration. It tells Claude Code and Cursor how to work on advpl-specialist itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything advpl-specialist configures →

Part of the advpl-specialist plugin — 18 skills, 14 commands, 2 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to thalysjuvenal/advpl-specialist. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/thalysjuvenal/advpl-specialist/main/.cursor/commands/migrate.md
Clone the repo
git clone --depth 1 https://github.com/thalysjuvenal/advpl-specialist

Made for: Claude Code, Cursor.

Or install advpl-specialist, the plugin that ships this one along with the rest of its 18 skills, 14 commands, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migrate

README.md
[![agentmods](https://agentmods.dev/badge/commands/thalysjuvenal/advpl-specialist/migrate/github.svg)](https://agentmods.dev/commands/thalysjuvenal/advpl-specialist/migrate)
Your own site
<a href="https://agentmods.dev/commands/thalysjuvenal/advpl-specialist/migrate"><img src="https://agentmods.dev/badge/commands/thalysjuvenal/advpl-specialist/migrate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migrate

Your own site · 80×15
<a href="https://agentmods.dev/commands/thalysjuvenal/advpl-specialist/migrate"><img src="https://agentmods.dev/badge/commands/thalysjuvenal/advpl-specialist/migrate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 630 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00630
Opus 5 $0.00000 $0.00315
Sonnet 5 $0.00000 $0.00126
Haiku 4.5 $0.00000 $0.00063

Measured 9d ago against content hash 4b52c1cf11a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

migrate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/commands/migrate.md · 30 lines

How it starts

The opening of the file, as written. The whole thing — 30 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/migrate — Migrate procedural ADVPL code to object-oriented TLPP with classes, namespaces, and modern patterns

You are an expert ADVPL/TLPP assistant for TOTVS Protheus. This command converts procedural ADVPL source into TLPP object-oriented code.

Knowledge to load first

Locate the advpl-specialist skills (installed via npx skills add thalysjuvenal/advpl-specialist; in this repository they live under skills/) and read, in order:

  1. skills/advpl-to-tlpp-migration/reference.md (migration rules and process)
  2. skills/advpl-to-tlpp-migration/migration-rules.md
  3. skills/advpl-to-tlpp-migration/migration-checklist.md (final validation checklist)

Workflow

  1. Read the target .prw file completely.
  2. Analyze its structure: functions, dependencies, shared/private/public variables.
  3. Search the codebase for external callers (u_FunctionName references) that may be impacted.
  4. Design a target class structure: map each function to a class method (public or private), map shared variables to class properties, and decide the namespace (auto-detected from the module, or --namespace override).
  5. Draft a migration plan including: source analysis summary, external callers impacted, target class/namespace, function-to-method mapping, includes to update (e.g. TOTVS.CH to tlpp-core.th), whether a backward-compatibility .prw wrapper is needed, and any risks or breaking changes. Present the plan and wait for user approval.
  6. If --dry-run was requested, stop after presenting the plan — do not generate files.
  7. After approval, generate the .tlpp file with the migrated class-based code, and the compatibility wrapper if --wrapper is enabled (default true).
  8. Run the migration against skills/advpl-to-tlpp-migration/migration-checklist.md and report any gaps.
  9. Report a summary of what changed and why.

Output rules

  • Target files use .tlpp extension with #include "tlpp-core.th" (and tlpp-rest.th if REST is involved).
  • Declare namespace custom.<agrupador>.<servico> right after the includes (all lowercase, dot-separated, no underscores).
  • Preserve Hungarian notation for variables; convert module-global state into class properties where appropriate.
  • Use Embedded SQL (BeginSQL/EndSQL with macros) if the original code used raw or dynamic SQL strings — never keep raw SQL strings.
  • Keep error handling (BEGIN SEQUENCE ... RECOVER ... END SEQUENCE) equivalent or improved relative to the original.
  • Validate any custom field (<prefix>_X*) against SX3 conventions; user-facing functions keep the U_ prefix in the compatibility wrapper.
  • Compilation must be validated in TDS / VS Code TOTVS extension — never claim the code compiles.

Read the full file on GitHub · 30 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 30 lines · 0 tokens per session scan A 4b52c1cf11a0

Subscribe to this mod's changes

migrate is a command published in the GitHub repository thalysjuvenal/advpl-specialist (186 stars, last pushed 18d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 630 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.