building-ui-bundle-frontend
forcedotcom/sf-skills
Modify existing UI bundle apps with project-specific conventions for pages, components, styling, and navigation.
What is building-ui-bundle-frontend?
Activate this skill before editing any file in uiBundles/*/src/ for visual or UI changes to an existing app. It enforces critical project conventions including appLayout.tsx shell structure, shadcn/ui components, Tailwind CSS, Salesforce base-path routing, and module restrictions that override general knowledge. Do not use when creating a new app from scratch.
- Enforce appLayout.tsx as the source of truth for navigation, layout, and branding across all pages
- Ensure correct React Router imports and dynamic basename derivation from <base href> tag
- Validate shadcn/ui component imports and Tailwind CSS utility usage
- Prevent unsafe TypeScript patterns (any, unsafe assertions) with proper type guards and generics
- Block imports of Salesforce platform modules (lightning/*, @wire) incompatible with React UI bundles
- Guide page, header/footer, and component implementations with category-specific conventions
How to install building-ui-bundle-frontend
npx skills add https://github.com/forcedotcom/sf-skills --skill building-ui-bundle-frontend- Project must contain appLayout.tsx, routes.tsx, src/pages/, src/components/, or global.css
- Existing UI bundle app structure (not a new app from scratch)
- React Router configured with createBrowserRouter and RouterProvider
- shadcn/ui and Tailwind CSS already set up in the project
How to use building-ui-bundle-frontend
- 1.Identify the task category: Page, Header/Footer, or Component
- 2.Ask clarifying questions one at a time to gather context (name, purpose, URL path, content sections, data needs)
- 3.Review appLayout.tsx as the source of truth for navigation and layout
- 4.Implement the change following the category-specific guide (implementation/page.md, implementation/header-footer.md, or implementation/component.md)
- 5.Use shadcn/ui for components and Tailwind CSS for styling; derive basename from <base href> tag at runtime
- 6.Ensure TypeScript types are explicit (no any), event handlers are properly typed, and Salesforce platform modules are not imported
- 7.Run lint and build from the UI bundle directory to verify 0 errors and successful build
Use cases
- Updating navigation items and branding in appLayout.tsx for an existing UI bundle app
- Adding a new routed page (contacts, dashboard, settings) with proper routing and layout integration
- Modifying component styling, colors, fonts, or animations using Tailwind CSS and shadcn/ui
- Refactoring header, footer, or site-wide navigation while maintaining Salesforce base-path routing
- Creating reusable components that follow project structure and TypeScript standards
- Frontend developers modifying existing UI bundle applications
- Teams building Salesforce-integrated React apps with shadcn/ui and Tailwind CSS
- Developers who need to enforce consistent routing, component, and styling conventions
- Anyone updating pages, components, layout, or navigation in an established UI bundle project
building-ui-bundle-frontend FAQ
Use this skill to modify an EXISTING UI bundle app (pages, components, styling, navigation). Use building-ui-bundle-app when creating a new app from scratch.
Generated code will use wrong imports, break routing, ignore project structure, and violate Salesforce base-path routing conventions. This skill contains critical project-specific conventions that override general knowledge.
No. React UI bundles cannot import LWC-only modules. For Salesforce data access, use the using-ui-bundle-salesforce-data skill instead.
Always derive basename from the document's <base href> tag at runtime using document.querySelector('base').href, never hardcode it. Use absolute paths in router navigation (<Link to>, navigate()) and dot-relative paths for non-router attributes.
Never use any, unsafe assertions (obj as User), or untyped state. Always provide explicit type parameters to useState, use proper types or generics, and use type guards instead of assertions.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: building-ui-bundle-frontend description: "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)." metadata: version: "1.0"
UI Bundle UI
Identify the Task
Determine which category the request falls into:
| Category | Examples | Implementation Guide |
|---|---|---|
| Page | New routed page (contacts, dashboard, settings) | implementation/page.md |
| Header / Footer | Site-wide nav bar, footer, branding | implementation/header-footer.md |
| Component | Widget, card, table, form, dialog | implementation/component.md |
Layout and Navigation
appLayout.tsx is the source of truth for navigation and layout. Every page shares this shell.
When making any change that affects navigation, header, footer, sidebar, theme, or layout:
- Edit
src/appLayout.tsx— the layout used byroutes.tsx - Replace all default/template nav items and labels with app-specific links and names
- Replace placeholder app name everywhere: header, nav brand, footer,
<title>inindex.html
Before finishing, confirm: Did I update appLayout.tsx with real nav items and branding?
| What | Where |
|---|---|
| Layout, nav, branding | src/appLayout.tsx |
| Document title | index.html |
| Root page content | Component at root route in routes.tsx |
React and TypeScript Standards
Routing
Use a single router package. With createBrowserRouter / RouterProvider, all imports must come from react-router (not react-router-dom).
If the app uses a client-side router (React Router, Remix Router, Vue Router, etc.), always derive basename / basepath / base from the document's <base href> tag at runtime. Never hardcode the basename:
const basename = document.querySelector('base')
? new URL(document.querySelector('base').href).pathname.replace(/\/$/, '')
: '/';
const router = createBrowserRouter(routes, { basename });
Component Library and Styling
- shadcn/ui for components:
import { Button } from '@/components/ui/button'; - Tailwind CSS utility classes
URL and Path Handling
Apps run behind dynamic base paths. Router navigation (<Link to>, navigate()) uses absolute paths (/x). Non-router attributes (<img src>) use dot-relative (./x). Prefer Vite import for static assets.
TypeScript
- Never use
any— use proper types, generics, orunknownwith type guards - Event handlers:
(event: React.FormEvent<HTMLFormElement>): void - State:
useState<User | null>(null)— always provide the type parameter - No unsafe assertions (
obj as User) — use type guards instead
Module Restrictions
React UI bundles must not import Salesforce platform modules like lightning/* or @wire (LWC-only). For data access, use the using-ui-bundle-salesforce-data skill.
Design Thinking
Before coding, commit to a bold aesthetic direction:
- Purpose: What problem does this interface solve? Who uses it?
- Tone: Pick a clear direction — brutally minimal, maximalist, retro-futuristic, organic, luxury, playful, editorial, brutalist, art deco, soft/pastel, industrial. Use these as inspiration but design one true to the context.
- Differentiation: What makes this unforgettable? What's the one thing someone will remember?
Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
Frontend Aesthetics
-
Typography: Choose distinctive, characterful fonts. Pair a display font with a refined body font. Never default to Inter, Roboto, Arial, Space Grotesk, or system fonts.
-
Color: Commit to a cohesive palette using CSS variables. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Avoid cliched purple gradients on white.
-
Motion: Focus on high-impact moments — one well-orchestrated page load with staggered reveals (
animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise. Prefer CSS-only solutions; use Motion library for React when available. -
Spatial Composition: Unexpected layouts — asymmetry, overlap, diagonal flow, grid-breaking elements. Generous negative space OR controlled density.
-
Backgrounds & Depth: Create atmosphere rather than defaulting to solid colors. Gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, grain overlays.
-
Mobile Responsiveness: All generated UI MUST be mobile-responsive. Use Tailwind responsive prefixes (
sm:,md:,lg:) to adapt layouts across breakpoints. Stack columns on small screens, use flexible grids, and ensure touch targets are at least 44px. Test that navigation, typography, and spacing work on mobile viewports.
Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate animations and effects. Minimalist designs need restraint, precision, and careful spacing/typography. No two designs should look the same — vary themes, fonts, and aesthetics across generations.
Clarifying Questions
Ask one question at a time and stop when you have enough context.
For a Page
- Name and purpose?
- URL path?
- Should it appear in navigation?
- Access control? (public, authenticated via
PrivateRoute, or unauthenticated viaAuthenticationRoute) - Content sections? (list, form, table, detail view)
- Data fetching needs?
For a Header / Footer
- Header, footer, or both?
- Contents? (logo, nav links, user avatar, copyright, social icons)
- Sticky header?
- Color scheme or style direction?
For a Component
- What should it do?
- Which page does it belong to?
- Shared/reusable or specific to one feature?
- Data or props needed?
- Internal state? (loading, toggle, form state)
- Specific shadcn components to use?
Verification
Before completing, run lint and build from the UI bundle directory. Lint must result in 0 errors and build must succeed.
Related skills
More from forcedotcom/sf-skills and the wider catalog.

configuring-connected-apps
Configure Salesforce OAuth flows, Connected Apps, and External Client Apps with security best practices.

connecting-datacloud
Manage Salesforce Data Cloud connections, connectors, and source system setup.

creating-b2b-commerce-store
Create B2B Commerce stores and retrieve storefront metadata via interactive workflow.

debugging-apex-logs
Analyze Salesforce debug logs to diagnose governor limits, stack traces, and performance bottlenecks.

deploying-metadata
Salesforce DevOps automation: deploy metadata safely with sf CLI v2, validate first, orchestrate CI/CD.

deploying-omnistudio-datapacks
Automate Vlocity DataPack deployment, validation, and retry workflows for OmniStudio/Industries configurations.