
Building Ui Bundle Frontend
Implement AFV Library UI bundle React components with shadcn primitives, Tailwind tokens, and consistent file placement.
Overview
building-ui-bundle-frontend is an agent skill for the Build phase that standardizes AFV UI bundle React components on shadcn, Tailwind tokens, and prescribed src/components paths.
Install
npx skills add https://github.com/forcedotcom/afv-library --skill building-ui-bundle-frontendWhat is this skill?
- 5 implementation rules: shadcn-only primitives, Tailwind utilities, design tokens, cn(), typed props with className
- File location table for ui primitives, feature folders, and layout components with export conventions
- Bans raw HTML equivalents for buttons, inputs, cards, alerts, tabs, tables, and labels
- Requires functional TypeScript components and named exports per component type
- Mandates tokens like bg-background, text-muted-foreground, and text-destructive over hardcoded colors
- 5 numbered implementation rules for components
- 3-row file location table (ui, feature, layout)
Adoption & trust: 1.3k installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps inventing raw HTML controls and inline styles instead of shadcn primitives and tokenized Tailwind in the AFV UI bundle.
Who is it for?
Builders extending forcedotcom/afv-library UI who want agent output to match existing shadcn and Tailwind patterns.
Skip if: Greenfield apps outside the AFV bundle that use a different component library or CSS-in-JS stack.
When should I use this skill?
Implementing or extending UI bundle frontend components in the AFV Library repo.
What do I get? / Deliverables
New or updated components land in the correct src/components tree with shadcn imports, cn()-merged classes, and typed props ready for bundle integration.
- React components under src/components/ui, feature, or layout per the table
- Named exports using shadcn and tokenized Tailwind classes
Recommended Skills
Journey fit
The skill encodes implementation rules for React UI in the bundle—primary Build-phase frontend work, not distribution or ops. Frontend subphase matches component structure, shadcn imports, and Tailwind-only styling for feature and layout code.
How it compares
Use this skill for bundle-specific shadcn placement rules instead of generic React UI prompts that ignore @/components/ui and token naming.
Common Questions / FAQ
Who is building-ui-bundle-frontend for?
Developers and agents implementing or refactoring React UI inside the AFV Library UI bundle with shadcn and Tailwind.
When should I use building-ui-bundle-frontend?
Use it during Build when adding shared primitives, feature widgets, or layout components so imports, tokens, and export paths stay consistent.
Is building-ui-bundle-frontend safe to install?
It is styling and structure guidance only; confirm source trust via the Security Audits panel on this Prism catalog page.
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