@salesforce/afv-skills 1.1.0 → 1.3.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.
- package/package.json +6 -5
- package/skills/accessing-webapp-data/SKILL.md +178 -0
- package/skills/agentforce-development/SKILL.md +427 -0
- package/skills/agentforce-development/assets/README-legacy.md +89 -0
- package/skills/agentforce-development/assets/agent-spec-template.md +90 -0
- package/skills/agentforce-development/assets/agents/README.md +45 -0
- package/skills/agentforce-development/assets/agents/hello-world.agent +60 -0
- package/skills/agentforce-development/assets/agents/multi-topic.agent +105 -0
- package/skills/agentforce-development/assets/agents/production-faq.agent +101 -0
- package/skills/agentforce-development/assets/agents/production-faq.bundle-meta.xml +4 -0
- package/skills/agentforce-development/assets/agents/simple-qa.agent +72 -0
- package/skills/agentforce-development/assets/apex/models-api-queueable.cls +225 -0
- package/skills/agentforce-development/assets/bundle-meta.xml +23 -0
- package/skills/agentforce-development/assets/components/apex-action.agent +52 -0
- package/skills/agentforce-development/assets/components/error-handling.agent +58 -0
- package/skills/agentforce-development/assets/components/escalation-setup.agent +169 -0
- package/skills/agentforce-development/assets/components/flow-action.agent +66 -0
- package/skills/agentforce-development/assets/components/n-ary-conditions.agent +110 -0
- package/skills/agentforce-development/assets/components/topic-with-actions.agent +40 -0
- package/skills/agentforce-development/assets/deterministic-routing.agent +166 -0
- package/skills/agentforce-development/assets/escalation-pattern.agent +209 -0
- package/skills/agentforce-development/assets/flow-action-lookup.agent +115 -0
- package/skills/agentforce-development/assets/hub-and-spoke.agent +104 -0
- package/skills/agentforce-development/assets/invocable-apex-template.cls +187 -0
- package/skills/agentforce-development/assets/local-info-agent-annotated.agent +355 -0
- package/skills/agentforce-development/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +109 -0
- package/skills/agentforce-development/assets/metadata/genai-function-apex.xml +92 -0
- package/skills/agentforce-development/assets/metadata/genai-function-flow.xml +57 -0
- package/skills/agentforce-development/assets/metadata/genai-plugin.xml +72 -0
- package/skills/agentforce-development/assets/metadata/http-callout-flow.flow-meta.xml +348 -0
- package/skills/agentforce-development/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +136 -0
- package/skills/agentforce-development/assets/minimal-starter.agent +42 -0
- package/skills/agentforce-development/assets/patterns/README.md +254 -0
- package/skills/agentforce-development/assets/patterns/action-callbacks.agent +178 -0
- package/skills/agentforce-development/assets/patterns/advanced-input-bindings.agent +141 -0
- package/skills/agentforce-development/assets/patterns/bidirectional-routing.agent +156 -0
- package/skills/agentforce-development/assets/patterns/critical-input-collection.agent +244 -0
- package/skills/agentforce-development/assets/patterns/delegation-routing.agent +89 -0
- package/skills/agentforce-development/assets/patterns/lifecycle-events.agent +127 -0
- package/skills/agentforce-development/assets/patterns/llm-controlled-actions.agent +184 -0
- package/skills/agentforce-development/assets/patterns/multi-step-workflow.agent +282 -0
- package/skills/agentforce-development/assets/patterns/open-gate-routing.agent +286 -0
- package/skills/agentforce-development/assets/patterns/procedural-instructions.agent +273 -0
- package/skills/agentforce-development/assets/patterns/prompt-template-action.agent +188 -0
- package/skills/agentforce-development/assets/patterns/system-instruction-overrides.agent +293 -0
- package/skills/agentforce-development/assets/prompt-rag-search.agent +131 -0
- package/skills/agentforce-development/assets/template-multi-topic.agent +160 -0
- package/skills/agentforce-development/assets/template-single-topic.agent +81 -0
- package/skills/agentforce-development/assets/verification-gate.agent +208 -0
- package/skills/agentforce-development/references/action-prompt-templates.md +164 -0
- package/skills/agentforce-development/references/actions-reference.md +592 -0
- package/skills/agentforce-development/references/agent-access-guide.md +72 -0
- package/skills/agentforce-development/references/agent-design-and-spec-creation.md +1010 -0
- package/skills/agentforce-development/references/agent-metadata-and-lifecycle.md +575 -0
- package/skills/agentforce-development/references/agent-script-core-language.md +1218 -0
- package/skills/agentforce-development/references/agent-topic-map-diagrams.md +323 -0
- package/skills/agentforce-development/references/agent-user-setup.md +526 -0
- package/skills/agentforce-development/references/agent-validation-and-debugging.md +803 -0
- package/skills/agentforce-development/references/known-issues.md +353 -0
- package/skills/agentforce-development/references/minimal-examples.md +67 -0
- package/skills/agentforce-development/references/production-gotchas.md +279 -0
- package/skills/agentforce-development/references/salesforce-cli-for-agents.md +393 -0
- package/skills/agentforce-development/references/version-history.md +23 -0
- package/skills/building-webapp-data-visualization/SKILL.md +72 -0
- package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
- package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
- package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
- package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
- package/skills/building-webapp-react-components/SKILL.md +96 -0
- package/skills/building-webapp-react-components/implementation/component.md +78 -0
- package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
- package/skills/building-webapp-react-components/implementation/page.md +93 -0
- package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
- package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
- package/skills/configuring-webapp-metadata/SKILL.md +158 -0
- package/skills/creating-webapp/SKILL.md +141 -0
- package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
- package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
- package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
- package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -4
- package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -5
- package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
- package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
- package/skills/generating-custom-tab/SKILL.md +154 -0
- package/skills/generating-experience-lwr-site/SKILL.md +196 -0
- package/skills/generating-experience-lwr-site/docs/bootstrap-template-byo-lwr.md +224 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-brandingSet.md +131 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-route.md +232 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-themeLayout.md +141 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-view.md +233 -0
- package/skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md +42 -0
- package/skills/generating-experience-lwr-site/docs/handle-component-and-region-ids.md +27 -0
- package/skills/generating-experience-lwr-site/docs/handle-ui-components.md +215 -0
- package/skills/generating-experience-react-site/SKILL.md +67 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
- package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
- package/skills/{salesforce-flow → generating-flow}/SKILL.md +3 -3
- package/skills/generating-fragment/SKILL.md +117 -0
- package/skills/generating-lightning-app/SKILL.md +423 -0
- package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
- package/skills/generating-permission-set/SKILL.md +174 -0
- package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
- package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
- package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
- package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
- package/skills/installing-webapp-features/SKILL.md +210 -0
- package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
- package/skills/switching-org/SKILL.md +28 -0
- package/skills/using-webapp-graphql/SKILL.md +324 -0
- package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
- package/skills/apex-class/SKILL.md +0 -253
- package/skills/apex-class/examples/AccountDeduplicationBatch.cls +0 -148
- package/skills/apex-class/examples/AccountSelector.cls +0 -193
- package/skills/apex-class/examples/AccountService.cls +0 -201
- package/skills/apex-class/templates/abstract.cls +0 -128
- package/skills/apex-class/templates/batch.cls +0 -125
- package/skills/apex-class/templates/domain.cls +0 -102
- package/skills/apex-class/templates/dto.cls +0 -108
- package/skills/apex-class/templates/exception.cls +0 -51
- package/skills/apex-class/templates/interface.cls +0 -25
- package/skills/apex-class/templates/queueable.cls +0 -92
- package/skills/apex-class/templates/schedulable.cls +0 -75
- package/skills/apex-class/templates/selector.cls +0 -92
- package/skills/apex-class/templates/service.cls +0 -69
- package/skills/apex-class/templates/utility.cls +0 -97
- package/skills/apex-test-class/SKILL.md +0 -101
- package/skills/apex-test-class/references/assertion-patterns.md +0 -209
- package/skills/apex-test-class/references/async-testing.md +0 -276
- package/skills/apex-test-class/references/mocking-patterns.md +0 -219
- package/skills/apex-test-class/references/test-data-factory.md +0 -176
- package/skills/deployment-readiness-check/SKILL.md +0 -257
- package/skills/deployment-readiness-check/assets/deployment_checklist.md +0 -286
- package/skills/deployment-readiness-check/references/rollback_procedures.md +0 -308
- package/skills/deployment-readiness-check/scripts/check_metadata.sh +0 -207
- package/skills/salesforce-custom-tab/SKILL.md +0 -78
- package/skills/salesforce-experience-site/SKILL.md +0 -178
- package/skills/salesforce-fragment/SKILL.md +0 -42
- package/skills/salesforce-lightning-app-build/SKILL.md +0 -254
- package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
- package/skills/salesforce-web-app-feature/SKILL.md +0 -70
- package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
- package/skills/salesforce-web-application/SKILL.md +0 -34
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: salesforce-experience-site
|
|
3
|
-
description: Use this skill when users need to create, modify, or manage Salesforce Experience Cloud sites (LWR sites). Trigger when users mention Experience sites, LWR sites, DigitalExperience, Experience Cloud, community sites, portals, creating pages, adding routes, views, theme layouts, branding sets, or any DigitalExperience bundle work. Also use when users mention specific content types like sfdc_cms__route, sfdc_cms__view, sfdc_cms__themeLayout, or when troubleshooting site deployment. Always use this skill for any Experience Cloud or LWR site work.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## When to Use This Skill
|
|
7
|
-
|
|
8
|
-
Use this skill when you need to:
|
|
9
|
-
- Create Experience Cloud sites or communities
|
|
10
|
-
- Build LWR (Lightning Web Runtime) sites
|
|
11
|
-
- Set up site configuration and settings
|
|
12
|
-
- Generate Experience Site metadata
|
|
13
|
-
- Troubleshoot deployment errors related to Experience Sites
|
|
14
|
-
|
|
15
|
-
## Specification
|
|
16
|
-
|
|
17
|
-
# Experience LWR Site Metadata Specification
|
|
18
|
-
An LWR site can be represented by metadata DigitalExperienceConfig, DigitalExperienceBundle, Network, CustomSite, and CMS contents. Your purpose is to assist developers in creating and editing these metadata.
|
|
19
|
-
|
|
20
|
-
## Supported Template Types
|
|
21
|
-
|
|
22
|
-
Template name - Template DevName
|
|
23
|
-
- Build Your Own (LWR) - talon-template-byo
|
|
24
|
-
|
|
25
|
-
## Core Properties
|
|
26
|
-
|
|
27
|
-
Before doing anything else, identify the following properties from the local project if available. Check with the user if any of the following is missing:
|
|
28
|
-
- Site name: Required. (e.g., `'My Community'`).
|
|
29
|
-
- URL path prefix: Optional. Alphanumeric characters only. Convert from site name if not provided (e.g., `'mycommunity'`) and verify with the user for the converted value.
|
|
30
|
-
- Template type devName: Optional. Defaults to `talon-template-byo`.
|
|
31
|
-
|
|
32
|
-
## General Tips
|
|
33
|
-
|
|
34
|
-
TIP 1. When available, the site developer name can be found in the CustomSite filename (e.g., `sites/MySite.site-meta.xml` → developer name is `MySite`).
|
|
35
|
-
|
|
36
|
-
## Project Structure in DigitalExperienceBundle Format
|
|
37
|
-
|
|
38
|
-
### Site Metadata
|
|
39
|
-
- DigitalExperienceConfig
|
|
40
|
-
- Path: `digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml`
|
|
41
|
-
- DigitalExperienceBundle
|
|
42
|
-
- Path: `digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml`
|
|
43
|
-
- Network
|
|
44
|
-
- Path: `networks/{siteName}.network-meta.xml`
|
|
45
|
-
- CustomSite
|
|
46
|
-
- Path: `sites/{siteName}.site-meta.xml`
|
|
47
|
-
|
|
48
|
-
### DigitalExperience Contents
|
|
49
|
-
- Path: `digitalExperiences/site/{siteName}1/sfdc_cms__*/{contentApiName}/*`
|
|
50
|
-
- Description: These are the content components defining routes, views, theme layouts, etc. Each component must have a `_meta.json` and `content.json` file.
|
|
51
|
-
|
|
52
|
-
#### Content Type Descriptions
|
|
53
|
-
| Content Type | Description | When to Use |
|
|
54
|
-
|-|-|-|
|
|
55
|
-
| `sfdc_cms__site` | Root site configuration containing site-wide settings | Required for every site; one per site |
|
|
56
|
-
| `sfdc_cms__appPage` | Application page container that groups routes and views | Required; defines the app shell |
|
|
57
|
-
| `sfdc_cms__route` | URL routing definition mapping paths to views | Create one for each page/URL path |
|
|
58
|
-
| `sfdc_cms__view` | Page layout and component structure | Create one for each route; defines page content. Also use to edit existing views (e.g., adding/removing components, updating theme layout) |
|
|
59
|
-
| `sfdc_cms__brandingSet` | Brand colors, fonts, and styling tokens | Required; defines site-wide styling |
|
|
60
|
-
| `sfdc_cms__languageSettings` | Language and localization configuration | Required; defines supported languages |
|
|
61
|
-
| `sfdc_cms__mobilePublisherConfig` | Mobile app publishing settings | Required for mobile app deployment |
|
|
62
|
-
| `sfdc_cms__theme` | Theme definition referencing layouts and branding | Required; one per site |
|
|
63
|
-
| `sfdc_cms__themeLayout` | Page layout templates used by views | Create layouts for different page structures |
|
|
64
|
-
|
|
65
|
-
**Important:** Creating any new pages require BOTH `sfdc_cms__route` AND `sfdc_cms__view`.
|
|
66
|
-
|
|
67
|
-
## CUD Operations on DigitalExperience Contents
|
|
68
|
-
- Users can perform create, update, delete operations on DigitalExperience Contents.
|
|
69
|
-
- **IMPORTANT:** Before ANY modification (create, update, or delete) to content, ALWAYS call `execute_metadata_action` first to get the schema, examples, and instructions for that content type.
|
|
70
|
-
- **Call once per content type per user request**: If you're creating/modifying multiple items of the same content type (e.g., creating 3 routes), you only need to call `execute_metadata_action` ONCE for that content type. Reuse the schema and examples for all items of that type within the same user request.
|
|
71
|
-
- For each unique content type you need to work with, call `execute_metadata_action` using the following:
|
|
72
|
-
```json
|
|
73
|
-
{
|
|
74
|
-
"metadataType": "ExperienceSite",
|
|
75
|
-
"actionName": "getSiteContentMetadata",
|
|
76
|
-
"parameters": {
|
|
77
|
-
"contentType": "<content type from table above>",
|
|
78
|
-
"shouldIncludeExamples": true
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
- Do not call the `execute_metadata_action` MCP tool with any other site actionName unless specified in this knowledge doc/instructions.
|
|
83
|
-
|
|
84
|
-
## Retrieving Site URLs After Deployment
|
|
85
|
-
|
|
86
|
-
After successfully deploying the site using `sf project deploy`, use the `execute_metadata_action` MCP tool to get the preview and builder URLs:
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"metadataType": "ExperienceSite",
|
|
90
|
-
"actionName": "getSiteUrls",
|
|
91
|
-
"parameters": {
|
|
92
|
-
"siteDevName": "<site developer name>"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Refer to TIP 1 to get the site developer name.
|
|
98
|
-
|
|
99
|
-
If the site is not found, an error message will be returned indicating that the site may not be deployed. Ensure the site has been successfully deployed before calling this action.
|
|
100
|
-
|
|
101
|
-
## Enhancement Rules
|
|
102
|
-
|
|
103
|
-
- If need to understand how site metadata should be configured, use the `get_metadata_api_context` MCP tool to get the schemas.
|
|
104
|
-
|
|
105
|
-
- Use MCP tool `execute_metadata_action` with `getSiteTemplateMetadata` to get the knowledge document about the template and its default configurations if needed. **IMPORTANT:** This MUST be used for new site:
|
|
106
|
-
```json
|
|
107
|
-
{
|
|
108
|
-
"metadataType": "ExperienceSite",
|
|
109
|
-
"actionName": "getSiteTemplateMetadata",
|
|
110
|
-
"parameters": {
|
|
111
|
-
"templateDevName": "<template DevName, e.g. talon-template-byo>"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
- To validate Experience Site metadata, run CLI command `sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}`
|
|
117
|
-
|
|
118
|
-
## Guest User Sharing Rules (Public Sites Only)
|
|
119
|
-
|
|
120
|
-
**When to use**: Only create guest sharing rules when the user explicitly wants to make the site **public** (accessible to unauthenticated visitors). If the site is private/login-required, guest sharing rules are not needed.
|
|
121
|
-
If sharingRules metadata is not available locally in force-app/main/default/sharingRules, retrieve it from the org before creating new rules.
|
|
122
|
-
|
|
123
|
-
To get the full SharingRules schema, use the `get_metadata_api_context` MCP tool:
|
|
124
|
-
```json
|
|
125
|
-
{
|
|
126
|
-
"metadataType": "SharingRules"
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### XML Example
|
|
131
|
-
|
|
132
|
-
```xml
|
|
133
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
134
|
-
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
135
|
-
<sharingGuestRules>
|
|
136
|
-
<fullName>ShareAccountsWithSiteGuest</fullName>
|
|
137
|
-
<accessLevel>Read</accessLevel>
|
|
138
|
-
<includeHVUOwnedRecords>false</includeHVUOwnedRecords>
|
|
139
|
-
<label>Share Accounts With Site Guest</label>
|
|
140
|
-
<sharedTo>
|
|
141
|
-
<guestUser>[site developer name]</guestUser>
|
|
142
|
-
</sharedTo>
|
|
143
|
-
<criteriaItems>
|
|
144
|
-
<field>Name</field>
|
|
145
|
-
<operation>notEqual</operation>
|
|
146
|
-
<value>null</value>
|
|
147
|
-
</criteriaItems>
|
|
148
|
-
</sharingGuestRules>
|
|
149
|
-
</SharingRules>
|
|
150
|
-
```
|
|
151
|
-
Refer to TIP 1 to get the site developer name.
|
|
152
|
-
|
|
153
|
-
### Critical Requirements
|
|
154
|
-
|
|
155
|
-
1. **SharedTo Element**: Must use `<guestUser>{siteName}</guestUser>` where `{siteName}` is the Network name (not URL path prefix).
|
|
156
|
-
2. **includeHVUOwnedRecords**: Required field. Set to `false` unless records owned by high-volume site users should be included.
|
|
157
|
-
3. **One XML file per object**: Put all rules for a given object in one file. Do not create additional.
|
|
158
|
-
|
|
159
|
-
### Common Mistakes
|
|
160
|
-
|
|
161
|
-
- Using `<role>` or `<group>` instead of `<guestUser>` in sharedTo
|
|
162
|
-
- Omitting the required `includeHVUOwnedRecords` field
|
|
163
|
-
- Using `includeRecordsOwnedByAll` (that's for `sharingCriteriaRules`, not guest rules)
|
|
164
|
-
|
|
165
|
-
## Workflows
|
|
166
|
-
|
|
167
|
-
### Creating a new site
|
|
168
|
-
|
|
169
|
-
- Verify with user on the value of site name, url path prefix, and site template type.
|
|
170
|
-
- Retrieve template information from `getSiteTemplateMetadata` and strictly follow the rules of its knowledge document.
|
|
171
|
-
- Proceed to the workflow of editing an existing site.
|
|
172
|
-
|
|
173
|
-
### Editing an existing site
|
|
174
|
-
|
|
175
|
-
- Identify the intent of the user and break it down into steps.
|
|
176
|
-
- Make use of `get_metadata_api_context` if user wants to edit site metadata.
|
|
177
|
-
- Use `getSiteContentMetadata` to understand how to edit site contents.
|
|
178
|
-
- Once the tasks are done, perform site metadata validation.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: salesforce-fragment
|
|
3
|
-
description: Use this skill when users need to create or edit Salesforce Fragments (reusable UI pieces). Trigger when users mention fragments, UEM blocks, reusable UI templates, structured rendering across Slack/Mobile/LEX, or block-based layouts. Also use when users want to create unified experience components. Always use this skill for any fragment work.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## When to Use This Skill
|
|
7
|
-
|
|
8
|
-
Use this skill when you need to:
|
|
9
|
-
- Create reusable UI fragments for Salesforce experiences
|
|
10
|
-
- Generate Fragment metadata following UEM structure
|
|
11
|
-
- Build fragments for Slack, Mobile, LEX, and other Salesforce experiences
|
|
12
|
-
- Troubleshoot deployment errors related to Fragments
|
|
13
|
-
|
|
14
|
-
## Specification
|
|
15
|
-
|
|
16
|
-
# Fragment Generation Guide
|
|
17
|
-
|
|
18
|
-
## 📋 Overview
|
|
19
|
-
Fragments are reusable pieces of UI similar to templates, with placeholders for actual data values. The purpose of this file is to assist developers in creating and editing fragments.
|
|
20
|
-
|
|
21
|
-
## 🎯 Purpose
|
|
22
|
-
Fragments render data in a structured and unified way across various Salesforce experiences like Slack, Mobile, LEX etc
|
|
23
|
-
|
|
24
|
-
## ⚙️ Composition
|
|
25
|
-
A fragment is a UEM (Unified Experience Model) tree of blocks and regions. The fragment you return must follow the Typescript interfaces below:
|
|
26
|
-
|
|
27
|
-
- **Block definition**: Follow `{namespace}}/{{blockName}` convention and use the same value as the block's definition when it appears in a fragment.
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
interface BlockType {
|
|
31
|
-
type: 'block'
|
|
32
|
-
definition: string // {namespace}/{blockName}, e.g. "bcx/heading"
|
|
33
|
-
attributes?: Record<string, any>
|
|
34
|
-
children?: (BlockType | RegionType)[]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface RegionType {
|
|
38
|
-
type: 'region'
|
|
39
|
-
name: string
|
|
40
|
-
children: BlockType[]
|
|
41
|
-
}
|
|
42
|
-
```
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: salesforce-lightning-app-build
|
|
3
|
-
description: Use this skill to build and orchestrate complete Salesforce Lightning Applications (LEX Apps), custom projects, or end-to-end business solutions from a natural language scenario. Triggers when a user requests a "custom app", a "business solution", or describes any scenario requiring multiple interconnected Salesforce components to be built together into a complete Lightning Experience (LEX) Application. Orchestrates the sequenced creation of Custom Objects, Relationships, Fields, Lightning Record Pages, Custom Tabs, Custom Applications, Permission Sets, and OPTIONALLY Flows and Validation Rules.
|
|
4
|
-
metadata:
|
|
5
|
-
category: orchestration
|
|
6
|
-
related-skills: salesforce-custom-object, salesforce-custom-field, salesforce-custom-tab, salesforce-flexipage, salesforce-custom-application, salesforce-flow, salesforce-validation-rule, salesforce-list-view
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Salesforce Lightning Application Build
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
Build complete Lightning Experience applications from natural language by orchestrating multiple metadata types in proper dependency order. This skill acts as a "conductor" that invokes specialized metadata skills when available, or generates metadata directly when no skill exists.
|
|
14
|
-
|
|
15
|
-
## When to Use This Skill
|
|
16
|
-
**Use when:**
|
|
17
|
-
- User requests a "complete app", "Lightning app", or "end-to-end solution"
|
|
18
|
-
- User says "build an app", "create an application", "build a [type] app" (project management, tracking, etc.)
|
|
19
|
-
- Request involves 3+ metadata types working together (objects + fields + pages + security)
|
|
20
|
-
- User describes multiple custom objects with relationships between them
|
|
21
|
-
- User mentions custom objects AND Lightning Record Pages in the same request
|
|
22
|
-
- User mentions custom objects AND permission sets/security in the same request
|
|
23
|
-
- Request includes phrases like "allows users to manage/track", "management system", "tracking app"
|
|
24
|
-
- Need to ensure proper sequencing (Objects → Fields → UI → Security)
|
|
25
|
-
|
|
26
|
-
**Examples that should trigger this skill:**
|
|
27
|
-
- "Build a project management app with Tasks, Resources, and Supplies objects"
|
|
28
|
-
- "Create an app to track vehicles with Lightning pages and permission sets"
|
|
29
|
-
- "I need a Space Station management system with multiple objects and relationships"
|
|
30
|
-
- "Build an employee onboarding app with custom Lightning Record Pages"
|
|
31
|
-
|
|
32
|
-
**Do NOT use when:**
|
|
33
|
-
- Creating a single metadata component (use specific metadata skill instead)
|
|
34
|
-
- Troubleshooting or debugging existing metadata
|
|
35
|
-
- Building Salesforce Classic apps (not Lightning Experience)
|
|
36
|
-
- User asks for just one object, or just one page, or just one permission set (without others)
|
|
37
|
-
---
|
|
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** | ❌ NO | - | Generate directly using Metadata API knowledge |
|
|
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
|
-
**Fallback generation (no skill available):**
|
|
119
|
-
1. Generate Permission Set XML directly 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
|
-
- [fallback] Permission Set XML generation (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 Sets (no skill) → Generate XML directly
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
## Error Handling
|
|
206
|
-
|
|
207
|
-
### Critical Errors (Stop Execution)
|
|
208
|
-
|
|
209
|
-
Stop and ask user for clarification if:
|
|
210
|
-
- User request is too vague to extract any objects or fields
|
|
211
|
-
- Conflicting requirements detected (e.g., "make it private" + "everyone should see it")
|
|
212
|
-
- Invalid Salesforce naming detected (reserved words like `Order`, `Group`)
|
|
213
|
-
|
|
214
|
-
### Non-Critical Errors (Continue with Warning)
|
|
215
|
-
|
|
216
|
-
Log warning and continue if:
|
|
217
|
-
- Optional component fails (e.g., List View generation fails)
|
|
218
|
-
- Skill invocation fails for non-critical metadata
|
|
219
|
-
- Validation Rule or Flow has minor issues
|
|
220
|
-
|
|
221
|
-
**Warning Pattern:**
|
|
222
|
-
```
|
|
223
|
-
⚠️ Warning: [Component Type] generation encountered issue
|
|
224
|
-
Component: [Name]
|
|
225
|
-
Issue: [Description]
|
|
226
|
-
Impact: [What won't work]
|
|
227
|
-
Recommendation: [How to fix manually]
|
|
228
|
-
|
|
229
|
-
Continuing with remaining components...
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Best Practices
|
|
235
|
-
|
|
236
|
-
### 1. Always Follow Dependency Order
|
|
237
|
-
Never invoke skills out of sequence. Fields need objects, pages need tabs, apps need tabs.
|
|
238
|
-
|
|
239
|
-
### 2. Use Skills When Available
|
|
240
|
-
Don't reinvent the wheel. Specialized skills have field-specific validation that prevents deployment errors.
|
|
241
|
-
|
|
242
|
-
### 3. Generate Thoughtful Defaults
|
|
243
|
-
When user doesn't specify details:
|
|
244
|
-
- Use Text name fields for human entities
|
|
245
|
-
- Use AutoNumber for transactions
|
|
246
|
-
- Enable Search and Reports for user-facing objects
|
|
247
|
-
- Set sharingModel based on relationships
|
|
248
|
-
|
|
249
|
-
### 5. Validate Before Building
|
|
250
|
-
Check for:
|
|
251
|
-
- Reserved words in API names
|
|
252
|
-
- Relationship limits (max 2 M-D per object)
|
|
253
|
-
- Name length limits
|
|
254
|
-
- 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.
|