mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-12 02:49:15 +08:00
Merge branch 'main' into t/tse/21829588/update-clt-skills
This commit is contained in:
commit
d0c9eb2331
@ -1,3 +1,12 @@
|
||||
## [1.7.2](https://github.com/forcedotcom/afv-library/compare/1.7.1...1.7.2) (2026-04-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* @W-22134404@ delete fragment skill ([#212](https://github.com/forcedotcom/afv-library/issues/212)) ([c818135](https://github.com/forcedotcom/afv-library/commit/c8181350b47fe0b2f512a9d2d01bd11dceed3793))
|
||||
|
||||
|
||||
|
||||
## [1.7.1](https://github.com/forcedotcom/afv-library/compare/1.7.0...1.7.1) (2026-04-21)
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@salesforce/afv-skills",
|
||||
"version": "1.7.1",
|
||||
"version": "1.7.2",
|
||||
"description": "Salesforce skills for Agentforce Vibes",
|
||||
"license": "CC-BY-NC-4.0",
|
||||
"files": [
|
||||
|
||||
@ -1,117 +0,0 @@
|
||||
---
|
||||
name: generating-fragment
|
||||
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."
|
||||
---
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Use this skill when you need to:
|
||||
- Create reusable UI fragments for Salesforce experiences
|
||||
- Generate Fragment metadata following UEM structure
|
||||
- Build fragments for Slack, Mobile, LEX, and other Salesforce experiences
|
||||
- Troubleshoot deployment errors related to Fragments
|
||||
|
||||
## Specification
|
||||
|
||||
# Fragment Generation Guide
|
||||
|
||||
## 📋 Overview
|
||||
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.
|
||||
|
||||
## 🎯 Purpose
|
||||
Fragments render data in a structured and unified way across various Salesforce experiences like Slack, Mobile, LEX etc
|
||||
|
||||
## ⚙️ Composition
|
||||
A fragment is a UEM (Unified Experience Model) tree of blocks and regions. The fragment you return must follow the Typescript interfaces below:
|
||||
|
||||
```ts
|
||||
interface BlockType {
|
||||
type: 'block'
|
||||
definition: string // {namespace}/{blockName}
|
||||
attributes?: Record<string, any>
|
||||
children?: (BlockType | RegionType)[]
|
||||
}
|
||||
|
||||
interface RegionType {
|
||||
type: 'region'
|
||||
name: string
|
||||
children: BlockType[]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Available Metadata Actions
|
||||
|
||||
### When to Use Each Action
|
||||
|
||||
#### discoverUiComponents
|
||||
|
||||
**When:** You want to see what block components are available for fragments.
|
||||
|
||||
**Purpose:** Discover the palette of available blocks that can be used in fragment composition.
|
||||
|
||||
**Input Parameters:**
|
||||
- `pageType` (required): "FRAGMENT"
|
||||
- `pageContext` (optional): JSON object - not required for FRAGMENT type
|
||||
- `searchQuery` (optional): String to filter components by name or description
|
||||
|
||||
**Returns:** List of components with:
|
||||
- `definition`: Fully qualified name (e.g., "namespace/definiton")
|
||||
- `description`: Component description
|
||||
- `label`: Human-readable label
|
||||
- `attributes`: Optional attribute metadata
|
||||
|
||||
**Use for:** Finding available blocks before building your fragment structure.
|
||||
|
||||
#### getUiComponentSchemas
|
||||
|
||||
**When:** You know which components you want but need to understand their properties and attributes.
|
||||
|
||||
**Purpose:** Get detailed JSON schemas for component configuration, including property types, required vs optional fields, and validation rules.
|
||||
|
||||
**Input Parameters:**
|
||||
- `pageType` (required): "FRAGMENT"
|
||||
- `pageContext` (optional): JSON object - not required for FRAGMENT type
|
||||
- `componentDefinitions` (required): List of fully qualified names (e.g., ["namespace/definition"])
|
||||
- `includeKnowledge` (optional): Boolean, defaults to true - includes additional component-specific guidance
|
||||
|
||||
**Returns:**
|
||||
- `componentSchemas`: List of results (supports partial failures)
|
||||
- **Success entries**: Contains JSON schema with property definitions, types, constraints
|
||||
- **Failure entries**: Contains error message explaining why schema couldn't be retrieved
|
||||
- `$defs`: Schema definitions and references (if schema transformation applied)
|
||||
|
||||
**Use for:** Understanding how to configure component attributes before adding blocks to your fragment.
|
||||
|
||||
**Key Feature:** Supports partial failures - if some components can't be found, you still get schemas for the successful ones.
|
||||
|
||||
---
|
||||
|
||||
## 💡 Typical Workflow
|
||||
|
||||
1. **Discover Available Blocks**
|
||||
- Use `discoverUiComponents` to explore what blocks are available
|
||||
- Optional: Use `searchQuery` to filter by keywords (e.g., "text", "button", "image")
|
||||
|
||||
2. **Select Components**
|
||||
- Choose blocks that fit your fragment requirements
|
||||
- Note their fully qualified definitions (e.g., "namespace/definition")
|
||||
|
||||
3. **Get Component Schemas**
|
||||
- Use `getUiComponentSchemas` with the selected component definitions
|
||||
- Review the JSON schemas to understand required and optional attributes
|
||||
|
||||
4. **Build Fragment**
|
||||
- Construct your fragment using the UEM tree structure
|
||||
- Configure block attributes according to the schemas
|
||||
- Use the TypeScript interfaces defined above
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Important Notes
|
||||
|
||||
- Block definitions always follow the `{namespace}/{blockName}` convention
|
||||
- Use the same definition format returned by `discoverUiComponents` when calling `getUiComponentSchemas`
|
||||
- The FRAGMENT page type doesn't require additional `pageContext` parameters
|
||||
- Schemas include both required and optional attributes - review carefully to ensure valid configuration
|
||||
@ -33,11 +33,12 @@ Universal routing skill for searching and retrieving existing images and media.
|
||||
|
||||
When a user requests to find an image:
|
||||
|
||||
**Your first response MUST be plain text only — zero tool calls.** You MUST follow this sequence:
|
||||
**Your first action MUST use the ask_followup_question tool to present search sources.**
|
||||
|
||||
1. **Use ask_followup_question** to present available search sources as options
|
||||
2. **Receive the user's selection** from the tool response
|
||||
3. **Then** call the appropriate search tool based on their choice
|
||||
|
||||
1. **First response MUST be text only:** A numbered list of search sources for the user. No tool calls of any kind.
|
||||
2. **Wait for user to reply** with their selected option number
|
||||
3. **Only then** call the appropriate search tool (this is the FIRST tool call in the entire interaction)
|
||||
|
||||
**Example of what NOT to do:**
|
||||
- ❌ 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:
|
||||
|
||||
## Presenting Search Results
|
||||
|
||||
Parse the tool response and present **ALL** results as numbered options. Show the image title only — do not display the URL. When the user selects an option, use the URL internally to apply the image.
|
||||
**Your action MUST use the `ask_followup_question` tool to present search results as options.**
|
||||
1. **Parse the tool response** — Extract all image results (title and source)
|
||||
2. **Use `ask_followup_question`** to present ALL results as selectable options. Show the image title only — do not display the URL.
|
||||
3. **Receive the user's selection** from the tool response
|
||||
4. **Then** apply the selected image
|
||||
|
||||
```
|
||||
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?
|
||||
|
||||
## Applying the Selected Image
|
||||
|
||||
|
||||
After the user chooses:
|
||||
|
||||
1. Confirm the selection with image name and URL
|
||||
|
||||
Loading…
Reference in New Issue
Block a user