
Building Ui Bundle Frontend
Implement Salesforce UI bundle screens with shadcn primitives, Tailwind tokens, and typed React components in the prescribed folder layout.
Overview
Building UI Bundle Frontend is an agent skill for the Build phase that enforces shadcn components, Tailwind design tokens, and typed React structure for Salesforce UI bundle work.
Install
npx skills add https://github.com/forcedotcom/sf-skills --skill building-ui-bundle-frontendWhat is this skill?
- Five implementation rules: shadcn-only primitives, Tailwind-only styling, design tokens, cn() for classes, typed props w
- File-location matrix for ui/, feature/, and layout/ components with named exports
- Explicit ban on raw HTML equivalents for buttons, inputs, cards, alerts, tabs, tables, and labels
- TypeScript functional components pattern with import examples from @/components/ui
- 5 implementation rules
- 3 component location tiers (ui, feature, layout)
Adoption & trust: 659 installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps generating raw HTML controls, inline styles, or misplaced components outside the sf-skills UI bundle layout.
Who is it for?
Indie devs extending a Salesforce UI bundle or sf-skills React scaffold who want agent output to match shadcn + Tailwind standards.
Skip if: Greenfield apps without shadcn/Tailwind or teams that intentionally use CSS modules or non-React Salesforce Lightning-only UIs.
When should I use this skill?
Implementing or refactoring React UI in a Salesforce UI bundle that must use @/components/ui and Tailwind utilities only.
What do I get? / Deliverables
You get feature and layout components that import from @/components/ui, use tokenized Tailwind, and land in the correct src/components paths ready for review.
- Typed functional components with correct export paths
- Tailwind-styled UI using design tokens and cn()
Recommended Skills
Journey fit
How it compares
Use as procedural guardrails for UI bundle repos—not a generic “make it pretty” design skill or an MCP design tool.
Common Questions / FAQ
Who is building-ui-bundle-frontend for?
Developers building Salesforce-related UI bundles with React, shadcn/ui, and Tailwind who want agents to follow the same component and path rules every time.
When should I use building-ui-bundle-frontend?
During Build frontend work whenever you add pages, feature widgets, or shared primitives in a sf-skills UI bundle project.
Is building-ui-bundle-frontend safe to install?
It guides filesystem edits only through your agent; confirm repo trust and read the Security Audits panel on this page before install.
SKILL.md
READMESKILL.md - Building Ui Bundle Frontend
# Implementation — Component ### Rules 1. **Always use shadcn components** from `@/components/ui` — never build raw HTML equivalents for buttons, inputs, cards, alerts, tabs, tables, or labels. 2. **All styling via Tailwind** — utility classes only. No inline `style={{}}`, CSS Modules, or other styling systems. 3. **Use design tokens** — prefer `bg-background`, `text-foreground`, `text-muted-foreground`, `border`, `bg-primary`, `text-destructive`, `rounded-lg` over hardcoded colors. 4. **Use `cn()`** from `@/lib/utils` for conditional or composable class names. 5. **TypeScript** — functional components with typed props interface; always accept `className?: string`. ### File Location — Component | Component type | Location | Export | | ---------------------------------------------- | ---------------------------------------- | ---------------------------------------- | | Shared UI primitive (reusable across features) | `src/components/ui/` — add to `index.ts` | Named export | | Feature-specific (e.g., dashboard widget) | `src/components/<feature>/` | Named export, import directly where used | | Page-level layout element | `src/components/layout/` | Named export | ### Component Structure ```tsx import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui"; import { cn } from "@/lib/utils"; interface MyComponentProps { title: string; value: string; className?: string; } export function MyComponent({ title, value, className }: MyComponentProps) { return ( <Card className={cn("border", className)}> <CardHeader> <CardTitle className="text-sm font-medium">{title}</CardTitle> </CardHeader> <CardContent> <p className="text-2xl font-semibold text-foreground">{value}</p> </CardContent> </Card> ); } ``` ### State and Hooks - **Local state only:** keep `useState`, `useReducer`, `useRef` inside the component. - **Shared or complex state:** extract to a custom hook in `src/hooks/` (prefix with `use`, e.g. `useFormData`). Do this when more than one component needs the state, or when multiple hooks are composed together. ### Adding the Component to a Page ```tsx // In the target page file, e.g. src/pages/HomePage.tsx import { MyComponent } from "@/components/<feature>/MyComponent"; export default function HomePage() { return ( <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"> <MyComponent title="Status" value="Active" /> </div> ); } ``` ### Useful Patterns — Component - **Programmatic navigation:** use `useNavigate` from `react-router`; call `navigate(path)` — consistent with GlobalSearchInput, SearchResultCard, MaintenanceTable, and other components in the UI bundle. - **Page container:** `max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12` - **Icons:** `lucide-react`; add `aria-hidden="true"` on decorative icons - **Focus styles:** use `focus-visible:` variants - **Multiple visual variants:** use CVA (`cva`) and `VariantProps` - **shadcn import barrel:** `import { Button, Card, Input } from "@/components/ui"` ### Confirm — Component - Imports use path aliases (`@/`, not deep relative paths) - No raw `<button>`, `<input>`, or styled `<div>` where shadcn equivalents exist - No inline `style={{}}` — Tailwind only # Implementation — Header / Footer ### Rules 1. **Edit `appLayout.tsx` only** — header and footer are layout-level concerns. Never add them to individual page files. 2. **Never modify `routes.tsx` or `app.tsx`** — the router setup must remain intact. 3. **Create component files in `src/components/layout/`** — the designated location for layout-level components. 4. **Use the full-height flex column pattern** — wrap layout in `min-h-screen flex flex-col` so footer stays at bottom. 5. **Use shadcn and Tailwind** — compo