npx skills add ...
npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-features-generate
MUST activate when the project contains a uiBundles/*/src/ directory and the user wants to add a pre-built feature — such as authentication (login, logout, protected routes, session management) or search (global search across pages and content) — instead of building it from scratch. Always run list first to see the current feature catalog, since it can include more than authentication and search. Always use this skill for installing pre-built features rather than hand-building them. DO NOT TRIGGER for Agentforce conversational client or file-upload features — use experience-ui-bundle-agentforce-client-generate and experience-ui-bundle-file-upload-generate respectively.
npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-features-generate
Always check for an existing feature before building something from scratch. The features CLI installs pre-built, tested packages into Salesforce UI bundles — from foundational UI libraries (shadcn/ui) to full-stack capabilities. Authentication and search are the most commonly used features today; run list --verbose for the full current catalog, since it can grow over time.
Ownership note: Agentforce AI conversation clients and file-upload are owned by separate skills (
experience-ui-bundle-agentforce-client-generate,experience-ui-bundle-file-upload-generate). If the catalog also lists an Agentforce or file-upload entry, do not install it from both places — confirm with the user which delivery path they want, and never install the same capability twice in one bundle.
Package name:
@salesforce/ui-bundle-featuresis the canonical package name. Some older templates/samples still reference the deprecated@salesforce/ui-bundle-features-experimentalname — never use the-experimentalsuffix. If a command fails to resolve, confirm the published version withnpm view @salesforce/ui-bundle-features versionbefore assuming the package name is wrong.
Confirm this is a React UI bundle — this CLI copies into src/features/ and expects npm run build to work. Non-React bundles are not supported and will fail late in the install.
Run scripts/verify-react-bundle.sh. If it exits non-zero, stop — the bundle is not React-based and this skill cannot proceed.
Search project code first — check src/ for existing implementations before installing anything. Scope searches to src/ to avoid matching node_modules/ or dist/.
Search available features — use npx @salesforce/ui-bundle-features list with --search <query> to filter by keyword. Use --verbose for full descriptions.
Describe a feature — MANDATORY before wiring. Run npx @salesforce/ui-bundle-features describe <feature> and read the feature's README via npm view <package> readme (using the Package: name from that output) before wiring it. The README is the contract: it tells you how the feature is meant to be wired — including any drop-in entry component and the file each integration example belongs in. Cross-check against the copied-in source under describe's Copy Operations destination — that source (and its JSDoc) is the version-matched truth for what's actually installed. Do not wire from assumptions about file names or component APIs. Skipping this is the most common reason a feature installs successfully but never actually runs.
Install — use npx @salesforce/ui-bundle-features install <feature> --ui-bundle-dir <name>. Key options:
--dry-run to preview changes--yes for non-interactive mode (skips conflicts)--on-conflict error to detect conflicts, then --conflict-resolution <file> to resolve themInstall features before doing custom frontend/layout work in this bundle — features may rewrite appLayout.tsx/routes.tsx, and installing after hand-built layout changes risks collisions.
If no matching feature is found, ask the user before building a custom implementation — a relevant feature may exist under a different name.
In non-interactive environments, use the two-pass approach:
--on-conflict error to detect conflicts without applying them.references/conflict-resolution-schema.json for the allowed keys and enum values.<ui-bundle-dir>/conflict-resolution.json (path is relative to the UI bundle directory being installed into, not the repo root). Key it by the exact paths the CLI printed as conflicts in pass 1, verbatim:
skip — the CLI will not overwrite a file you didn't explicitly mark overwrite.--conflict-resolution <path-to-that-file>.Features may include example files under an __examples__/ directory (plural) showing integration patterns. These are often full, working pages with concrete names (e.g. AccountSearch.tsx), not bare placeholder templates. For each:
describe output).If either check fails, do NOT delete __examples__/ — the integration is incomplete. Fix the integration first, then re-run the verification.
When a feature ships an integration point, the UI must use it rather than a parallel hand-rolled version. For features that ship an entry component, mount it — e.g. for search, mount the feature's <Search> on the search-results page; do not author a bespoke results page that queries data directly (a custom SearchResults.tsx against seed data or a raw GraphQL call bypasses the installed, tested feature, so the deployed sObject/CMS search never runs). The only exception is when the user explicitly opts out and asks for a custom one — confirm that intent, don't infer it.
Some copy paths use <descriptive-name> placeholders (e.g., <desired-page-with-search-input>) that the CLI does not resolve. After installation, rename or relocate these files to the intended target, or integrate their patterns into an existing file. This is separate from the __examples__/ convention above — a single copy path can use either mechanism.
Installing the authentication feature only copies files — it does not configure the org. Before telling the user auth is done, flag that these org-side steps still need to happen (outside this skill's scope, but required for the feature to actually work):
<sfdxRoot> After Every InstallThe CLI may copy files under a literal <sfdxRoot> folder — an unresolved placeholder for this project's Salesforce DX metadata root (from sfdx-project.json's packageDirectories[].path, e.g. force-app/main/default). Files left there are undeployable.
After every install:
If found, move each file to <metadata-root>/<same-relative-subpath> (keep -meta.xml sidecars attached) and delete the emptied placeholder dir(s).
Verification:
find uiBundles/<AppName> -type d -regex '.*/<[^/]+>$' — output must be empty before proceeding.