@salesforce/afv-skills 1.6.7 → 1.6.8

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.
@@ -1,141 +0,0 @@
1
- # Content Type: sfdc_cms__brandingSet
2
-
3
- **Use when** user explicitly requests creating/updating branding set.
4
-
5
- ## Table of Contents
6
-
7
- - Core Principles
8
- - Generation Guidelines
9
- - Editing Existing Branding Sets
10
- - Branding Property Patterns
11
-
12
- ## Core Principles
13
-
14
- 1. **Purpose**: Manage site-wide branding properties (colors, fonts, etc.).
15
- 2. **Site Association**: Branding sets are linked to the site configuration.
16
-
17
- ## Generation Guidelines
18
-
19
- ### 1. Directory Structure
20
-
21
- 1. **Location**: `digitalExperiences/site/[SITE_NAME]/sfdc_cms__brandingSet/[BRANDING_SET_NAME]/`
22
- 2. **Required Files**:
23
- - `_meta.json` - Metadata file defining the API name and type
24
- - `content.json` - Content file defining the configuration and layout
25
- 3. **Naming Convention**: Underscore-separated names (e.g., `Branding_Set`).
26
-
27
- ### 2. _meta.json Structure
28
-
29
- The `_meta.json` file must contain:
30
-
31
- ```json
32
- {
33
- "apiName": "[BRANDING_SET_NAME]",
34
- "type": "sfdc_cms__brandingSet",
35
- "path": "brandingSets"
36
- }
37
- ```
38
-
39
- **Rules**:
40
-
41
- - `apiName`: Must match the directory name exactly (e.g., `Branding_Set`)
42
-
43
- ### 3. content.json Structure
44
-
45
- The `content.json` file must contain:
46
-
47
- ```json
48
- {
49
- "type": "sfdc_cms__brandingSet",
50
- "title": "[DISPLAY_TITLE]",
51
- "contentBody": {},
52
- "urlName": "[URL_NAME]"
53
- }
54
- ```
55
-
56
- **Field Definitions**:
57
-
58
- - `type`: **Required**. Represents the content type. The only supported value is `"sfdc_cms__brandingSet"`.
59
- - `title`: **Required**. Human-readable display title (e.g., Branding Set).
60
- - Maximum length is **100 characters**.
61
- - Must be **unique** within the space's brandingSet content items.
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
-
67
- - `brandingSetType`: Represents whether the color palette is for the entire site or a specific section.
68
- - `APP`: The branding set applies to the entire site. There can be only one branding set of this type.
69
- - `SCOPED`: A `SCOPED` branding set can be applied only to a section component for granular overrides.
70
- - `definitionName`: **Required**. Represents the name for the branding set used in the site or template’s theme.
71
- - **Build Your Own (LWR)**: uses `talon-template-byo:branding`
72
- - **Microsite**: uses `microsite-template-marketing:branding`
73
- - `values`: **Required**. Represents a map (object) of branding values (colors, fonts, etc.) that can be applied to a site.
74
- - **Format**: An object containing key-value pairs that represent branding-set values.
75
- - **Patterns**: See the "Branding Property Patterns" section for details on value relationships.
76
- - `urlName`: Lowercase with hyphens (e.g., `branding-set`)
77
-
78
- ### 4. Naming Conventions Summary
79
-
80
- | Field | Format | Example |
81
- |-------|--------|--------|
82
- | Directory/apiName | Underscore-separated | `Branding_Set` |
83
- | title | Human-readable | `Branding Set` |
84
- | urlName | Lowercase-hyphens | `build-your-own-lwr` |
85
-
86
- ### 5. Generation Checklist
87
-
88
- - [ ] Directory and `_meta.json` follow naming conventions
89
- - [ ] `content.json` has all required fields
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.
100
-
101
- ## Branding Property Patterns
102
-
103
- When generating or validating `contentBody.values`, follow these established patterns for consistency:
104
-
105
- ### 1. Color Scaling Patterns (The "Rule of 3")
106
-
107
- Salesforce uses a numeric suffix system (`Color`, `Color1`, `Color2`, `Color3`) to create a tonal palette.
108
-
109
- - **Darkening Trend**: As the suffix number increases, the color becomes progressively darker.
110
- - Example: `BackgroundColor` (#ffffff) → `_BackgroundColor1` (#ebebeb) → `_BackgroundColor2` (#c2c2c2) → `_BackgroundColor3` (#858585).
111
- - **Contrast/Foreground Colors**: Every base color has a corresponding `ForegroundColor` to ensure accessibility.
112
- - **WCAG Compliance**: Ensure a color contrast ratio of at least **4.5:1** between the background and foreground colors for standard text.
113
- - Dark base colors usually have white (#ffffff) foregrounds.
114
- - Light base colors (like `_NeutralColor`) usually have black (#000000) foregrounds.
115
-
116
- ### 2. Font Size Hierarchy
117
-
118
- - **Base vs. Small**: The `Small` variant is typically **75%** of the base size.
119
- - Example: `BodyFontSize` (1rem) → `BodySmallFontSize` (0.75rem).
120
- - **Heading Scale**: Headings follow a standard typographic scale:
121
- - `HeadingExtraLarge`: 2.5rem
122
- - `HeadingLarge`: 1.75rem (~70% of XL)
123
- - `HeadingMedium`: 1.25rem (~50% of XL)
124
- - `HeadingSmall`: 1.125rem
125
-
126
- ### 3. Design Token Mapping
127
-
128
- Prefer using **DXP Design Tokens** over hardcoded values where possible:
129
-
130
- - **Fonts**: Use `var(--dxp-s-html-font-family)` for base, body, and button fonts.
131
- - **Brand Alignment**: Use `var(--dxp-g-brand)` for primary brand colors and links.
132
-
133
- ### 4. Component Consistency
134
-
135
- - **Buttons**: Maintain consistent `BorderRadius` (e.g., 4px) across all button sizes (Small, Medium, Large).
136
- - **Form Elements**: `FormElementLabelFontSize` and `FormElementTextFontSize` should match.
137
-
138
- ### 5. Spacing and Ratios
139
-
140
- - **Device Ratios**: Desktop spacing (padding/spacers) is typically **1.33x** larger than mobile spacing.
141
- - Example: `ColumnSpacerSizeDesktop` (1rem) vs `ColumnSpacerSizeMobile` (0.75rem).
@@ -1,232 +0,0 @@
1
- # Content Type: sfdc_cms__route
2
-
3
- **Use when** user explicitly requests creating a new page. Not for editing existing routes.
4
-
5
- ## Table of Contents
6
-
7
- - Generation Guidelines
8
- - Core Principles
9
- - Directory Structure (All Routes)
10
- - _meta.json Structure
11
- - Part A: CUSTOM PAGES
12
- - Part B: OBJECT PAGES
13
-
14
- ## Generation Guidelines
15
-
16
- **PAGE TYPES**: These guidelines supports two types of pages:
17
-
18
- 1. **Custom Pages** - Single route pages for custom content (e.g., About Us). **Note**: Standard pages (e.g., Home, Login) come pre-built with the site and cannot be created.
19
- 2. **Object Pages** - Requires 3 routes: Detail, List, and Related List (e.g., Account, custom objects)
20
-
21
- ## Core Principles
22
-
23
- 1. **Purpose**: Generate new routes under the `sfdc_cms__route` directory.
24
- 2. **View Association**: Each route must reference a corresponding view in the `sfdc_cms__view` directory.
25
- 3. **CRITICAL**: The `routeType` in the route's `content.json` MUST exactly match the `viewType` in the corresponding view's `content.json`. This is a required validation rule.
26
-
27
- ## Directory Structure (All Routes)
28
-
29
- 1. **Location**: `digitalExperiences/site/[SITE_NAME]/sfdc_cms__route/[ROUTE_NAME]/`
30
- 2. **Required Files**:
31
- - `_meta.json` - Metadata file defining the API name and type
32
- - `content.json` - Content file defining the configuration and layout
33
- 3. **Naming Convention**: Underscore-separated names with "__c" suffix (About_Us__c, Account_Detail__c)
34
-
35
- ## _meta.json Structure (All Routes)
36
-
37
- The `_meta.json` file must contain:
38
-
39
- ```json
40
- {
41
- "apiName": "[ROUTE_NAME]",
42
- "type": "sfdc_cms__route",
43
- "path": "routes"
44
- }
45
- ```
46
-
47
- **Rules**:
48
-
49
- - `apiName`: Must match the route directory name exactly
50
- - `type`: Always `"sfdc_cms__route"`
51
- - `path`: Always `"routes"`
52
-
53
- ## Part A: CUSTOM PAGES
54
-
55
- Use this section when creating single-route custom content pages.
56
-
57
- ### A.1. content.json Structure
58
-
59
- The `content.json` file must contain:
60
-
61
- ```json
62
- {
63
- "type": "sfdc_cms__route",
64
- "title": "[DISPLAY_TITLE]",
65
- "contentBody": {},
66
- "urlName": "[URL_NAME]"
67
- }
68
- ```
69
-
70
- **Field Definitions**:
71
-
72
- - `type`: Always `"sfdc_cms__route"`
73
- - `title`: Human-readable display title (e.g., About Us)
74
- - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
75
- - `urlName`: URL identifier (lowercase with hyphens, e.g., `about-us`)
76
-
77
- ### A.2. Naming Conventions
78
-
79
- For a page named "About Us":
80
-
81
- | Field | Format | Example |
82
- |-------|--------|--------|
83
- | Directory Name | Underscore-separated + "__c" | `About_Us__c` |
84
- | apiName | Same as directory | `About_Us__c` |
85
- | title | Human-readable | `About Us` |
86
- | contentBody.activeViewId | Underscore-separated (no __c) | `About_Us` |
87
- | contentBody.routeType | "custom-" + lowercase hyphens | `custom-about-us` |
88
- | contentBody.urlPrefix | Lowercase hyphens | `about-us` |
89
- | urlName | Lowercase hyphens | `about-us` |
90
-
91
- **CRITICAL**: `routeType` MUST exactly match `viewType` in the corresponding view's `content.json`.
92
-
93
- ### A.3. View Dependency
94
-
95
- - Before creating a route, ensure the corresponding view exists in `sfdc_cms__view/[view_name]/`
96
- - If the view doesn't exist, create it first following the view creation guidelines
97
-
98
- ### A.4. Generation Checklist
99
-
100
- - [ ] Route directory and files created (see Directory Structure)
101
- - [ ] `_meta.json` follows structure (see _meta.json Structure)
102
- - [ ] `content.json` follows structure (see A.1)
103
- - [ ] All naming conventions applied (see A.2)
104
- - [ ] Corresponding view exists (see A.3)
105
-
106
- ## Part B: OBJECT PAGES
107
-
108
- Use this section when creating object pages that require Detail, List, and Related List routes.
109
-
110
- ### B.1. Overview
111
-
112
- Object pages require **three routes** to be created together:
113
-
114
- 1. **Detail Route** - Displays a single record
115
- 2. **List Route** - Displays a list of records
116
- 3. **Related List Route** - Displays related records for a parent record
117
-
118
- **OBJECT TYPES**: Two types of Salesforce objects use different `routeType` formats:
119
-
120
- | Object Type | routeType Format | Example |
121
- |-------------|------------------|----------|
122
- | **Standard** (Account, Contact) | `[type]-[keyPrefix]` | `detail-001`, `list-001`, `relatedlist-001` |
123
- | **Custom** (Test_Object__c) | `[type]-[ObjectApiName]` | `detail-Test_Object__c`, `list-Test_Object__c` |
124
-
125
- - **keyPrefix**: 3-character identifier unique to each standard object (Account=001, Contact=003)
126
- - **ObjectApiName**: Custom object API name including the "__c" suffix
127
-
128
- Obtain object information from the `objectList` MCP output:
129
-
130
- ```json
131
- [
132
- ["Label", "ApiName", "KeyPrefix", "IsCustom"]
133
- ]
134
- ```
135
-
136
- ### B.2. Required Routes
137
-
138
- Create three directories under `sfdc_cms__route/`:
139
-
140
- - `[OBJECT_NAME]_Detail__c/`
141
- - `[OBJECT_NAME]_List__c/`
142
- - `[OBJECT_NAME]_Related_List__c/`
143
-
144
- ### B.3. content.json Structure
145
-
146
- Each route's `content.json` file must contain:
147
-
148
- ```json
149
- {
150
- "type": "sfdc_cms__route",
151
- "title": "[OBJECT_NAME] [TYPE]",
152
- "contentBody": {},
153
- "urlName": "[object_name_lowercase]-[type]"
154
- }
155
- ```
156
-
157
- **Field Definitions**:
158
-
159
- - `type`: Always `"sfdc_cms__route"`
160
- - `title`: Human-readable title (Account Detail, Account List)
161
- - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
162
- - `contentBody.urlPrefix`: **CRITICAL**: Must be identical across all three object page views (Detail, List, and Related List) for the same object.
163
- - `urlName`: Lowercase with hyphens (account-detail, account-list)
164
-
165
- ### B.4. Object Page Examples
166
-
167
- Use `[ObjectName]` as the object name (Account, Test_Object) and `[IDENTIFIER]` as:
168
-
169
- - **Standard objects**: keyPrefix (001 for Account, 003 for Contact)
170
- - **Custom objects**: ObjectApiName (Test_Object__c)
171
-
172
- #### content.json Template
173
-
174
- ```json
175
- {
176
- "type": "sfdc_cms__route",
177
- "title": "[ObjectName] [Detail|List|Related List]",
178
- "contentBody": {
179
- "activeViewId": "[ObjectName]_[Detail|List|Related_List]",
180
- "configurationTags": [],
181
- "pageAccess": "UseParent",
182
- "routeType": "[detail|list|relatedlist]-[IDENTIFIER]",
183
- "urlPrefix": "[object-name-lowercase]"
184
- },
185
- "urlName": "[object-name-lowercase]-[detail|list|related-list]"
186
- }
187
- ```
188
-
189
- **Rules**:
190
-
191
- - Before any actions, *always* call `execute_metadata_action` to get the full schema and examples per the skill document.
192
-
193
- #### routeType Examples
194
-
195
- | Route Type | Standard (Account) | Custom (Test_Object__c) |
196
- |------------|-------------------|------------------------|
197
- | Detail | `detail-001` | `detail-Test_Object__c` |
198
- | List | `list-001` | `list-Test_Object__c` |
199
- | Related List | `relatedlist-001` | `relatedlist-Test_Object__c` |
200
-
201
- ### B.5. Naming Conventions
202
-
203
- For an object named "Account":
204
-
205
- | Field | Detail | List | Related List |
206
- |-------|--------|------|---------------|
207
- | Directory Name | `Account_Detail__c` | `Account_List__c` | `Account_Related_List__c` |
208
- | apiName | `Account_Detail__c` | `Account_List__c` | `Account_Related_List__c` |
209
- | title | `Account Detail` | `Account List` | `Account Related List` |
210
- | activeViewId | `Account_Detail` | `Account_List` | `Account_Related_List` |
211
- | routeType (Standard) | `detail-[keyPrefix]` | `list-[keyPrefix]` | `relatedlist-[keyPrefix]` |
212
- | routeType (Custom) | `detail-[ObjectApiName]` | `list-[ObjectApiName]` | `relatedlist-[ObjectApiName]` |
213
- | urlPrefix | `account` | `account` | `account` |
214
- | urlName | `account-detail` | `account-list` | `account-related-list` |
215
-
216
- **CRITICAL**: `routeType` MUST exactly match `viewType` in the corresponding view's `content.json`.
217
-
218
- ### B.6. View Dependency
219
-
220
- - Before creating routes, ensure corresponding views exist in `sfdc_cms__view/`:
221
- - `[ObjectName]_Detail/`, `[ObjectName]_List/`, `[ObjectName]_Related_List/`
222
- - `activeViewId` must match the view directory name exactly
223
- - `routeType` must exactly match `viewType` in the corresponding view
224
- - If views don't exist, create them first following the view creation guidelines
225
-
226
- ### B.7. Generation Checklist
227
-
228
- - [ ] Object type determined (Standard or Custom) and identifier obtained (keyPrefix or ObjectApiName)
229
- - [ ] All three routes created: **Detail**, **List**, and **Related List**, each with `_meta.json` and `content.json`
230
- - [ ] All naming conventions applied (see B.5)
231
- - [ ] Corresponding views exist (see B.6)
232
- - [ ] `routeType` matches `viewType` for all three routes
@@ -1,145 +0,0 @@
1
- # Content Type: sfdc_cms__themeLayout
2
-
3
- **Use when** user explicitly requests creating a new layout.
4
-
5
- ## Table of Contents
6
-
7
- - Directory Structure
8
- - Purpose A: Generate new theme layouts under the `sfdc_cms__themeLayout` directory.
9
-
10
- - _meta.json Structure
11
- - content.json Structure
12
- - Naming Conventions
13
- - Theme Sync After Creation
14
- - Generation Checklist
15
- - Purpose B: Editing existing theme layouts under the `sfdc_cms__themeLayout` directory.
16
-
17
- ## Directory Structure
18
-
19
- 1. **Location**: `digitalExperiences/site/[SITE_NAME]/sfdc_cms__themeLayout/[THEME_LAYOUT_NAME]/`
20
- 2. **Required Files**:
21
-
22
- - `_meta.json` - Metadata file defining the API name and type
23
- - `content.json` - Content file defining the configuration and layout
24
-
25
- ## Purpose A: Generate New Theme Layouts
26
-
27
- **IMPORTANT**: These guidelines should ONLY be applied when the user explicitly requests creating a new layout for their site. Do not apply these guidelines automatically for other tasks or when editing existing layouts.
28
-
29
- ### Order of operations
30
- If the user decides to create a new LWC, create the LWC first THEN the theme layout metadata.
31
-
32
- ### _meta.json Structure
33
-
34
- The `_meta.json` file must contain:
35
-
36
- ```json
37
- {
38
- "apiName": "[THEME_LAYOUT_NAME]",
39
- "type": "sfdc_cms__themeLayout",
40
- "path": "themeLayouts"
41
- }
42
- ```
43
-
44
- **Rules**:
45
-
46
- - `apiName`: Must match the themeLayout directory name exactly
47
- - `type`: Always `"sfdc_cms__themeLayout"`
48
- - `path`: Always `"themeLayouts"`
49
-
50
- ### content.json Structure
51
-
52
- The `content.json` file must contain:
53
-
54
- ```json
55
- {
56
- "type": "sfdc_cms__themeLayout",
57
- "title": "[DISPLAY_TITLE]",
58
- "contentBody": {
59
- "component": {
60
- "attributes": { },
61
- "children": [ "[regions in the layout]" ],
62
- "definition": "[FQN of root layout component]",
63
- "id": "[root component id]",
64
- "type": "component"
65
- }
66
- },
67
- "urlName": "[url name]"
68
- }
69
- ```
70
-
71
- **Field Definitions**:
72
-
73
- - `type`: Always `"sfdc_cms__themeLayout"`
74
- - `title`: Human-readable display title, words separated by spaces (e.g. "Scoped Header and Footer")
75
- - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
76
- - Do not add additional fields.
77
- - `urlName`: URL identifier (lowercase, words separated by dashes e.g., "scoped-header-and-footer")
78
- - `contentBody.compnent.definition`: The actual theme layout component that displays/renders the layout and includes theme region components.
79
-
80
- **Rules**:
81
-
82
- - Before any actions, *always* call `execute_metadata_action` to get the full schema and examples per the skill document.
83
-
84
- ### Naming Conventions
85
-
86
- 1. **Directory Name**: Should be in camelCase
87
- 2. **apiName**: Must exactly match the directory name
88
- 3. **title**: Human-readable title with spaces (e.g., "Service Not Available Theme Layout")
89
- 4. **urlName**: Lowercase with hyphens for URL-friendly format (e.g., "new-layout")
90
-
91
- ### Theme Sync After Creation
92
-
93
- After creating a new `sfdc_cms__themeLayout`, you MUST update:
94
-
95
- ```
96
- digitalExperiences/site/[SITE_NAME]/sfdc_cms__theme/[THEME_API_NAME]/content.json
97
- ```
98
-
99
- **Lookup**: To find the theme content.json for the current site:
100
-
101
- 1. Navigate up from the current theme layout directory to the site directory.
102
- 2. Look in sfdc_cms__theme/ (sibling directory to sfdc_cms__themeLayout/).
103
- 3. Find the theme directory (typically one per site).
104
- 4. Read the file: content.json.
105
-
106
- **Action (append-only)**:
107
-
108
- - ALWAYS append a new entry to `contentBody.layouts`.
109
- - Do NOT replace or remove existing `layouts` entries.
110
- - `layoutId` MUST exactly match the new theme layout `apiName`.
111
- - `layoutType` MUST be chosen based on intended view usage.
112
- - **Default**: Generate a random 30-character alphanumeric string (e.g., `xEGgPxY5j5TForZe3J7SBguOfQicEy`) for the `layoutType`. Ensure this string is unique and does not match any existing `layoutType` in the list.
113
-
114
- **Example**:
115
-
116
- ```json
117
- {
118
- "contentBody": {
119
- "layouts": [
120
- { "layoutId": "existingLayoutA", "layoutType": "Inner" },
121
- { "layoutId": "existingLayoutB", "layoutType": "ServiceNotAvailable" },
122
- { "layoutId": "[NEW_THEME_LAYOUT_API_NAME]", "layoutType": "[30_CHAR_RANDOM_STRING]" }
123
- ]
124
- }
125
- }
126
- ```
127
-
128
- ### Generation Checklist
129
-
130
- When generating a new theme layout, ensure:
131
-
132
- - [ ] `_meta.json` created with correct `apiName`, `type`, and `path`
133
- - [ ] `content.json` created with all required fields
134
- - [ ] `urlName` uses lowercase with hyphens
135
- - [ ] `title` is human-readable
136
- - [ ] `sfdc_cms__theme/[THEME_API_NAME]/content.json` updated by appending a new `contentBody.layouts` mapping
137
- - [ ] **CRITICAL**: Complete all the UUID generation steps. See [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md)
138
-
139
- ## Purpose B: Editing Existing Theme Layouts
140
-
141
- ### Component Modifications
142
-
143
- When adding, removing, or configuring components in existing theme layouts, **always** refer to [handle-ui-components.md](docs/handle-ui-components.md) for placement hierarchy, component structure, column layout, and property configuration.
144
-
145
- **Note**: Theme layouts often define the overall structure (header/footer) surrounding the main content region. Ensure components are added to the correct region (e.g., `header`, `footer`).