@salesforce/afv-skills 1.9.1 → 1.11.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 (24) hide show
  1. package/package.json +1 -1
  2. package/skills/applying-cms-brand/SKILL.md +170 -0
  3. package/skills/generating-permission-set/SKILL.md +1 -1
  4. package/skills/integrating-b2b-commerce-open-code-components/SKILL.md +166 -0
  5. package/skills/running-code-analyzer/SKILL.md +499 -0
  6. package/skills/running-code-analyzer/examples/README.md +38 -0
  7. package/skills/running-code-analyzer/examples/basic-scan-output.json +92 -0
  8. package/skills/running-code-analyzer/examples/command-variations.md +333 -0
  9. package/skills/running-code-analyzer/examples/fix-application-before-after.md +142 -0
  10. package/skills/running-code-analyzer/examples/large-scan-output.json +67 -0
  11. package/skills/running-code-analyzer/examples/security-focused-output.json +95 -0
  12. package/skills/running-code-analyzer/references/command-examples.md +27 -0
  13. package/skills/running-code-analyzer/references/engine-reference.md +34 -0
  14. package/skills/running-code-analyzer/references/error-handling.md +29 -0
  15. package/skills/running-code-analyzer/references/flag-reference.md +96 -0
  16. package/skills/running-code-analyzer/references/quick-start.md +28 -0
  17. package/skills/running-code-analyzer/references/special-behaviors.md +83 -0
  18. package/skills/running-code-analyzer/references/vendor-file-handling.md +239 -0
  19. package/skills/running-code-analyzer/scripts/apply-fixes.js +86 -0
  20. package/skills/running-code-analyzer/scripts/discover-fixes.js +34 -0
  21. package/skills/running-code-analyzer/scripts/filter-violations.js +405 -0
  22. package/skills/running-code-analyzer/scripts/parse-results.js +59 -0
  23. package/skills/running-code-analyzer/scripts/summarize-fixes.js +32 -0
  24. package/skills/running-code-analyzer/scripts/verify-execution.sh +28 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.9.1",
3
+ "version": "1.11.0",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: applying-cms-brand
3
+ description: "Extracts, retrieves, and applies CMS brand guidelines (voice, tone, style, colors, typography) to generated content. Use this skill ANY TIME a user request involves branding, brand voice, brand tone, brand guidelines, brand identity, brand styling, or applying a brand to content. Triggers for requests like \"apply my brand\", \"use our brand voice\", \"match our brand guidelines\", \"find my brand\", \"search for brand\", \"get brand instructions\", \"apply brand tone\". Handles the full workflow: searching for brands in Salesforce CMS, extracting brand instructions, and applying brand voice/tone/guidelines to generated content. Does not apply to media/image search (use searching-media skill), logo search, or creating new brand definitions."
4
+ compatibility: "Requires get_brand_instructions and/or search_brands MCP tools"
5
+ metadata:
6
+ version: "1.0"
7
+ ---
8
+
9
+ # Applying CMS Brand
10
+
11
+ Universal skill for searching, extracting, and applying CMS brand guidelines to generated content.
12
+
13
+ ## Scope
14
+
15
+ **This skill is for APPLYING existing brand guidelines from Salesforce CMS to content you generate.**
16
+
17
+ **Use this skill when the user wants to:**
18
+ - Apply their brand voice/tone to generated content
19
+ - Find and use brand guidelines stored in Salesforce CMS
20
+ - Search for an existing brand in their org
21
+ - Get brand instructions for content generation
22
+ - Ensure generated content matches their brand identity
23
+ - Apply brand styling, tone, or voice to a page, component, or app
24
+
25
+ **DO NOT use this skill when the user wants to:**
26
+ - Search for images or media (use searching-media skill)
27
+ - Create a new brand from scratch
28
+ - Edit brand definitions in CMS
29
+ - Generate logos or visual brand assets
30
+
31
+ ## Before You Start
32
+
33
+ **CRITICAL: You must retrieve brand instructions BEFORE generating or modifying any brand.**
34
+
35
+ When a user requests branded content:
36
+
37
+ 1. **Search for available brands** (if brand is not already identified)
38
+ 2. **Extract brand instructions** for the selected brand
39
+ 3. **Apply brand guidelines** to all content you generate
40
+
41
+ **Never generate content first and retrofit branding later.** Brand instructions must inform content generation from the start.
42
+
43
+ ## Workflow Overview
44
+
45
+ Copy this checklist and track your progress:
46
+
47
+ ```
48
+ CMS Branding Progress:
49
+ - [ ] Step 1: Determine if brand is already identified or needs search
50
+ - [ ] Step 2: Search for brands (if needed) and present options to user
51
+ - [ ] Step 3: Extract brand instructions for the selected brand
52
+ ```
53
+
54
+ ## Step 1: Determine Brand Context
55
+
56
+ Check if the user has already specified which brand to use:
57
+
58
+ **Brand is known** (user named it, or only one brand exists):
59
+ - Skip to Step 3 (Extract Brand Instructions)
60
+
61
+ **Brand is unknown** (user says "apply my brand" without specifying which):
62
+ - Proceed to Step 2 (Search for Brands)
63
+
64
+ ## Step 2: Search for Brands
65
+
66
+ **Tool:** `search_brands`
67
+
68
+ **Process:**
69
+
70
+ 1. **Determine search query** — Use the user's description, company name, or a general keyword
71
+ 2. **Build the request:**
72
+
73
+ ```json
74
+ {
75
+ "inputs": [{
76
+ "searchQuery": "keyword or brand name"
77
+ }]
78
+ }
79
+ ```
80
+
81
+ 3. **Call `search_brands`** with the query
82
+ 4. **Parse the response** — Extract brand results:
83
+ - `managedContentId` — Unique ID (use this for extraction in Step 3)
84
+ - `managedContentKey` — Content key identifier
85
+ - `title` — Brand display name
86
+ - `contentUrl` — URL to the brand content
87
+ - `totalResults` — Number of brands found
88
+
89
+ ### Presenting Brand Results
90
+
91
+ **If multiple brands found**, use `ask_followup_question` to present options:
92
+
93
+ ```
94
+ I found [N] brands in your CMS. Which one should I apply?
95
+
96
+ 1. [Brand Title 1]
97
+ 2. [Brand Title 2]
98
+ 3. [Brand Title 3]
99
+
100
+ Which brand would you like to use?
101
+ ```
102
+
103
+ **If one brand found**, confirm with the user:
104
+
105
+ ```
106
+ I found the brand "[Brand Title]". Should I apply this brand's guidelines to the content?
107
+ ```
108
+
109
+ **If no brands found:**
110
+
111
+ ```
112
+ No brands found in Salesforce CMS. To use branding:
113
+ 1. Create a brand in Salesforce CMS (Content Type: sfdc_cms__brand)
114
+ 2. Provide brand guidelines directly in this conversation
115
+
116
+ Would you like to proceed without CMS branding, or provide guidelines manually?
117
+ ```
118
+
119
+ **Never auto-select a brand without confirmation.** Always wait for user choice.
120
+
121
+ ## Step 3: Extract Brand Instructions
122
+
123
+ **Tool:** `get_brand_instructions`
124
+
125
+ **Process:**
126
+
127
+ 1. **Call `get_brand_instructions`** — This retrieves the branding extraction prompt template
128
+ 2. **Parse the response:**
129
+ - `promptBody` — Contains the full brand instruction prompt with extraction and application rules
130
+
131
+ 3. **Follow the instructions in `promptBody`** — The prompt template contains specific guidance on:
132
+ - How to extract brand properties from the brand content
133
+ - Brand voice and tone rules
134
+ - Typography and color guidelines
135
+ - Content formatting rules
136
+ - Guardrails and restrictions
137
+
138
+ ### What Brand Instructions Contain
139
+
140
+ The extracted brand instructions typically include:
141
+
142
+ | Property | Description |
143
+ |---|---|
144
+ | Brand Voice | How the brand speaks (e.g., professional, friendly, authoritative) |
145
+ | Brand Tone | Emotional quality of communication (e.g., confident, warm, empathetic) |
146
+ | Key Messages | Core messaging pillars and value propositions |
147
+ | Content Rules | Dos and don'ts for content generation |
148
+ | Style Guidelines | Typography, color, spacing preferences |
149
+ | Guardrails | Hard restrictions on language, topics, or claims |
150
+
151
+ ## Error Handling
152
+
153
+ | Error | Response |
154
+ |---|---|
155
+ | `search_brands` unavailable | "Brand search is unavailable. Please provide your brand name or guidelines directly." |
156
+ | `get_brand_instructions` unavailable | "Cannot retrieve brand instructions. Please share your brand guidelines in this conversation and I'll apply them manually." |
157
+ | Org lacks Vibes branding | "CMS branding is not enabled for this org. Contact your admin to enable the Agentforce Vibes branding feature." |
158
+ | Permission denied | "You don't have permission to access CMS brands. Ensure you have Managed Content Authoring permission." |
159
+ | Brand extraction returns empty | "The brand exists but has no configured guidelines. Please add brand properties in CMS or provide guidelines here." |
160
+
161
+ **Never silently fail.** Always inform the user and offer alternatives.
162
+
163
+ ## Key Principles
164
+
165
+ 1. **Brand first, content second** — Always extract brand instructions before generating content
166
+ 2. **Never assume brand guidelines** — Only apply what was explicitly retrieved from CMS
167
+ 3. **Respect guardrails absolutely** — Brand content rules are hard constraints, not suggestions
168
+ 4. **Confirm brand selection** — Never auto-select a brand without user confirmation
169
+ 5. **Show your work** — Tell the user which guidelines you applied and how
170
+ 6. **Graceful degradation** — If tools are unavailable, ask for manual guidelines rather than proceeding without branding
@@ -177,7 +177,7 @@ Before deploying, verify:
177
177
  - [ ] Permissions follow least privilege
178
178
  - [ ] No required fields in `<fieldPermissions>`
179
179
  - [ ] No duplicate permissions
180
- - [ ] no lengthy comments
180
+ - [ ] No lengthy comments
181
181
 
182
182
  ## What Causes Deployment Failure
183
183
 
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: integrating-b2b-commerce-open-code-components
3
+ description: "Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\", \"open source B2B commerce\", \"add open code components\", \"forcedotcom/b2b-commerce-open-source-components\", or want to add open source commerce components to their store. Copies all components and labels so they become available in Experience Builder."
4
+ license: LICENSE.txt has complete terms
5
+ allowed-tools: Bash(git clone:*) Bash(cp:*) Read
6
+ metadata:
7
+ version: "1.0"
8
+ ---
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when you need to:
13
+ - Integrate all open source B2B Commerce components into a store
14
+ - Add open source components to a new or existing B2B Commerce store
15
+ - Make open code components available in Experience Builder
16
+
17
+ ## Rules
18
+
19
+ 1. **Always explain before executing.** Before running any command, you MUST tell the user what the command does and why you are running it. Never just show a raw command and ask for permission. The user should be able to read your explanation and understand the purpose before approving.
20
+
21
+ ## Overview
22
+
23
+ This skill copies all open source B2B Commerce components from the official Salesforce repository (https://github.com/forcedotcom/b2b-commerce-open-source-components) into a B2B Commerce store's site metadata. After integration, the components appear in the Experience Builder component palette.
24
+
25
+ ---
26
+
27
+ ## Startup Flow
28
+
29
+ When this skill is triggered, perform these checks automatically before copying.
30
+
31
+ ### Check 0: Resolve Package Directory
32
+
33
+ Read `sfdx-project.json` and pick the active package directory. Extract `packageDirectories[]` and use the entry with `"default": true`; if no entry is flagged default, use the first entry. Use this value as `<package-dir>` everywhere below. If `sfdx-project.json` is missing or has no `packageDirectories`, tell the user and abort.
34
+
35
+ ### Check 1: Open Source Repository
36
+
37
+ Verify the repo is cloned at `.tmp/b2b-commerce-open-source-components`:
38
+
39
+ 1. **If directory does not exist:** Tell user: "I'm cloning the official B2B Commerce open source components repository from GitHub into a local `.tmp/` folder. This gives us access to all the open code components."
40
+ Then run: `git clone https://github.com/forcedotcom/b2b-commerce-open-source-components .tmp/b2b-commerce-open-source-components`
41
+ 2. **If directory exists** and contains `force-app/main/default/sfdc_cms__lwc` and `sfdc_cms__label`, present options:
42
+ > "Open source repository is already cloned. How would you like to proceed?"
43
+ > 1. **Reuse existing** — Use the already cloned repository
44
+ > 2. **Re-clone** — Remove and clone fresh from GitHub
45
+ 3. **If directory exists but structure is invalid:** Tell user: "The cloned repository has an unexpected structure. I'll remove it and clone a fresh copy."
46
+ Then remove and re-clone.
47
+ 4. **If clone fails:** inform user and abort
48
+
49
+ ### Check 2: Store and Site Metadata
50
+
51
+ Verify a store is selected and site metadata is available locally:
52
+
53
+ 1. Tell user: "I'm checking if your project already has B2B store metadata locally."
54
+ Check if `<package-dir>/main/default/digitalExperiences/site/` contains any store directories.
55
+ 2. **If store metadata exists:** use it. If multiple stores found, ask user to select one.
56
+ 3. **If no store metadata found:** Try retrieving from the connected org before delegating:
57
+ 1. Run `sf org list` (or check `sf config get target-org`) to find a connected org. Ask the user to confirm or pick one if more than one.
58
+ 2. List `DigitalExperienceBundle` site bundles in that org with `sf org list metadata --metadata-type DigitalExperienceBundle --target-org <alias>`. Filter to `site/*` entries.
59
+ 3. If at least one site bundle exists, ask the user which to use, then run:
60
+ `sf project retrieve start --metadata "DigitalExperienceBundle:site/<storeName>" --target-org <alias>`
61
+ The bundle lands at `<package-dir>/main/default/digitalExperiences/site/<storeName>/`.
62
+ 4. **Only if no connected org is available, or no site bundles are found, or retrieve fails:** delegate to the **creating-b2b-commerce-store** skill.
63
+
64
+ **Required state** after all checks:
65
+ - **Package dir** — the value resolved in Check 0 (e.g., `force-app`)
66
+ - **Store name** — the selected `fullName` value (e.g., `My_B2B_Store1`)
67
+ - **Site metadata path** — `<package-dir>/main/default/digitalExperiences/site/<store-name>/`
68
+ - **Repo path** — `.tmp/b2b-commerce-open-source-components/`
69
+
70
+ ---
71
+
72
+ ## Integration Task
73
+
74
+ Copy all components and labels from cloned repo to site directory:
75
+
76
+ - **Source:** `.tmp/b2b-commerce-open-source-components/force-app/main/default/sfdc_cms__lwc/*` and `sfdc_cms__label/*` (the open source repo's own layout — always `force-app`)
77
+ - **Destination:** `<package-dir>/main/default/digitalExperiences/site/<store-name>/sfdc_cms__lwc/` and `sfdc_cms__label/` (`<package-dir>` resolved in Check 0)
78
+
79
+ **Steps:**
80
+
81
+ 1. Tell user: "I'm checking if open code components already exist in your store's site metadata."
82
+ Check if destination directories already contain files.
83
+ 2. If files exist, present options:
84
+ > "Components already exist in **{store-name}**. How would you like to proceed?"
85
+ > 1. **Overwrite all** — Replace all existing components with latest from repo
86
+ > 2. **Copy only new** — Skip existing components, copy only ones not yet present
87
+ 3. Tell user: "I'm now copying all open code LWC components from the cloned repository into your store's site metadata directory."
88
+ Copy all component directories from source to destination.
89
+ 4. Tell user: "I'm copying the associated label files that these components need."
90
+ Copy all label directories from source to destination.
91
+ 5. Report: "Copied X components and Y label sets"
92
+
93
+ **Output:**
94
+ ```
95
+ ✅ Integration Complete!
96
+
97
+ Copied: X components and Y label sets to <store-name>
98
+
99
+ Next Steps:
100
+ 1. Deploy: sf project deploy start -d <package-dir>/main/default/digitalExperiences/site/<store-name>
101
+ 2. Open Experience Builder and use new components from the palette
102
+ 3. Publish your site when ready
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Example Interaction
108
+
109
+ **User:** "Integrate open code components to my store"
110
+
111
+ **Agent:** "I'm checking if the open source components repository is already cloned locally..."
112
+
113
+ **Agent:** _(repo exists)_
114
+ > "Open source repository is already cloned. How would you like to proceed?"
115
+ > 1. **Reuse existing** — Use the already cloned repository
116
+ > 2. **Re-clone** — Remove and clone fresh from GitHub
117
+
118
+ **User:** "1"
119
+
120
+ **Agent:** "I'm checking if your project already has B2B store metadata locally..."
121
+ - ✓ Found store metadata for My_B2B_Store1
122
+
123
+ **Agent:** "I'm checking if open code components already exist in your store's site metadata..."
124
+
125
+ **Agent:** _(files exist)_
126
+ > "Components already exist in **My_B2B_Store1**. How would you like to proceed?"
127
+ > 1. **Overwrite all** — Replace all existing components with latest from repo
128
+ > 2. **Copy only new** — Skip existing components, copy only ones not yet present
129
+
130
+ **User:** "1"
131
+
132
+ **Agent:** "I'm now copying all open code LWC components from the cloned repository into your store's site metadata directory..."
133
+ **Agent:** "I'm copying the associated label files that these components need..."
134
+ - ✓ Copied 45 components and 38 label sets
135
+
136
+ ```
137
+ ✅ Integration Complete!
138
+
139
+ Copied: 45 components and 38 label sets to My_B2B_Store1
140
+
141
+ Next Steps:
142
+ 1. Deploy: sf project deploy start -d force-app/main/default/digitalExperiences/site/My_B2B_Store1
143
+ 2. Open Experience Builder and use new components from the palette
144
+ 3. Publish your site when ready
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Error Handling
150
+
151
+ | Error | Message | Action |
152
+ |-------|---------|--------|
153
+ | Store not found | "Store '{name}' not found in org." | List stores again |
154
+ | Git clone failed | "Failed to clone repository. Check internet connection." | Retry or abort |
155
+ | Invalid repo structure | "Repository structure has changed. Expected sfdc_cms__lwc and sfdc_cms__label." | Warn user, abort |
156
+ | File copy failed | "Failed to copy files. Check file permissions." | Show error details |
157
+
158
+ ---
159
+
160
+ ## Verification Checklist
161
+
162
+ - [ ] Startup Flow completed: repo cloned, store metadata available
163
+ - [ ] Components copied to correct destination path (`sfdc_cms__lwc/`)
164
+ - [ ] Labels copied to correct destination path (`sfdc_cms__label/`)
165
+ - [ ] No file permission errors during copy
166
+ - [ ] Deployment command provided and user informed about testing