Install
$ agentstack add skill-totvs-fluig-agent-skills-fluig-migrate-jquery-es6 ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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.
Objetivo
Migrar, com responsabilidade única, código jQuery 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.
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.
Entradas Esperadas
| Entrada | Descrição | Obrigatória | |---------|-----------|-------------| | Código jQuery alvo | Trecho ou arquivo legado a ser migrado | sim | | Contexto do artefato | Tipo do artefato em que o código roda (widget SuperWidget ou Custom Element) | não | | Chaves i18n | Chaves de tradução já usadas no código, a preservar | não |
Contexto de Referência (Fonte de Verdade)
Leia antes de executar — não reproduza o conteúdo aqui:
- [conventions.md](../../context/conventions.md) — ES6+ (
const/let, arrow functions, template literals), DOM nativo, REST viaWCMAPI/FLUIGC, bindings de widget, i18n e segurança. - [technologies.md](../../context/technologies.md) — jQuery (3.7.1) é legado; ES6+ é o padrão para código novo; bibliotecas client-side disponíveis.
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→ verconventions.md..on('click', fn)/$.proxy→addEventListener(ou bindings declarativos do widget quando aplicável) → verconventions.md.$.ajax()/fetch()para endpoints internos →WCMAPI.*(legado) ouFLUIGC.ajax(novo); nunca$.ajax/fetchdireto a endpoints internos → verconventions.md.var→constpor padrão,letquando há reatribuição → verconventions.md.- Concatenação de strings → template literals (cuidado com
${...}vs i18n) → verconventions.md. .each()→for...ofouArray.prototype.forEach→ verconventions.md.- Preservar comportamento e i18n (
${i18n.getTranslation('chave')}) → verconventions.md.
Procedimento
- Ler o código alvo e mapear cada uso de jQuery (seletores, eventos, manipulação de DOM, chamadas REST, iterações).
- Para cada uso, escolher o equivalente ES6+/Fluig conforme as equivalências acima e o
conventions.md. - Substituir preservando o comportamento observável (mesma lógica, mesmos efeitos colaterais, mesma i18n).
- Manter as chamadas REST a endpoints internos via
WCMAPI/FLUIGC.ajax— não introduzirfetch/$.ajaxdiretos. - Validar que nenhum novo uso de jQuery foi introduzido e que o código resultante está em ES6+.
- 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 internas via APIs públicas do Fluig.
Exemplo de Uso
Trecho ilustrativo (antes/depois), usando apenas APIs públicas:
// Antes (jQuery)
var $list = $('#MyWidget_' + instanceId + ' .items');
$list.on('click', '.item', function () {
$(this).addClass('active');
});
// Depois (ES6+)
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
- [ ] Sem
$(),$.ajax,$.proxyou outros usos de jQuery no código novo. - [ ] Sem
var— apenasconst/let. - [ ] Chamadas REST a endpoints internos via
WCMAPI/FLUIGC.ajax. - [ ] Comportamento original preservado (mesma lógica e efeitos).
- [ ] i18n preservada via
${i18n.getTranslation('...')}.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: totvs
- Source: totvs/fluig-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.