---
name: frontend-design
description: Generate React + Bootstrap 5 frontend components and pages following the project design system. Invoke for any new page, component, layout, or visual modification.
user-invocable: true
title: frontend-design
canonical_url: https://skilld.dev/gh/colaberryintern/colaberryenterprise_ai_leadershipaccelerator/frontend-design
last_updated: 2026-10-08T09:39:34.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install colaberryintern/colaberryenterprise_ai_leadershipaccelerator/frontend-design`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/frontend-design`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/colaberryintern/colaberryenterprise_ai_leadershipaccelerator/frontend-design) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/frontend-design`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/frontend-design --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/frontend-design --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Frontend Design — Component & Page Generator

## Workflow

Follow these steps for every frontend task:

1. **Read the target file** (if modifying existing code)
2. **Read `frontend/src/styles/global.css`** for design tokens and custom classes
3. **Reference the baseline-ui skill** mentally for component patterns
4. **Use Bootstrap 5 utility classes** — no custom CSS unless a class already exists in `global.css`
5. **Match existing patterns** from similar pages in the codebase
6. **Write TypeScript** with proper interfaces for all props and data structures

---

## Project Stack

- **React 18** with functional components and hooks
- **TypeScript** — all components must have typed props interfaces
- **Bootstrap 5** via CDN — utility-first styling, no CSS modules
- **Recharts** — for charts and data visualization
- **React Router v6** — `useParams`, `useNavigate`, `useLocation`
- **Auth**: `useAuth()` hook from `frontend/src/contexts/AuthContext.tsx` provides `{ token, user }`
- **API calls**: `fetch('/api/admin/...',  { headers: { Authorization: 'Bearer ' + token } })`

---

## Reference Template Files

Study these files to understand established patterns:

### Table + Filter + Pagination + Batch Actions
**File**: `frontend/src/pages/admin/AdminLeadsPage.tsx`
- Search input + filter dropdowns + action buttons in a flex bar
- `table-responsive > table table-hover mb-0` with `thead table-light`
- Checkbox selection with `Set<number>` state
- Batch action bar appears when items selected
- Pagination controls at bottom

### Tab Shell + KPI Cards
**File**: `frontend/src/pages/admin/AdminCampaignDetailPage.tsx`
- Header with name, badges, action buttons
- `nav nav-tabs mb-4` for tab navigation
- KPI stat cards in `row g-3` with `col-md-3` or `col-md-4`
- Each tab renders a separate component

### Card Columns (Pipeline/Kanban)
**File**: `frontend/src/pages/admin/AdminPipelinePage.tsx`
- `row g-3` with `col-md-*` for column layout
- Cards inside each column with status-colored headers
- Draggable/clickable cards with lead summary info

### Reusable Badge Component
**File**: `frontend/src/components/TemperatureBadge.tsx`
- Small functional component with typed props
- Maps data values to Bootstrap badge classes
- Handles null/undefined gracefully

---

## Component Structure

```tsx
import React, { useState, useEffect } from 'react';
import { useAuth } from '../../contexts/AuthContext';

interface Props {
  campaignId: string;
  headers: Record<string, string>;
}

interface DataItem {
  id: number;
  name: string;
  // ... typed fields
}

export default function MyComponent({ campaignId, headers }: Props) {
  const [data, setData] = useState<DataItem[]>([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    fetchData();
  }, [campaignId]);

  const fetchData = async () => {
    try {
      const res = await fetch(`/api/admin/campaigns/${campaignId}/data`, { headers });
      const json = await res.json();
      setData(json.data || []);
    } catch (err) {
      console.error('Failed to fetch data:', err);
    } finally {
      setLoading(false);
    }
  };

  if (loading) {
    return (
      <div className="text-center py-5">
        <div className="spinner-border text-primary" />
      </div>
    );
  }

  return (
    <>
      {/* Content */}
    </>
  );
}
```

---

## Layout Rules

### Grid
- Use `row g-3` for grid rows with gutters
- Use `col-md-*` for responsive columns (stacks on mobile)
- Common splits: `col-md-3` (4-up), `col-md-4` (3-up), `col-md-6` (2-up)

### Spacing
- Cards: `mb-4` between sections
- Filter bars: `mb-3` below
- Button groups: `d-flex gap-2`
- Inline badges: `d-flex gap-2 align-items-center`

### Responsive
- Tables: always wrap in `div.table-responsive`
- Inputs: `form-control-sm` or `form-select-sm` for compact admin forms
- Constrain filter widths: `style={{ maxWidth: 150 }}`
- Stack on mobile: rely on Bootstrap `col-md-*` grid, no custom breakpoints

---

## Do's and Don'ts

### Do
- Use `border-0 shadow-sm` on all cards
- Use `bg-white fw-semibold` on card headers
- Use `table-light` on thead
- Use `btn-sm` for all admin action buttons
- Use `small` or `text-muted` for secondary information
- Use `form-control-sm` and `form-select-sm` for admin forms
- Provide loading spinners for async data
- Handle empty states with centered muted text

### Don't
- Write custom CSS — use Bootstrap utilities or existing `global.css` classes
- Hardcode colors — use CSS variables or Bootstrap classes
- Use inline styles except for `maxWidth`, `maxHeight`, `cursor`, `fontSize` tweaks
- Create new layout wrappers — use existing `AdminLayout` shell
- Skip TypeScript interfaces for props or data structures
- Use `any` type unless wrapping an untyped API response
