@salesforce/afv-skills 1.7.0 β 1.7.2
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/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# Agentforce Vibes Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This repository provides a curated collection of Salesforce agent skills for building applications. It includes skills for Agentforce agents, Lightning apps, Flow, Apex, SOQL, Lightning Web Components (LWC), UI bundles, objects and fields, permission sets, and related areas.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This repository curates Salesforce-focused skills from the wider developer community to accelerate Agentforce Vibes agentic workflows.
|
|
5
|
+
The skills are contributed by Salesforce and the broader community. Itβs optimized for Agentforce Vibes and can be used with any AI tool that supports skills.
|
|
8
6
|
|
|
9
7
|
## ποΈ Structure
|
|
10
8
|
|
|
@@ -23,44 +21,51 @@ afv-library/
|
|
|
23
21
|
βββ README.md
|
|
24
22
|
```
|
|
25
23
|
|
|
26
|
-
##
|
|
24
|
+
## π Usage
|
|
25
|
+
|
|
26
|
+
| **Tool** | **Usage** |
|
|
27
|
+
|----------|-------------|
|
|
28
|
+
| **Agentforce Vibes** | Skills are auto-installed and auto-updated |
|
|
29
|
+
| **OpenCode, Claude Code, Codex, Cursor, [more](https://agentskills.io/)** | `npx skills add forcedotcom/afv-library` |
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
## π¦ Samples
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
The `samples/` folder contains synced sample apps. For example, `samples/ui-bundle-template-app-react-sample-b2e/` tracks the npm package `@salesforce/ui-bundle-template-app-react-sample-b2e` (nightly and on manual trigger via GitHub Actions).
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
To run the same sync locally from the repository root:
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
38
|
npm install
|
|
36
39
|
npm run sync-react-b2e-sample
|
|
37
40
|
```
|
|
38
41
|
|
|
39
|
-
The GitHub Action runs
|
|
40
|
-
|
|
42
|
+
The GitHub Action runs the same commands and opens a pull request when the npm package version changes. For more information, see [samples/README.md](samples/README.md).
|
|
41
43
|
|
|
42
44
|
## π οΈ Agent Skills
|
|
43
45
|
|
|
44
|
-
Agent Skills
|
|
46
|
+
Agent Skills package executable workflows, scripts, and reference material into self-contained directories. This repository follows the open [Agent Skills specification](https://agentskills.io/) and can be used with OpenCode, Claude Code, Codex, Cursor, and other tools that support skills.
|
|
45
47
|
|
|
46
48
|
### Directory Structure
|
|
47
49
|
|
|
48
|
-
Each skill is a folder
|
|
49
|
-
- `SKILL.md` (required)
|
|
50
|
-
- `scripts/` (optional)
|
|
51
|
-
- `references/` (optional)
|
|
52
|
-
- `assets/` (optional)
|
|
53
|
-
|
|
50
|
+
Each skill is a folder that can include:
|
|
51
|
+
- `SKILL.md` (required): Instructions and YAML front matter.
|
|
52
|
+
- `scripts/` (optional): Executable scripts (For example, Python, Bash, or JavaScript).
|
|
53
|
+
- `references/` (optional): Extra reference documentation.
|
|
54
|
+
- `assets/` (optional): Templates, schemas, and lookup data
|
|
54
55
|
|
|
55
56
|
## π€ Contributing
|
|
56
57
|
|
|
57
|
-
See [Contributing](./CONTRIBUTING.md)
|
|
58
|
+
See [Contributing](./CONTRIBUTING.md).
|
|
58
59
|
|
|
60
|
+
## π¬ Feedback
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
- Open an issue in this repository
|
|
63
|
+
- Open a pull request with suggested changes
|
|
64
|
+
- Use GitHub Discussions or the pull request thread for broader conversation
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
- Open an issue in GitHub
|
|
64
|
-
- Suggest improvements via pull request
|
|
65
|
-
- Start a discussion in GitHub Discussions or the pull request thread
|
|
66
|
+
## Project Governance & Support
|
|
66
67
|
|
|
68
|
+
- [License](./LICENSE.txt)
|
|
69
|
+
- [Code of Conduct](./CODE_OF_CONDUCT.md)
|
|
70
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
71
|
+
- [Security](./SECURITY.md)
|
package/package.json
CHANGED
|
@@ -87,7 +87,7 @@ Generates flow metadata element by element. This step is **mandatory** and must
|
|
|
87
87
|
- When `isComplete` is `true`, extract the flow metadata from the `result` field.
|
|
88
88
|
- If errors are returned, stop the loop and surface the error to the user.
|
|
89
89
|
|
|
90
|
-
**STRICT CONSTRAINTS (CRITICAL):**
|
|
90
|
+
**STRICT CONSTRAINTS (CRITICAL) β These rules apply to the XML returned by the generation pipeline:**
|
|
91
91
|
- DO NOT modify the content, values, or child nodes inside any block.
|
|
92
92
|
- DO NOT add new nodes, tags, attributes, or text (do not add missing labels, X/Y coordinates, etc.).
|
|
93
93
|
- DO NOT remove any existing nodes.
|
|
@@ -334,6 +334,7 @@ Call repeatedly with the same `operationId` until `isComplete` is `true` or erro
|
|
|
334
334
|
## Mandatory Best Practices
|
|
335
335
|
- **ALWAYS** follow the 3-step pipeline: fetchGroundedObjectMetadata β flowElementSelection β flowElementGeneration. This is the ONLY way to generate flow metadata. There are no alternatives.
|
|
336
336
|
- Do NOT manually create flow metadata XML, JSON, or any other format outside of this pipeline.
|
|
337
|
+
- **When the user explicitly requests fixes to validation or deployment errors** in an already-generated flow XML, you ARE permitted to make targeted manual edits to the XML to resolve those errors. This is the only exception to the "no manual metadata" rule.
|
|
337
338
|
- Do NOT attempt to "optimize" by skipping steps or combining steps. Each step is atomic and required.
|
|
338
339
|
- **NEVER** skip any step in the pipeline. All 3 steps are required.
|
|
339
340
|
- **NEVER** try to generate flow metadata without calling all 3 steps.
|
|
@@ -366,3 +367,4 @@ Call repeatedly with the same `operationId` until `isComplete` is `true` or erro
|
|
|
366
367
|
- [ ] **Multi-flow**: Each flow's full pipeline is completed before starting the next flow's pipeline (no interleaving)
|
|
367
368
|
- [ ] **result** field is used to extract the XML flow metadata only when `isComplete` is `true`
|
|
368
369
|
- [ ] **No additions to XML**: NO elements, attributes, or properties were added that were not present in the original pipeline output. Nothing was inserted (no `<label>`, `<description>`, or any other node). The final XML must be identical to what the pipeline returned.
|
|
370
|
+
- [ ] **Error fix exception**: If the user explicitly requested fixes to validation/deployment errors, targeted manual edits to the XML are permitted and the "No additions to XML" / "No manual metadata" constraints do not apply to those edits.
|
|
@@ -33,11 +33,12 @@ Universal routing skill for searching and retrieving existing images and media.
|
|
|
33
33
|
|
|
34
34
|
When a user requests to find an image:
|
|
35
35
|
|
|
36
|
-
**Your first
|
|
36
|
+
**Your first action MUST use the ask_followup_question tool to present search sources.**
|
|
37
|
+
|
|
38
|
+
1. **Use ask_followup_question** to present available search sources as options
|
|
39
|
+
2. **Receive the user's selection** from the tool response
|
|
40
|
+
3. **Then** call the appropriate search tool based on their choice
|
|
37
41
|
|
|
38
|
-
1. **First response MUST be text only:** A numbered list of search sources for the user. No tool calls of any kind.
|
|
39
|
-
2. **Wait for user to reply** with their selected option number
|
|
40
|
-
3. **Only then** call the appropriate search tool (this is the FIRST tool call in the entire interaction)
|
|
41
42
|
|
|
42
43
|
**Example of what NOT to do:**
|
|
43
44
|
- β Calling ANY tool before the user picks a source (MCP tools, file reads, descriptor checks, etc.)
|
|
@@ -279,7 +280,11 @@ Ask the user to provide:
|
|
|
279
280
|
|
|
280
281
|
## Presenting Search Results
|
|
281
282
|
|
|
282
|
-
|
|
283
|
+
**Your action MUST use the `ask_followup_question` tool to present search results as options.**
|
|
284
|
+
1. **Parse the tool response** β Extract all image results (title and source)
|
|
285
|
+
2. **Use `ask_followup_question`** to present ALL results as selectable options. Show the image title only β do not display the URL.
|
|
286
|
+
3. **Receive the user's selection** from the tool response
|
|
287
|
+
4. **Then** apply the selected image
|
|
283
288
|
|
|
284
289
|
```
|
|
285
290
|
I found 4 images. Which one would you like to use?
|
|
@@ -301,6 +306,7 @@ I found 4 images. Which one would you like to use?
|
|
|
301
306
|
|
|
302
307
|
## Applying the Selected Image
|
|
303
308
|
|
|
309
|
+
|
|
304
310
|
After the user chooses:
|
|
305
311
|
|
|
306
312
|
1. Confirm the selection with image name and URL
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: generating-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
|
-
```ts
|
|
28
|
-
interface BlockType {
|
|
29
|
-
type: 'block'
|
|
30
|
-
definition: string // {namespace}/{blockName}
|
|
31
|
-
attributes?: Record<string, any>
|
|
32
|
-
children?: (BlockType | RegionType)[]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface RegionType {
|
|
36
|
-
type: 'region'
|
|
37
|
-
name: string
|
|
38
|
-
children: BlockType[]
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## π§ Available Metadata Actions
|
|
45
|
-
|
|
46
|
-
### When to Use Each Action
|
|
47
|
-
|
|
48
|
-
#### discoverUiComponents
|
|
49
|
-
|
|
50
|
-
**When:** You want to see what block components are available for fragments.
|
|
51
|
-
|
|
52
|
-
**Purpose:** Discover the palette of available blocks that can be used in fragment composition.
|
|
53
|
-
|
|
54
|
-
**Input Parameters:**
|
|
55
|
-
- `pageType` (required): "FRAGMENT"
|
|
56
|
-
- `pageContext` (optional): JSON object - not required for FRAGMENT type
|
|
57
|
-
- `searchQuery` (optional): String to filter components by name or description
|
|
58
|
-
|
|
59
|
-
**Returns:** List of components with:
|
|
60
|
-
- `definition`: Fully qualified name (e.g., "namespace/definiton")
|
|
61
|
-
- `description`: Component description
|
|
62
|
-
- `label`: Human-readable label
|
|
63
|
-
- `attributes`: Optional attribute metadata
|
|
64
|
-
|
|
65
|
-
**Use for:** Finding available blocks before building your fragment structure.
|
|
66
|
-
|
|
67
|
-
#### getUiComponentSchemas
|
|
68
|
-
|
|
69
|
-
**When:** You know which components you want but need to understand their properties and attributes.
|
|
70
|
-
|
|
71
|
-
**Purpose:** Get detailed JSON schemas for component configuration, including property types, required vs optional fields, and validation rules.
|
|
72
|
-
|
|
73
|
-
**Input Parameters:**
|
|
74
|
-
- `pageType` (required): "FRAGMENT"
|
|
75
|
-
- `pageContext` (optional): JSON object - not required for FRAGMENT type
|
|
76
|
-
- `componentDefinitions` (required): List of fully qualified names (e.g., ["namespace/definition"])
|
|
77
|
-
- `includeKnowledge` (optional): Boolean, defaults to true - includes additional component-specific guidance
|
|
78
|
-
|
|
79
|
-
**Returns:**
|
|
80
|
-
- `componentSchemas`: List of results (supports partial failures)
|
|
81
|
-
- **Success entries**: Contains JSON schema with property definitions, types, constraints
|
|
82
|
-
- **Failure entries**: Contains error message explaining why schema couldn't be retrieved
|
|
83
|
-
- `$defs`: Schema definitions and references (if schema transformation applied)
|
|
84
|
-
|
|
85
|
-
**Use for:** Understanding how to configure component attributes before adding blocks to your fragment.
|
|
86
|
-
|
|
87
|
-
**Key Feature:** Supports partial failures - if some components can't be found, you still get schemas for the successful ones.
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## π‘ Typical Workflow
|
|
92
|
-
|
|
93
|
-
1. **Discover Available Blocks**
|
|
94
|
-
- Use `discoverUiComponents` to explore what blocks are available
|
|
95
|
-
- Optional: Use `searchQuery` to filter by keywords (e.g., "text", "button", "image")
|
|
96
|
-
|
|
97
|
-
2. **Select Components**
|
|
98
|
-
- Choose blocks that fit your fragment requirements
|
|
99
|
-
- Note their fully qualified definitions (e.g., "namespace/definition")
|
|
100
|
-
|
|
101
|
-
3. **Get Component Schemas**
|
|
102
|
-
- Use `getUiComponentSchemas` with the selected component definitions
|
|
103
|
-
- Review the JSON schemas to understand required and optional attributes
|
|
104
|
-
|
|
105
|
-
4. **Build Fragment**
|
|
106
|
-
- Construct your fragment using the UEM tree structure
|
|
107
|
-
- Configure block attributes according to the schemas
|
|
108
|
-
- Use the TypeScript interfaces defined above
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## β οΈ Important Notes
|
|
113
|
-
|
|
114
|
-
- Block definitions always follow the `{namespace}/{blockName}` convention
|
|
115
|
-
- Use the same definition format returned by `discoverUiComponents` when calling `getUiComponentSchemas`
|
|
116
|
-
- The FRAGMENT page type doesn't require additional `pageContext` parameters
|
|
117
|
-
- Schemas include both required and optional attributes - review carefully to ensure valid configuration
|