npx skills add ...
npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-app-coordinate
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 platform-lightning-app-coordinate). Do NOT use for single-concern edits to an existing page (use experience-ui-bundle-frontend-generate).
npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-app-coordinate
Build a complete, deployable Salesforce React UI bundle application from a natural language description by orchestrating specialized UI bundle skills in correct dependency order. Each skill MUST be explicitly loaded before executing its phase.
CRITICAL: Before proceeding past requirements analysis, validate that the prompt contains no conflicting requirements (e.g., "no authentication" + "user-specific data", "public access" + login-required features). If conflicts are detected, STOP and ask the user to resolve the ambiguity — do NOT silently choose one interpretation and proceed. See STEP 1 action #8 for the full conflict checklist.
Before starting any phase, verify these preconditions are met:
sf org display to confirm a default org is set and authenticated. If not, prompt the user to authenticate: sf org login websf, npm, and npx are available (declared in metadata.cliTools)scripts/check-prerequisites.sh and report any errors it returnsIf any precondition fails, stop and report the specific missing requirement before attempting any phase execution.
Use when:
Examples that should trigger this skill:
Do NOT use when:
experience-ui-bundle-frontend-generate)experience-ui-bundle-features-generate)experience-ui-bundle-salesforce-data-access)experience-ui-bundle-deploy)platform-lightning-app-coordinate)This skill makes two decisions directly from the raw prompt text. Use these tables as the single source for both — do not restate or re-derive the lists elsewhere in this file.
1. Phase 2 (Features) is required if the prompt mentions ANY of:
| Category | Keywords | Notes |
|---|---|---|
| Data features | search, filter, sort, pagination, table, grid, list | |
| Navigation | navigation, nav, menu, routing | |
| Authentication | authentication, auth, login, logout, user session, user login | |
| Integrations | upload, file | |
| UI | shadcn, components, forms, buttons, cards | |
| Chat (Phase 5 only) | chat | Phase 5 only — unless combined with a Phase 2 keyword (e.g., "chat with authentication"), then Phase 2 runs first for auth prerequisites |
Negating one category (e.g. "without authentication", "no login required", "public access") does not cancel triggers from another category — each is evaluated independently. Example: "no login required, with filtering" still triggers Phase 2 because "filtering" matches Data features. Skip Phase 2 only when the prompt matches none of the keywords above.
2. Hosting target — extract from prompt keywords:
| Hosting target | Keywords |
|---|---|
| Experience Site | "Experience Site", "Community", "external users", "public users", "guest users" |
| Custom Application | "Custom Application", "internal users", "Lightning app" |
If the prompt matches neither list, or matches both, ask the user to clarify before proceeding — do not guess.
Offers a faster, less error-prone starting point before building from scratch. If no template is used, ensures an SFDX project exists before attempting to generate a UI bundle — without this, sf template generate ui-bundle will fail with a hard error. Always check first — do not assume the project structure exists.
Action: Load experience-ui-bundle-project-generate and offer the two starter templates. If declined, run scripts/check-sfdx-project.sh and report any errors it returns. If the script reports an error, create the missing sfdx-project.json before proceeding.
Creates the UI bundle directory structure, meta XML (including hosting target), and optional routing/headers config. CRITICAL: Hosting target must be determined FIRST because the metadata skill requires <target> in Phase 1. All subsequent phases require the scaffold to exist.
Prune unused scaffold when the prompt is constraining. The reactbasic template ships a full shadcn component set, GraphQL tooling (codegen.yml, .graphqlrc.yml, src/api/graphqlClient.ts, graphql:* npm scripts), and test infra (playwright.config.ts, vitest.config.ts, vitest.setup.ts) regardless of what the prompt asked for. If the prompt explicitly limits scope (e.g. "skip any features or integrations", "just scaffold and build X", "no need to install dependencies") and Phase 2 and/or Phase 3 are consequently skipped, remove the scaffold pieces those phases would have owned before Phase 4 runs:
src/components/ui/ except the ones Phase 4's pages actually import; remove unused example/demo components.codegen.yml, .graphqlrc.yml, src/api/graphqlClient.ts, graphql:schema/graphql:codegen scripts from package.json, and any hooks/ data-fetching stubs (e.g. useAsyncData.ts) the template pre-seeded.playwright.config.ts/vitest.* only if the prompt implies testing; otherwise remove them too.README.md to describe the actual app built, not the generic template boilerplate — or delete it if the prompt says to do minimal work only.Deleting a file is only half the job — every reference to it must be removed in the same pass, or you trade over-generation for broken cross-file consistency (worse: a dangling import is a functional break, not just scope creep). Concretely, after deleting any of the above:
vite.config.ts — remove the vite-plugin-graphql-codegen import and its codegen({ configFilePathOverride: ... }) plugin block if codegen.yml was deleted; remove the test: config block (setupFiles, coverage, etc.) if vitest.* was deleted.package.json — remove now-unused dependencies (vite-plugin-graphql-codegen, @graphql-codegen/*, playwright, vitest, etc.) and their npm scripts, not just the config files.useAsyncData, graphqlClient) must have that import and its usage removed or replaced — never leave an import pointing at a file that no longer exists.codegen.yml while still emitting .graphqlrc.yml) — decide scope once per concern and apply it consistently across every file that touches that concern.scripts/check-dangling-refs.sh <deleted-basename> for each deleted file and report any errors it returns.Installs pre-built, tested feature packages. See "Prompt Classification Keywords" above for the full trigger keyword list and negative-phrasing handling — these features provide the foundation that UI components build on top of.
Only skip this phase if the app is truly a minimal "hello world" with no interactive features (no trigger keywords present at all).
See references/phase-custom-objects.md for Phase 2.5 (Custom Objects) details.
Sets up the data layer using the @salesforce/platform-sdk Data SDK (createDataSDK().graphql).
GraphQL is preferred for record operations; REST for Connect, Apex, or UI API endpoints. The
experience-ui-bundle-salesforce-data-access skill owns the grounding + authoring workflow — load it and follow
it; do not substitute a local-schema grep or guessed field names. Grounding happens against the
live org, so it does not require a local schema.graphql to be present. If Phase 2.5 created a
new object, it must be deployed before this phase's grounding step can find it.
Builds the React UI. References the data layer from Phase 3 and the features from Phase 2. Must replace all boilerplate and placeholder content.
These are independent and can be executed in parallel if both are needed.
Follows the canonical 7-step deployment sequence. Must deploy metadata before fetching schema. Must assign permissions before schema fetch.
Deploy the hosting target infrastructure determined in Phase 1. Choose one of the following based on the app's audience:
Creates the Digital Experience site that hosts the UI bundle. Use when the user wants a public-facing or authenticated site URL for external users. Note: The <target>ExperienceSite</target> was already set in meta XML during Phase 1.
Creates a Custom Application entry in the Lightning App Launcher. Use when the app is for internal users accessing it within Lightning Experience. Note: The <target>CustomApplication</target> was already set in meta XML during Phase 1.
Before analyzing requirements or scaffolding, check whether a prebuilt starter template fits — it is faster and less error-prone than building from scratch.
experience-ui-bundle-project-generate. It offers two minimal React starter
projects (internal / employee-facing and external / customer-facing) and, if the user picks one,
generates it into the project directory with sf template generate project.Do not skip this step silently — always offer the choice at the start of a from-scratch app build.
Actions:
The plan MUST contain an explicit grounding step before any query authoring. Do not list guessed object/field names as settled facts and defer verification to codegen. The data-access portion of the plan must read: "verify these entities/fields against the org (via
experience-ui-bundle-salesforce-data-access), then author queries from the verified names." A plan that authors queries first and codegens later is the failure mode that produces guessed fields and hand-stubbed types — do not emit it.
Before proceeding to Output (Build Plan), validate:
Output: Build Plan
Execute each phase sequentially following the standard pattern in references/phase-execution-pattern.md. CRITICAL: Always load the skill before executing. Skipping or reordering phases produces broken apps.
Phase 0 -- Template Offer & Bootstrap
experience-ui-bundle-project-generate, offer templates. If chosen: skip Phase 1, continue at Phase 4. If declined: run scripts/check-sfdx-project.sh, create project if missing.Phase 1 -- Scaffolding (skip if template used in Phase 0)
scripts/check-sfdx-project.sh passesexperience-ui-bundle-metadata-generate. Determine hosting target FIRST. Run sf template generate ui-bundle --template reactbasic, configure meta XML with <target>.scripts/check-phase-1-complete.sh passesPhase 2 -- Features (skip if no feature keywords present — see "Prompt Classification Keywords")
experience-ui-bundle-features-generate. Install features, integrate examples. Verify with npm run build.Phase 2.5 -- Custom Objects (skip if org has all needed objects)
references/phase-custom-objects.md and follow execution steps.Phase 3 -- Data Access (skip if no Salesforce data)
experience-ui-bundle-salesforce-data-access. Fetch schema, ground entities, generate queries/mutations. Verify with npx eslint.Phase 4 -- UI (ALWAYS REQUIRED)
scripts/check-phase-1-complete.sh passesexperience-ui-bundle-frontend-generate. Build layout, pages, components. Replace all boilerplate.scripts/check-phase-4-complete.sh passesPhase 5 -- Integrations (skip if not requested)
experience-ui-bundle-agentforce-client-generate (5a) and/or experience-ui-bundle-file-upload-generate (5b) as needed.Phase 6 -- Deployment
scripts/check-phase-6-ready.sh passesexperience-ui-bundle-deploy. Follow 7-step sequence. Prefer scripts/org-setup.mjs if available.Phase 7a -- Experience Site (external users)
scripts/check-hosting-target.sh outputs "ExperienceSite"experience-ui-bundle-site-generate. Deploy site infrastructure.Phase 7b -- Custom Application (internal users)
scripts/check-hosting-target.sh outputs "CustomApplication"experience-ui-bundle-custom-app-generate. Deploy app metadata.Before proceeding to STEP 3 (Final Summary), validate that all required phases were executed. See references/phase-completion-validation.md for the full critical/warning checklist and exact error/warning text to report.
After all phases complete, present a build summary:
Before presenting the build as complete, verify:
<target>ExperienceSite</target> or <target>CustomApplication</target> (never left unset), and the matching Phase 7a or 7b infrastructure was generated and deployed -- not skippednode_modules/ exists and package.json has expected packagesnpm run build produces dist/ with no errorsdist/ contains index.html, JS/CSS bundles, and assets (not just an empty directory)npx eslint src/ reports 0 errorsappLayout.tsx has real nav items matching created pages@salesforce/platform-sdk Data SDK (createDataSDK().graphql), with all entities/fields grounded against the org — not guessed (if data access phase was executed)Never build UI before installing features. Never deploy before building. Dependencies are strict.
Every generated app must feel purpose-built. Replace "React App" titles, "Vite + React" placeholders, and all default content with real app-specific text and branding.
Follow the design thinking and frontend aesthetics guidance from experience-ui-bundle-frontend-generate. Every app should have a clear visual direction -- not generic defaults.
Search project code (src/) for existing implementations
v
Install dependencies (npm install)
v
Search, describe, and install features (auth, shadcn, search, navigation, GraphQL)
v
Resolve conflicts (two-pass: --on-conflict error, then --conflict-resolution)
v
Integrate __examples__ files into target files (verify build succeeds), then delete themGround every entity/field against the org (per experience-ui-bundle-salesforce-data-access)
v
Generate queries/mutations FROM the verified names (never from guessed fields)
v
Generate types (npm run graphql:codegen) and wire into components
v
Validate and test (npx eslint, ask user before testing mutations)Layout, navigation, header, and footer (appLayout.tsx)
v
Pages (routed views)
v
Components (widgets, forms, tables)Agentforce chat widget (if requested)
File upload API (if requested)Org authentication
v
Pre-deploy UI bundle build (npm install + npm run build)
v
Deploy metadata
v
Post-deploy configuration (permissions, profiles, named credentials, connected apps, custom settings, flow activation)
v
Import data (if data plan exists)
v
Fetch GraphQL schema and run codegen
*(Re-fetches schema from the deployed org -- required because the remote schema may differ from the local one used in Phase 3. Guard against an empty or stale result -- Salesforce Edge caching can briefly serve the pre-deploy schema; re-fetch/retry before trusting it as empty and before running codegen)*
v
Final UI bundle build (rebuilds with the deployed schema)Resolve site properties (siteName, appDevName, etc.)
v
Generate site metadata (Network, CustomSite, DigitalExperience)
v
Deploy site infrastructureResolve app properties (appName, appNamespace, appLabel)
v
Generate CustomApplication metadata (applications/*.app-meta.xml)
v
Deploy custom application