@schandlergarcia/sf-web-components 1.9.75 → 1.9.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.a4drules/features/command-center-dashboard-rule.md +16 -7
- package/.a4drules/features/engine-dashboard-rule.md +11 -5
- package/.a4drules/features/pre-code-checklist.md +29 -6
- package/.a4drules/skills/command-center-builder/SKILL.md +119 -76
- package/.a4drules/skills/command-center-builder/improved-build-process.md +32 -1
- package/.a4drules/skills/command-center-guide/SKILL.md +25 -17
- package/CHANGELOG.md +17 -0
- package/data/engine-command-center-prd.md +40 -31
- package/package.json +1 -1
|
@@ -8,6 +8,22 @@ paths:
|
|
|
8
8
|
|
|
9
9
|
These rules apply to all dashboard files. For Engine-specific rules, see `engine-dashboard-rule.md`.
|
|
10
10
|
|
|
11
|
+
**Read `.a4drules/skills/command-center-builder/SKILL.md` before building any dashboard.** It has the full conventions, component rules, and wiring steps.
|
|
12
|
+
|
|
13
|
+
## Wiring — MANDATORY (do not skip)
|
|
14
|
+
|
|
15
|
+
After creating a dashboard, you MUST update all 3 files or the dashboard will never appear:
|
|
16
|
+
|
|
17
|
+
1. **`CommandCenter.tsx`** — import and render your dashboard (change only the import line)
|
|
18
|
+
2. **`Home.tsx`** — REWRITE to render `CommandCenter` (it ships as Account Search by default):
|
|
19
|
+
```tsx
|
|
20
|
+
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
21
|
+
export default function HomePage() { return <CommandCenter />; }
|
|
22
|
+
```
|
|
23
|
+
3. **`routes.tsx`** — set `Home` as index route with label "Dashboard", move Search to `/search`
|
|
24
|
+
|
|
25
|
+
**If you skip this, the user sees the Account Search page instead of your dashboard.**
|
|
26
|
+
|
|
11
27
|
## Core Constraints
|
|
12
28
|
|
|
13
29
|
1. Dashboard files: `.tsx` in `src/pages/` — never `.jsx`, never `src/components/pages/`
|
|
@@ -21,13 +37,6 @@ These rules apply to all dashboard files. For Engine-specific rules, see `engine
|
|
|
21
37
|
9. DO NOT run `npm run dev`, `npm run validate:dashboard`, or `npm run build` during builds
|
|
22
38
|
10. DO NOT `npm install` any packages — everything needed is already installed
|
|
23
39
|
|
|
24
|
-
## Wiring
|
|
25
|
-
|
|
26
|
-
After creating a dashboard, update all 3 files:
|
|
27
|
-
1. `CommandCenter.tsx` — import and render your dashboard
|
|
28
|
-
2. `Home.tsx` — render `CommandCenter`
|
|
29
|
-
3. `routes.tsx` — set `Home` as index route
|
|
30
|
-
|
|
31
40
|
## Component API
|
|
32
41
|
|
|
33
42
|
For full component props and data shapes, read `.a4drules/skills/component-library/SKILL.md`.
|
|
@@ -33,13 +33,19 @@ These rules load automatically when editing Engine dashboard files. For full bui
|
|
|
33
33
|
|
|
34
34
|
Complete each phase fully before starting the next. Read the relevant phase file for detailed instructions and code templates.
|
|
35
35
|
|
|
36
|
-
## Wiring Checklist
|
|
36
|
+
## Wiring Checklist — MANDATORY
|
|
37
37
|
|
|
38
|
-
After creating or updating `EngineDashboard.tsx
|
|
38
|
+
After creating or updating `EngineDashboard.tsx`, update ALL 3 files:
|
|
39
39
|
|
|
40
|
-
1.
|
|
41
|
-
2.
|
|
42
|
-
|
|
40
|
+
1. **`CommandCenter.tsx`** — imports `EngineDashboard` (not `BlankDashboard`)
|
|
41
|
+
2. **`Home.tsx`** — REWRITE to render `CommandCenter` (it ships as Account Search by default):
|
|
42
|
+
```tsx
|
|
43
|
+
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
44
|
+
export default function HomePage() { return <CommandCenter />; }
|
|
45
|
+
```
|
|
46
|
+
3. **`routes.tsx`** — has `Home` as index route with label "Dashboard", `Search` at `/search`
|
|
47
|
+
|
|
48
|
+
**If you skip steps 2-3, the user sees the Account Search page instead of the dashboard.**
|
|
43
49
|
|
|
44
50
|
## Component Quick Reference
|
|
45
51
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pre-Code Checklist
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Read `.a4drules/skills/command-center-builder/SKILL.md` before building. It has the full conventions and wiring steps.
|
|
4
4
|
|
|
5
5
|
## Before creating a dashboard file
|
|
6
6
|
|
|
@@ -18,9 +18,32 @@ This is a reference checklist. For build instructions, use the phase files in `.
|
|
|
18
18
|
| `text-black` | `text-slate-900` | Body text (light mode) |
|
|
19
19
|
| `bg-black` | `bg-slate-900` or `bg-black/40` (with opacity) | Backgrounds |
|
|
20
20
|
|
|
21
|
-
## After creating the dashboard
|
|
21
|
+
## After creating the dashboard — WIRE IT (MANDATORY)
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- [ ]
|
|
26
|
-
|
|
23
|
+
**All 3 steps are required or the dashboard will never render on screen.**
|
|
24
|
+
|
|
25
|
+
- [ ] **`CommandCenter.tsx`** — change the import to your dashboard:
|
|
26
|
+
```tsx
|
|
27
|
+
// src/components/workspace/CommandCenter.tsx
|
|
28
|
+
import MyDashboard from "../../pages/MyDashboard"; // ← your dashboard
|
|
29
|
+
// ... render <MyDashboard /> inside the existing providers
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- [ ] **`Home.tsx`** — REPLACE the entire file (it ships as Account Search by default):
|
|
33
|
+
```tsx
|
|
34
|
+
// src/pages/Home.tsx — REPLACE EVERYTHING
|
|
35
|
+
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
36
|
+
export default function HomePage() {
|
|
37
|
+
return <CommandCenter />;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- [ ] **`routes.tsx`** — set Home as the index route with label "Dashboard":
|
|
42
|
+
```tsx
|
|
43
|
+
{ index: true, element: <Home />, handle: { showInNavigation: true, showNavBar: true, label: "Dashboard" } },
|
|
44
|
+
{ path: "search", element: <Search />, handle: { showInNavigation: true, showNavBar: true, label: "Search" } },
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- [ ] DO NOT run `npm run dev` or `npm run validate:dashboard` during builds
|
|
48
|
+
|
|
49
|
+
**If you skip the wiring steps, the user will see the Account Search page instead of your dashboard.**
|
|
@@ -13,15 +13,131 @@ description: >-
|
|
|
13
13
|
|
|
14
14
|
These rules apply when building dashboards rendered by `CommandCenter.tsx`. For full component API details, read the **component-library** skill.
|
|
15
15
|
|
|
16
|
+
## WIRING — DO THIS FIRST (before building the dashboard)
|
|
17
|
+
|
|
18
|
+
**Building a dashboard requires updating 4 files. If you only create the dashboard file, the user will never see it — they'll see the old Account Search page instead.**
|
|
19
|
+
|
|
20
|
+
Read the existing `Home.tsx`, `CommandCenter.tsx`, and `routes.tsx` BEFORE you start building. Plan all 4 file changes up front:
|
|
21
|
+
|
|
22
|
+
1. `src/pages/YourDashboard.tsx` — the dashboard component
|
|
23
|
+
2. `src/components/workspace/CommandCenter.tsx` — import and render your dashboard
|
|
24
|
+
3. `src/pages/Home.tsx` — **MUST be rewritten** to render CommandCenter (it ships as Account Search)
|
|
25
|
+
4. `src/routes.tsx` — set Home as index route with label "Dashboard"
|
|
26
|
+
|
|
27
|
+
**Home.tsx ships as an Account Search page by default.** You MUST replace its entire contents:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
// src/pages/Home.tsx — REPLACE the entire file
|
|
31
|
+
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
32
|
+
|
|
33
|
+
export default function HomePage() {
|
|
34
|
+
return <CommandCenter />;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**CommandCenter.tsx** — only change the dashboard import. Preserve the `heroui-scope` wrapper and `Toast.Provider`:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// src/components/workspace/CommandCenter.tsx
|
|
42
|
+
import AppThemeProvider from "@/components/library/theme/AppThemeProvider";
|
|
43
|
+
import DataModeProvider from "@/components/library/data/DataModeProvider";
|
|
44
|
+
import { Toast } from "@heroui/react";
|
|
45
|
+
import MyDashboard from "../../pages/MyDashboard"; // ← change ONLY this import
|
|
46
|
+
|
|
47
|
+
export default function CommandCenter() {
|
|
48
|
+
return (
|
|
49
|
+
<div className="heroui-scope">
|
|
50
|
+
<AppThemeProvider initialMode="light">
|
|
51
|
+
<DataModeProvider initialMode="sample">
|
|
52
|
+
<MyDashboard />
|
|
53
|
+
<Toast.Provider placement="bottom end" />
|
|
54
|
+
</DataModeProvider>
|
|
55
|
+
</AppThemeProvider>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**routes.tsx** — make Home the index route, move Search to `/search`:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
{
|
|
65
|
+
index: true,
|
|
66
|
+
element: <Home />,
|
|
67
|
+
handle: { showInNavigation: true, showNavBar: true, label: "Dashboard" }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
path: "search",
|
|
71
|
+
element: <Search />,
|
|
72
|
+
handle: { showInNavigation: true, showNavBar: true, label: "Search" }
|
|
73
|
+
},
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**After writing all files, verify:**
|
|
77
|
+
1. Your dashboard `.tsx` file exists in `src/pages/`
|
|
78
|
+
2. `CommandCenter.tsx` imports your dashboard (not `BlankDashboard`)
|
|
79
|
+
3. `Home.tsx` imports and renders `CommandCenter` (NOT the Account Search interface)
|
|
80
|
+
4. `routes.tsx` has `Home` as the index route with label "Dashboard"
|
|
81
|
+
|
|
82
|
+
**If any of these are missing, the dashboard will not render.** This is the #1 cause of "I built the dashboard but I can't see it."
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Quick Import Reference
|
|
87
|
+
|
|
88
|
+
Use these exact imports. Do NOT read component source files to discover imports — this list is authoritative.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
// Library components — named imports from barrel
|
|
92
|
+
import {
|
|
93
|
+
BaseCard, MetricCard, ChartCard, TableCard, ListCard, ActivityCard,
|
|
94
|
+
StatusCard, WidgetCard, SectionCard, FeedPanel, CalloutCard, ActionList,
|
|
95
|
+
MetricsStrip, D3Chart, D3ChartTemplates, GeoMap, Avatar, UIButton,
|
|
96
|
+
UIChip, UIText, EmptyState, Spinner, ChatBar, FilterBar,
|
|
97
|
+
FormModal, toast,
|
|
98
|
+
} from "@/components/library";
|
|
99
|
+
|
|
100
|
+
// Theme — named export
|
|
101
|
+
import { useThemeMode } from "@/components/library/theme/AppThemeProvider";
|
|
102
|
+
|
|
103
|
+
// Data — DEFAULT export (no braces)
|
|
104
|
+
import useDataSource from "@/components/library/data/useDataSource";
|
|
105
|
+
|
|
106
|
+
// Icons — Heroicons ONLY (not Lucide) — use 24/outline by default
|
|
107
|
+
import {
|
|
108
|
+
UsersIcon, BellIcon, SunIcon, MoonIcon, SparklesIcon,
|
|
109
|
+
CheckCircleIcon, ArrowPathIcon, ClockIcon, BanknotesIcon,
|
|
110
|
+
ShieldCheckIcon, ChevronDownIcon, ChevronUpIcon,
|
|
111
|
+
ExclamationTriangleIcon, PaperAirplaneIcon, BuildingOfficeIcon,
|
|
112
|
+
MapPinIcon, GlobeAltIcon, UserIcon,
|
|
113
|
+
} from "@heroicons/react/24/outline";
|
|
114
|
+
|
|
115
|
+
// Sample data
|
|
116
|
+
import {
|
|
117
|
+
MAP_MARKERS, MAP_ARCS, MAP_OVERLAYS, FLIGHT_STATUS_LIST,
|
|
118
|
+
TRAVELER_CARDS, DISRUPTION_CARDS, ESCALATION_CARDS,
|
|
119
|
+
MONTHLY_SPEND, METRICS,
|
|
120
|
+
} from "@/data/engine-sample-data.js";
|
|
121
|
+
|
|
122
|
+
// Logo
|
|
123
|
+
import engineLogo from "@/assets/images/engine_logo.png";
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Common mistakes:** `PlaneIcon` doesn't exist (use `PaperAirplaneIcon`), `HotelIcon` doesn't exist (use `BuildingOfficeIcon`), `import { useDataSource }` fails (it's a default export — no braces).
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
16
130
|
## Core Conventions
|
|
17
131
|
|
|
18
132
|
The following conventions apply to all dashboard development in this project.
|
|
19
133
|
|
|
20
|
-
|
|
134
|
+
The most common mistakes are:
|
|
135
|
+
- **Forgetting to update Home.tsx and routes.tsx** (dashboard exists but never renders)
|
|
21
136
|
- Creating `.jsx` instead of `.tsx` files
|
|
22
137
|
- Creating files in `src/components/pages/` instead of `src/pages/`
|
|
23
138
|
- Using forbidden colors (`text-white`, `bg-black`)
|
|
24
139
|
- Hand-rolling HTML cards instead of using library components
|
|
140
|
+
- Reading component source files instead of using this skill's documentation
|
|
25
141
|
|
|
26
142
|
1. **Write `.tsx` files** in `src/pages/` and update `CommandCenter.tsx` to import the dashboard. This is a TypeScript project — all React components use `.tsx` extension.
|
|
27
143
|
|
|
@@ -106,85 +222,12 @@ The logo is black — use `brightness-0 invert` to make it white when placed on
|
|
|
106
222
|
|
|
107
223
|
No `<nav>`, header bar, tab bar, or content-swapping via `useState("activeTab")` inside dashboard pages. The app shell handles navigation. Dashboards are single scrollable pages — all content visible by scrolling.
|
|
108
224
|
|
|
109
|
-
## Where Dashboards Live
|
|
225
|
+
## Where Dashboards Live
|
|
110
226
|
|
|
111
227
|
- Dashboard page files: `src/pages/` (e.g. `EngineDashboard.tsx`, `FleetDashboard.tsx`) — **NOT** `src/components/pages/`
|
|
112
228
|
- File format: `.tsx` (MUST be TypeScript) — this is a TypeScript project, all React components use `.tsx`, NEVER `.jsx`.
|
|
113
229
|
- `CommandCenter.tsx` wraps with `heroui-scope` div + `AppThemeProvider` + `DataModeProvider` + `Toast.Provider` from `@heroui/react`. **Never recreate these providers in dashboard pages.** When wiring a new dashboard, only change the import — preserve the `heroui-scope` wrapper and `Toast.Provider` exactly as-is. For toasts inside dashboards, import `toast` from `@heroui/react` (or `@/components/library`) — NOT from `sonner`.
|
|
114
|
-
|
|
115
|
-
### Wiring a new dashboard (REQUIRED STEPS)
|
|
116
|
-
|
|
117
|
-
All three steps are required for the dashboard to render:
|
|
118
|
-
|
|
119
|
-
**Step 1:** Create the dashboard file in `src/pages/` (NOT `src/components/pages/`):
|
|
120
|
-
```tsx
|
|
121
|
-
// src/pages/MyDashboard.tsx (NOTE: .tsx NOT .jsx, in src/pages/ NOT src/components/pages/)
|
|
122
|
-
import React from "react";
|
|
123
|
-
import { MetricCard, ListCard, ChartCard, D3Chart } from "@/components/library";
|
|
124
|
-
|
|
125
|
-
export default function MyDashboard() {
|
|
126
|
-
return (
|
|
127
|
-
<div className="space-y-6 p-6">
|
|
128
|
-
{/* dashboard content using library components */}
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Step 2:** Update `CommandCenter.tsx` to import and render it. Only change the import line — preserve `heroui-scope` and `Toast.Provider`:
|
|
135
|
-
```tsx
|
|
136
|
-
// src/components/workspace/CommandCenter.tsx
|
|
137
|
-
import AppThemeProvider from "@/components/library/theme/AppThemeProvider";
|
|
138
|
-
import DataModeProvider from "@/components/library/data/DataModeProvider";
|
|
139
|
-
import { Toast } from "@heroui/react";
|
|
140
|
-
import MyDashboard from "../../pages/MyDashboard"; // ← change ONLY this import
|
|
141
|
-
|
|
142
|
-
export default function CommandCenter() {
|
|
143
|
-
return (
|
|
144
|
-
<div className="heroui-scope"> {/* ← preserve this wrapper */}
|
|
145
|
-
<AppThemeProvider initialMode="light">
|
|
146
|
-
<DataModeProvider initialMode="sample">
|
|
147
|
-
<MyDashboard /> {/* ← change this */}
|
|
148
|
-
<Toast.Provider placement="bottom end" /> {/* ← preserve this */}
|
|
149
|
-
</DataModeProvider>
|
|
150
|
-
</AppThemeProvider>
|
|
151
|
-
</div>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Step 2.5:** Update `Home.tsx` to render `CommandCenter`:
|
|
157
|
-
```tsx
|
|
158
|
-
// src/pages/Home.tsx
|
|
159
|
-
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
160
|
-
|
|
161
|
-
export default function HomePage() {
|
|
162
|
-
return <CommandCenter />;
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
**Step 3:** Update `src/routes.tsx` to make the dashboard the home page. Replace the Search page index route with the Home/CommandCenter route:
|
|
167
|
-
```tsx
|
|
168
|
-
// src/routes.tsx — change the index route
|
|
169
|
-
{
|
|
170
|
-
index: true,
|
|
171
|
-
element: <SuspenseWrap><Home /></SuspenseWrap>,
|
|
172
|
-
handle: { showInNavigation: true, label: 'Dashboard' }
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
path: "search",
|
|
176
|
-
element: <SuspenseWrap><Search /></SuspenseWrap>,
|
|
177
|
-
handle: { showInNavigation: true, label: 'Search' }
|
|
178
|
-
},
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
The `Home` page renders `CommandCenter`, which renders your dashboard. The Search page moves to `/search`.
|
|
182
|
-
|
|
183
|
-
**Verify:** After writing all files, confirm:
|
|
184
|
-
1. Your dashboard `.tsx` file exists in `src/pages/`
|
|
185
|
-
2. `CommandCenter.tsx` (in `src/components/workspace/`) imports your dashboard (not `BlankDashboard`)
|
|
186
|
-
3. `Home.tsx` (in `src/pages/`) imports and renders `CommandCenter` (not search interface)
|
|
187
|
-
4. `src/routes.tsx` has `Home` as the index route and `Search` at `/search`
|
|
230
|
+
- **Wiring is covered at the top of this file** — see "WIRING — DO THIS FIRST".
|
|
188
231
|
|
|
189
232
|
## Page Structure
|
|
190
233
|
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
# Efficient Build Process
|
|
2
|
+
|
|
3
|
+
## Speed Rules
|
|
4
|
+
|
|
5
|
+
1. **Load only 2 files before building:** the PRD and this skill (command-center-builder). Do NOT load component-library, command-center-project, or outer-app skills — they add latency and aren't needed for the initial build.
|
|
6
|
+
|
|
7
|
+
2. **Do NOT read component source files.** The props for every component (GeoMap, BaseCard, Avatar, ChartCard, D3Chart, etc.) are documented in this skill and the PRD. Reading `GeoMap.jsx`, `BaseCard.jsx`, etc. wastes time and produces no new information.
|
|
8
|
+
|
|
9
|
+
3. **Write the dashboard in one pass.** Plan the full file before writing. Do not write a partial dashboard and iterate — write the complete component with all imports, data, and JSX in a single Write call.
|
|
10
|
+
|
|
11
|
+
4. **Write all 4 files without stopping.** After the dashboard, immediately write CommandCenter.tsx, Home.tsx, and edit routes.tsx. Do not run build commands between files.
|
|
12
|
+
|
|
13
|
+
5. **Do NOT run `npm run build`, `npm run dev`, `tsc`, or `npm run validate:dashboard` during the build.** These waste time. The Vite build handles JSX/TSX regardless of TypeScript errors, and pre-existing TS7016 errors (from untyped .jsx library files) are normal.
|
|
14
|
+
|
|
15
|
+
## File Write Order
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
1. src/pages/EngineDashboard.tsx ← full dashboard, one pass
|
|
19
|
+
2. src/components/workspace/CommandCenter.tsx ← import dashboard
|
|
20
|
+
3. src/pages/Home.tsx ← REPLACE with CommandCenter wrapper
|
|
21
|
+
4. src/routes.tsx ← edit index route label to "Dashboard"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Common Time Wasters
|
|
25
|
+
|
|
26
|
+
| Waste | Fix |
|
|
27
|
+
|-------|-----|
|
|
28
|
+
| Loading 4-5 skills before starting | Load only command-center-builder + PRD |
|
|
29
|
+
| Reading GeoMap.jsx, Avatar.jsx, BaseCard.jsx source | Props are in this skill — trust the docs |
|
|
30
|
+
| Running `npm run build` after writing | Don't — Vite handles it, TS errors are pre-existing |
|
|
31
|
+
| Fixing imports iteratively (wrong icon names, wrong exports) | Check the PRD and this skill for exact import names before writing |
|
|
32
|
+
| Writing Home.tsx with Account Search content | REPLACE it with the 3-line CommandCenter wrapper (see WIRING section) |
|
|
@@ -10,37 +10,45 @@ description: >-
|
|
|
10
10
|
|
|
11
11
|
# Command Center Development Guide
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## How to Build Efficiently
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**Read these two files, then start building. Do not load other skills or explore component source files.**
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
1. **`.a4drules/skills/command-center-builder/SKILL.md`** — has the wiring steps, conventions, component APIs, and everything you need
|
|
18
|
+
2. **`engine-command-center-prd.md`** — the product spec (layout, data model, brand tokens)
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
That's it. The builder skill already contains the component API reference inline. Do NOT separately load `component-library`, `command-center-project`, or `outer-app` skills — they add latency and you don't need them for the initial build. Do NOT read individual component source files (GeoMap.jsx, Avatar.jsx, etc.) — the builder skill documents all the props.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|-------|---------------|
|
|
23
|
-
| **component-library** | Component API reference — props, data shapes, import patterns |
|
|
24
|
-
| **command-center-builder** | Dashboard conventions — layout, styling, component selection, dark mode |
|
|
25
|
-
| **command-center-project** | Project structure — routing, file locations, tech stack, wiring |
|
|
26
|
-
| **outer-app** | Outer app — navigation, shadcn/ui, non-dashboard pages |
|
|
22
|
+
## Build Order (write files in this exact order)
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
1. **Read** the PRD and builder skill
|
|
25
|
+
2. **Write** `src/pages/EngineDashboard.tsx` (or your dashboard name) — the full dashboard in one pass
|
|
26
|
+
3. **Write** `src/components/workspace/CommandCenter.tsx` — import your dashboard
|
|
27
|
+
4. **Write** `src/pages/Home.tsx` — REPLACE with CommandCenter (it ships as Account Search):
|
|
28
|
+
```tsx
|
|
29
|
+
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
30
|
+
export default function HomePage() { return <CommandCenter />; }
|
|
31
|
+
```
|
|
32
|
+
5. **Edit** `src/routes.tsx` — set Home as index route with label "Dashboard"
|
|
33
|
+
6. **Done** — do NOT run `npm run build`, `npm run dev`, or `tsc`
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
## Other Skills (load only when needed later)
|
|
36
|
+
|
|
37
|
+
| Skill | When to load |
|
|
38
|
+
|-------|-------------|
|
|
39
|
+
| **component-library** | Only if you need detailed props not covered in the builder skill |
|
|
40
|
+
| **command-center-project** | Only if you need project architecture context |
|
|
41
|
+
| **outer-app** | Only for non-dashboard pages (search, navigation) |
|
|
34
42
|
|
|
35
43
|
## Salesforce Data Integration
|
|
36
44
|
|
|
37
|
-
For live data, use these global skills:
|
|
45
|
+
For live data (prompt 2), use these global skills:
|
|
38
46
|
- **exploring-webapp-graphql-schema** — Look up objects and fields in `schema.graphql`
|
|
39
47
|
- **generating-webapp-graphql-read-query** — Generate typed GraphQL queries
|
|
40
48
|
- **using-webapp-graphql** — Create data hooks with `{ data, loading, error }`
|
|
41
49
|
|
|
42
50
|
## Agentforce Integration
|
|
43
51
|
|
|
44
|
-
For AI agent features, use:
|
|
52
|
+
For AI agent features (prompt 3), use:
|
|
45
53
|
- **managing-webapp-agentforce-conversation-client** — Full Agentforce setup
|
|
46
54
|
- **component-library** (`chat-data.md`) — ChatBar component API
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.76] - 2026-04-04
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Dashboard wiring failure** — Agent was building the dashboard but not updating Home.tsx and routes.tsx, so users saw the Account Search page instead of their dashboard
|
|
12
|
+
- **Slow builds** — Agent was loading 5 skills and reading component source files before writing anything
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **Builder skill (SKILL.md)** — Moved wiring instructions to the very top as "WIRING — DO THIS FIRST". Added Quick Import Reference with all component, icon, and data imports so the agent doesn't need to read source files
|
|
16
|
+
- **Guide skill (SKILL.md)** — Simplified to "load 2 files, then start building" instead of loading 4-5 skills. Added explicit Build Order (write files 1-2-3-4, done)
|
|
17
|
+
- **improved-build-process.md** — Replaced one-liner with full speed rules, file write order, and Common Time Wasters table
|
|
18
|
+
- **pre-code-checklist.md** — Added explicit code snippets for all 3 wiring files (CommandCenter.tsx, Home.tsx, routes.tsx)
|
|
19
|
+
- **command-center-dashboard-rule.md** — Moved wiring above constraints with Home.tsx code example
|
|
20
|
+
- **engine-dashboard-rule.md** — Expanded wiring checklist with Home.tsx replacement code
|
|
21
|
+
- **PRD build prompts (section 13)** — Rewrote all 3 prompts in natural language. Prompt 1 now says "Make it the home page when you're done". Added agent checklists and common failure notes below each prompt
|
|
22
|
+
|
|
23
|
+
**Context:** Agent was creating EngineDashboard.tsx and CommandCenter.tsx but leaving Home.tsx as the default Account Search page and not updating routes.tsx. The dashboard existed but never rendered. Root cause: wiring was buried 115 lines deep in the builder skill, the guide skill told the agent to load 5 skills before building, and the prompt didn't mention wiring. Fixed by moving wiring to the top of every skill file, simplifying the skill loading, and rewriting prompts.
|
|
24
|
+
|
|
8
25
|
## [1.9.75] - 2026-04-02
|
|
9
26
|
|
|
10
27
|
### Updated
|
|
@@ -320,51 +320,60 @@ Every element supports light and dark. GeoMap: `theme={mode === "dark" ? "dark"
|
|
|
320
320
|
|
|
321
321
|
## 13. Build Prompts
|
|
322
322
|
|
|
323
|
-
Build incrementally in 3 prompts. Each prompt builds on the previous result.
|
|
323
|
+
Build incrementally in 3 prompts. Each prompt builds on the previous result. The user prompt (blockquote) is what you copy-paste. The agent instructions below each prompt are guidance for the AI — not shown to the user.
|
|
324
324
|
|
|
325
325
|
---
|
|
326
326
|
|
|
327
|
-
### Build the Dashboard
|
|
327
|
+
### Prompt 1 — Build the Dashboard
|
|
328
328
|
|
|
329
|
-
> Build
|
|
329
|
+
> Build me a travel command center for Engine. There's a PRD with the full spec. I want the big hero map showing where all our travelers are with flight arcs, glass KPI overlays on top of the map, a flight status ticker, and then below that the main panels — escalations that need attention, active disruptions, our traveler roster with expandable details, and a spend trend chart. Hook it all up to the sample data so it looks real. Make it the home page when you're done — I want to see it when I open the app.
|
|
330
|
+
|
|
331
|
+
**What the agent must do:**
|
|
332
|
+
|
|
333
|
+
1. Read the PRD and the `command-center-builder` skill for conventions
|
|
334
|
+
2. Create `src/pages/EngineDashboard.tsx` with the full dashboard
|
|
335
|
+
3. Update `src/components/workspace/CommandCenter.tsx` to import EngineDashboard
|
|
336
|
+
4. **Rewrite `src/pages/Home.tsx`** to render CommandCenter (it ships as Account Search — must be replaced)
|
|
337
|
+
5. **Update `src/routes.tsx`** to set Home as the index route with label "Dashboard"
|
|
338
|
+
6. Add Engine brand tokens to `global.css` if not already present
|
|
339
|
+
|
|
340
|
+
**Common failure:** The agent creates the dashboard file but forgets to update `Home.tsx` and `routes.tsx`, so the user still sees the Account Search page. The wiring section at the top of `.a4drules/skills/command-center-builder/SKILL.md` explains all required file changes.
|
|
330
341
|
|
|
331
342
|
---
|
|
332
343
|
|
|
333
|
-
### Connect to Salesforce Data
|
|
334
|
-
|
|
335
|
-
>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
> ```tsx
|
|
348
|
-
> const activeMetrics = live.loading ? METRICS : live.metrics;
|
|
349
|
-
> ```
|
|
350
|
-
>
|
|
351
|
-
> After wiring the data, check if `Flight__c` has a `Weather_Impact__c` field for tracking weather disruptions — if it doesn't exist, ask me before creating it. Use the SFDX XML template from section 14a below and deploy with `sf project deploy start`.
|
|
352
|
-
|
|
353
|
-
**Reference — what the agent should say and do:**
|
|
354
|
-
|
|
355
|
-
1. After wiring the live data, tell the user: *"I notice `Flight__c` doesn't have a field to track weather impact on individual flights. A `Weather_Impact__c` picklist would help the dashboard filter storm-affected flights. Want me to create it?"* — When confirmed, create the custom field XML from section 14a and deploy it.
|
|
344
|
+
### Prompt 2 — Connect to Salesforce Data
|
|
345
|
+
|
|
346
|
+
> Now let's connect this to real data. There's a second dataset with different travelers and metrics — hook that up as the "live" data source so when someone toggles from sample to live mode, everything refreshes with the new data. After that, see if there are any data model improvements we should make for tracking weather disruptions.
|
|
347
|
+
|
|
348
|
+
**What the agent must do:**
|
|
349
|
+
|
|
350
|
+
1. Find and use `src/data/engine-live-data.js` and `src/hooks/useEngineLiveData.ts`
|
|
351
|
+
2. Import `useEngineLiveData` and wire each `useDataSource({ sample, live })` call
|
|
352
|
+
3. Update KPI overlays to derive from whichever metrics are active
|
|
353
|
+
4. After wiring, proactively offer to create the `Weather_Impact__c` custom field (section 14a)
|
|
354
|
+
|
|
355
|
+
**Reference — what the agent should say:**
|
|
356
|
+
|
|
357
|
+
After wiring the live data: *"I notice `Flight__c` doesn't have a field to track weather impact on individual flights. A `Weather_Impact__c` picklist would help the dashboard filter storm-affected flights. Want me to create it?"* — When confirmed, create the custom field XML from section 14a and deploy it.
|
|
356
358
|
|
|
357
359
|
---
|
|
358
360
|
|
|
359
|
-
### Add Agentforce
|
|
361
|
+
### Prompt 3 — Add Agentforce
|
|
362
|
+
|
|
363
|
+
> Last piece — let's add Eva, the AI travel assistant. I want a chat bar right below the map where people can ask her questions about travelers and disruptions. Also hook up the real Agentforce agent so she can actually do things. Then let's set up the backend so disruption alerts can flow through the platform in real time.
|
|
364
|
+
|
|
365
|
+
**What the agent must do:**
|
|
360
366
|
|
|
361
|
-
|
|
367
|
+
1. Add `ChatBar` with suggestions from section 9, placed between map and data panels
|
|
368
|
+
2. Add `AgentforceConversationClient` with `agentId="0Xxa5000000relhCAA"` and `agentLabel="Eva"`
|
|
369
|
+
3. Proactively offer to create `Travel_Disruption_Alert__e` platform event (section 14b)
|
|
370
|
+
4. After the event, proactively offer to create `TravelDisruptionEventService` Apex class (section 14c)
|
|
362
371
|
|
|
363
|
-
**Reference — what the agent should say
|
|
372
|
+
**Reference — what the agent should say:**
|
|
364
373
|
|
|
365
|
-
1. After adding Eva
|
|
374
|
+
1. After adding Eva: *"The dashboard tracks disruptions in real time. I can create a `Travel_Disruption_Alert__e` platform event so disruption data can be published to the Salesforce event bus — other systems and automation can subscribe to it. Want me to set it up?"* — When confirmed, create the platform event and its fields from section 14b and deploy.
|
|
366
375
|
|
|
367
|
-
2. After the platform event
|
|
376
|
+
2. After the platform event: *"Now I'll write an Apex service class to publish disruption records to that event bus. `TravelDisruptionEventService` will take a list of disruptions and fire platform events with the flight number, severity, and description. Want me to create it?"* — When confirmed, create the Apex class from section 14c and deploy.
|
|
368
377
|
|
|
369
378
|
---
|
|
370
379
|
|
package/package.json
CHANGED