К основному содержанию
скилл CX Codex

experience-lwc-widget-migrate — скилл для Claude Code: перенос LWC

Скилл experience-lwc-widget-migrate для Claude Code переносит существующий Lightning Web Component (LWC) в декларативный виджет HXL / Agentforce. Запускается по запросу переделать конкретный LWC в виджет.

Apache-2.0 126 установок ★ 1 183 обновлён 2026-10-23

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add forcedotcom/sf-skills --skill experience-lwc-widget-migrate -a claude-code
Открыть на GitHub

Что делает experience-lwc-widget-migrate

Скилл оценивает, можно ли заменить конкретный LWC декларативным виджетом, затем передаёт форму полей генератору и связывает виджет с рендерером Lightning Type. Если перенос не подходит или оценка требует проверки человеком, процесс останавливается. Для адаптации вместо точного переноса скилл фиксирует потерянные взаимодействия.

Генератору передаются поля и их типы, вложенные структуры, порядок отображения и поддерживаемые действия. Для создания пакета нужны доступные discoverUiComponents и getUiComponentSchemas через metadata-experts MCP или средства discovery; без них скилл остановится до создания файлов. Завершённая миграция включает пакет и привязку рендерера, а статическая проверка не подтверждает работу в развёрнутой среде.

Какие задачи решает

  • перенести существующий LWC в декларативный виджет
  • определить, подходит ли назначение LWC для виджета
  • связать сгенерированный виджет с рендерером Lightning Type
  • зафиксировать потерянные действия и изменения контракта данных

Примеры запросов агенту

  • Перенеси компонент accountSummary в декларативный виджет Agentforce.
  • Преобразуй существующий LWC orderDetails в виджет и подключи его к Lightning Type.
  • Оцени caseActions и создай виджет, сохранив доступные действия.

Как установить experience-lwc-widget-migrate

1Через Skills CLI (Vercel)

npx skills add forcedotcom/sf-skills --skill experience-lwc-widget-migrate -a claude-code

2Вручную: положить файлы

~/.claude/skills/experience-lwc-widget-migrate/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/experience-lwc-widget-migrate/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об experience-lwc-widget-migrate

Как установить experience-lwc-widget-migrate в Claude Code?

Выполни npx skills add forcedotcom/sf-skills --skill experience-lwc-widget-migrate -a claude-code. Файл скилла находится по пути ~/.claude/skills/experience-lwc-widget-migrate/SKILL.md.

Что делает experience-lwc-widget-migrate?

Он оценивает перенос конкретного LWC, формирует структуру полей для виджета и связывает пакет с рендерером Lightning Type. Если назначение нельзя перенести или интеграцию не удаётся установить, скилл сообщает об остановке.

Что нужно для работы experience-lwc-widget-migrate?

Для генерации пакета нужны доступные вызовы discoverUiComponents и getUiComponentSchemas через metadata-experts MCP или discovery. Также требуется установить связанные скиллы генерации виджета и координации Lightning Type.

Исходный текст

SKILL.md · Apache-2.0
---
name: experience-lwc-widget-migrate
description: "Convert a specific existing Lightning web component (LWC) into a declarative HXL / Agentforce widget, end to end. Gates on experience-lwc-widget-assess and stops when a widget cannot serve the LWC's purpose; otherwise hands the derived field shape to platform-widget-generate and wires the widget as the Lightning Type renderer. TRIGGER when: the user wants to convert, migrate, port, rebuild, or turn a named LWC into a widget or declarative Agentforce widget, or asks for a widget built from an existing LWC component. DO NOT TRIGGER when: the user only wants to know whether an LWC can become a widget (use experience-lwc-widget-assess), or wants a widget for a data shape, entity, or Lightning Type with no existing LWC (use platform-widget-generate or platform-lightning-type-widget-coordinate)."
metadata:
  version: "1.0"
  domains: ["Experience", "Platform", "Agentforce"]
  minApiVersion: "68.0"
  relatedSkills:
    - "experience-lwc-widget-assess"
    - "platform-widget-generate"
    - "platform-custom-lightning-type-generate"
    - "platform-lightning-type-widget-coordinate"
  mcpTools:
    metadata-experts:
      tools: ["execute_metadata_action"]
      semver: ">=1.0.0"
---

# Migrate an LWC to a widget

Use the LWC to recover the **user's goal and data contract**, then build the closest useful widget. A widget is its own declarative artifact. `platform-widget-generate` authors it; a Lightning Type renderer may need separate wiring to make it reachable. This skill owns the comparison, handoff, integration check, and honest final status.

## 1. Decide whether to proceed

Read and apply `experience-lwc-widget-assess` to the component, its action output, and any existing Lightning Type/renderer. Preserve its verdict and the key findings from its report (blockers, contract change, lost interactions) in your report; do not write the assessment's own `verdict.json` or `report.md` files. Stop on `pointless`, `blocked`, `review`, or `needsHumanReview: true`. Proceed on `viable` only when the intended change is explicit:

- For `port-declarative`, preserve the current visible fields and actions.
- For `needs-IA-contract-change`, identify the exact bounded output fields or pre-shaped values required. A widget against a **proposed** contract is a draft until the action returns that contract; do not call it working.
- For `not-portable` with a viable adaptation, describe the replacement UX and each lost interaction. Call it a rebuild, not a faithful port.

## 2. Derive the generator handoff

Trace each value the proposed widget displays to the actual or proposed action output. Before authoring, verify the action contract rather than relying only on an assessment prompt's description. Pass `platform-widget-generate` an ordered field shape (`name`, `type`, `required`), nested/list item fields, the intended tile role of each visible element, and supported terminal actions. Preserve render order and field paths. Use its discovery results for tile definitions and attributes, its documented formula catalog for expressions, and its instructions for schema types and bundle layout; do not maintain a second catalog here. A formula can cover supported scalar/date/regex operations, while collection restructuring may require pre-shaped output.

If an LWC fixture or action example contains sample data, it can help infer the shape; sample data is optional and is **not** a documented generator input or a substitute for the action contract. Do not invent sample fields. For an action such as `sendMessage`, verify that the required context reaches the agent and that the agent has a way to perform the requested work. Do not assume a widget input form can submit collected values without a discovered, validated mechanism.

## 3. Generate and connect

Load `platform-widget-generate` and follow its mandatory live `discoverUiComponents` and `getUiComponentSchemas` calls. If the `metadata-experts` MCP or discovery is unavailable, stop before authoring a bundle; report the completed assessment and proposed field shape. The generator owns its three widget files and self-validation. Do not copy its UEM syntax or validation checklist into this skill.

For an Agentforce renderer migration, also establish the Lightning Type that receives the action output. A bundle alone is not connected to the action:

- **Existing compatible Lightning Type:** inspect its schema and current `renderer.json`. After generation, read `platform-custom-lightning-type-generate/references/widget-rendition.md`, wire the widget with field mappings, and follow `platform-lightning-type-widget-coordinate`'s renderer checks. If the existing renderer points to another widget or LWC, surface the replacement/merge decision before changing it.
- **No compatible Lightning Type:** resolve the action's output class and a Lightning Type name from the project or the user's request. For the coordinator's supported Apex-backed route, use `platform-lightning-type-widget-coordinate` with that type and the assessed output shape; let it own bundle generation and renderer wiring. That coordinator does not cover every type. If the output/type route cannot be established, stop and identify the missing integration step. Do not claim a complete migration.

If the user requested a **bundle only**, report it explicitly as an unconnected bundle. Otherwise, completion requires both the bundle and renderer wiring.

## 4. Check the result

Use the generator's bundle self-validation. Then compare the result to the assessed candidate: every retained visible field has a binding to the real/proposed payload; list item paths and supported actions match; omitted behavior and contract changes are stated; and, for a renderer migration, the Lightning Type points to this widget with matching attributes. Static checks establish structure and mapping, not deployed runtime behavior. Report assessment, created paths, validation results, and one of: `migrated and wired`, `bundle only`, `draft pending IA contract`, or `stopped`, with the reason.

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Похожие скиллы

Каталог скиллов SKILL.md →
flutter-add-widget-test flutter Скилл flutter-add-widget-test для Claude Code помогает писать тесты Flutter-виджетов: проверять отображение, состояние и реакцию на действия. Включается при проверке конкретного виджета. CX Codex +1 42 900установок flutter-add-widget-preview flutter Скилл flutter-add-widget-preview для Claude Code обучает агента создавать интерактивные превью виджетов Flutter через package:flutter/widget_previews.dart. Превью позволяют верстать UI изолированно, без сборки всего приложения. CX Codex +1 40 000установок customware-support-widget customware-ai Скилл customware-support-widget ставит виджет поддержки Customware в клиентский React Router SPA: скрипт в root.tsx, элемент <customware-chat> в нужном маршруте или лейауте. CX Codex +1 2 600установок sap-sac-custom-widget secondsky Скилл sap-sac-custom-widget для Claude Code и других агентов собирает кастомные виджеты SAP Analytics Cloud: Web Components, привязка данных, панели стилей — там, где стандартных визуализаций нет. CX Codex +1 789установок isolet-widget-isolation reason-machines Скилл isolet-widget-isolation для Claude Code и ещё пяти платформ учит агента упаковывать компоненты в самодостаточные виджеты через isolet-js. Компонент получает shadow DOM, область видимости стилей и сборку в IIFE, ESM или CommonJS. CX Codex +1 481установок ui-widget-developer microsoft Скилл ui-widget-developer для Claude Code помогает создавать MCP-серверы и интерактивные виджеты для Copilot Chat. Он охватывает создание нового сервера и добавление виджетов к существующему. CX Codex +1 ★ 3 232звёзд репо

Из того же набора232

Весь набор →
service-agentforce-human-escalation-configure Скилл service-agentforce-human-escalation-configure для Claude Code настраивает передачу диалога Agentforce оператору через Omni-Channel и проверяет результат. Настраивает ручную эскалацию с очередью и порогом сбоев. CX Codex +1 135установок service-omni-command-center-analyze Скилл service-omni-command-center-analyze для Claude Code анализирует, выбрать ли Command Center V2 или классический Omni Supervisor, и рекомендует следующий шаг без изменений в организации. CX Codex +1 132установок experience-lwc-widget-assess Скилл experience-lwc-widget-assess для Claude Code оценивает, можно ли представить Lightning Web Component как декларативный виджет HXL. CX Codex +1 129установок life-sciences-fieldsalesrep-coordinate Скилл life-sciences-fieldsalesrep-coordinate запускает все пять этапов настройки Life Sciences Cloud для торгового представителя подряд, с проверкой перед каждым следующим шагом. CX Codex +1 128установок education-cloud-academic-calendar-generate Скилл education-cloud-academic-calendar-generate для Claude Code создаёт в Education Cloud учебный год, семестры и другие периоды, а также сессии по датам из текста или документа. Настраивает календарь учебного заведения. CX Codex +1 124установок life-sciences-kam-coordinate Скилл life-sciences-kam-coordinate для Claude Code пошагово настраивает Life Sciences Cloud в выбранной Salesforce org для роли Key Account Management (KAM). CX Codex +1 123установок education-cloud-course-catalog-migrate Скилл education-cloud-course-catalog-migrate переносит каталог курсов из CSV, PDF или сайта в Education Cloud: парсит данные, создаёт объекты Learning и LearningCourse через REST API, связывает лекции с лабораторными. CX Codex +1 117установок service-omni-queue-deploy Скилл service-omni-queue-deploy для Claude Code проверяет или создаёт очередь в Salesforce для маршрутизируемых объектов через привязку QueueSobject. Задача запускается в CI или агентом при настройке омниканальной маршрутизации. CX Codex +1 116установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой