Fluig Migrate Jquery Es6 logo

Fluig Migrate Jquery Es6

Organization
totvs
fluig-migrate-jquery-es6

Migra e moderniza código jQuery para JavaScript ES6+ em customizações Fluig, preservando o comportamento, a internacionalização e a compatibilidade com a plataforma. Use quando o desenvolvedor pedir para converter/atualizar um trecho ou arquivo legado em jQuery para ES6+ (DOM nativo, eventos, REST via APIs públicas).

Overview

Publishertotvs
Repositoryfluig-agent-skills
Skill namefluig-migrate-jquery-es6
Stars
37
Forks
14
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by totvs on GitHub. Read the source before you install it.

Installation

Install the Fluig Migrate Jquery Es6 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/totvs/fluig-agent-skills/tree/main/skills/fluig-migrate-jquery-es6
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/totvs/fluig-agent-skills.git /tmp/fluig-agent-skills
mkdir -p .claude/skills
cp -r /tmp/fluig-agent-skills/skills/fluig-migrate-jquery-es6 .claude/skills/fluig-migrate-jquery-es6
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fluig Migrate Jquery Es6 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Fluig Migrate Jquery Es6 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Fluig Migrate Jquery Es6 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Migração de jQuery para ES6+

Esta skill converte código jQuery legado em ES6+ equivalente; ela não duplica convenções — os arquivos de context/ são a fonte de verdade, referenciada abaixo.

Passo 0 — Persona

Antes de modernizar, classifique a persona do desenvolvedor seguindo a cascata em persona-routing.md: conversa > marcador de arquivo > marcador técnico de Store (component.xml ou API de slot) > estrutura do projeto > pergunta. Se restar ambígua, pare e pergunte antes de continuar. Emita Persona: <Parceiro|Consultor> (motivo) — esta skill aplica as mesmas regras técnicas independentemente da persona (não há camada da Store envolvida na migração jQuery → ES6+).

Objetivo

Migrar, com responsabilidade única, código jQuery de aplicação para ES6+, substituindo cada uso de jQuery pelo equivalente nativo (ou pela API pública do Fluig) sem alterar o comportamento, a i18n nem a compatibilidade com a plataforma. Não se remove o jQuery exigido pelos plugins embutidos da plataforma (jQuery UI, Mustache, eventos fluig.datatable.* e demais helpers do Style Guide que expõem API jQuery): esse uso é legítimo e suportado — ver fluig-style-guide-helpers e technologies.md.

Quando Usar

  • Ao modernizar um widget ou Custom Element que ainda usa jQuery.
  • Quando o desenvolvedor seleciona um trecho/arquivo jQuery e pede a versão ES6+.
  • Antes de evoluir código legado, para padronizá-lo em ES6+ e remover dependência de jQuery em código novo.

🚫 Escopo: só código client-side (navegador). Esta skill é para JS de widget/Custom Element que roda no browser. NÃO aplique a eventos server-side de form/dataset/processo (events/*.js, datasets/*.js, eventos de workflow) — eles rodam no motor Rhino (ES5) e lá as mesmas "modernizações" introduzem bugs: var→const/arrow/template literal podem não ter suporte, e trocar == por === em valores vindos da API Java (getFormMode, getValue, getIsEditMode) deixa a comparação sempre falsa (os retornos são java.lang.String, não primitivos JS). Se o alvo for server-side, pare e não migre; nesse contexto o padrão correto é ES5 + String(valor) + == → ver technologies.md › "Princípio: valores vindos de API Java no Rhino" e conventions-form.md › "Eventos server-side".

Entradas Esperadas

EntradaDescriçãoObrigatória
Código jQuery alvoTrecho ou arquivo legado a ser migradosim
Contexto do artefatoTipo do artefato em que o código roda (widget SuperWidget ou Custom Element)não
Chaves i18nChaves de tradução já usadas no código, a preservarnão

Contexto de Referência (Fonte de Verdade)

Leia antes de executar — não reproduza o conteúdo aqui:

  • conventions.md — ES6+ (const/let, arrow functions, template literals), DOM nativo, REST via fetch(), bindings de widget, i18n e segurança.
  • technologies.md — jQuery 3.7.1 é embutido e suportado pela plataforma (não é "legado"); ES6+ é o padrão para código novo de aplicação, mas o jQuery dos plugins embutidos (jQuery UI, Mustache, fluig.datatable.*) permanece válido. Só o plugin jQuery Migrate está em descontinuação. Bibliotecas client-side disponíveis listadas aqui.
  • platform-constitution.md — regras invioláveis de i18n ([=i18n.getTranslation(...)] em .js, ${i18n.getTranslation(...)} em .ftl) e HTTP (fetch).

Regras Aplicáveis (Resumo Executivo)

Somente o mínimo para orientar a migração; o detalhe está no contexto. Equivalências comuns jQuery → ES6+:

  • $(sel) → document.querySelector / document.querySelectorAll → ver conventions.md.
  • .on('click', fn) / $.proxy → addEventListener (ou bindings declarativos do widget quando aplicável) → ver conventions.md.
  • $.ajax() → fetch() + async/await + try/catch para qualquer chamada; domínio do próprio Fluig só com API pública, URL via WCMAPI.getServerURL() → ver platform-constitution.md.
  • var → const por padrão, let quando há reatribuição → ver conventions.md. Exceção que permanece var (regra 3 da constituição): apenas a variável raiz que recebe SuperWidget.extend({...}) (ex.: var MyWidget = SuperWidget.extend(...)). Não converta essa para const → ver platform-constitution.md e conventions.md.
  • Dentro de .extend({}) (regra 3): manter métodos como nome: function() {} (nunca method shorthand nem arrow como método). Remover var ctx = this; / var that = this; (usar this direto no método) e converter os callbacks function() {} para Arrow Functions () => {} — a migração nunca ensina ES5 → ver platform-constitution.md.
  • Concatenação de strings → template literals, exceto em .js legado que usa ${i18n...} e é minificado pelo Closure Compiler: nesse caso manter concatenação (+), não converter para template literal (a minificação conflita com template strings que contêm ${i18n...}). Com [=i18n...] não há restrição: converta normalmente → ver conventions.md e platform-constitution.md.
  • .each() → for...of ou Array.prototype.forEach → ver conventions.md.
  • Preservar comportamento e i18n: manter a sintaxe já usada no arquivo ([=i18n.getTranslation('chave')] em .js novo, ${i18n.getTranslation('chave')} em .ftl ou em .js legado), sem misturar as duas e sem trocá-la a menos que solicitado → ver platform-constitution.md.

Procedimento

  1. Ler o código alvo e mapear cada uso de jQuery (seletores, eventos, manipulação de DOM, chamadas REST, iterações).
  2. Para cada uso, escolher o equivalente ES6+/Fluig conforme as equivalências acima e o conventions.md.
  3. Substituir preservando o comportamento observável (mesma lógica, mesmos efeitos colaterais, mesma i18n).
  4. Converter chamadas REST para fetch() + async/await + try/catch, com domínio do próprio Fluig via API pública e URL montada a partir de WCMAPI.getServerURL() — nunca $.ajax direto.
  5. Validar que nenhum novo uso de jQuery de aplicação foi introduzido e que o código resultante está em ES6+ — preservando o uso legítimo dos plugins embutidos (jQuery UI, Mustache, fluig.datatable.*), que não devem ser removidos.
  6. Conferir o resultado com o checklist abaixo antes de entregar.

Saída Esperada

Código migrado para ES6+ equivalente ao original, sem regressões de comportamento nem de i18n, sem dependência de jQuery no código novo e com chamadas REST ao domínio do próprio Fluig via APIs públicas.

Exemplo de Uso

Trecho ilustrativo (antes/depois), usando apenas APIs públicas:

javascript
// Antes (jQuery)
var $list = $('#MyWidget_' + instanceId + ' .items');
$list.on('click', '.item', function () {
  $(this).addClass('active');
});
javascript
// Depois (ES6+) — este trecho NÃO usa i18n, então o template literal é seguro.
// ⚠️ Se o arquivo for legado, usar `${i18n...}` e for minificado pelo Closure
// Compiler, prefira concatenação (`+`) a template literal ao montar textos com
// a tradução. Com `[=i18n...]` o template literal é liberado.
// Obs.: este é um listener de DOM comum (arrow é ok aqui). Dentro de
// SuperWidget.extend({}) os MÉTODOS continuam `nome: function() {}`, com `this` direto (sem `var ctx = this;`).
const list = document.querySelector('#MyWidget_' + this.instanceId + ' .items');
list.addEventListener('click', (event) => {
  const item = event.target.closest('.item');
  if (item) item.classList.add('active');
});

Checklist de Validação

  • O alvo é client-side (widget/Custom Element no navegador) — não é evento server-side de form/dataset/processo (Rhino/ES5). Se for server-side, a migração foi interrompida (ES6+/=== quebrariam o Rhino) → ver technologies.md/conventions-form.md.
  • Sem jQuery no código novo de aplicação ($(), $.ajax, $.proxy); exceção: uso legítimo dos plugins embutidos da plataforma que expõem API jQuery (jQuery UI, Mustache, eventos fluig.datatable.*) permanece válido — ver fluig-style-guide-helpers e technologies.md.
  • const/let no código em geral, exceto a variável raiz do SuperWidget.extend (var) (regra 3 da constituição).
  • Dentro de .extend({}): métodos como nome: function() {} (sem shorthand/arrow como método), this direto (sem var ctx = this;) e callbacks em Arrow Functions () => {}.
  • Chamadas REST via fetch() + async/await + try/catch; domínio do próprio Fluig só com API pública via WCMAPI.getServerURL().
  • Comportamento original preservado (mesma lógica e efeitos).
  • i18n preservada com a sintaxe do arquivo ([=i18n.getTranslation('...')] em .js novo; ${i18n.getTranslation('...')} em .ftl ou .js legado), sem misturar as duas.

Frequently asked questions

What does the Fluig Migrate Jquery Es6 AI skill do?

Migra e moderniza código jQuery para JavaScript ES6+ em customizações Fluig, preservando o comportamento, a internacionalização e a compatibilidade com a plataforma. Use quando o desenvolvedor pedir para converter/atualizar um trecho ou arquivo legado em jQuery para ES6+ (DOM nativo, eventos, REST via APIs públicas).

Why use Fluig Migrate Jquery Es6 on TypingMind?

Because you install it once and use it with any model. Fluig Migrate Jquery Es6 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Fluig Migrate Jquery Es6 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/totvs/fluig-agent-skills/tree/main/skills/fluig-migrate-jquery-es6. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Fluig Migrate Jquery Es6?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Fluig Migrate Jquery Es6?

As many as you like. As long as a model supports skills, you can use Fluig Migrate Jquery Es6 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Fluig Migrate Jquery Es6 AI skill free?

Yes. It is published on GitHub by totvs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇