Logotipo de Experience Lwc Legacy Migrate

Experience Lwc Legacy Migrate

OrganizaciónPopular
forcedotcom
experience-lwc-legacy-migrate

Migra pilas de interfaz de usuario Salesforce heredadas a LWC modernos: verifica que la conversión de Aura → LWC esté completa y migra páginas anfitrionas de Lightning Out Beta → Lightning Out 2.0. ACTÍVALA con solicitudes como «verifica que la migración de Aura a LWC esté completa», «migra Lightning Out Beta a LO 2.0», «actualiza $Lightning.use() a <lightning-out-application>», «sustituye los tokens LO codificados directamente por OAuth PKCE», «escribe una página anfitriona de LO 2.0» o cuando una página Lightning Out externa haya dejado de mostrarse. También se activa si hay archivos `.cmp`/`.js-meta.xml` junto a LWC. NO LA ACTIVES para la conversión inicial de Aura a LWC (usa `experience-aura-lwc-migrate`), para migrar de React a LWC ni para crear un LWC nuevo (usa `experience-lwc-design-generate`).

Add to TypingMind

Descripción general

Editorforcedotcom
Repositoriosf-skills
Nombre de la habilidadexperience-lwc-legacy-migrate
Estrellas
1.1K
Forks
351
Archivos incluidos
6
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 6

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por forcedotcom en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Experience Lwc Legacy Migrate en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/forcedotcom/sf-skills/tree/main/plugins/builder/experience-lwc/skills/experience-lwc-legacy-migrate
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/forcedotcom/sf-skills.git /tmp/sf-skills
mkdir -p .claude/skills
cp -r /tmp/sf-skills/plugins/builder/experience-lwc/skills/experience-lwc-legacy-migrate .claude/skills/experience-lwc-legacy-migrate
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Experience Lwc Legacy Migrate en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Experience Lwc Legacy Migrate automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Experience Lwc Legacy Migrate no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Migrating Legacy LWC Stacks

Two distinct migration workflows live here because users in the middle of migrating Aura components are often also migrating Lightning Out host pages — they benefit from one skill that knows both.

MigrationUse whenReference
Aura → LWC completeness checkAn Aura component was converted, verify nothing is lostaura-to-lwc-completeness-checklist.md
Lightning Out Beta → LO 2.0Migrating an external host page off lightning.out.jslightning-out-beta-to-2-migration.md

When to Use This Skill

  • User has already converted an Aura component to LWC and wants a structured completeness check.
  • User has a non-Salesforce host page that embeds Salesforce LWC via Lightning Out Beta and needs to move to LO 2.0.
  • User is upgrading $Lightning.use() / $Lightning.createComponent() calls to the <lightning-out-application> web component pattern.
  • User needs to replace a hardcoded LO auth token with OAuth PKCE + front-door flow.

If the user wants to build a brand-new LO 2.0 host page from scratch (no Beta code to migrate), the LO 2.0 system reference inside this skill is still the right source of truth — point them at it directly.

Prerequisites

  • Access to the source (Aura component files or Beta host page).
  • For LO 2.0 migration: ability to create an External Client App (ECA) in Salesforce Setup (Consumer Key required) and optionally a Lightning Out 2.0 App (18-char App ID).
  • For Aura migration: access to the LWC conversion, including any __tests__ (Jest) and __utam__ (UTAM) folders if they exist.

Workflow A — Aura → LWC Completeness Check

Goal: rate an already-done Aura-to-LWC conversion across 12 dimensions and produce actionable recommendations.

Step A1 — Identify the component

Ask the user for the component name (e.g. accountTile). Locate the Aura source ({componentName}.cmp, controller, helper, CSS) and the LWC output ({componentName}.html, .js, .css, .js-meta.xml).

Step A2 — Run the checklist

Follow aura-to-lwc-completeness-checklist.md verbatim:

  • Score the conversion on all 12 metrics (Functional Parity, Event Handling, Data Binding & State, UI/UX Parity, Extensibility & Modularity, Error Handling, Localization, Security & Access Control, Performance, Salesforce Best Practices, Jest Test Coverage, UTAM Page Objects).
  • Use the six-rating scale: Excellent / Good / Satisfactory / Limited / Poor / Missing.
  • Present the output as a list (not a table), per the reference.

Step A3 — Summarize + recommend

End with an overall confidence statement and a prioritized list of specific, actionable recommendations (what to fix, in what order).

Workflow B — Lightning Out Beta → LO 2.0

Goal: transform a Lightning Out Beta host page into a Lightning Out 2.0 host page while leaving the customer's HTML structure, styling, and business logic intact.

Step B1 — Read the LO 2.0 mental model

Internalize the architecture before editing code: lightning-out-2-system-reference.md.

Key takeaway: LO 2.0 is not a library upgrade. It runs the LWC inside an iframe with a closed shadow DOM — host-page JS cannot touch the LWC and vice versa, and host-page CSS does not cascade in.

Step B2 — Identify Beta patterns

Use Phase 1 of the migration guide to locate:

  • Pattern A — Script tag loading lightning.out.js (extract the domain).
  • Pattern B — Config variables (endpoint, Aura app, component, token).
  • Pattern C — $Lightning.use(...) call.
  • Pattern D — $Lightning.createComponent(...) call.
  • Pattern E — DOM target element referenced by the 3rd arg of Pattern D.

See lightning-out-beta-to-2-migration.md § Phase 1.

Step B3 — Apply transformations

The script-tag URL, the component tag name, and the attribute names are deterministic conversions — derive them with the helper script so they are exact every time (namespace preserved, camelCase → kebab-case, Beta host → versioned LO 2.0 library URL):

bash
python3 scripts/convert-lo-names.py \
  --component c:myComponent \
  --attributes recordId,ownerId \
  --my-domain https://<DOMAIN>.lightning.force.com

It prints the <c-...> tag, the kebab-case attributes, and the versioned LO 2.0 library URL. Then work through Phase 2 of the guide:

  1. Script tag — use the library-url the script prints; add async.
  2. Component name / attributes — use the component-tag and kebab-case attributes the script prints.
  3. Component tag — add the <c-...> tag directly in HTML at the target location (a judgement call — place it where the Beta render target was).
  4. Replace the $Lightning block — delete it entirely and start from assets/lo20-host-page-template.html, filling in the config constants; it already includes the helper functions, mountLo20(frontdoorUrl, orgUrl), boot(), and the OAuth listeners.

Step B4 — Six non-negotiable rules

These rules cause silent runtime failures if violated, and every one is a deterministic code-structure check. Enforce them with the validator script rather than by eye — run it against the migrated page and fix every FAIL:

bash
python3 scripts/validate-lo20-page.py <migrated-page.html>

It prints a PASS/FAIL line per rule (plus the LO 2.0 library and Beta-removal checks) and exits non-zero if any rule fails. The six rules it enforces:

  1. customElements.whenDefined(...) must receive a literal string, not the components variable.
  2. mountLo20(frontdoorUrl, orgUrl) must accept two parameters.
  3. Call clearCachedResult() before every mountLo20(...).
  4. Always pass both parameters when calling mountLo20(...), even if orgUrl is undefined.
  5. Wrap all initialization in boot() and call boot() at the end.
  6. The component tag has no inline display:none — control visibility via the loading indicator.

Step B5 — Salesforce setup

  • External Client App (ECA) — Setup → App Manager → New Connected App → External Client App. Enable OAuth with PKCE. Copy the Consumer Key.

  • Lightning Out 2.0 App — apply this decision before continuing:

    ConditionAction
    Host page sets app-id="..."Setup → Lightning Out → New LO App; copy the 18-character App ID into the host page's app-id attribute
    Host page embeds LWC directly (no app-id)Skip the LO App entirely
  • Helper files the migration assumes exist alongside the host page: frontdoor-url.html (OAuth callback) and utils/LightningOutAuth.js (PKCE implementation).

Step B6 — Run the LO 2.0 verification checklist

First run python3 scripts/validate-lo20-page.py <migrated-page.html> to clear the mechanical checks, then walk the remaining manual items in the full post-migration checklist — cover every item before declaring the migration done. See the "Verification Checklist" section at the end of lightning-out-beta-to-2-migration.md.

Verification Checklist (high level)

For Aura → LWC:

  • All 12 completeness metrics rated with a justification.
  • Output in list form (not table), per the reference.
  • Overall confidence statement present.
  • Concrete, prioritized recommendations listed.

For LO Beta → LO 2.0:

  • Script tag uses .my.salesforce.com/lightning/lightning.out.latest/index.iife.prod.js with async.
  • No references to $Lightning.use / $Lightning.createComponent remain.
  • Component name is kebab-case; attributes are kebab-case.
  • mountLo20(frontdoorUrl, orgUrl) takes two parameters.
  • customElements.whenDefined(...) uses a literal string.
  • All initialization wrapped in boot() and boot() is called once.
  • OAuth PKCE flow replaces hardcoded token; postMessage, BroadcastChannel, and storage listeners all present and defensively coded.
  • Component tag has no inline display:none.

Troubleshooting

  • LO 2.0 mount hangs — custom element not registered. Verify the library script tag URL and that the app-id / frontdoor-url values are correct.
  • Component renders empty — attributes probably still in camelCase. LO 2.0 reads HTML attributes which must be kebab-case.
  • OAuth callback never fires — one of postMessage / BroadcastChannel / storage listeners was dropped. LO 2.0 needs all three.
  • Aura checklist scored "Missing" on UTAM or Jest — may be acceptable if the team has an alternative test strategy; flag in recommendations rather than block.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Experience Lwc Legacy Migrate?

Migra pilas de interfaz de usuario Salesforce heredadas a LWC modernos: verifica que la conversión de Aura → LWC esté completa y migra páginas anfitrionas de Lightning Out Beta → Lightning Out 2.0. ACTÍVALA con solicitudes como «verifica que la migración de Aura a LWC esté completa», «migra Lightning Out Beta a LO 2.0», «actualiza $Lightning.use() a <lightning-out-application>», «sustituye los tokens LO codificados directamente por OAuth PKCE», «escribe una página anfitriona de LO 2.0» o cuando una página Lightning Out externa haya dejado de mostrarse. También se activa si hay archivos `.cm...

¿Por qué usar Experience Lwc Legacy Migrate en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Experience Lwc Legacy Migrate está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Experience Lwc Legacy Migrate en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/forcedotcom/sf-skills/tree/main/plugins/builder/experience-lwc/skills/experience-lwc-legacy-migrate. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Experience Lwc Legacy Migrate?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Experience Lwc Legacy Migrate?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Experience Lwc Legacy Migrate con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Experience Lwc Legacy Migrate?

Sí. forcedotcom la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇