@salesforce/mcp-provider-lwc-experts 0.6.3 → 0.6.4

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.
Files changed (58) hide show
  1. package/index.bundle.js +109 -117
  2. package/knowledge/graphql/generation-guide.md +212 -0
  3. package/knowledge/graphql/generation-mutation.md +265 -0
  4. package/knowledge/graphql/generation-query.md +235 -0
  5. package/knowledge/graphql/generation-schema.md +20 -0
  6. package/knowledge/graphql/schema/shared.graphqls +1140 -0
  7. package/knowledge/o11y/activityApi.md +64 -0
  8. package/knowledge/o11y/bestPractices.md +106 -0
  9. package/knowledge/o11y/counterMetrics.md +61 -0
  10. package/knowledge/o11y/errorTracking.md +70 -0
  11. package/knowledge/o11y/initialization.md +46 -0
  12. package/knowledge/o11y/lifecycleInstrumentation.md +91 -0
  13. package/knowledge/o11y/logApi.md +53 -0
  14. package/knowledge/o11y/schemaUsage.md +48 -0
  15. package/knowledge/slds/styling-hooks/README.md +408 -0
  16. package/knowledge/slds/styling-hooks/categories/color.md +963 -0
  17. package/knowledge/slds/styling-hooks/categories/radius.md +526 -0
  18. package/knowledge/slds/styling-hooks/categories/shadow.md +489 -0
  19. package/knowledge/slds/styling-hooks/categories/sizing.md +667 -0
  20. package/knowledge/slds/styling-hooks/categories/spacing.md +501 -0
  21. package/knowledge/slds/styling-hooks/categories/typography.md +708 -0
  22. package/knowledge/slds/styling-hooks/global-semantic/accent-hooks.md +207 -0
  23. package/knowledge/slds/styling-hooks/global-semantic/feedback-hooks.md +819 -0
  24. package/knowledge/slds/styling-hooks/global-semantic/surface-hooks.md +215 -0
  25. package/knowledge/slds/styling-hooks/guidance.md +906 -0
  26. package/knowledge/slds/styling-hooks/metadata/hooks-index.json +6576 -0
  27. package/knowledge/utam/generation-guide.md +499 -0
  28. package/knowledge/utam/generation-workflow.md +243 -0
  29. package/knowledge/utam/namespaces-mapping.md +26 -0
  30. package/knowledge/utam/utam-json-schema.md +720 -0
  31. package/knowledge/utils.ts +27 -0
  32. package/package.json +4 -3
  33. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-create-list-info.md +0 -0
  34. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-create-record.md +0 -0
  35. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-delete-list-info.md +0 -0
  36. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-delete-record.md +0 -0
  37. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-info-by-name.md +0 -0
  38. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-infos-by-name.md +0 -0
  39. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-infos-by-object-name.md +0 -0
  40. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-object-info.md +0 -0
  41. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-preferences.md +0 -0
  42. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-records-by-name.md +0 -0
  43. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-list-info.md +0 -0
  44. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-list-preferences.md +0 -0
  45. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-record.md +0 -0
  46. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/lds-wire-adapter-types.json +0 -0
  47. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-count.md +0 -0
  48. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-info-batch.md +0 -0
  49. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-info.md +0 -0
  50. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-records-batch.md +0 -0
  51. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-records.md +0 -0
  52. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-lists-info.md +0 -0
  53. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-object-info.md +0 -0
  54. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-object-infos.md +0 -0
  55. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-picklist-values-record.md +0 -0
  56. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-picklist-values.md +0 -0
  57. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-record.md +0 -0
  58. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-records.md +0 -0
@@ -0,0 +1,408 @@
1
+ # SLDS Styling Hooks Knowledge Base
2
+
3
+ Comprehensive documentation of all 473 SLDS global styling hooks for AI coding agents.
4
+
5
+ ---
6
+
7
+ ## Structure Overview
8
+
9
+ ```
10
+ styling-hooks/
11
+ ├── guidance.md [✅ COMPLETE] Main agent guidance
12
+ ├── review-guidance.md [✅ COMPLETE] Validation report
13
+
14
+ ├── global-semantic/ [✅ PHASE 3 COMPLETE]
15
+ │ ├── accent-hooks.md [12 hooks - Semantic accent colors]
16
+ │ ├── surface-hooks.md [10 hooks - Surface & container colors]
17
+ │ └── feedback-hooks.md [26 hooks - Error, success, warning, info, disabled]
18
+
19
+ ├── categories/ [✅ PHASE 4C COMPLETE]
20
+ │ ├── color.md [Comprehensive color system guidance]
21
+ │ ├── spacing.md [Complete spacing system guidance]
22
+ │ ├── typography.md [Full typography system guidance]
23
+ │ ├── shadow.md [39 shadow hooks - elevation & focus]
24
+ │ ├── radius.md [6 radius hooks - border curvature]
25
+ │ └── sizing.md [26 sizing hooks - dimensions, borders, typography-width]
26
+
27
+ ├── metadata/ [✅ PHASE 1 COMPLETE]
28
+ │ └── hooks-index.json [All 473 hooks - Complete index]
29
+
30
+ └── scripts/
31
+ └── generate-hooks-index.js [Script to regenerate index from metadata]
32
+ ```
33
+
34
+ ---
35
+
36
+ ## What's Available
37
+
38
+ ### ✅ Phase 1: Core Structure (Complete)
39
+
40
+ #### 1. `guidance.md` - Main Agent Guidance
41
+
42
+ **Purpose:** Primary reference for coding agents
43
+
44
+ **Contains:**
45
+
46
+ - Overview of all styling hook categories
47
+ - Three-tier color system (Semantic → System → Palette)
48
+ - Current implementation status (what's available vs. planned)
49
+ - Usage patterns for common scenarios
50
+ - Decision trees for hook selection
51
+ - Migration examples and troubleshooting
52
+
53
+ #### 2. `global-semantic/*.md` - Semantic Color Documentation
54
+
55
+ **48 Fully Documented Hooks across 3 files:**
56
+
57
+ - **Accent:** `accent-1/2/3`, `accent-container`, `border-accent`, `on-accent`
58
+ - **Surface:** `surface-1/2/3`, `surface-container`, `surface-inverse`
59
+ - **Feedback:** Error, Success, Warning, Info, Disabled variants
60
+
61
+ **Includes:** Usage do/don't, context, state progression, accessibility, related hooks
62
+
63
+ #### 3. `metadata/hooks-index.json` - Complete Hooks Index
64
+
65
+ **Total:** 473 global SLDS hooks
66
+
67
+ **Categories:** Color (312), Spacing (48), Font (46), Shadow (27), Sizing (26), Radius (6), Other (8)
68
+
69
+ **Use For:** Fast lookup and verification of any hook
70
+
71
+ ---
72
+
73
+ ### ✅ Phase 2: Category Guidance (Complete)
74
+
75
+ #### 1. `categories/color.md` - Color System Guide
76
+
77
+ **Covers:** ~312 color hooks
78
+
79
+ **Key Topics:**
80
+
81
+ - **Three-tier system:** Semantic UI → System → Palette
82
+ - **Magic numbers:** 50-point separation (text), 40-point (UI elements)
83
+ - **85-5-10 color density rule**
84
+ - **Decision tree for tier selection**
85
+ - **All palette families** with usage guidance
86
+
87
+ **Agent Gets:** When to use each tier, how to ensure accessibility, common patterns
88
+
89
+ #### 2. `categories/spacing.md` - Spacing System Guide
90
+
91
+ **Covers:** 48 spacing hooks
92
+
93
+ **Key Topics:**
94
+
95
+ - **Base spacing:** Fixed values (spacing-1 through spacing-12)
96
+ - **Density-aware:** Auto-adapts for comfy/compact modes
97
+ - **Directional variants:** block (vertical), inline (horizontal), var (all sides)
98
+ - **Target sizes:** 44×44px minimum for interactive elements
99
+
100
+ **Agent Gets:** Which spacing type to use when, how to maintain accessibility
101
+
102
+ #### 3. `categories/typography.md` - Typography System Guide
103
+
104
+ **Covers:** 49 typography hooks
105
+
106
+ **Key Topics:**
107
+
108
+ - **Numbered weight system:** font-weight-1 through font-weight-7
109
+ - **Line heights:** font-lineheight-1 through font-lineheight-6
110
+ - **Font families:** base, monospace
111
+ - **Typography hierarchy patterns**
112
+
113
+ **Agent Gets:** How to use numbered (not named) hooks, accessibility requirements (1.5 line height, 14px minimum)
114
+
115
+ ---
116
+
117
+ ### ✅ Phase 3: Complete Semantic Hooks (Complete)
118
+
119
+ #### 1. `global-semantic/accent-hooks.md` - Accent Colors
120
+
121
+ **12 Hooks:** Fully documented semantic accent colors
122
+
123
+ **Includes:**
124
+
125
+ - `accent-1/2/3` - Text/icon colors with state progression
126
+ - `accent-container-1/2/3` - Background fills for brand buttons
127
+ - `border-accent-1/2/3` - Border colors for brand elements
128
+ - `on-accent-1/2/3` - Foreground colors for accent backgrounds
129
+
130
+ **Metadata:** Usage do/don't, context, state progression, accessibility, related hooks
131
+
132
+ #### 2. `global-semantic/surface-hooks.md` - Surface & Container Colors
133
+
134
+ **10 Hooks:** Complete surface color system
135
+
136
+ **Includes:**
137
+
138
+ - `surface-1/2/3` - Page-level backgrounds for stacking context
139
+ - `surface-container-1/2/3` - Container backgrounds for elements on surfaces
140
+ - `on-surface-1/2/3` - Foreground colors with emphasis levels
141
+ - `surface-inverse-1` - Dark mode/inverted surfaces
142
+
143
+ **Key Insights:**
144
+
145
+ - Surface numbering is aesthetic choice, NOT interaction states
146
+ - Surface vs. surface-container is semantic distinction (same color values)
147
+ - On-surface pairing based on emphasis, not strict number matching
148
+
149
+ #### 3. `global-semantic/feedback-hooks.md` - Feedback States
150
+
151
+ **26 Hooks:** Complete feedback color system
152
+
153
+ **Includes:**
154
+
155
+ - **Error (7 hooks):** error-1, error-container-1/2, border-error-1/2, on-error-1/2
156
+ - **Success (7 hooks):** success-1, success-container-1/2, border-success-1/2, on-success-1/2
157
+ - **Warning (4 hooks):** warning-1, warning-container-1, border-warning-1, on-warning-1
158
+ - **Info (3 hooks):** info-1, info-container-1, on-info-1
159
+ - **Disabled (5 hooks):** disabled-1/2, disabled-container-1/2, border-disabled-1, on-disabled-1/2
160
+
161
+ **Key Insights:**
162
+
163
+ - Error/Success have -2 variants for interactive destructive/confirmation buttons
164
+ - Warning/Info lack -2 variants (no interactive buttons in SLDS2 currently)
165
+ - Disabled variants represent visual weight, not interaction states
166
+
167
+ ---
168
+
169
+ ### ✅ Phase 4C: Shadow, Radius, Sizing (Complete)
170
+
171
+ #### 1. `categories/shadow.md` - Shadow System
172
+
173
+ **Covers:** 39 shadow hooks
174
+
175
+ **Key Topics:**
176
+
177
+ - **Core shadows:** shadow-1 through shadow-6 for elevation levels
178
+ - **Directional shadows:** block (vertical) and inline (horizontal) placement
179
+ - **Focus shadows:** outline, outset, inset, inverse for keyboard navigation
180
+ - **Inverse shadows:** Dark mode shadow handling
181
+ - **Elevation principles:** Progressive shadow usage for visual hierarchy
182
+
183
+ **Agent Gets:** When to use each shadow level, how to combine shadows, focus state patterns
184
+
185
+ #### 2. `categories/radius.md` - Border Radius System
186
+
187
+ **Covers:** 6 radius hooks
188
+
189
+ **Key Topics:**
190
+
191
+ - **Progressive rounding:** radius-border-1 through radius-border-4
192
+ - **Special shapes:** circle (100%) and pill (15rem)
193
+ - **Component-specific usage:** When to use each radius level
194
+ - **Directional radius:** Applying radius to specific corners
195
+
196
+ **Agent Gets:** Consistent radius choices, circle vs pill usage, accessibility considerations
197
+
198
+ #### 3. `categories/sizing.md` - Sizing System
199
+
200
+ **Covers:** 26 sizing hooks (16 general + 4 border + 6 typography-width)
201
+
202
+ **Key Topics:**
203
+
204
+ - **Element dimensions:** sizing-1 through sizing-16 for icons, avatars, containers
205
+ - **Border widths:** sizing-border-1 through sizing-border-4
206
+ - **Typography widths:** sizing-content-_ and sizing-heading-_ for optimal readability (character-based)
207
+ - **8-point grid alignment:** Values in multiples of 8
208
+ - **Target sizing:** When to use padding vs fixed dimensions
209
+ - **Responsive scaling:** Relative to root font-size
210
+
211
+ **Agent Gets:** Icon sizing consistency, avatar dimensions, content width constraints, when NOT to use sizing hooks (spacing)
212
+
213
+ ---
214
+
215
+ ## How Agents Use This Knowledge
216
+
217
+ ### Query Pattern 1: Getting General Guidance
218
+
219
+ ```javascript
220
+ // Agent wants to understand colors
221
+ {
222
+ {
223
+ GUIDE_SLDS_STYLING_TOOL;
224
+ }
225
+ }
226
+ ({ topic: 'colors' });
227
+ // Returns: categories/color.md with principles, palette system, rules
228
+
229
+ // Agent wants to understand spacing
230
+ {
231
+ {
232
+ GUIDE_SLDS_STYLING_TOOL;
233
+ }
234
+ }
235
+ ({ topic: 'spacing' });
236
+ // Returns: categories/spacing.md with scale, density-aware hooks, patterns
237
+ ```
238
+
239
+ ### Query Pattern 2: Finding Specific Hooks
240
+
241
+ ```javascript
242
+ // Agent needs accent color hooks
243
+ {
244
+ {
245
+ EXPLORE_SLDS_STYLING_TOOL;
246
+ }
247
+ }
248
+ ({ prefix: '--slds-g-color-accent-' });
249
+ // Returns: All 12 accent hooks from global-semantic/accent-hooks.md
250
+
251
+ // Agent wants all spacing hooks
252
+ {
253
+ {
254
+ EXPLORE_SLDS_STYLING_TOOL;
255
+ }
256
+ }
257
+ ({ category: 'spacing' });
258
+ // Returns: All 48 spacing hooks from metadata/hooks-index.json
259
+
260
+ // Agent checks if specific hook exists
261
+ {
262
+ {
263
+ EXPLORE_SLDS_STYLING_TOOL;
264
+ }
265
+ }
266
+ ({ hooks: ['--slds-g-spacing-4'] });
267
+ // Returns: Hook details from index
268
+ ```
269
+
270
+ ### Query Pattern 3: Category Exploration
271
+
272
+ ```javascript
273
+ // Agent browses all color hooks
274
+ {
275
+ {
276
+ EXPLORE_SLDS_STYLING_TOOL;
277
+ }
278
+ }
279
+ ({ category: 'color' });
280
+ // Returns: ~312 color hooks from metadata/hooks-index.json
281
+
282
+ // Agent searches palette colors
283
+ {
284
+ {
285
+ EXPLORE_SLDS_STYLING_TOOL;
286
+ }
287
+ }
288
+ ({ search: 'palette-neutral' });
289
+ // Returns: All neutral palette hooks
290
+ ```
291
+
292
+ ---
293
+
294
+ ## What's Next (Future Phases)
295
+
296
+ ### 🚧 Phase 3: Complete Hook References (Medium Priority)
297
+
298
+ **Goal:** Generate comprehensive JSON metadata files for all hook categories
299
+
300
+ 1. **`categories/color-hooks.json`** - All 312 color hooks with metadata
301
+ 2. **`categories/typography-hooks.json`** - All 46 typography hooks with metadata
302
+ 3. **`categories/spacing-hooks.json`** - All 48 spacing hooks with metadata
303
+ 4. **`categories/sizing-shadow-radius-hooks.json`** - All utility hooks (sizing: 26, shadow: 27, radius: 6)
304
+
305
+ **Format:** Detailed metadata (token, category, value, properties) to complement Markdown guides.
306
+
307
+ ### 🔮 Phase 4: Additional Semantic Hooks (Future)
308
+
309
+ **Goal:** Add more semantic hook documentation as they become available
310
+
311
+ 1. **`global-semantic/container-hooks.md`** - Container color hooks (when documented)
312
+ 2. **`global-semantic/border-hooks.md`** - Border semantic hooks (when documented)
313
+
314
+ ---
315
+
316
+ ## Maintenance
317
+
318
+ ### Regenerating the Hooks Index
319
+
320
+ When `globalstylinghooks.metadata.json` is updated:
321
+
322
+ ```bash
323
+ cd packages/knowledge/styling-hooks
324
+ node scripts/generate-hooks-index.js
325
+ ```
326
+
327
+ This will regenerate `metadata/hooks-index.json` with the latest hook data.
328
+
329
+ ### Adding New Semantic Hooks
330
+
331
+ 1. Create Markdown file in `global-semantic/` directory
332
+ 2. Follow format from `accent-hooks.md`
333
+ 3. Include: Overview, Available Hooks list, and Detailed Usage sections
334
+ 4. Update this README with counts
335
+
336
+ ### Adding New Category Guides
337
+
338
+ 1. Create MD file in `categories/` directory
339
+ 2. Include: overview, complete scale/system, decision trees, patterns, accessibility, troubleshooting
340
+ 3. Cross-reference other category files and guidance.md
341
+ 4. Update this README
342
+
343
+ ---
344
+
345
+ ## Integration with MCP Tools
346
+
347
+ This knowledge base is consumed by the `{{EXPLORE_SLDS_STYLING_TOOL}}` MCP tool via the `KnowledgeLoader` utility.
348
+
349
+ ### Tool Behavior
350
+
351
+ **The tool automatically loads:**
352
+
353
+ - `global-semantic/*.md` → Returns rich documentation for semantic hooks
354
+ - `metadata/hooks-index.json` → Returns basic metadata for all hooks
355
+ - MD files are returned by separate guidance tools
356
+
357
+ **Query Processing:**
358
+
359
+ 1. Exact lookup (`hooks: ["--slds-g-color-accent-1"]`) → Returns from semantic documentation if available, else from index
360
+ 2. Prefix search (`prefix: "--slds-g-color-accent-"`) → Returns all matching hooks
361
+ 3. Category filter (`category: "color"`) → Returns all hooks in category
362
+ 4. Search (`search: "accent"`) → Fuzzy matches across all hooks
363
+
364
+ ---
365
+
366
+ ## Key Design Decisions
367
+
368
+ ### Why Markdown for Semantic Hooks?
369
+
370
+ **Decision:** We moved from JSON to Markdown for semantic hook documentation.
371
+
372
+ **Reasons:**
373
+
374
+ - ✅ **Context-Rich:** Semantic hooks require explanation (do's/don'ts, accessibility context) which fits better in Markdown.
375
+ - ✅ **Readability:** Easier for both humans and LLMs to consume linear guidance.
376
+ - ✅ **Unified Format:** Aligns with category guides.
377
+
378
+ **Metadata Role:**
379
+ We still maintain `metadata/hooks-index.json` for fast, structured lookups and existence validation. The Markdown files provide the _qualitative_ guidance, while the JSON index provides the _quantitative_ data (values, categories).
380
+
381
+ ### Why Numbered Spacing (1-12) Not Named (small/medium)?
382
+
383
+ **Reality:** SLDS metadata uses numbered hooks (`spacing-1` through `spacing-12`)
384
+
385
+ **Benefits:**
386
+
387
+ - Precise control over values
388
+ - Clear progression (1 < 2 < 3)
389
+ - No ambiguity (is "small" 8px or 12px?)
390
+ - Aligns with numbered typography scale
391
+
392
+ **Agent-Friendly:** The MD files provide mapping tables showing numbered hooks with their pixel values and legacy name equivalents.
393
+
394
+ ---
395
+
396
+ ## Questions or Issues?
397
+
398
+ - **Missing hooks?** Run `{{EXPLORE_SLDS_STYLING_TOOL}}({ search: "your-term" })` to check metadata
399
+ - **Incorrect information?** Check `review-guidance.md` for validation notes
400
+ - **Need to regenerate index?** Run `node scripts/generate-hooks-index.js`
401
+ - **Want to add semantic hooks?** Follow format from `global-semantic/accent-hooks.md`
402
+
403
+ ---
404
+
405
+ **Last Updated:** November 2025
406
+ **Knowledge Base Version:** 1.1
407
+ **Total Hooks Documented:** 473 (100% of SLDS global hooks)
408
+ **Fully Documented Semantic Hooks:** 48 (Accent: 12, Feedback: 26, Surface: 10)