@schandlergarcia/sf-web-components 1.9.63 → 1.9.65
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 +20 -46
- package/.a4drules/features/engine-dashboard-rule.md +36 -288
- package/.a4drules/features/phase2-data-pattern.md +8 -159
- package/.a4drules/features/pre-code-checklist.md +16 -205
- package/.a4drules/skills/command-center-builder/SKILL.md +6 -30
- package/.a4drules/skills/command-center-builder/completion-checklist.md +3 -29
- package/.a4drules/skills/command-center-builder/improved-build-process.md +20 -331
- package/.a4drules/skills/command-center-builder/page-layout.md +4 -2
- package/.a4drules/skills/command-center-guide/SKILL.md +23 -257
- package/.a4drules/skills/command-center-project/SKILL.md +1 -1
- package/CHANGELOG.md +34 -0
- package/data/engine-command-center-prd.md +11 -13
- package/data/engine-sample-data.js +20 -8
- package/package.json +1 -1
|
@@ -1,341 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Dashboard Build Process
|
|
2
2
|
|
|
3
|
-
## 4-Phase Build
|
|
3
|
+
## 4-Phase Build
|
|
4
4
|
|
|
5
|
-
Build dashboards in 4 distinct phases with
|
|
5
|
+
Build dashboards in 4 distinct phases. Each phase has a dedicated instruction file with a code template in `.a4drules/phases/`:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
| Phase | File | Goal | Output |
|
|
8
|
+
|-------|------|------|--------|
|
|
9
|
+
| 1 | `phase-1-layout.md` | Layout & structure | Skeleton with placeholders |
|
|
10
|
+
| 2 | `phase-2-components.md` | Components & sample data | Fully functional UI with mock data |
|
|
11
|
+
| 3 | `phase-3-live-data.md` | Real data integration | Dashboard connected to Salesforce |
|
|
12
|
+
| 4 | `phase-4-agent.md` | Agentforce integration | Eva agent + Salesforce signals |
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
**Goal:** Build all UI components with realistic mock data
|
|
13
|
-
**Output:** Fully functional UI using hardcoded sample data
|
|
14
|
-
|
|
15
|
-
### Phase 3: Real Data Integration
|
|
16
|
-
**Goal:** Replace sample data with live Salesforce data
|
|
17
|
-
**Output:** Dashboard connected to real data sources
|
|
18
|
-
|
|
19
|
-
### Phase 4: Agentforce Integration
|
|
20
|
-
**Goal:** Add AI agent capabilities
|
|
21
|
-
**Output:** Eva agent integrated with chat interface
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Example: Engine Travel Command Center
|
|
26
|
-
|
|
27
|
-
### Prompt 1 — Layout & Structure
|
|
28
|
-
|
|
29
|
-
> Load skills: command-center-builder, command-center-project, component-library, outer-app.
|
|
30
|
-
> Use `docs/engine-command-center-prd.md` as source of truth.
|
|
31
|
-
>
|
|
32
|
-
> **Phase 1: Layout Only**
|
|
33
|
-
>
|
|
34
|
-
> Scaffold the Engine Travel Command Center structure:
|
|
35
|
-
>
|
|
36
|
-
> 1. **Header Layout** - Compact dark header with:
|
|
37
|
-
> - Engine logo placeholder (gray box)
|
|
38
|
-
> - Wordmark placeholder
|
|
39
|
-
> - Theme toggle (functional)
|
|
40
|
-
> - Empty space for ChatBar (Phase 4)
|
|
41
|
-
>
|
|
42
|
-
> 2. **Hero Section** - Full-width map container:
|
|
43
|
-
> - Empty GeoMap component (no markers, no data)
|
|
44
|
-
> - Placeholder for KPI overlays (gray boxes with labels)
|
|
45
|
-
> - Placeholder for flight status strip (gray bar)
|
|
46
|
-
>
|
|
47
|
-
> 3. **Data Panels Grid** - Layout sections with empty cards:
|
|
48
|
-
> - Disruptions panel (left, wide)
|
|
49
|
-
> - Active travelers panel (right, narrow)
|
|
50
|
-
> - Activity feed + chart row
|
|
51
|
-
> - Bookings table section
|
|
52
|
-
> - Policy + spend chart row
|
|
53
|
-
>
|
|
54
|
-
> 4. **Theme Setup** - Update brand palette to Engine teal tokens (section 3 PRD)
|
|
55
|
-
>
|
|
56
|
-
> 5. **File Structure**:
|
|
57
|
-
> - Create `src/pages/EngineDashboard.tsx`
|
|
58
|
-
> - Wire into `CommandCenter.tsx`
|
|
59
|
-
> - Use placeholder cards: `<BaseCard><div className="h-48 bg-slate-100">Section Name</div></BaseCard>`
|
|
60
|
-
>
|
|
61
|
-
> **DO NOT:**
|
|
62
|
-
> - Add any real data or sample data
|
|
63
|
-
> - Build actual components beyond placeholders
|
|
64
|
-
> - Add data fetching logic
|
|
65
|
-
> - Add interactive features beyond theme toggle
|
|
66
|
-
>
|
|
67
|
-
> **Deliverable:** A skeleton dashboard with proper layout, spacing, and placeholder cards that shows the structure.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
### Prompt 2 — Components & Sample Data
|
|
72
|
-
|
|
73
|
-
> Load skills: command-center-builder, command-center-project, component-library.
|
|
74
|
-
> Refer to `docs/engine-command-center-prd.md` sections 7, 8, and 12.
|
|
75
|
-
>
|
|
76
|
-
> **Phase 2: Build All Components with Sample Data**
|
|
77
|
-
>
|
|
78
|
-
> Replace all placeholders with fully functional components using hardcoded sample data:
|
|
79
|
-
>
|
|
80
|
-
> 1. **Create Sample Data File** - `src/data/engine-sample-data.ts`:
|
|
81
|
-
> - Travelers (10 active travelers with names, flights, hotels)
|
|
82
|
-
> - Flights (8 active flights with routes, status, progress %)
|
|
83
|
-
> - Disruptions (3 weather events, 2 delays, 1 cancellation)
|
|
84
|
-
> - Bookings (20 bookings with all fields)
|
|
85
|
-
> - Policy items (5 compliance items with status)
|
|
86
|
-
> - Eva actions (15 recent actions)
|
|
87
|
-
> - Spend history (12 months of data)
|
|
88
|
-
> - Destination stats (top 10 cities)
|
|
89
|
-
>
|
|
90
|
-
> 2. **Populate Map** - Wire sample data into GeoMap:
|
|
91
|
-
> - Show markers at origin/destination cities
|
|
92
|
-
> - Draw flight arcs with animated progress dots
|
|
93
|
-
> - Add weather overlays for disrupted areas
|
|
94
|
-
> - Add 4 glass KPI overlays (flights, travelers, disruptions, bookings count)
|
|
95
|
-
> - Add flight status strip with colored status chips
|
|
96
|
-
>
|
|
97
|
-
> 3. **Build Disruptions Panel**:
|
|
98
|
-
> - Use ListCard with disruption items
|
|
99
|
-
> - Show severity indicators (red/yellow/blue)
|
|
100
|
-
> - Show affected travelers
|
|
101
|
-
> - Show Eva's actions
|
|
102
|
-
>
|
|
103
|
-
> 4. **Build Active Travelers Panel**:
|
|
104
|
-
> - Use ListCard with expandable traveler cards
|
|
105
|
-
> - Click to expand and show flight, hotel, return date
|
|
106
|
-
> - Use Avatar for traveler photos
|
|
107
|
-
> - Show status chips
|
|
108
|
-
>
|
|
109
|
-
> 5. **Build Activity Feed + Chart**:
|
|
110
|
-
> - Use FeedPanel for Eva activities
|
|
111
|
-
> - Use ChartCard with bar chart of travelers by destination
|
|
112
|
-
>
|
|
113
|
-
> 6. **Build Bookings Table**:
|
|
114
|
-
> - Use TableCard with search, sort, pagination
|
|
115
|
-
> - Show all booking fields from section 12
|
|
116
|
-
> - Add status chips
|
|
117
|
-
>
|
|
118
|
-
> 7. **Build Policy + Spend Charts**:
|
|
119
|
-
> - Use StatusCard for policy compliance
|
|
120
|
-
> - Use ChartCard with line chart of monthly spend
|
|
121
|
-
>
|
|
122
|
-
> 8. **Add Interactivity**:
|
|
123
|
-
> - Click travelers to expand/collapse
|
|
124
|
-
> - Search/filter bookings table
|
|
125
|
-
> - Sort table columns
|
|
126
|
-
> - Hover map markers for tooltips
|
|
127
|
-
>
|
|
128
|
-
> **DO NOT:**
|
|
129
|
-
> - Connect to Salesforce data (use hardcoded data only)
|
|
130
|
-
> - Add data fetching hooks
|
|
131
|
-
> - Add GraphQL queries
|
|
132
|
-
> - Add Agentforce/Eva chat
|
|
133
|
-
>
|
|
134
|
-
> **Deliverable:** A fully functional dashboard with all components working using sample data. Everything should look and feel complete, just not connected to live data yet.
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
### Prompt 3 — Real Data Integration
|
|
139
|
-
|
|
140
|
-
> Load skills: command-center-builder, command-center-project, component-library, using-salesforce-data.
|
|
141
|
-
> Refer to `docs/engine-command-center-prd.md` sections 11 and 13.
|
|
142
|
-
>
|
|
143
|
-
> **Phase 3: Connect to Salesforce Data**
|
|
144
|
-
>
|
|
145
|
-
> Replace sample data with live Salesforce data:
|
|
146
|
-
>
|
|
147
|
-
> 1. **Create Data Hooks** - `src/hooks/`:
|
|
148
|
-
> - `useFlights.ts` - Fetch active flights from Flight__c
|
|
149
|
-
> - `useTravelers.ts` - Fetch travelers from Contact with flight relationships
|
|
150
|
-
> - `useDisruptions.ts` - Fetch disruption cases from Case
|
|
151
|
-
> - `useBookings.ts` - Fetch bookings from Booking__c
|
|
152
|
-
> - `usePolicyItems.ts` - Fetch policy compliance from Policy__c
|
|
153
|
-
> - `useEvaActions.ts` - Fetch Eva activity from Eva_Action__c
|
|
154
|
-
> - `useSpendData.ts` - Fetch spend trends from aggregate query
|
|
155
|
-
>
|
|
156
|
-
> 2. **GraphQL Queries** - For each hook, write GraphQL:
|
|
157
|
-
> - Use @optional on all fields (FLS resilience)
|
|
158
|
-
> - Include all relationships needed
|
|
159
|
-
> - Add proper filters (Active__c = true, etc.)
|
|
160
|
-
> - Use proper Salesforce field names from section 13
|
|
161
|
-
>
|
|
162
|
-
> 3. **Replace Sample Data** - In EngineDashboard.tsx:
|
|
163
|
-
> - Replace hardcoded arrays with hook calls
|
|
164
|
-
> - Add loading states with CardSkeleton
|
|
165
|
-
> - Add error states with EmptyState
|
|
166
|
-
> - Add refresh functionality
|
|
167
|
-
>
|
|
168
|
-
> 4. **Data Transformations** - Create `src/utils/engine-data-transforms.ts`:
|
|
169
|
-
> - Transform Salesforce records to map data format
|
|
170
|
-
> - Calculate KPI values from live data
|
|
171
|
-
> - Aggregate data for charts
|
|
172
|
-
> - Format dates, currencies, percentages
|
|
173
|
-
>
|
|
174
|
-
> 5. **Real-time Updates** - Add DataModeToggle:
|
|
175
|
-
> - Toggle between "sample" (Phase 2 data) and "live" (Salesforce data)
|
|
176
|
-
> - Store preference in localStorage
|
|
177
|
-
> - Show "Last synced" timestamp for live mode
|
|
178
|
-
>
|
|
179
|
-
> 6. **Error Handling**:
|
|
180
|
-
> - Network errors → Show retry button
|
|
181
|
-
> - No data → Show EmptyState with action
|
|
182
|
-
> - Partial data → Show what's available with warning
|
|
183
|
-
>
|
|
184
|
-
> **DO NOT:**
|
|
185
|
-
> - Add Agentforce/Eva chat yet
|
|
186
|
-
> - Add complex AI features
|
|
187
|
-
> - Modify component UI (should look same as Phase 2)
|
|
188
|
-
>
|
|
189
|
-
> **Deliverable:** Dashboard connected to live Salesforce data with loading states, error handling, and ability to toggle between sample/live data for testing.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### Prompt 4 — Agentforce Integration
|
|
194
|
-
|
|
195
|
-
> Load skills: command-center-builder, command-center-project, component-library, managing-agentforce-conversation-client.
|
|
196
|
-
> Refer to `docs/engine-command-center-prd.md` sections 9 and 10.
|
|
197
|
-
>
|
|
198
|
-
> **Phase 4: Add Eva Agent**
|
|
199
|
-
>
|
|
200
|
-
> Integrate Agentforce Eva agent:
|
|
201
|
-
>
|
|
202
|
-
> 1. **Add ChatBar to Header**:
|
|
203
|
-
> - Import ChatBar from @/components/library
|
|
204
|
-
> - Position in header (right side, before theme toggle)
|
|
205
|
-
> - Add keyboard shortcut (Cmd+K / Ctrl+K)
|
|
206
|
-
> - Add starter suggestions:
|
|
207
|
-
> - "Which travelers are affected by disruptions?"
|
|
208
|
-
> - "Show me all delayed flights"
|
|
209
|
-
> - "What's Eva doing right now?"
|
|
210
|
-
> - "Summarize today's travel status"
|
|
211
|
-
>
|
|
212
|
-
> 2. **Configure Eva Agent**:
|
|
213
|
-
> - Use Agentforce Eva agent ID from PRD section 9
|
|
214
|
-
> - Configure context: current user, visible data, dashboard state
|
|
215
|
-
> - Add tool calls for dashboard actions:
|
|
216
|
-
> - View traveler details
|
|
217
|
-
> - Filter bookings
|
|
218
|
-
> - Export data
|
|
219
|
-
> - Refresh data
|
|
220
|
-
>
|
|
221
|
-
> 3. **Add Salesforce Signals**:
|
|
222
|
-
> - Header: "Powered by Salesforce Data Cloud" badge
|
|
223
|
-
> - Traveler cards: "View in Salesforce" links → open Contact record
|
|
224
|
-
> - Booking rows: "View in Salesforce" links → open Booking__c record
|
|
225
|
-
> - Success toasts on actions: "Updated by Eva" with undo option
|
|
226
|
-
> - Live sync indicator with timestamp
|
|
227
|
-
>
|
|
228
|
-
> 4. **Eva Integration Points**:
|
|
229
|
-
> - ChatBar can filter visible data
|
|
230
|
-
> - ChatBar can expand specific travelers
|
|
231
|
-
> - ChatBar can open specific bookings
|
|
232
|
-
> - ChatBar can trigger refreshes
|
|
233
|
-
> - ChatBar shows contextual suggestions based on current view
|
|
234
|
-
>
|
|
235
|
-
> 5. **Testing Mode**:
|
|
236
|
-
> - If no Eva agent configured, show mock responses
|
|
237
|
-
> - Add "Configure Eva" EmptyState in ChatBar
|
|
238
|
-
> - Link to Agentforce setup docs
|
|
239
|
-
>
|
|
240
|
-
> **Deliverable:** Fully functional dashboard with Eva agent integrated, able to answer questions about travel data and perform dashboard actions.
|
|
241
|
-
|
|
242
|
-
---
|
|
14
|
+
Each phase file is self-contained — it includes the code template, exact imports, and the 5 constraints that matter for that phase. No cross-references needed.
|
|
243
15
|
|
|
244
16
|
## Why This Works
|
|
245
17
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
2
|
|
250
|
-
3. Data → Can focus on data fetching/transformation without UI changes
|
|
251
|
-
4. Agent → Can add AI on top of working dashboard
|
|
252
|
-
|
|
253
|
-
### Easy Testing
|
|
254
|
-
- Phase 1: Review layout, spacing, branding
|
|
255
|
-
- Phase 2: Test all interactions, edge cases with known data
|
|
256
|
-
- Phase 3: Test loading states, errors, real data shapes
|
|
257
|
-
- Phase 4: Test agent responses, tool calls
|
|
258
|
-
|
|
259
|
-
### Easy Debugging
|
|
260
|
-
- UI issues? → Phase 2
|
|
261
|
-
- Data issues? → Phase 3
|
|
262
|
-
- Agent issues? → Phase 4
|
|
263
|
-
|
|
264
|
-
### Easy Iterations
|
|
265
|
-
- Don't like layout? → Go back to Phase 1
|
|
266
|
-
- Component not working? → Fix in Phase 2 with sample data
|
|
267
|
-
- Data mapping wrong? → Fix Phase 3 transforms
|
|
268
|
-
- Agent not helpful? → Improve Phase 4 prompts
|
|
269
|
-
|
|
270
|
-
### Can Stop Early
|
|
271
|
-
- Need just the UI mockup? → Stop after Phase 2
|
|
272
|
-
- Don't have Salesforce yet? → Stop after Phase 2
|
|
273
|
-
- Don't need AI? → Stop after Phase 3
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Phase Checklist Template
|
|
278
|
-
|
|
279
|
-
### Phase 1: Layout ✓
|
|
280
|
-
- [ ] Header structure
|
|
281
|
-
- [ ] Hero section containers
|
|
282
|
-
- [ ] Data panel grid
|
|
283
|
-
- [ ] Placeholder cards in place
|
|
284
|
-
- [ ] Theme/branding applied
|
|
285
|
-
- [ ] Proper spacing and responsive layout
|
|
286
|
-
|
|
287
|
-
### Phase 2: Components ✓
|
|
288
|
-
- [ ] Sample data file created
|
|
289
|
-
- [ ] All components built
|
|
290
|
-
- [ ] All interactions working
|
|
291
|
-
- [ ] All visualizations working
|
|
292
|
-
- [ ] Charts rendering with sample data
|
|
293
|
-
- [ ] Table search/sort/pagination working
|
|
294
|
-
- [ ] Dashboard looks and feels complete
|
|
295
|
-
|
|
296
|
-
### Phase 3: Data ✓
|
|
297
|
-
- [ ] All data hooks created
|
|
298
|
-
- [ ] All GraphQL queries working
|
|
299
|
-
- [ ] Loading states added
|
|
300
|
-
- [ ] Error states handled
|
|
301
|
-
- [ ] Data transformations working
|
|
302
|
-
- [ ] Live/sample toggle working
|
|
303
|
-
- [ ] Real data rendering correctly
|
|
304
|
-
|
|
305
|
-
### Phase 4: Agent ✓
|
|
306
|
-
- [ ] ChatBar in header
|
|
307
|
-
- [ ] Eva agent configured
|
|
308
|
-
- [ ] Starter suggestions working
|
|
309
|
-
- [ ] Agent can answer questions
|
|
310
|
-
- [ ] Tool calls working
|
|
311
|
-
- [ ] Salesforce signals added
|
|
312
|
-
- [ ] Links to Salesforce records working
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## Benefits Over Original Approach
|
|
317
|
-
|
|
318
|
-
### Original Approach Issues:
|
|
319
|
-
- Mixed layout + components + data in early prompts
|
|
320
|
-
- Hard to debug what phase an issue is from
|
|
321
|
-
- No clear stopping point
|
|
322
|
-
- Can't test UI without data
|
|
323
|
-
- Can't review structure before building
|
|
324
|
-
|
|
325
|
-
### New Approach Benefits:
|
|
326
|
-
- Clear separation of concerns
|
|
327
|
-
- Each phase builds on previous
|
|
328
|
-
- Easy to identify issue source
|
|
329
|
-
- Can demo/test after each phase
|
|
330
|
-
- Can iterate on each phase independently
|
|
331
|
-
- Stakeholders can provide feedback earlier
|
|
18
|
+
- Each phase has a single focus
|
|
19
|
+
- Code templates mean less interpretation, faster builds
|
|
20
|
+
- Self-contained files eliminate contradictions
|
|
21
|
+
- Can stop after any phase (Phase 2 is a complete demo on its own)
|
|
332
22
|
|
|
333
|
-
|
|
23
|
+
## Build Prompts
|
|
334
24
|
|
|
335
|
-
|
|
25
|
+
Each phase is triggered by a simple prompt:
|
|
336
26
|
|
|
337
|
-
-
|
|
338
|
-
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
- **Can split Phase 2** - If many components, do 2a (map/KPIs) and 2b (panels/tables)
|
|
27
|
+
- Phase 1: "Scaffold the Engine Travel Command Center skeleton"
|
|
28
|
+
- Phase 2: "Replace placeholders with library components and sample data"
|
|
29
|
+
- Phase 3: "Connect the dashboard to live Salesforce data"
|
|
30
|
+
- Phase 4: "Add Eva ChatBar and Salesforce signals"
|
|
@@ -108,9 +108,11 @@ Every dashboard needs a unique layout structure and at least one domain-specific
|
|
|
108
108
|
|
|
109
109
|
## Map Layout
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
**Default pattern:** GeoMap in a **wide/narrow grid** (`lg:grid-cols-3` with `lg:col-span-2`). This works well for dashboards where the map is one of several equal-weight sections.
|
|
112
112
|
|
|
113
|
-
**
|
|
113
|
+
**If the PRD specifies a "visualization-hero" layout**, the map is full-width hero with glass overlays. The PRD always overrides this default pattern.
|
|
114
|
+
|
|
115
|
+
**Default pattern: Map + sidebar at matched height**
|
|
114
116
|
|
|
115
117
|
```jsx
|
|
116
118
|
<div className="grid grid-cols-1 gap-4 lg:grid-cols-3">
|
|
@@ -1,270 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: command-center-guide
|
|
3
|
-
description: Master guide for building command center dashboards. Routes to the appropriate
|
|
3
|
+
description: Master guide for building command center dashboards. Routes to the appropriate phase file or reference skill.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Command Center Development Guide
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Quick Start
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For the Engine Travel Command Center, use the phase files in `.a4drules/phases/`:
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
| Phase | File | What to build |
|
|
13
|
+
|-------|------|---------------|
|
|
14
|
+
| 1 | `phase-1-layout.md` | Header, hero map, glass overlays, placeholder panels |
|
|
15
|
+
| 2 | `phase-2-components.md` | Library components + sample data |
|
|
16
|
+
| 3 | `phase-3-live-data.md` | GraphQL hooks + live Salesforce data |
|
|
17
|
+
| 4 | `phase-4-agent.md` | Eva ChatBar + Salesforce signals |
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
Each file is self-contained with a code template and exact imports. Complete phases in order.
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|------------|---------|------------|-------------|
|
|
18
|
-
| **[component-library](#component-library)** | Complete component API reference | 55 + 8 sub-files | Looking up component props, data shapes, or choosing which component to use |
|
|
19
|
-
| **[command-center-builder](#command-center-builder)** | Dashboard build rules and workflows | 46 + 6 sub-files | Building/editing dashboards, layouts, styling, validation |
|
|
20
|
-
| **[command-center-project](#command-center-project)** | Project structure and routing | 100 lines | Understanding project organization, adding new pages to routes |
|
|
21
|
-
| **[outer-app](#outer-app)** | App shell and global navigation | 61 lines | Modifying header, sidebar, global nav, or app wrapper |
|
|
21
|
+
## Reference Skills (read on demand)
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
| Skill | When to use |
|
|
24
|
+
|-------|-------------|
|
|
25
|
+
| `component-library/SKILL.md` | Looking up component props or choosing which component to use |
|
|
26
|
+
| `command-center-project/SKILL.md` | Understanding project structure, routing, tech stack |
|
|
27
|
+
| `outer-app/SKILL.md` | Working on the app shell, navigation, or non-dashboard pages |
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
## Decision Tree
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| **exploring-webapp-graphql-schema** | Schema exploration, field lookup | Finding available fields on objects |
|
|
35
|
-
| **generating-webapp-graphql-read-query** | Query generation | Creating read queries |
|
|
36
|
-
| **generating-webapp-graphql-mutation-query** | Mutation generation | Creating/updating records |
|
|
37
|
-
| **managing-webapp-agentforce-conversation-client** | Agentforce chat integration | Adding Agentforce agent/chatbot |
|
|
38
|
-
| **building-webapp-react-components** | React patterns, hooks | Building custom React components |
|
|
39
|
-
| **building-webapp-data-visualization** | Charts, graphs, visualizations | Creating data visualizations |
|
|
40
|
-
|
|
41
|
-
## Decision Tree: Which Skill to Use?
|
|
42
|
-
|
|
43
|
-
Follow this decision tree to find the right skill:
|
|
44
|
-
|
|
45
|
-
### 1. Are you building or editing a dashboard page?
|
|
46
|
-
|
|
47
|
-
**YES** → Use **[command-center-builder](#command-center-builder)**
|
|
48
|
-
|
|
49
|
-
Start with [getting-started.md](../command-center-builder/getting-started.md) to understand critical requirements, then follow the workflow:
|
|
50
|
-
- Page structure & layout → [page-layout.md](../command-center-builder/page-layout.md)
|
|
51
|
-
- Choosing components → [components-styling.md](../command-center-builder/components-styling.md)
|
|
52
|
-
- Building charts → [charts-visualization.md](../command-center-builder/charts-visualization.md)
|
|
53
|
-
- Validation → [completion-checklist.md](../command-center-builder/completion-checklist.md)
|
|
54
|
-
|
|
55
|
-
**NO** → Continue to question 2
|
|
56
|
-
|
|
57
|
-
### 2. Do you need to look up a component's props or data shape?
|
|
58
|
-
|
|
59
|
-
**YES** → Use **[component-library](#component-library)**
|
|
60
|
-
|
|
61
|
-
Start with [when-to-use.md](../component-library/when-to-use.md) decision matrix, then go to the relevant detail file:
|
|
62
|
-
- Cards (MetricCard, ChartCard, TableCard, etc.) → [card-components.md](../component-library/card-components.md)
|
|
63
|
-
- Charts & visualizations → [charts.md](../component-library/charts.md)
|
|
64
|
-
- Forms & filters → [forms-filters.md](../component-library/forms-filters.md)
|
|
65
|
-
- Chat & data → [chat-data.md](../component-library/chat-data.md)
|
|
66
|
-
- Advanced components → [hero-ui.md](../component-library/hero-ui.md)
|
|
67
|
-
- Troubleshooting props → [common-mistakes.md](../component-library/common-mistakes.md)
|
|
68
|
-
|
|
69
|
-
**NO** → Continue to question 3
|
|
70
|
-
|
|
71
|
-
### 3. Are you adding a new page or modifying routes?
|
|
72
|
-
|
|
73
|
-
**YES** → Use **[command-center-project](#command-center-project)**
|
|
74
|
-
|
|
75
|
-
This skill explains:
|
|
76
|
-
- Project structure (`src/pages/`, `src/dashboards/`, etc.)
|
|
77
|
-
- How to register new pages in the router
|
|
78
|
-
- Route configuration
|
|
79
|
-
- Where different file types live
|
|
80
|
-
|
|
81
|
-
**NO** → Continue to question 4
|
|
82
|
-
|
|
83
|
-
### 4. Are you connecting to live Salesforce data?
|
|
84
|
-
|
|
85
|
-
**YES** → Use global skills: **accessing-webapp-data**, **exploring-webapp-graphql-schema**, **using-webapp-graphql**
|
|
86
|
-
|
|
87
|
-
Workflow:
|
|
88
|
-
1. Explore schema for custom objects
|
|
89
|
-
2. Write GraphQL queries with actual field names
|
|
90
|
-
3. Run codegen for TypeScript types
|
|
91
|
-
4. Create hook with useDataSource for sample/live mode switching
|
|
92
|
-
|
|
93
|
-
**NO** → Continue to question 5
|
|
94
|
-
|
|
95
|
-
### 5. Are you adding an Agentforce agent or chatbot?
|
|
96
|
-
|
|
97
|
-
**YES** → Use global skill: **managing-webapp-agentforce-conversation-client**
|
|
98
|
-
|
|
99
|
-
Or for simpler chat UI: Use **[component-library](../component-library/chat-data.md)** (ChatBar component)
|
|
100
|
-
|
|
101
|
-
**NO** → Continue to question 6
|
|
102
|
-
|
|
103
|
-
### 6. Are you modifying the app shell (header, sidebar, global nav)?
|
|
104
|
-
|
|
105
|
-
**YES** → Use **[outer-app](#outer-app)**
|
|
106
|
-
|
|
107
|
-
This skill covers:
|
|
108
|
-
- App wrapper layout
|
|
109
|
-
- Global header component
|
|
110
|
-
- Sidebar navigation
|
|
111
|
-
- Theme/dark mode toggle
|
|
112
|
-
- App-level configuration
|
|
113
|
-
|
|
114
|
-
**NO** → If none of the above, ask for clarification or check **command-center-builder** as the default.
|
|
115
|
-
|
|
116
|
-
## Common Workflows
|
|
117
|
-
|
|
118
|
-
### Workflow 1: Build a New Dashboard from Scratch
|
|
119
|
-
|
|
120
|
-
1. **[command-center-builder](../command-center-builder/getting-started.md)** — Read STOP and CRITICAL rules first
|
|
121
|
-
2. **[command-center-project](../command-center-project/SKILL.md)** — Understand where to create the page file
|
|
122
|
-
3. **[command-center-builder/page-layout.md](../command-center-builder/page-layout.md)** — Wire up the page and choose layout
|
|
123
|
-
4. **[component-library/when-to-use.md](../component-library/when-to-use.md)** — Choose components from decision matrix
|
|
124
|
-
5. **[component-library](../component-library/SKILL.md)** — Look up exact props for each component
|
|
125
|
-
6. **[command-center-builder/charts-visualization.md](../command-center-builder/charts-visualization.md)** — If using charts, follow MANDATORY rules
|
|
126
|
-
7. **[command-center-builder/completion-checklist.md](../command-center-builder/completion-checklist.md)** — Validate before reporting done
|
|
127
|
-
|
|
128
|
-
### Workflow 1b: Connect Dashboard to Live Salesforce Data
|
|
129
|
-
|
|
130
|
-
1. **accessing-webapp-data** (global) — Understand Data SDK requirements
|
|
131
|
-
2. **exploring-webapp-graphql-schema** (global) — Explore schema for custom objects (Trip__c, Flight__c, etc.)
|
|
132
|
-
3. **using-webapp-graphql** (global) — Write GraphQL queries, run codegen for types
|
|
133
|
-
4. **[component-library/chat-data.md](../component-library/chat-data.md)** — Use DataModeProvider and useDataSource hook
|
|
134
|
-
5. Create custom hook that transforms live data to match sample data shape
|
|
135
|
-
6. Add DataModeToggle to switch between sample/live modes
|
|
136
|
-
|
|
137
|
-
### Workflow 2: Add a Chart to an Existing Dashboard
|
|
138
|
-
|
|
139
|
-
1. **[command-center-builder/charts-visualization.md](../command-center-builder/charts-visualization.md)** — Read chart requirements
|
|
140
|
-
2. **[component-library/charts.md](../component-library/charts.md)** — Look up D3Chart props and templates
|
|
141
|
-
3. **[component-library/card-components.md](../component-library/card-components.md)** — Look up ChartCard wrapper props
|
|
142
|
-
4. **[command-center-builder/completion-checklist.md](../command-center-builder/completion-checklist.md)** — Validate chart implementation
|
|
143
|
-
|
|
144
|
-
### Workflow 3: Troubleshoot a Component Error
|
|
145
|
-
|
|
146
|
-
1. **[component-library/common-mistakes.md](../component-library/common-mistakes.md)** — Check "Do Not" list for common errors
|
|
147
|
-
2. **[component-library](../component-library/SKILL.md)** — Look up the component in the relevant detail file
|
|
148
|
-
3. Verify you're using exact prop names (not guessing)
|
|
149
|
-
4. Check that you imported from `@/components/library` correctly
|
|
150
|
-
|
|
151
|
-
### Workflow 4: Style or Theme a Dashboard
|
|
152
|
-
|
|
153
|
-
1. **[command-center-builder/components-styling.md](../command-center-builder/components-styling.md)** — Brand colors, semantic colors, dark mode
|
|
154
|
-
2. **[component-library/ui-primitives.md](../component-library/ui-primitives.md)** — UI primitives for styling consistency
|
|
155
|
-
3. **[command-center-builder/getting-started.md](../command-center-builder/getting-started.md)** — Image requirements
|
|
156
|
-
|
|
157
|
-
### Workflow 5: Add Global Navigation or Modify App Shell
|
|
158
|
-
|
|
159
|
-
1. **[outer-app](../outer-app/SKILL.md)** — App shell structure and header/sidebar
|
|
160
|
-
2. **[command-center-project](../command-center-project/SKILL.md)** — Router configuration if adding nav links
|
|
161
|
-
|
|
162
|
-
### Workflow 6: Add Agentforce Agent/Chatbot
|
|
163
|
-
|
|
164
|
-
1. **managing-webapp-agentforce-conversation-client** (global) — Complete integration guide
|
|
165
|
-
2. **[component-library/chat-data.md](../component-library/chat-data.md)** — For ChatBar component (simpler alternative)
|
|
166
|
-
3. Ask user for agent ID if not already configured
|
|
167
|
-
4. Configure inline vs floating mode, styling, dimensions
|
|
168
|
-
|
|
169
|
-
## Skill Interaction Rules
|
|
170
|
-
|
|
171
|
-
### component-library vs command-center-builder
|
|
172
|
-
|
|
173
|
-
- **component-library** = WHAT (exact props, data shapes, API reference)
|
|
174
|
-
- **command-center-builder** = WHEN & HOW (which component to use, layout patterns, validation rules)
|
|
175
|
-
|
|
176
|
-
**Use both together:** command-center-builder tells you which component to use, component-library tells you how to use it.
|
|
177
|
-
|
|
178
|
-
### command-center-project vs outer-app
|
|
179
|
-
|
|
180
|
-
- **command-center-project** = Dashboard pages and routing
|
|
181
|
-
- **outer-app** = App wrapper and global navigation
|
|
182
|
-
|
|
183
|
-
**Boundary:** If it's inside `src/dashboards/` → command-center-project. If it's in `App.tsx` or global layout → outer-app.
|
|
184
|
-
|
|
185
|
-
### When to Read Multiple Skills
|
|
186
|
-
|
|
187
|
-
Some tasks require multiple skills in sequence:
|
|
188
|
-
|
|
189
|
-
- **Building a new dashboard** → command-center-builder + component-library + command-center-project
|
|
190
|
-
- **Adding a chart** → command-center-builder + component-library
|
|
191
|
-
- **Modifying navigation** → outer-app + command-center-project
|
|
192
|
-
- **Troubleshooting** → component-library (common-mistakes) first, then command-center-builder
|
|
193
|
-
|
|
194
|
-
## Critical Reminders
|
|
195
|
-
|
|
196
|
-
1. **ALWAYS start with command-center-builder/getting-started.md** before building any dashboard
|
|
197
|
-
2. **NEVER guess component prop names** — look them up in component-library
|
|
198
|
-
3. **NEVER hand-roll HTML cards** — use library components only
|
|
199
|
-
4. **ALWAYS run the completion checklist** before reporting done
|
|
200
|
-
5. **Dark mode is MANDATORY** — check all color choices support it
|
|
201
|
-
6. **Images are MANDATORY** — every dashboard needs visuals
|
|
202
|
-
|
|
203
|
-
## Feature Rule
|
|
204
|
-
|
|
205
|
-
The **command-center-dashboard-rule.md** feature provides automated validation. It checks:
|
|
206
|
-
- Component usage (library components vs hand-rolled HTML)
|
|
207
|
-
- Dark mode compliance
|
|
208
|
-
- Image presence
|
|
209
|
-
- Chart implementation
|
|
210
|
-
- Navigation structure
|
|
211
|
-
|
|
212
|
-
This rule runs automatically during validation. See [completion-checklist.md](../command-center-builder/completion-checklist.md) for details.
|
|
213
|
-
|
|
214
|
-
## File Organization Summary
|
|
215
|
-
|
|
216
|
-
All skills are split into sub-files (<300 lines each) for easier navigation:
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
.a4drules/
|
|
220
|
-
├── features/
|
|
221
|
-
│ └── command-center-dashboard-rule.md (50 lines)
|
|
222
|
-
└── skills/
|
|
223
|
-
├── command-center-guide/ ← YOU ARE HERE
|
|
224
|
-
│ └── SKILL.md (this file)
|
|
225
|
-
├── component-library/
|
|
226
|
-
│ ├── SKILL.md (55 lines - routing file)
|
|
227
|
-
│ ├── when-to-use.md (39 lines)
|
|
228
|
-
│ ├── card-components.md (253 lines)
|
|
229
|
-
│ ├── charts.md (64 lines)
|
|
230
|
-
│ ├── ui-primitives.md (92 lines)
|
|
231
|
-
│ ├── forms-filters.md (130 lines)
|
|
232
|
-
│ ├── chat-data.md (184 lines)
|
|
233
|
-
│ ├── hero-ui.md (211 lines)
|
|
234
|
-
│ └── common-mistakes.md (25 lines)
|
|
235
|
-
├── command-center-builder/
|
|
236
|
-
│ ├── SKILL.md (46 lines - routing file)
|
|
237
|
-
│ ├── getting-started.md (127 lines)
|
|
238
|
-
│ ├── page-layout.md (143 lines)
|
|
239
|
-
│ ├── components-styling.md (97 lines)
|
|
240
|
-
│ ├── data-forms-ai.md (43 lines)
|
|
241
|
-
│ ├── charts-visualization.md (136 lines)
|
|
242
|
-
│ └── completion-checklist.md (87 lines)
|
|
243
|
-
├── command-center-project/
|
|
244
|
-
│ └── SKILL.md (100 lines)
|
|
245
|
-
└── outer-app/
|
|
246
|
-
└── SKILL.md (61 lines)
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## Quick Reference Card
|
|
250
|
-
|
|
251
|
-
| I need to... | Start here |
|
|
252
|
-
|-------------|------------|
|
|
253
|
-
| Build a new dashboard | [command-center-builder/getting-started.md](../command-center-builder/getting-started.md) |
|
|
254
|
-
| Look up a component's props | [component-library/when-to-use.md](../component-library/when-to-use.md) → relevant detail file |
|
|
255
|
-
| Add a new page to routes | [command-center-project](../command-center-project/SKILL.md) |
|
|
256
|
-
| Modify header or sidebar | [outer-app](../outer-app/SKILL.md) |
|
|
257
|
-
| Build a chart | [command-center-builder/charts-visualization.md](../command-center-builder/charts-visualization.md) |
|
|
258
|
-
| Fix a component error | [component-library/common-mistakes.md](../component-library/common-mistakes.md) |
|
|
259
|
-
| Validate before reporting done | [command-center-builder/completion-checklist.md](../command-center-builder/completion-checklist.md) |
|
|
260
|
-
| Understand project structure | [command-center-project](../command-center-project/SKILL.md) |
|
|
261
|
-
|
|
262
|
-
## Getting Help
|
|
263
|
-
|
|
264
|
-
If you're unsure which skill to use:
|
|
265
|
-
1. Start with this guide's decision tree
|
|
266
|
-
2. Check the Quick Reference Card above
|
|
267
|
-
3. When in doubt, start with **command-center-builder** for dashboard work
|
|
268
|
-
4. Use **component-library** for any component prop lookups
|
|
269
|
-
|
|
270
|
-
Remember: **Skills are split for easier navigation, not sequential reading.** Use the decision tree to jump directly to what you need.
|
|
31
|
+
1. **Building the Engine dashboard?** → Read the phase file for your current phase
|
|
32
|
+
2. **Need component API details?** → Read `component-library/SKILL.md` → relevant sub-file
|
|
33
|
+
3. **Adding routes or pages?** → Read `command-center-project/SKILL.md`
|
|
34
|
+
4. **Working on app shell/nav?** → Read `outer-app/SKILL.md`
|
|
35
|
+
5. **Connecting to live data?** → Phase 3 file + global skills: `exploring-webapp-graphql-schema`, `using-webapp-graphql`
|
|
36
|
+
6. **Adding Agentforce agent?** → Phase 4 file + global skill: `managing-webapp-agentforce-conversation-client`
|