@salesforce/afv-skills 1.4.0 → 1.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -11,14 +11,15 @@
11
11
  "registry": "https://registry.npmjs.org"
12
12
  },
13
13
  "devDependencies": {
14
- "@salesforce/webapp-template-app-react-sample-b2e-experimental": "^1.112.5",
15
- "@salesforce/webapp-template-app-react-sample-b2x-experimental": "^1.112.5",
14
+ "@salesforce/webapp-template-app-react-sample-b2e-experimental": "^1.112.7",
15
+ "@salesforce/webapp-template-app-react-sample-b2x-experimental": "^1.112.7",
16
+ "@types/js-yaml": "^4.0.9",
17
+ "js-yaml": "^4.1.1",
16
18
  "tsx": "^4.21.0"
17
19
  },
18
20
  "scripts": {
19
21
  "validate:skills": "tsx scripts/validate-skills.ts",
20
22
  "sync-react-b2e-sample": "node scripts/sync-react-b2e-sample.js",
21
- "sync-react-b2x-sample": "node scripts/sync-react-b2x-sample.js",
22
- "sync-webapp-skills": "node scripts/sync-webapp-skills.js"
23
+ "sync-react-b2x-sample": "node scripts/sync-react-b2x-sample.js"
23
24
  }
24
25
  }
@@ -7,6 +7,11 @@ description: "Creates, modifies, or manages Salesforce Experience Cloud LWR site
7
7
 
8
8
  Build and configure Salesforce Experience Cloud Lightning Web Runtime (LWR) sites via metadata (DigitalExperienceConfig, DigitalExperienceBundle, Network, CustomSite, CMS contents).
9
9
 
10
+ ## IMPORTANT!!
11
+
12
+ Right after loading this skill, you MUST copy the selected workflows/steps to your plan as a TODO checklist and work on each of the item carefully to ensure correctness.
13
+ You MUST load the relevant reference docs even though they may live outside of user's project folder.
14
+
10
15
  ## Table of Contents
11
16
 
12
17
  - When to Use
@@ -33,8 +38,8 @@ When working with Experience LWR sites:
33
38
  ## Critical Rules
34
39
 
35
40
  1. Before using any MCP tool, make sure they're actually available. If a tool is missing for the current task, let the user know and pause the current workflow.
36
- 2. **ALWAYS** load the relevant reference docs before doing anything.
37
- 3. **ALWAYS** strictly follow workflows in [Common Workflows](#common-workflows) that match user's requirements. The instructions there should override any conflicting global rules and should have the highest priority over your existing knowledge.
41
+ 2. **MUST ALWAYS** load the relevant reference docs before doing anything.
42
+ 3. **MUST ALWAYS** strictly follow workflows in [Common Workflows](#common-workflows) that match user's requirements. The instructions there should override any conflicting global rules and should have the highest priority over your existing knowledge.
38
43
  4. Flexipage is abstracted away for newer LWR sites with DigitalExperienceBundle, so **NEVER** use any Flexipage-related MCP tool or skills to handle LWR sites' contents.
39
44
 
40
45
  ## Core Site Properties
@@ -71,7 +76,7 @@ Before doing anything else, note down the following properties from the local pr
71
76
  | `sfdc_cms__appPage` | Application page container that groups routes and views | Required; defines the app shell |
72
77
  | `sfdc_cms__route` | URL routing definition mapping paths to views | Create one for each page/URL path |
73
78
  | `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 on a specific page) |
74
- | `sfdc_cms__brandingSet` | Brand colors, fonts, and styling tokens | Required; defines site-wide styling |
79
+ | `sfdc_cms__brandingSet` | Brand colors, fonts, and styling tokens | Required; defines site-wide styling. Use to create or edit existing branding sets |
75
80
  | `sfdc_cms__languageSettings` | Language and localization configuration | Required; defines supported languages |
76
81
  | `sfdc_cms__mobilePublisherConfig` | Mobile app publishing settings | Required for mobile app deployment |
77
82
  | `sfdc_cms__theme` | Theme definition referencing layouts and branding | Required; one per site |
@@ -79,9 +84,14 @@ Before doing anything else, note down the following properties from the local pr
79
84
 
80
85
  **Important:** Creating any new pages require BOTH `sfdc_cms__route` AND `sfdc_cms__view`.
81
86
 
87
+ #### Object Pages
88
+
89
+ Object Pages are dedicated pages used to display and manage record-level data for a specific Salesforce entity/object. For example, an custom object "Car" should have "Car_Detail", "Car_List", and "Car_Related_list" views.
90
+
82
91
  ## References
83
92
 
84
93
  Reference docs within the skill directory. Note that these are **local** and not MCP.
94
+ Before doing anything, you **MUST ALWAYS** load them first if they match user intent.
85
95
 
86
96
  - [bootstrap-template-byo-lwr.md](docs/bootstrap-template-byo-lwr.md) - Site creation, template defaults
87
97
  - [configure-content-route.md](docs/configure-content-route.md) - Route creation (custom/object pages)
@@ -111,32 +121,46 @@ Reference docs within the skill directory. Note that these are **local** and not
111
121
 
112
122
  **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
113
123
 
114
- - [ ] Load [configure-content-route.md](docs/configure-content-route.md)
115
- - [ ] Load [configure-content-view.md](docs/configure-content-view.md)
116
- - [ ] Load [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md)
117
- - [ ] Follow the instructions of the above docs strictly to accomplish user's goal
124
+ - [ ] MUST read [configure-content-route.md](docs/configure-content-route.md)
125
+ - [ ] MUST read [configure-content-view.md](docs/configure-content-view.md)
126
+ - [ ] MUST read [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md)
118
127
 
119
128
  ### Adding UI Components to Pages
120
129
 
121
130
  **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
122
131
 
123
- - [ ] Read and follow [handle-ui-components.md](docs/handle-ui-components.md) to add LWCs to LWR sites.
124
- - [ ] Load and follow [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md) to handle id generation
125
- - [ ] Read and follow [configure-content-themeLayout.md](docs/configure-content-themeLayout.md) if a component has one of the following requirements:
132
+ - [ ] MUST read [handle-ui-components.md](docs/handle-ui-components.md) to add LWCs to LWR sites.
133
+ - [ ] MUST read [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md) to handle id generation
134
+ - [ ] MUST read [configure-content-themeLayout.md](docs/configure-content-themeLayout.md) if a component has one of the following requirements:
126
135
  - needs to be "sticky" and persistent across pages
127
136
  - is used as a theme layout
128
137
 
138
+ ### Creating Page Layouts / Container Components
139
+
140
+ **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
141
+
142
+ - [ ] MUST read [handle-ui-components.md](docs/handle-ui-components.md)
143
+
129
144
  ### Creating Theme Layouts
130
145
 
131
146
  **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
132
147
 
133
- - [ ] Read and follow strictly [configure-content-themeLayout.md](docs/configure-content-themeLayout.md).
148
+ - [ ] Check with user whether this new theme layout reuses an existing theme layout component or requires a new one.
149
+ - [ ] MUST read [handle-ui-components.md](docs/handle-ui-components.md) if creating a new theme layout component.
150
+ - [ ] MUST read [configure-content-themeLayout.md](docs/configure-content-themeLayout.md).
151
+ - [ ] MUST read [configure-content-view.md](docs/configure-content-view.md) if need to apply theme layout to pages
152
+
153
+ ### Applying/Setting Theme Layouts
154
+
155
+ **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
156
+
157
+ - [ ] MUST read [configure-content-view.md](docs/configure-content-view.md)
134
158
 
135
159
  ### Configuring Branding
136
160
 
137
161
  **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
138
162
 
139
- - [ ] Read and follow strictly [configure-content-brandingSet.md](docs/configure-content-brandingSet.md) to configure background colors, foreground colors, button colors, and other branding colors that affect all pages.
163
+ - [ ] MUST read [configure-content-brandingSet.md](docs/configure-content-brandingSet.md) to configure background colors, foreground colors, button colors, and other branding colors that affect all pages.
140
164
 
141
165
  ### CUD Operations on DigitalExperience Contents
142
166
 
@@ -145,8 +169,8 @@ Reference docs within the skill directory. Note that these are **local** and not
145
169
  **Steps** (Follow the steps sequentially. Do not skip any step before proceeding):
146
170
 
147
171
  - [ ] Determine what content types the user wants to modify
148
- - [ ] Read and follow strictly the reference doc related to the target content types if the doc exists. e.g., if modifying `sfdc_cms__route`, load [configure-content-route.md](docs/configure-content-route.md).
149
- - [ ] **Always** Read [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md) if creating or modifying view or theme layout
172
+ - [ ] MUST read the reference doc related to the target content types if the doc exists. e.g., if modifying `sfdc_cms__route`, load [configure-content-route.md](docs/configure-content-route.md).
173
+ - [ ] MUST read [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md) if creating or modifying view or theme layout
150
174
  - [ ] **Always** Call `execute_metadata_action` to get the schema and examples for that content type **after** loading the corresponding reference docs.
151
175
  - **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.
152
176
  - For each unique content type you need to work with, **always** call `execute_metadata_action` using the following:
@@ -162,9 +186,11 @@ Reference docs within the skill directory. Note that these are **local** and not
162
186
  }
163
187
  ```
164
188
 
165
- ### Retrieving Site URLs After Deployment
189
+ ### Retrieving Site Preview and Builder URLs After Deployment
190
+
191
+ **Use when** user requests to preview a site, access a builder site, or after successfully deploying a site.
166
192
 
167
- After successfully deploying the site using `sf project deploy`, use the `execute_metadata_action` MCP tool to get the preview and builder URLs:
193
+ Use the `execute_metadata_action` MCP tool to get the preview and builder URLs:
168
194
 
169
195
  ```json
170
196
  {
@@ -6,6 +6,7 @@
6
6
 
7
7
  - Core Principles
8
8
  - Generation Guidelines
9
+ - Editing Existing Branding Sets
9
10
  - Branding Property Patterns
10
11
 
11
12
  ## Core Principles
@@ -58,7 +59,11 @@ The `content.json` file must contain:
58
59
  - `title`: **Required**. Human-readable display title (e.g., Branding Set).
59
60
  - Maximum length is **100 characters**.
60
61
  - Must be **unique** within the space's brandingSet content items.
61
- - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
62
+ - `contentBody`: Include all `required` properties from `schemaDefinition`.
63
+ 1. **Seed**: Always call `execute_metadata_action` with `shouldIncludeExamples: true`. Copy the *entire* example object from `examplesOfContentType[0]` into `content.json`. **NEVER** start from a minimal stub.
64
+ 2. **Recalculate (CRITICAL STOP)**: You MUST stop and perform explicit changes for dependent tokens BEFORE generating JSON.
65
+ - [] Refer to "Branding Property Patterns" for detailed calculations.
66
+
62
67
  - `brandingSetType`: Represents whether the color palette is for the entire site or a specific section.
63
68
  - `APP`: The branding set applies to the entire site. There can be only one branding set of this type.
64
69
  - `SCOPED`: A `SCOPED` branding set can be applied only to a section component for granular overrides.
@@ -70,10 +75,6 @@ The `content.json` file must contain:
70
75
  - **Patterns**: See the "Branding Property Patterns" section for details on value relationships.
71
76
  - `urlName`: Lowercase with hyphens (e.g., `branding-set`)
72
77
 
73
- **Rules**:
74
-
75
- - Before any actions, *always* call `execute_metadata_action` to get the full schema and examples per the skill document.
76
-
77
78
  ### 4. Naming Conventions Summary
78
79
 
79
80
  | Field | Format | Example |
@@ -84,9 +85,18 @@ The `content.json` file must contain:
84
85
 
85
86
  ### 5. Generation Checklist
86
87
 
87
- - [ ] Directory and `_meta.json` follow naming conventions (1, 2)
88
- - [ ] `content.json` has all required fields (3)
88
+ - [ ] Directory and `_meta.json` follow naming conventions
89
+ - [ ] `content.json` has all required fields
89
90
  - [ ] `contentBody` follows the schema provided by `execute_metadata_action`
91
+ - [ ] **STOP AND VERIFY**: `contentBody.values` honors all **Branding Property Patterns** defined below and explicitly recalculated and updated all dependent tokens based on any token updates requested by the user.
92
+
93
+ ## Editing Existing Branding Sets
94
+
95
+ Use this section when modifying existing branding sets under the `sfdc_cms__brandingSet` directory.
96
+
97
+ ### Editing Checklist
98
+
99
+ - [ ] Ensure all modified branding properties honor the **Branding Property Patterns** defined below.
90
100
 
91
101
  ## Branding Property Patterns
92
102
 
@@ -72,6 +72,7 @@ The `content.json` file must contain:
72
72
  - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
73
73
  - Do not add additional fields.
74
74
  - `urlName`: URL identifier (lowercase, words separated by dashes e.g., "scoped-header-and-footer")
75
+ - `contentBody.compnent.definition`: The actual theme layout component that displays/renders the layout and includes theme region components.
75
76
 
76
77
  **Rules**:
77
78
 
@@ -130,7 +131,7 @@ When generating a new theme layout, ensure:
130
131
  - [ ] `urlName` uses lowercase with hyphens (V)
131
132
  - [ ] `title` is human-readable (V)
132
133
  - [ ] `sfdc_cms__theme/[THEME_API_NAME]/content.json` updated by appending a new `contentBody.layouts` mapping (VI)
133
- - [ ] **CRITICAL**: Complete all the UUID generation steps. See `docs/handle-component-and-region-ids.md`
134
+ - [ ] **CRITICAL**: Complete all the UUID generation steps. See [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md)
134
135
 
135
136
  ## Purpose B: Editing Existing Theme Layouts
136
137
 
@@ -49,7 +49,7 @@ The `_meta.json` file must contain:
49
49
 
50
50
  ### Theme Layout Type (All Views)
51
51
 
52
- The `contentBody.themeLayoutType` field specifies which theme layout to use for the view.
52
+ The `contentBody.themeLayoutType` field specifies which theme layout to use for the view. There can only be one per view.
53
53
 
54
54
  - **Default**: `"Inner"` - Use this default if the user does not specify a layout OR if the lookup fails to find a matching layoutType
55
55
  - **Lookup**: To find valid values:
@@ -126,7 +126,7 @@ The route's `activeViewId` must match the view's directory name exactly.
126
126
  - [ ] Directory and `_meta.json` follow structure (see Directory Structure, _meta.json Structure)
127
127
  - [ ] `content.json` has all required fields (A.1)
128
128
  - [ ] Component structure correct with both regions (A.1)
129
- - [ ] **CRITICAL**: Complete all the UUID generation steps. see `docs/handle-component-and-region-ids.md`
129
+ - [ ] **CRITICAL**: Complete all the UUID generation steps. see [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md)
130
130
  - [ ] `viewType` matches route's `routeType` (CRITICAL)
131
131
 
132
132
  ### PART B: OBJECT PAGES
@@ -218,7 +218,7 @@ The route's `activeViewId` must match the view's directory name exactly. The `vi
218
218
  - [ ] `viewType` matches route's `routeType` for all three views (CRITICAL)
219
219
  - [ ] Component structure correct with both regions (see A.1)
220
220
  - [ ] SEO assistant configured correctly per view type (B.4)
221
- - [ ] **CRITICAL**: Complete both UUID generation steps. see `docs/handle-component-and-region-ids.md`
221
+ - [ ] **CRITICAL**: Complete both UUID generation steps. see [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md)
222
222
 
223
223
  ## Purpose B: Editing Existing Views
224
224