@salesforce/afv-skills 1.2.0 → 1.4.0

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/package.json +5 -4
  2. package/skills/building-webapp-data-visualization/SKILL.md +72 -0
  3. package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
  4. package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
  5. package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
  6. package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
  7. package/skills/building-webapp-react-components/SKILL.md +96 -0
  8. package/skills/building-webapp-react-components/implementation/component.md +78 -0
  9. package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
  10. package/skills/building-webapp-react-components/implementation/page.md +93 -0
  11. package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
  12. package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
  13. package/skills/configuring-webapp-metadata/SKILL.md +158 -0
  14. package/skills/creating-webapp/SKILL.md +140 -0
  15. package/skills/deploying-webapp-to-salesforce/SKILL.md +226 -0
  16. package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -3
  17. package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +2 -2
  18. package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +37 -3
  19. package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +2 -2
  20. package/skills/{salesforce-custom-tab → generating-custom-tab}/SKILL.md +2 -2
  21. package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/SKILL.md +2 -2
  22. package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/handle-ui-components.md +1 -1
  23. package/skills/generating-experience-react-site/SKILL.md +67 -0
  24. package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
  25. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
  26. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
  27. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
  28. package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
  29. package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +87 -10
  30. package/skills/{salesforce-flow → generating-flow}/SKILL.md +2 -2
  31. package/skills/{salesforce-fragment → generating-fragment}/SKILL.md +2 -2
  32. package/skills/generating-lightning-app/SKILL.md +423 -0
  33. package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +2 -2
  34. package/skills/{generate-permission-set → generating-permission-set}/SKILL.md +2 -2
  35. package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +2 -2
  36. package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
  37. package/skills/installing-webapp-features/SKILL.md +210 -0
  38. package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
  39. package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
  40. package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
  41. package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
  42. package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
  43. package/skills/switching-org/SKILL.md +28 -0
  44. package/skills/trigger-refactor-pipeline/SKILL.md +1 -1
  45. package/skills/using-webapp-salesforce-data/SKILL.md +363 -0
  46. package/skills/using-webapp-salesforce-data/graphql-search.sh +139 -0
  47. package/skills/salesforce-lightning-app-build/SKILL.md +0 -346
  48. package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
  49. package/skills/salesforce-web-app-feature/SKILL.md +0 -70
  50. package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
  51. package/skills/salesforce-web-application/SKILL.md +0 -34
  52. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/bootstrap-template-byo-lwr.md +0 -0
  53. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-brandingSet.md +0 -0
  54. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-route.md +0 -0
  55. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-themeLayout.md +0 -0
  56. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-view.md +0 -0
  57. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-guest-sharing-rules.md +0 -0
  58. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/handle-component-and-region-ids.md +0 -0
@@ -1,346 +0,0 @@
1
- ---
2
- name: salesforce-lightning-app-build
3
- description: Build complete Salesforce Lightning Experience applications from natural language descriptions. Use this skill when a user requests a "complete app", "Lightning app", "business solution", "management system", or describes a scenario requiring multiple interconnected Salesforce components (objects, fields, pages, tabs, security). Orchestrates all required metadata types in proper dependency order to produce a deployable application.
4
- metadata:
5
- category: orchestration
6
- version: "1.0"
7
- related-skills: salesforce-custom-object, salesforce-custom-field, salesforce-custom-tab, salesforce-flexipage, salesforce-custom-application, salesforce-flow, salesforce-validation-rule, salesforce-list-view, generate-permission-set
8
- ---
9
-
10
- # Salesforce Lightning Application Build
11
-
12
- ## Overview
13
-
14
- Build a complete, deployable Salesforce Lightning Experience application from a natural language description by orchestrating multiple metadata types in correct dependency order. Invoke specialized metadata skills when available; generate metadata directly when no skill exists.
15
-
16
- ## When to Use This Skill
17
- **Use when:**
18
- - User requests a "complete app", "Lightning app", or "end-to-end solution"
19
- - User says "build an app", "create an application", "build a [type] app" (project management, tracking, etc.)
20
- - Request involves 3+ metadata types working together (objects + fields + pages + security)
21
- - User describes multiple custom objects with relationships between them
22
- - User mentions custom objects AND Lightning Record Pages in the same request
23
- - User mentions custom objects AND permission sets/security in the same request
24
- - Request includes phrases like "allows users to manage/track", "management system", "tracking app"
25
- - Need to ensure proper sequencing (Objects → Fields → UI → Security)
26
-
27
- **Examples that should trigger this skill:**
28
- - "Build a project management app with Tasks, Resources, and Supplies objects"
29
- - "Create an app to track vehicles with Lightning pages and permission sets"
30
- - "I need a Space Station management system with multiple objects and relationships"
31
- - "Build an employee onboarding app with custom Lightning Record Pages"
32
-
33
- **Do NOT use when:**
34
- - Creating a single metadata component (use specific metadata skill instead)
35
- - Troubleshooting or debugging existing metadata
36
- - Building Salesforce Classic apps (not Lightning Experience)
37
- - User asks for just one object, or just one page, or just one permission set (without others)
38
-
39
- ## Metadata Type Registry
40
-
41
- This table shows which metadata types are commonly needed for LEX apps and their skill availability.
42
-
43
- | Metadata Type | Skill Available? | Skill Name | Usage Rule |
44
- |---------------|------------------|------------|------------|
45
- | **Custom Object** | ✅ YES | `salesforce-custom-object` | MUST use skill |
46
- | **Custom Field** | ✅ YES | `salesforce-custom-field` | MUST use skill |
47
- | **Custom Tab** | ✅ YES | `salesforce-custom-tab` | MUST use skill |
48
- | **FlexiPage** | ✅ YES | `salesforce-flexipage` | MUST use skill |
49
- | **Custom Application** | ✅ YES | `salesforce-custom-application` | MUST use skill |
50
- | **List View** | ✅ YES | `salesforce-list-view` | MUST use skill |
51
- | **Validation Rule** | ✅ YES | `salesforce-validation-rule` | MUST use skill (if requested) |
52
- | **Flow** | ✅ YES | `salesforce-flow` | MUST use skill (if requested) |
53
- | **Permission Set** | ✅ YES | `generate-permission-set` | MUST use skill |
54
-
55
- ### Skill Usage Rules
56
-
57
- **CRITICAL RULE**: When a skill exists for a metadata type (✅ YES in table above), you **MUST** invoke that skill. Do NOT generate the metadata directly.
58
-
59
- **FALLBACK RULE**: When NO skill exists for a metadata type (❌ NO in table above), you **MAY** generate the metadata directly using your knowledge of Salesforce Metadata API and best practices.
60
-
61
- **RATIONALE**: Specialized skills contain validated patterns, error handling, and field-specific knowledge that prevent deployment failures.
62
-
63
- ---
64
-
65
- ## Dependency Graph & Build Order
66
-
67
- ### Phase 1: Data Model (Foundation)
68
- ```
69
- Custom Objects (no dependencies)
70
-
71
- Custom Fields (depends on: Objects exist)
72
-
73
- Relationships (depends on: Both parent and child objects + fields exist)
74
- ```
75
-
76
- **Skills to invoke in order:**
77
- 1. `salesforce-custom-object` for each object
78
- 2. `salesforce-custom-field` for each field (including Master-Detail, Lookup, Roll-up Summary)
79
-
80
- ### Phase 2: Business Logic (Optional - only if requested)
81
- ```
82
- Validation Rules (depends on: Fields exist)
83
-
84
- Flows (depends on: Objects, Fields exist)
85
- ```
86
-
87
- **Skills to invoke (only if user requested):**
88
- 1. `salesforce-validation-rule` if validation requirements mentioned
89
- 2. `salesforce-flow` if automation/workflow requirements mentioned
90
-
91
- ### Phase 3: User Interface
92
- ```
93
- List Views (depends on: Objects, Fields exist)
94
-
95
- Custom Tabs (depends on: Objects exist)
96
-
97
- FlexiPages (depends on: Objects, Tabs exist)
98
- ```
99
-
100
- **Skills to invoke in order:**
101
- 1. `salesforce-list-view` for filtered record views (if requested)
102
- 2. `salesforce-custom-tab` for each object tab
103
- 3. `salesforce-flexipage` for record/home/app pages
104
-
105
- ### Phase 4: Application Assembly
106
- ```
107
- Custom Application (depends on: Tabs exist)
108
- ```
109
-
110
- **Skills to invoke:**
111
- 1. `salesforce-custom-application` to create the Lightning App container
112
-
113
- ### Phase 5: Security & Access
114
- ```
115
- Permission Sets (depends on: Objects, Fields, Tabs, App exist)
116
- ```
117
-
118
- **Skills to invoke:**
119
- 1. `generate-permission-set` for each permission set with access to:
120
- - Objects (Read, Create, Edit, Delete)
121
- - Fields (Read, Edit)
122
- - Tabs (Visible)
123
- - Custom Application (Visible)
124
-
125
- ---
126
-
127
- ## Execution Workflow
128
-
129
- ### STEP 1: Requirements Analysis & Planning
130
-
131
- **Actions:**
132
- 1. Parse user's natural language request
133
- 2. Extract business entities (become Custom Objects)
134
- 3. Extract attributes/properties (become Custom Fields)
135
- 4. Identify relationships (Master-Detail, Lookup)
136
- 5. Detect validation requirements (become Validation Rules)
137
- 6. Detect automation requirements (become Flows)
138
- 7. Identify user personas (inform Permission Sets)
139
-
140
- **Output: Build Plan**
141
-
142
- Generate a structured plan listing:
143
-
144
- ```
145
- 📋 Lightning App Build Plan: [App Name]
146
-
147
- DATA MODEL:
148
- - Custom Objects: [list with object names]
149
- - Custom Fields: [list grouped by object]
150
- - Relationships: [list M-D and Lookup relationships]
151
-
152
- BUSINESS LOGIC (if applicable):
153
- - Validation Rules: [list with object and rule name]
154
- - Flows: [list with flow name and type]
155
-
156
- USER INTERFACE:
157
- - List Views: [list with object and view name]
158
- - Custom Tabs: [list with object]
159
- - FlexiPages: [list with page name and type]
160
- - Custom Application: [app name]
161
-
162
- SECURITY:
163
- - Permission Sets: [list with purpose]
164
-
165
- METADATA SKILLS TO INVOKE:
166
- - salesforce-custom-object (x N)
167
- - salesforce-custom-field (x N)
168
- - salesforce-validation-rule (x N) - if validation requirements identified
169
- - salesforce-flow (x N) - if automation requirements identified
170
- - salesforce-custom-tab (x N)
171
- - salesforce-flexipage (x N)
172
- - salesforce-custom-application (x 1)
173
- - generate-permission-set (x N)
174
-
175
- DEPENDENCY ORDER:
176
- 1. Phase 1: Data Model (Objects → Fields)
177
- 2. Phase 2: Business Logic (Validation Rules → Flows)
178
- 3. Phase 3: User Interface (List Views → Tabs → Pages)
179
- 4. Phase 4: App Assembly (Application)
180
- 5. Phase 5: Security (Permission Sets)
181
- ```
182
-
183
- ### STEP 2: Skill Invocation Sequence
184
-
185
- Execute in strict dependency order. For each metadata component:
186
-
187
- 1. **Check Metadata Type Registry**: Does a skill exist?
188
- 2. **If YES (✅)**: Invoke the specialized skill with required parameters
189
- 3. **If NO (❌)**: Generate metadata directly using Metadata API knowledge
190
- 4. **Handle Errors**: If skill invocation fails, log error and continue (don't block entire app)
191
-
192
- **Invocation Pattern Example:**
193
-
194
- - For Custom Object → Invoke `salesforce-custom-object`
195
- - For Custom Field → Invoke `salesforce-custom-field`
196
- - For Validation Rule → Invoke `salesforce-validation-rule`
197
- - For Flow → Invoke `salesforce-flow`
198
- - For Custom Tab → Invoke `salesforce-custom-tab`
199
- - For FlexiPage → Invoke `salesforce-flexipage`
200
- - For Custom Application → Invoke `salesforce-custom-application`
201
- - For Permission Set → Invoke `generate-permission-set`
202
-
203
- ### STEP 3: Final Artifact Assembly
204
-
205
- After all phases complete, consolidate outputs into deployment-ready structure.
206
-
207
- ---
208
-
209
- ## Output
210
-
211
- The completed build produces:
212
-
213
- 1. **Salesforce DX Project Directory** containing all generated metadata
214
- - Organized by standard SFDX structure: `force-app/main/default/`
215
-
216
- 2. **Metadata Files** - One file per component, organized by type:
217
- ```
218
- force-app/main/default/
219
- ├── objects/ # Custom Objects (.object-meta.xml)
220
- ├── fields/ # Custom Fields (.field-meta.xml)
221
- ├── tabs/ # Custom Tabs (.tab-meta.xml)
222
- ├── flexipages/ # Lightning Pages (.flexipage-meta.xml)
223
- ├── applications/ # Custom Applications (.app-meta.xml)
224
- ├── permissionsets/ # Permission Sets (.permissionset-meta.xml)
225
- ├── flows/ # Flows (.flow-meta.xml) - if applicable
226
- └── objects/.../validationRules/ # Validation Rules (.validationRule-meta.xml) - if applicable
227
- ```
228
-
229
- 3. **Deployment Manifest** (`package.xml`)
230
- - Lists all components with proper API version
231
- - Organized by metadata type in dependency order
232
- - Ready for Salesforce CLI deployment or Metadata API deployment
233
-
234
- 4. **Build Summary Report** - A markdown file listing:
235
- - Every component created
236
- - Component type and API name
237
- - File path location
238
- - Dependency relationships
239
- - Any warnings or recommendations
240
-
241
- **Example Summary Structure:**
242
- ```
243
- 📦 Lightning App Build Complete: Project Management App
244
-
245
- METADATA GENERATED:
246
- ✅ 3 Custom Objects
247
- - Project__c → force-app/main/default/objects/Project__c/Project__c.object-meta.xml
248
- - Task__c → force-app/main/default/objects/Task__c/Task__c.object-meta.xml
249
- - Resource__c → force-app/main/default/objects/Resource__c/Resource__c.object-meta.xml
250
-
251
- ✅ 12 Custom Fields
252
- - Project__c.Name → force-app/main/default/objects/Project__c/fields/Name.field-meta.xml
253
- - Project__c.Status__c → force-app/main/default/objects/Project__c/fields/Status__c.field-meta.xml
254
- [... etc ...]
255
-
256
- ✅ 3 Custom Tabs
257
- - Project__c → force-app/main/default/tabs/Project__c.tab-meta.xml
258
- [... etc ...]
259
-
260
- ✅ 3 Lightning Record Pages
261
- - Project_Record_Page → force-app/main/default/flexipages/Project_Record_Page.flexipage-meta.xml
262
- [... etc ...]
263
-
264
- ✅ 1 Custom Application
265
- - Project_Management → force-app/main/default/applications/Project_Management.app-meta.xml
266
-
267
- ✅ 2 Permission Sets
268
- - Project_Manager → force-app/main/default/permissionsets/Project_Manager.permissionset-meta.xml
269
- - Project_User → force-app/main/default/permissionsets/Project_User.permissionset-meta.xml
270
-
271
- ⚠️ WARNINGS: None
272
- ```
273
-
274
- ---
275
-
276
- ## Validation
277
-
278
- Before presenting the completed build to the user, verify cross-component integrity:
279
-
280
- - [ ] **Object-Tab Coverage**: Every Custom Object has at least one Custom Tab
281
- - [ ] **Relationship Integrity**: Every Custom Object referenced in a relationship (parent or child) exists in the build
282
- - [ ] **Field References in Pages**: Every field referenced in a FlexiPage exists on the corresponding object
283
- - [ ] **Tab References in App**: Every tab referenced in the Custom Application was successfully created
284
- - [ ] **Permission Set Completeness**: Permission Sets grant access to all generated objects, fields, tabs, and the application
285
- - [ ] **No Orphaned Components**: No tabs without objects, no pages without corresponding tabs, no app without tabs
286
- - [ ] **Deployment Manifest Completeness**: `package.xml` includes all generated components in proper dependency order
287
-
288
- **Validation Failure Handling:**
289
- - If validation fails, include failed checks in the Build Summary Report under a `⚠️ VALIDATION WARNINGS` section
290
- - Do NOT block delivery of the build, but clearly communicate what needs manual review or correction
291
- - Provide specific remediation steps for each failed validation check
292
-
293
- **Note**: Individual component validations (reserved words, name lengths, field types, etc.) are handled by specialized metadata skills and do not need to be re-validated here.
294
-
295
- ---
296
-
297
- ## Error Handling
298
-
299
- ### Critical Errors (Stop Execution)
300
-
301
- Stop and ask user for clarification if:
302
- - User request is too vague to extract any objects or fields
303
- - Conflicting requirements detected (e.g., "make it private" + "everyone should see it")
304
- - Invalid Salesforce naming detected (reserved words like `Order`, `Group`)
305
-
306
- ### Non-Critical Errors (Continue with Warning)
307
-
308
- Log warning and continue if:
309
- - Optional component fails (e.g., List View generation fails)
310
- - Skill invocation fails for non-critical metadata
311
- - Validation Rule or Flow has minor issues
312
-
313
- **Warning Pattern:**
314
- ```
315
- ⚠️ Warning: [Component Type] generation encountered issue
316
- Component: [Name]
317
- Issue: [Description]
318
- Impact: [What won't work]
319
- Recommendation: [How to fix manually]
320
-
321
- Continuing with remaining components...
322
- ```
323
-
324
- ---
325
-
326
- ## Best Practices
327
-
328
- ### 1. Always Follow Dependency Order
329
- Never invoke skills out of sequence. Fields need objects, pages need tabs, apps need tabs.
330
-
331
- ### 2. Use Skills When Available
332
- Don't reinvent the wheel. Specialized skills have field-specific validation that prevents deployment errors.
333
-
334
- ### 3. Generate Thoughtful Defaults
335
- When user doesn't specify details:
336
- - Use Text name fields for human entities
337
- - Use AutoNumber for transactions
338
- - Enable Search and Reports for user-facing objects
339
- - Set sharingModel based on relationships
340
-
341
- ### 4. Validate Before Building
342
- Check for:
343
- - Reserved words in API names
344
- - Relationship limits (max 2 M-D per object)
345
- - Name length limits
346
- - Duplicate names
@@ -1,84 +0,0 @@
1
- ---
2
- name: salesforce-web-app-creating-records
3
- description: Use this skill when users need to create Salesforce records from React web applications. Trigger when users mention createRecord, creating leads/contacts/custom objects from web apps, handling record IDs, form submissions to Salesforce, or Application__c custom objects. Always use this skill for any record creation from React apps.
4
- ---
5
-
6
- ## When to Use This Skill
7
-
8
- Use this skill when you need to:
9
- - Create Salesforce records from web applications
10
- - Implement createRecord functionality for custom or standard objects
11
- - Handle record ID extraction from create responses
12
- - Troubleshoot deployment errors related to record creation
13
-
14
-
15
- # Creating Salesforce records (webApplication)
16
-
17
- ## Overview
18
- Implement list and create functionality for any custom object using GraphQL queries and createRecord API with automatic list refresh.
19
-
20
- ## API
21
-
22
- - Use **createRecord** from `@salesforce/webapp-experimental/api`:
23
- - `createRecord(objectApiName: string, fields: Record<string, unknown>)` → returns a result object that may contain the new record id in different shapes depending on the API version.
24
-
25
- ## Getting the new record id
26
-
27
- The create response is not always a simple `{ id: string }`. Handle both common shapes so you don't get "Create succeeded but no record id returned":
28
-
29
- - Prefer **result.id** when it's a string.
30
- - Else read **result.fields.Id.value** (or equivalent) if the API returns the id inside a fields wrapper.
31
-
32
- Example helper:
33
-
34
- ```ts
35
- function getRecordIdFromResponse(result: Record<string, unknown>): string {
36
- const id =
37
- typeof result.id === "string"
38
- ? result.id
39
- : (result.fields as Record<string, { value?: string }> | undefined)?.Id?.value;
40
- if (!id) throw new Error("Create succeeded but no record id returned");
41
- return id;
42
- }
43
- ```
44
-
45
- Use this after `createRecord()` and return `{ id }` to the caller so the UI can show success or navigate.
46
-
47
- ## Field set and org schema
48
-
49
- - **Only send fields that exist in the org.** If you send a field that doesn't exist (e.g. custom field not deployed), the API can return POST body parse errors (e.g. "Field X does not exist").
50
- - For **custom objects**, deploy the object and its fields (e.g. via SFDX/CLI or metadata API) before relying on them in the app.
51
- - **Fallback:** If you need to capture data that might not have a custom field yet (e.g. contact details), store it in a long text area or similar (e.g. `Employment_Info__c`) as a blob (e.g. JSON or line-based text) so no data is lost and the create still succeeds.
52
-
53
- ## Custom objects (e.g. Application__c)
54
-
55
- - Define the object and fields in the project's Salesforce metadata (e.g. `objects/Application__c/`, `fields/*.field-meta.xml`).
56
- - In the app, build a `fields` object with only the API names and values you want to set; omit required fields only if they have defaults.
57
- - Use a typed input interface and map it to the `fields` passed to `createRecord`; optionally combine contact/extra info into one blob field if some fields might not be deployed.
58
-
59
- ## Standard objects (e.g. Lead)
60
-
61
- - Use standard field API names: **FirstName**, **LastName**, **Email**, **Company**, **Phone**, **Description**, **LeadSource**, etc.
62
- - **LeadSource** helps distinguish origin (e.g. "Website", "Website Newsletter").
63
- - For "Contact Us" → Lead: map subject to **Company** (or a custom field if available), message to **Description**.
64
- - For newsletter signup → Lead: set **Email**; use a placeholder **LastName** (e.g. "Newsletter Subscriber") and **Company** (e.g. "Website") so the Lead is valid.
65
-
66
- ## Structure
67
-
68
- | Concern | Where |
69
- |--------|--------|
70
- | Create custom object (e.g. Application) | e.g. `src/api/applicationApi.ts` — `createApplicationRecord(input)` → `createRecord("Application__c", fields)` |
71
- | Create standard object (e.g. Lead) | e.g. `src/api/leadApi.ts` — `createContactUsLead(input)`, `createNewsletterLead(email)` |
72
- | Form UI | Pages that collect data and call these APIs; show success/error and optionally redirect or reset form |
73
-
74
- ## Errors
75
-
76
- - **"Field X does not exist"** → Remove that field from the payload or deploy the field to the org.
77
- - **"Create succeeded but no record id returned"** → Use the id-extraction pattern above (result.id or result.fields.Id.value).
78
- - **Validation errors** → Return and display the API error message; fix required/invalid values in the form.
79
-
80
- ## Verification
81
-
82
- - Deploy object/fields to the org if using custom objects.
83
- - Run the create flow in the app; confirm the record appears in the org and the UI shows success and the new id if needed.
84
- - Test with minimal required fields first, then add optional or blob fields.
@@ -1,70 +0,0 @@
1
- ---
2
- name: salesforce-web-app-feature
3
- description: Use this skill when users need to add features to Salesforce React web applications. Trigger when users mention adding authentication, search, charts, GraphQL, ShadCN components, Agentforce conversation client, or any feature packages. Also use when users want to install npm packages, copy-then-adjust workflow, or integrate official feature packages. This is the PRIMARY skill for web app features - always prefer official packages listed here.
4
- ---
5
-
6
- ## When to Use This Skill
7
-
8
- Use this skill when you need to:
9
- - Add features to Salesforce React web applications
10
- - Install and integrate feature packages (authentication, search, charts, etc.)
11
- - Follow copy-then-adjust workflow for feature integration
12
- - Troubleshoot deployment errors related to web application features
13
-
14
-
15
- # Adding a new webApplication feature
16
-
17
- **Always prefer the features listed below.** When the user asks to add auth, search, charts, navigation, GraphQL, shared UI, or Agentforce conversation (ACC/copilot/agent) to a webapp, match their request to one of the official feature packages in the table in section 1. Use those packages first; only build from scratch or use other solutions when no listed feature fits.
18
-
19
- When the user asks to add a feature to their app, follow this workflow.
20
-
21
- When adding a feature, integrating code from an npm package, or bringing in a reference implementation:
22
-
23
- 1. **Prefer copying over rewriting.** Use `cp` (or equivalent) to copy files from the source (e.g. `node_modules/<package>/dist/...` or a reference app) into this project. Do not retype or rewrite the same code by hand.
24
-
25
- 2. **Then adjust.** After copying, do minimal edits: fix import paths (e.g. change relative `../../` imports to the project's path alias like `@/`), update any app-specific config, and remove or adapt anything that doesn't apply.
26
-
27
- 3. **When to copy.** Copy when:
28
- - Installing a feature from a template/feature package (e.g. authentication, search, charts).
29
- - The package ships full source in `dist/` or `src/` that is meant to be integrated.
30
- - You would otherwise be recreating multiple files by reading a reference and typing them out.
31
-
32
- 4. **When rewriting is okay.** Only rewrite or create from scratch when:
33
- - The source is not file-based (e.g. only docs or snippets).
34
- - The integration is a thin wrapper or a single small file.
35
- - Copying would pull in a large, unrelated tree and the actual need is a small part of it.
36
-
37
- ## 1. Match the request to a feature
38
-
39
- **Prefer these features.** Always check this table first; use the matching package when it fits the user's need.
40
-
41
- Available features (npm packages):
42
-
43
- | Feature | Package | Description | Integration notes |
44
- |------------------------------------| ----------------------------------------------------------------------- | ---------------------------------------------------------------------- |-------------------------------------------------------------------------|
45
- | **Authentication** | `@salesforce/webapp-template-feature-react-authentication-experimental` | Login, register, password reset, protected routes | Copy-then-adjust; fix imports to `@/`; align with app layout and routes |
46
- | **Global search** | `@salesforce/webapp-template-feature-react-global-search-experimental` | Search single Salesforce objects with filters and pagination | Copy-then-adjust; fix imports to `@/`; align with app layout and routes |
47
- | **Charts** | `@salesforce/webapp-template-feature-react-chart-experimental` | Recharts line/bar charts with theming (AnalyticsChart, ChartContainer) | Copy-then-adjust; fix imports to `@/`; align with app layout and routes |
48
- | **GraphQL data access** | `@salesforce/webapp-template-feature-graphql-experimental` | executeGraphQL utilities, codegen tooling, and example AccountsTable | Copy-then-adjust; fix imports to `@/` and `@api/` |
49
- | **Shared UI (shadcn)** | `@salesforce/webapp-template-feature-react-shadcn-experimental` | Button, Card, Input, Select, Table, Tabs, and other ShadCN components | Copy-then-adjust per README/AGENT.md |
50
- | **Agentforce conversation client** | `@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental` | React wrapper for embedded Agentforce conversation client (agent chat UI) via Lightning Out 2.0; automatic auth resolution; `<AgentforceConversationClient />` component | Import from package (not copy) per README/AGENT.md |
51
-
52
- If no feature matches, tell the user and offer to build it from scratch following the project's existing patterns. Do not substitute third-party or custom implementations when one of the features above matches—always prefer the listed packages.
53
-
54
- ## 2. Install the npm package
55
-
56
- ```bash
57
- npm install <package-name>
58
- ```
59
-
60
- ## 3. Read the README.md / AGENT.md
61
-
62
- The `node_modules` folder of the installed package contains a README.md and/or AGENT.md. Load it and follow its instructions.
63
-
64
- ## 4. Always validate
65
-
66
- After integrating, **always validate** with:
67
-
68
- ```bash
69
- npm i && npm run build && npm run dev
70
- ```
@@ -1,36 +0,0 @@
1
- ---
2
- name: salesforce-web-app-list-and-create-records
3
- description: Use this skill when users need to list and create records for Salesforce custom objects from React web apps. Trigger when users mention list and create patterns, GraphQL queries, refetch after create, form picklists matching object schema, or dashboard widgets showing record lists. Always use this skill for list+create patterns.
4
- ---
5
-
6
- ## When to Use This Skill
7
-
8
- Use this skill when you need to:
9
- - Implement list and create functionality for custom objects
10
- - Build GraphQL queries for listing records
11
- - Create records and update lists without page reload
12
- - Troubleshoot deployment errors related to list and create operations
13
-
14
-
15
- # List and create records (webApplication)
16
-
17
- ## Pattern
18
-
19
- - **List:** Query the object via **GraphQL** (`executeGraphQL`, `uiapi.query.ObjectApiName__c`). Use **webApplicationFeature** (GraphQL) for the connection shape (first/after, edges.node, field `{ value, displayValue }`). Map nodes to a simple summary type; sort client-side by date or other field if needed.
20
- - **Create:** Use **createRecord** from `@salesforce/webapp-experimental/api`. See **webApplicationCreatingRecords** for required/optional fields and id handling.
21
- - **Hook:** One hook that fetches the list on mount and exposes `refetch`. After a successful create, call `refetch()` so the list updates without a full page reload.
22
- - **Form:** Collect only fields that exist on the object. For picklist fields, use option values that **match the object's value set** (e.g. from the object's field metadata or a known value set). Default required picklists (e.g. Status to "New", Priority to "Standard") when the object defines defaults.
23
- - **UI:** Table or cards for the list; form above or on a separate route. Show loading and error states for both list and submit. Optional: dashboard widget showing a slice of the list (e.g. first N items) with a "See all" link.
24
-
25
- ## Structure (generic)
26
-
27
- | Concern | Where |
28
- |--------|--------|
29
- | API: list + create | e.g. `src/api/<objectName>Api.ts` — query function (GraphQL) and create function (createRecord) |
30
- | Hook: list + refetch | e.g. `src/hooks/use<ObjectName>List.ts` — returns `{ items, loading, error, refetch }` |
31
- | Page | Form (controlled inputs, submit → create → refetch) and table/list of items |
32
-
33
- ## Cross-references
34
-
35
- - **webApplicationFeature** — Feature packages including GraphQL (connection shape, node shape, field value extraction).
36
- - **webApplicationCreatingRecords** — createRecord, id extraction, only send existing fields, picklist/required handling.
@@ -1,34 +0,0 @@
1
- ---
2
- name: salesforce-web-application
3
- description: Directory of web application (React) sub-knowledges for Salesforce React BYO, feature packages, and copy-then-adjust workflow. Use when working with Salesforce web applications.
4
- ---
5
-
6
- ## When to Use This Skill
7
-
8
- Use this skill when you need to:
9
- - Work with Salesforce React web applications
10
- - Understand available web application features and workflows
11
- - Navigate web application knowledge resources
12
- - Troubleshoot deployment errors related to web applications
13
-
14
- ## Specification
15
-
16
- ## Overview
17
-
18
- This skill provides guidance for working with Salesforce React web applications (Salesforce BYO React template). It covers adding features, creating Salesforce records, and listing/creating custom object records.
19
-
20
- ## Web Applications — Directory
21
-
22
- This is the **directory** of sub-knowledges for web applications (Salesforce React BYO, feature packages, copy-then-adjust workflow). **Call `get_expert_knowledge` again with one of the topic names below** to load the relevant knowledge.
23
-
24
- ## Sub-knowledges (use as `topic` in get_expert_knowledge)
25
-
26
- | Topic name | Use when |
27
- |-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
28
- | **webApplicationFeature** | Adding a feature to a webapp: authentication, search, charts, GraphQL, ShadCN, Agentforce conversation client. Feature table, npm install, copy-then-adjust workflow |
29
- | **webApplicationCreatingRecords** | Creating Salesforce records: createRecord, custom/standard objects, id handling, Application__c, Lead |
30
- | **webApplicationListAndCreateRecords** | List + create any custom object: GraphQL list, createRecord, hook with refetch, form picklists match object |
31
-
32
- **Flow:** After reading this directory, call `get_expert_knowledge({ topic: "<subTopicName>" })` with the single sub-topic that best matches the user's request (e.g. `webApplicationFeature`, `webApplicationCreatingRecords`).
33
-
34
- **Adding features:** Always prefer the feature packages listed in **webApplicationFeature** (authentication, search, charts, nav, GraphQL, ShadCN, Agentforce conversation) over building from scratch or other solutions when one of them matches the request.