Communitygithub.com

forcedotcom/deploying-ui-bundle

Debe activarse cuando el proyecto contiene un directorio uiBundles/*/src/ o sfdx-project.json y la tarea implica desplegar, enviar a una org o configuración posterior al despliegue. Utiliza esta skill al desplegar una aplicación de paquete UI en una org de Salesforce. Cubre la secuencia completa de despliegue: autenticación de org, compilación previa al despliegue, despliegue de metadatos, asignación de conjuntos de permisos, importación de datos, obtención del esquema GraphQL y generación de código. Actívala cuando existan archivos como *.uibundle-meta.xml o sfdx-project.json y el usuario mencione tareas de despliegue, envío, configuración de org o posteriores al despliegue.

¿Qué es deploying-ui-bundle?

Esta skill está diseñada para desarrolladores que trabajan con aplicaciones de paquete UI en Salesforce, automatizando todo el proceso de despliegue desde la autenticación hasta la generación de código. Es especialmente útil cuando el proyecto contiene un directorio uiBundles/*/src/ o un archivo sfdx-project.json, y el usuario necesita desplegar, enviar cambios a una org o ejecutar configuraciones posteriores al despliegue. La skill orquesta los siguientes pasos: autenticación en la org de Salesforce, compilación previa al despliegue (como la instalación de dependencias y la construcción del paquete), despliegue de metadatos (incluyendo archivos .uibundle-meta.xml), asignación de conjuntos de permisos personalizados, importación de datos de muestra o configuración desde archivos CSV, obtención del esquema GraphQL desde Salesforce mediante el endpoint de GraphQL Apex, y ejecución de codegen para generar tipos y consultas de Apollo. Está optimizada para entornos que utilizan Salesforce DX (sfdx-project.json) y herramientas como Salesforce CLI, y se activa automáticamente cuando se detectan tareas relacionadas con despliegue, push o configuración de org en el contexto del usuario. Al centralizar estos pasos, reduce errores manuales y acelera significativamente los despliegues repetitivos.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/forcedotcom/afv-library/tree/main/skills/deploying-ui-bundle

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace deploying-ui-bundle?

DEBE activarse cuando el proyecto contiene un directorio uiBundles/*/src/ o sfdx-project.json y la tarea implica desplegar, enviar a una org o configuración posterior al despliegue. Utiliza esta skill al desplegar una aplicación de paquete UI en una org de Salesforce. Cubre la secuencia completa de despliegue: autenticación de org, compilación previa al despliegue, despliegue de metadatos, asignación de conjuntos de permisos, importación de datos, obtención del esquema GraphQL y generación de código. Actívala cuando existan archivos como *.uibundle-meta.xml o sfdx-project.json y el usuario mencione tareas de despliegue, envío, configuración de org o posteriores al despliegue.

Descripción General

Este flujo de trabajo despliega una aplicación de paquete UI en una org de Salesforce. Incluye los siguientes pasos:

  1. Autenticación en la org de Salesforce: Verifica que el usuario tenga una sesión activa con sf org login o sfdx auth:web:login.
  2. Compilación previa al despliegue: Ejecuta npm install o yarn install en el directorio uiBundles/*/src/ y luego construye el paquete con npm run build o el comando correspondiente.
  3. Despliegue de metadatos: Utiliza sf project deploy start o sfdx force:source:deploy para desplegar los archivos del paquete UI, incluyendo *.uibundle-meta.xml.
  4. Asignación de conjuntos de permisos: Asigna los conjuntos de permisos definidos en los metadatos (por ejemplo, PermissionSet o CustomPermission) a los usuarios especificados.
  5. Importación de datos: Ejecuta sf data import tree o sfdx force:data:tree:import para importar datos desde archivos CSV ubicados en data/.
  6. Obtención del esquema GraphQL: Llama al endpoint de GraphQL de Salesforce mediante sf data query o sfdx force:data:soql:query para obtener el esquema personalizado.
  7. Generación de código: Ejecuta herramientas de codegen (por ejemplo, apollo codegen:generate o graphql-codegen) para generar tipos y consultas de Apollo basadas en el esquema obtenido.

Activación de la Skill

Esta skill debe activarse cuando:

  • Existe un directorio uiBundles/*/src/ en el proyecto.
  • Existe un archivo sfdx-project.json.
  • El usuario menciona uno de los siguientes términos: "desplegar", "deploy", "push", "org setup", "post-deploy", "configurar org".

Requisitos

  • Salesforce CLI instalado y configurado.
  • Node.js y npm o yarn instalados.
  • Acceso a la org de Salesforce con permisos adecuados.
  • Archivos de configuración como sfdx-project.json y *.uibundle-meta.xml presentes.

Ejemplo de Uso

# Autenticarse en la org
sf org login web -a miOrgAlias

# Desplegar el paquete UI
sf project deploy start -d uiBundles/miPaquete -o miOrgAlias

# Asignar conjunto de permisos
sf org assign permset -n MiPermiso -o miOrgAlias

# Importar datos
sf data import tree -f data/muestras/oportunidades.csv -o miOrgAlias

# Obtener esquema GraphQL
sf data query -q "SELECT QualifiedApiName, DeveloperName FROM FieldDefinition WHERE EntityDefinition.DeveloperName = 'Opportunity'" -o miOrgAlias > esquema.json

# Generar código
graphql-codegen --config codegen.yml

Solución de Problemas

  • Error de autenticación: Asegúrate de que el alias de la org sea correcto y que tengas una sesión activa. Usa sf org list para verificar.
  • Fallo en la compilación: Verifica que Node.js esté instalado y que todos los paquetes necesarios estén en package.json. Ejecuta npm install manualmente para depurar.
  • Despliegue de metadatos fallido: Revisa los archivos XML en uiBundles/ para errores de sintaxis. Usa sf project deploy validate para probar sin cambios.
  • Importación de datos sin éxito: Asegúrate de que los archivos CSV estén en el directorio data/ y que sigan el formato de árbol de datos de Salesforce.

Notas Adicionales

  • Si la org ya tiene los permisos configurados, el paso de asignación puede omitirse.
  • La obtención del esquema GraphQL y la generación de código son opcionales; solo se ejecutan si hay archivos de configuración relevantes (por ejemplo, codegen.yml o apollo.config.js).
  • Para despliegues incrementales, usa sf project deploy start -d uiBundles/miPaquete -o miOrgAlias --ignore-conflicts.

Referencias


Skill mantenida por forcedotcom.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

forcedotcom/building-ui-bundle-app

MUST activate when the user wants to build, create, or generate a React application, React app, web application, single-page application (SPA), or frontend application — even if no project files exist yet. MUST also activate when the project contains a uiBundles/*/src/ directory or sfdx-project.json and the prompt says create, build, construct, or generate a new app, site, or page from scratch — even if the prompt also describes visual styling. MUST also activate when the task spans more than one ui-bundle skill. Use this skill when building a complete app end-to-end. Do NOT use for Lightning Experience apps with custom objects (use generating-lightning-app). Do NOT use for single-concern edits to an existing page (use building-ui-bundle-frontend).

forcedotcom/building-ui-bundle-frontend

MUST activate before editing ANY file under uiBundles/*/src/ for visual or UI changes to an EXISTING app — pages, components, sections, layout, styling, colors, fonts, navigation, animations, or any look-and-feel change. Use this skill when modifying pages, components, layout, styling, or navigation in an existing UI bundle app. Activate when the project contains appLayout.tsx, routes.tsx, src/pages/, src/components/, or global.css. This skill contains critical project-specific conventions (appLayout.tsx shell, shadcn/ui components, Tailwind CSS, Salesforce base-path routing, module restrictions) that override general knowledge. Without this skill, generated code will use wrong imports, break routing, or ignore project structure. Do NOT use when creating a new app from scratch (use building-ui-bundle-app instead).

forcedotcom/creating-b2b-commerce-store

Interactive workflow to create Commerce B2B Stores and retrieve storefront metadata. Use when users want to: create B2B Commerce stores, build Commerce storefronts, set up B2B stores from Vibes, retrieve Commerce metadata, deploy Commerce experiences, work with DigitalExperienceBundle for Commerce.

forcedotcom/developing-agentforce

Build, modify, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, or asks about .agent files or aiAuthoringBundle metadata; changes agent behavior, responses, or conversation logic; designs agent actions, tools, subagents, or flow control; writes or reviews an Agent Spec; previews, debugs, deploys, publishes, or tests agents; uses Agent Script CLI commands (sf agent generate/preview/publish/test). DO NOT TRIGGER when: Apex development, Flow building, Prompt Template authoring, Experience Cloud configuration, or general Salesforce CLI tasks unrelated to Agent Script.

forcedotcom/generating-apex

Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.

forcedotcom/generating-apex-test

Generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking strategies, assertion best practices, and disciplined test-fix loops. Use this skill when creating new Apex test classes, improving test coverage, debugging and fixing failing Apex tests, running test execution and coverage analysis, or implementing testing patterns for triggers, services, controllers, batch jobs, queueables, and integrations. Triggers on *Test.cls, *_Test.cls files, sf apex run test workflows, coverage reports, test-fix loops. Do NOT trigger for production Apex code (use generating-apex) or Jest/LWC tests.

forcedotcom/generating-custom-application

Use this skill when users need to create or configure tab-based Salesforce Custom Applications with navigation, branding, and action overrides. Trigger when users mention custom apps, application metadata, app navigation, or organizing tabs into applications. Use when users want to create app containers for tabs and pages. Do NOT use when the goal is hosting a React UI bundle in the App Launcher — use generating-ui-bundle-custom-app for that case.

forcedotcom/generating-custom-field

Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, or field metadata. Also use when users encounter field deployment errors, especially around Roll-up Summary format, Master-Detail constraints, or formula issues. Always use this skill for any custom field metadata work, field generation, or field troubleshooting.

forcedotcom/generating-custom-lightning-type

Use this skill when users need to create Custom Lightning Types (CLTs) for Einstein Agent actions or structured input/output schemas. Trigger when users mention CLT, Custom Lightning Types, Custom Lightning Types (CLTs) with widget/mosaic/fragment rendition/renderer, JSON schemas for agents, type definitions, lightning__objectType, or editor/renderer configurations. When widget renditions are requested, you MUST first read the widget-rendition.md reference file in this skill's references/ directory and follow its complete workflow. This is complex - always use this skill for CLT work.

forcedotcom/generating-custom-object

Use this skill when users need to create, generate, or validate Salesforce Custom Object metadata. Trigger when users mention custom objects, creating objects, object metadata, .object files, sharing models, name fields, or validation rules on objects. Also use when users say things like "create a custom object", "generate object metadata", "set up an object for...", or when they're troubleshooting object deployment errors especially around sharing models and Master-Detail relationships. Always use this skill for any custom object metadata work.

forcedotcom/generating-custom-tab

Use this skill when users need to create or configure Salesforce Custom Tabs. Trigger when users mention tabs, navigation tabs, object tabs, web tabs, Visualforce tabs, Lightning component tabs, app page tabs, or tab configuration. Also use when users want to add navigation to custom objects, create tabs for external content, or set up Lightning page tabs. Always use this skill for any custom tab work.

forcedotcom/generating-flexipage

Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like 'create a Lightning page', 'add a component to a page', 'customize the record page', 'generate a FlexiPage', or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention 'page' in the context of Salesforce.

forcedotcom/generating-flow

Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as "when a record is created", "trigger daily at", "send an email when", "update the field when", "automate", "workflow", or "flow XML/metadata". This is the only skill for Salesforce Flow generation.

forcedotcom/generating-lightning-app

Build complete Salesforce Lightning Experience applications from natural language descriptions. Use this skill when a user requests a "complete app", "Lightning app", "business solution", "management system", or describes a scenario requiring multiple interconnected Salesforce components (objects, fields, pages, tabs, security). Orchestrates all required metadata types in proper dependency order to produce a deployable application.

forcedotcom/generating-list-view

Use this skill when users need to create, generate, or validate Salesforce List View metadata. Trigger when users mention list views, filtered record lists, creating views, setting up record columns, filtering records by criteria, or ask about list view visibility. Also use when users say things like "I need a view that shows...", "filter records by...", "create a list view for...", or when they're working with ListView XML files and need validation or troubleshooting.

forcedotcom/generating-permission-set

Generates correct, deployable Salesforce permission set metadata (PermissionSet XML) with object, field, user, and app permissions. Use this skill when creating or editing permission set metadata, object permissions, field-level security (FLS), tab visibility, or deploying permission sets.

forcedotcom/generating-ui-bundle-features

MUST activate when the project contains a uiBundles/*/src/ directory and the user wants to add authentication or search to their app. Use this skill when adding authentication or search to a UI bundle app. Only covers two features: authentication (login, logout, protected routes, session management) and search (global search across pages and content). Always use this skill for these two features instead of building from scratch.

forcedotcom/generating-ui-bundle-metadata

MUST activate when the project contains a uiBundles/*/src/ directory and scaffolding a new UI bundle or app, or when editing ui-bundle.json, .uibundle-meta.xml, or CSP trusted site files. Use this skill when scaffolding with sf template generate ui-bundle, configuring ui-bundle.json (routing, headers, outputDir), or registering CSP Trusted Sites. Activate when the task involves files matching *.uibundle-meta.xml, ui-bundle.json, or cspTrustedSites/*.cspTrustedSite-meta.xml.

forcedotcom/generating-ui-bundle-site

MUST activate when the project contains a uiBundles/*/src/ directory and the task involves creating or configuring site infrastructure. Use this skill when creating or configuring a Salesforce Digital Experience Site for hosting a UI bundle. Activate when files matching digitalExperiences/, networks/, customSite/, or DigitalExperienceBundle exist and need modification, or when the user wants to publish, host, or configure guest access for their app.

forcedotcom/generating-validation-rule

Use this skill when users need to create, modify, or validate Salesforce Validation Rules. Trigger when users mention validation rules, field validation, data quality rules, formula validation, error messages, or validation logic. Also use when users encounter validation errors, need to update formulas, or want to enforce business rules at the data layer. Always use this skill for any validation rule work.

Skills relacionados