@salesforce/afv-skills 1.66.0 → 1.68.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/README.md +55 -5
- package/package.json +2 -4
- package/skills/agentforce-offline-experimentation-run/SKILL.md +26 -49
- package/skills/agentforce-offline-experimentation-run/scripts/bt_compare.py +81 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_fetch.py +358 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_patch_agent.py +110 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/__init__.py +34 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentpatch.py +483 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentsrc.py +565 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/cache.py +95 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/compare.py +617 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/fetch.py +1012 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +148 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +92 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/patch.py +327 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/redact.py +40 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/results.py +288 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/scoring.py +340 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +238 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/splits.py +136 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/stdm.py +98 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/tokens.py +173 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/units.py +199 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/versions.py +194 -0
- package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +366 -378
- package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +14 -4
- package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +472 -796
- package/skills/commerce-react-storefront-create/SKILL.md +350 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +2 -2
- package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +28 -16
- package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +18 -1
- package/skills/dx-lifecycle-center/SKILL.md +5 -2
- package/skills/dx-lifecycle-center/assets/widgets/connect-connected/connect-connected.json +65 -0
- package/skills/dx-lifecycle-center/assets/widgets/connect-connected/schema.json +32 -0
- package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/connect-sign-in.json +57 -0
- package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/schema.json +21 -0
- package/skills/dx-lifecycle-center/examples/workflows.md +20 -6
- package/skills/dx-lifecycle-center/references/connect-org.md +21 -2
- package/skills/dx-lifecycle-center/references/deploy.md +2 -2
- package/skills/dx-lifecycle-center/references/list-orgs.md +1 -1
- package/skills/dx-lifecycle-center/scripts/card-policy.jq +71 -0
- package/skills/dx-lifecycle-center/scripts/fill-widget.jq +29 -0
- package/skills/dx-lifecycle-center/scripts/widget.sh +28 -0
- package/skills/dx-org-devhub-configure/SKILL.md +85 -84
- package/skills/dx-org-devhub-configure/examples/status-output.md +25 -2
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +265 -140
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +100 -15
- package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +89 -0
- package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +164 -0
- package/skills/dx-scratch-def-configure/SKILL.md +163 -0
- package/skills/dx-scratch-def-configure/examples/confirm-card.md +53 -0
- package/skills/dx-scratch-def-configure/examples/report-recipes.md +100 -0
- package/skills/dx-scratch-def-configure/references/features.json +3270 -0
- package/skills/dx-scratch-def-configure/references/project-scratch-def.schema.json +1841 -0
- package/skills/dx-scratch-def-configure/references/settings-map.json +682 -0
- package/skills/dx-scratch-def-configure/scripts/lib_scratch_def.py +1306 -0
- package/skills/dx-scratch-def-configure/scripts/requirements.txt +3 -0
- package/skills/dx-scratch-def-configure/scripts/scrape_config_values.py +848 -0
- package/skills/education-cloud-domain-configure/SKILL.md +22 -24
- package/skills/education-cloud-domain-configure/references/dependent-features.md +9 -0
- package/skills/education-cloud-domain-configure/references/domain-features.md +15 -0
- package/skills/education-cloud-domain-configure/references/gotchas-extended.md +8 -0
- package/skills/education-cloud-domain-configure/references/setup-widgets.md +123 -0
- package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -1
- package/skills/experience-design-validate/SKILL.md +1 -1
- package/skills/experience-search-coordinate/SKILL.md +19 -13
- package/skills/experience-search-coordinate/references/content-route.md +79 -1
- package/skills/experience-search-coordinate/references/media-route.md +30 -4
- package/skills/experience-ui-bundle-features-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +1 -1
- package/skills/field-service-data-capture-migrate/SKILL.md +1 -1
- package/skills/platform-apex-generate/SKILL.md +14 -11
- package/skills/platform-apex-test-generate/SKILL.md +2 -1
- package/skills/platform-datamask-run/SKILL.md +52 -71
- package/skills/platform-datamask-run/references/api-surface.md +10 -4
- package/skills/platform-datamask-run/references/policy-authoring.md +56 -7
- package/skills/platform-datamask-run/references/run-and-abort.md +17 -10
- package/skills/platform-datamask-run/scripts/poll-job.sh +15 -25
- package/skills/platform-dataspace-access-configure/SKILL.md +19 -1
- package/skills/platform-metadata-deploy/README.md +1 -1
- package/skills/platform-metadata-deploy/SKILL.md +114 -15
- package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +3 -4
- package/skills/platform-metadata-deploy/references/orchestration.md +2 -3
- package/skills/platform-metadata-discovery-get/SKILL.md +185 -0
- package/skills/platform-metadata-discovery-get/references/api-map.md +25 -0
- package/skills/platform-metadata-discovery-get/references/h360-routes.md +30 -0
- package/skills/platform-metadata-discovery-get/references/scoped-soql.md +52 -0
- package/skills/platform-metadata-grounding-get/SKILL.md +170 -0
- package/skills/platform-policy-rule-generate/SKILL.md +84 -232
- package/skills/platform-policy-rule-generate/references/condition-model.md +47 -0
- package/skills/platform-policy-rule-generate/references/condition-templates.md +89 -0
- package/skills/platform-policy-rule-generate/references/conjunction-compiler.md +25 -0
- package/skills/platform-policy-rule-generate/references/conjunction-expression.md +22 -0
- package/skills/platform-policy-rule-generate/references/consumer-all.md +9 -0
- package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +91 -0
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +24 -36
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition +91 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitions/FieldReadDeny_Rule_1.policyRuleDefinition +72 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitions/LastCharactersFieldMasking_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitions/PrincipalFieldMatchRLS_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +4 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitions/TaggedObjectAccess_Rule_1.policyRuleDefinition +65 -0
- package/skills/platform-policy-rule-generate/references/headless-transport.md +87 -0
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +17 -10
- package/skills/platform-policy-rule-generate/references/policy-shapes.md +74 -0
- package/skills/platform-policy-rule-generate/references/principal-expression.md +31 -0
- package/skills/platform-policy-rule-generate/references/reference-resolution.md +51 -0
- package/skills/platform-policy-rule-generate/references/resource-expression.md +48 -0
- package/skills/platform-policy-rule-generate/references/runtime-context.md +9 -0
- package/skills/platform-policy-rule-generate/references/templates-access.md +11 -9
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +4 -2
- package/skills/platform-policy-rule-generate/references/templates-record.md +37 -22
- package/skills/platform-policy-rule-generate/references/templates-transform.md +10 -8
- package/skills/platform-policy-rule-generate/references/templates.md +2 -2
- package/skills/platform-policy-rule-generate/references/ui-compatibility.md +35 -17
- package/skills/platform-report-generate/SKILL.md +9 -4
- package/skills/platform-report-generate/references/chart-types.md +26 -2
- package/skills/platform-report-generate/references/column-names.md +43 -0
- package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
- package/skills/platform-report-generate/references/verification-checklist.md +10 -2
- package/skills/platform-value-set-generate/SKILL.md +19 -19
- package/skills/platform-widget-generate/SKILL.md +25 -51
- package/skills/platform-widget-generate/examples/formulas.json +19 -2
- package/skills/platform-widget-generate/examples/localized-labels.json +57 -0
- package/skills/platform-widget-generate/references/widget-actions.md +29 -0
- package/skills/platform-widget-generate/references/widget-bundle-validation.md +1 -0
- package/skills/platform-widget-generate/references/widget-formulas.md +24 -7
- package/skills/platform-widget-generate/references/widget-gotchas.md +10 -0
- package/skills/platform-widget-generate/references/widget-labels.md +78 -0
- package/skills/platform-widget-generate/references/widget-styling.md +12 -0
- package/skills/sales-call-scoring-configure/SKILL.md +17 -10
- package/skills/sales-call-scoring-configure/scripts/enable-call-scoring.sh +55 -33
- package/skills/service-digital-engagement-channel-configure/SKILL.md +11 -7
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +33 -0
- package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +123 -16
- package/skills/service-digital-engagement-deployment-configure/SKILL.md +37 -100
- package/skills/service-digital-engagement-deployment-configure/assets/esd_web_update_template.xml +83 -8
- package/skills/service-digital-engagement-deployment-configure/examples/esd_web_prechat_fields.xml +74 -0
- package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +13 -3
- package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +13 -78
- package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +5 -6
- package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +245 -0
- package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +164 -120
- package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +61 -37
- package/skills/service-itsm-agentic-setup-incident-management/references/audit-tracking.md +42 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/broadcast-communications.md +23 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/email-to-incident.md +23 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-dashboards.md +25 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-persona-psg.md +30 -146
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-preferences.md +32 -136
- package/skills/service-itsm-agentic-setup-incident-management/references/major-incident-management.md +32 -155
- package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +45 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +32 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/service-mgmt-privilege.md +30 -140
- package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +110 -0
package/README.md
CHANGED
|
@@ -1,15 +1,52 @@
|
|
|
1
|
-
# Salesforce Skills Library
|
|
1
|
+
# Salesforce Skills and Plugins Library
|
|
2
2
|
|
|
3
|
-
This repository provides
|
|
3
|
+
This repository provides Salesforce agent skills, plugins, and sample apps 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. The [builder plugins](plugins/builder/) package skills with additional capabilities such as agents, hooks, commands, and Model Context Protocol (MCP) servers. Each client loads the components supported by that plugin's manifest.
|
|
4
4
|
|
|
5
|
-
The skills are contributed by Salesforce and the broader community.
|
|
5
|
+
The skills are contributed by Salesforce and the broader community. The skills library is optimized for Agentforce Vibes and can be used with any AI tool that supports skills. For guided Salesforce development, start with the [Salesforce Development plugin README](plugins/builder/salesforce-development/README.md) and the [Salesforce Development plugin documentation](https://developer.salesforce.com/docs/platform/salesforce-skills-plugins/guide/salesforce-development-overview.html).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## See the development workflow
|
|
8
|
+
|
|
9
|
+
Go from a natural-language request to an app deployed in Salesforce. These short demos
|
|
10
|
+
were recorded with Salesforce Development 2.5.0 and show a terminal workflow followed by the finished app.
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
| Demo | Length | Watch or download |
|
|
15
|
+
|---|---:|---|
|
|
16
|
+
| Claude Code: Lightning app | 35 seconds | [GIF](docs/media/development-demos/claude-salesforce-development-2.5.0.gif) · [MP4](docs/media/development-demos/claude-salesforce-development-2.5.0.mp4) |
|
|
17
|
+
| Codex CLI: Lightning app | 30 seconds | [GIF](docs/media/development-demos/codex-salesforce-development-2.5.0.gif) · [MP4](docs/media/development-demos/codex-salesforce-development-2.5.0.mp4) |
|
|
18
|
+
| Claude Code: internal React app | 32 seconds | [GIF](docs/media/development-demos/claude-react-salesforce-development-2.5.0.gif) · [MP4](docs/media/development-demos/claude-react-salesforce-development-2.5.0.mp4) |
|
|
19
|
+
|
|
20
|
+
The Codex Lightning demo also uses Experience LWC 0.3.0; the React demo uses
|
|
21
|
+
Experience React 0.2.1. The clips combine real terminal excerpts with captured views
|
|
22
|
+
of the deployed apps. Accelerated terminal sections are labeled. All Account data
|
|
23
|
+
shown is fictional. See the [recording notes](docs/media/development-demos/README.md).
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>Preview Codex CLI and React</summary>
|
|
27
|
+
|
|
28
|
+
### Codex CLI: Lightning app
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
### Claude Code: internal React app
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
</details>
|
|
37
|
+
|
|
38
|
+
> ⚠️ **Expect frequent changes.** The Salesforce skills and plugins library is evolving rapidly as we refine patterns and incorporate feedback. Skills and plugins may be renamed, restructured, or removed between releases — they do not follow the same stability guarantees as GA platform APIs. If you’ve forked or synced the repository, be prepared for upstream changes that may conflict with local modifications. This repository is always the source of truth.
|
|
8
39
|
|
|
9
40
|
## 🗂️ Structure
|
|
10
41
|
|
|
11
42
|
```
|
|
12
43
|
sf-skills/
|
|
44
|
+
├── .claude-plugin/
|
|
45
|
+
│ └── marketplace.json # Salesforce plugin marketplace catalog
|
|
46
|
+
├── plugins/
|
|
47
|
+
│ └── builder/ # Plugins for Salesforce development
|
|
48
|
+
│ ├── salesforce-development/
|
|
49
|
+
│ └── ...
|
|
13
50
|
├── skills/ # Directory-based executable workflows
|
|
14
51
|
│ ├── platform-apex-generate/
|
|
15
52
|
│ ├── platform-custom-object-generate/
|
|
@@ -28,7 +65,20 @@ sf-skills/
|
|
|
28
65
|
| **Tool** | **Usage** |
|
|
29
66
|
|----------|-------------|
|
|
30
67
|
| **Agentforce Vibes** | Skills are auto-installed and auto-updated |
|
|
31
|
-
| **
|
|
68
|
+
| **Claude Code — Salesforce Development plugin** | Follow the [Claude Code installation guide](https://developer.salesforce.com/docs/platform/salesforce-skills-plugins/guide/install-salesforce-development.html) for skills, guided workflows, and integrated tools |
|
|
69
|
+
| **Codex — Salesforce Development plugin** | Follow [Codex setup and requirements](plugins/builder/salesforce-development/README.md#codex-lifecycle-support); use a release containing the Codex manifests and Codex CLI 0.145.0 or later |
|
|
70
|
+
| **OpenCode, Claude Code, Codex, Cursor, [more](https://agentskills.io/) — standalone skills** | `npx skills add forcedotcom/sf-skills` |
|
|
71
|
+
|
|
72
|
+
## 🔌 Plugins
|
|
73
|
+
|
|
74
|
+
Plugins bundle skills with other components that the coding client installs and loads together. The Salesforce Development plugin provides shared workflows for building, testing, and deploying on the Salesforce Platform, with client-specific commands, hooks, and MCP configuration. Claude Code agents and hooks aren't automatically available in other clients. Specialized builder plugins add capabilities for areas such as Agentforce, code quality, LWC, and React development.
|
|
75
|
+
|
|
76
|
+
- [Salesforce marketplace manifest](.claude-plugin/marketplace.json) — available plugins, descriptions, and source paths
|
|
77
|
+
- [Salesforce Development plugin README](plugins/builder/salesforce-development/README.md) — prerequisites, quick start, and component inventory
|
|
78
|
+
- [Salesforce Development plugin documentation](https://developer.salesforce.com/docs/platform/salesforce-skills-plugins/guide/salesforce-development-overview.html) — installation, project and org setup, workflows, and troubleshooting; use the plugin README for Codex-specific setup
|
|
79
|
+
- [Claude Code plugin documentation](https://code.claude.com/docs/en/plugins) — plugin components and how plugins work
|
|
80
|
+
|
|
81
|
+
Check the [plugin changelog](plugins/builder/salesforce-development/CHANGELOG.md) and installed version for release availability. Other clients, including Cursor, can use standalone skills where supported; full plugin support depends on the client and plugin manifest.
|
|
32
82
|
|
|
33
83
|
## 📦 Samples
|
|
34
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/afv-skills",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.68.0",
|
|
4
4
|
"description": "Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@salesforce/ui-bundle-template-app-react-sample-b2e": "^12.4.4",
|
|
15
|
-
"@salesforce/ui-bundle-template-app-react-sample-b2x": "^12.4.4"
|
|
16
|
-
"@salesforce/webapp-template-app-react-sample-b2e-experimental": "^1.117.1",
|
|
17
|
-
"@salesforce/webapp-template-app-react-sample-b2x-experimental": "^1.117.1"
|
|
15
|
+
"@salesforce/ui-bundle-template-app-react-sample-b2x": "^12.4.4"
|
|
18
16
|
},
|
|
19
17
|
"scripts": {
|
|
20
18
|
"sync-react-b2e-sample": "node scripts/sync-react-b2e-sample.js",
|
|
@@ -4,41 +4,39 @@ description: "Use this skill when users want to execute this workflow when a use
|
|
|
4
4
|
metadata:
|
|
5
5
|
relatedSkills:
|
|
6
6
|
- dx-apexguru-scan
|
|
7
|
-
version:
|
|
7
|
+
version: "1.0"
|
|
8
8
|
cliTools:
|
|
9
9
|
- tool:
|
|
10
|
-
- curl
|
|
11
|
-
semver:
|
|
10
|
+
- "curl"
|
|
11
|
+
semver: ">=7.0"
|
|
12
12
|
- tool:
|
|
13
|
-
- jq
|
|
14
|
-
semver:
|
|
13
|
+
- "jq"
|
|
14
|
+
semver: ">=1.6"
|
|
15
15
|
- tool:
|
|
16
|
-
- python3
|
|
17
|
-
semver:
|
|
16
|
+
- "python3"
|
|
17
|
+
semver: ">=3.8"
|
|
18
18
|
- tool:
|
|
19
|
-
- sf
|
|
20
|
-
semver:
|
|
19
|
+
- "sf"
|
|
20
|
+
semver: ">=2.0.0"
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
# Managing Agentforce Offline Experimentation
|
|
24
24
|
|
|
25
25
|
## When to Use This Skill
|
|
26
26
|
|
|
27
|
-
Execute this workflow when a user wants to test how a different LLM model would handle existing Agentforce agent conversations. Fetches session traces from Data Cloud STDM, replays prompts via the SFAP AI Gateway REST API with structured tool calling, scores across four metrics (topic agreement, function name accuracy, function argument accuracy via LLM-as-judge, text response quality via LLM-as-judge), and produces
|
|
27
|
+
Execute this workflow when a user wants to test how a different LLM model would handle existing Agentforce agent conversations. Fetches session traces from Data Cloud STDM, replays prompts via the SFAP AI Gateway REST API with structured tool calling, scores across four metrics (topic agreement, function name accuracy, function argument accuracy via LLM-as-judge, text response quality via LLM-as-judge), and produces a run directory with units.jsonl, results.jsonl, summary.json, and an HTML report. Requires Data Cloud with Agentforce Activity data streaming enabled, an authenticated org, and a target model ID (llmgateway__ prefix for SFAP replay). Estimated runtime: 10-30 minutes for 10 sessions.
|
|
28
28
|
|
|
29
29
|
## Workflow
|
|
30
30
|
|
|
31
|
-
discover-data-space → verify-stdm-availability → discover-agents →
|
|
31
|
+
discover-data-space → verify-stdm-availability → discover-agents → list-available-models (if user needs help choosing) → find-sessions → get-conversation-details → get-llm-step-details → obtain-sfap-token → replay-turn-prompts (scoring happens inline) → generate-run-results → generate-html-report.
|
|
32
32
|
WORKFLOW GATE: Do not proceed past Phase 0 until org alias (auto-discover from authenticated orgs), agent API name (auto-discover from STDM), and target model ID (ask user) are all confirmed.
|
|
33
33
|
SFAP JWT expires after ~2 hours. For 20+ session replays, refresh the token between batches. Each SFAP replay call takes ~1-3 seconds; keep under 20 sessions for reasonable wall-clock time (~10-30 minutes).
|
|
34
|
-
The scoring and judging steps (Phase 3) can run in parallel once replay completes. Exact-match scoring is instant; LLM judge calls add ~1-2 seconds per turn.
|
|
35
34
|
|
|
36
35
|
## Critical Constraints
|
|
37
36
|
|
|
38
37
|
**Preconditions:**
|
|
39
38
|
|
|
40
39
|
- Data Cloud is provisioned and enabled in the org (check: `DataCloudProvisioned`)
|
|
41
|
-
- Agentforce Activity data streaming is active in Data Cloud (check: `AgentforceActivityStream`)
|
|
42
40
|
- Einstein LLM / GenAI Gateway is configured in the org (check: `EinsteinLlmEnabled`)
|
|
43
41
|
- User has an authenticated session to the target org (check: `OrgAuthenticated`)
|
|
44
42
|
|
|
@@ -53,7 +51,6 @@ Operations grouped by purpose. Use these as the building blocks for the workflow
|
|
|
53
51
|
| `discover-data-space` | read | implemented | `getDataSpaces` | — |
|
|
54
52
|
| `verify-stdm-availability` | validate | implemented | `queryCdpAnsiSqlV2` | `discover-data-space` |
|
|
55
53
|
| `discover-agents` | read | implemented | `queryCdpAnsiSqlV2` | `verify-stdm-availability` |
|
|
56
|
-
| `resolve-agent-label` | read | implemented | `queryGenAiPlannerDefinition` | `discover-agents` |
|
|
57
54
|
| `list-available-models` | read | implemented | `queryAiModel` | — |
|
|
58
55
|
| `find-sessions` | read | implemented | `queryCdpAnsiSqlV2` | `verify-stdm-availability`, `discover-agents` |
|
|
59
56
|
| `get-conversation-details` | read | proposed | `queryCdpAnsiSqlV2` | `find-sessions` |
|
|
@@ -63,8 +60,8 @@ Operations grouped by purpose. Use these as the building blocks for the workflow
|
|
|
63
60
|
| `score-exact-matches` | read | proposed | — | `replay-turn-prompts` |
|
|
64
61
|
| `judge-function-args` | read | proposed | — | `score-exact-matches`, `obtain-sfap-token` |
|
|
65
62
|
| `judge-text-responses` | read | proposed | — | `replay-turn-prompts`, `obtain-sfap-token` |
|
|
66
|
-
| `generate-
|
|
67
|
-
| `generate-html-report` | write | proposed | — | `generate-
|
|
63
|
+
| `generate-run-results` | write | proposed | — | `score-exact-matches`, `judge-function-args`, `judge-text-responses` |
|
|
64
|
+
| `generate-html-report` | write | proposed | — | `generate-run-results` |
|
|
68
65
|
|
|
69
66
|
### Dependency graph
|
|
70
67
|
|
|
@@ -73,7 +70,6 @@ graph TD
|
|
|
73
70
|
discover_data_space["discover-data-space (read)"]
|
|
74
71
|
verify_stdm_availability["verify-stdm-availability (validate)"]
|
|
75
72
|
discover_agents["discover-agents (read)"]
|
|
76
|
-
resolve_agent_label["resolve-agent-label (read)"]
|
|
77
73
|
list_available_models["list-available-models (read)"]
|
|
78
74
|
find_sessions["find-sessions (read)"]
|
|
79
75
|
get_conversation_details["get-conversation-details (read)"]
|
|
@@ -83,11 +79,10 @@ graph TD
|
|
|
83
79
|
score_exact_matches["score-exact-matches (read)"]
|
|
84
80
|
judge_function_args["judge-function-args (read)"]
|
|
85
81
|
judge_text_responses["judge-text-responses (read)"]
|
|
86
|
-
|
|
82
|
+
generate_run_results["generate-run-results (write)"]
|
|
87
83
|
generate_html_report["generate-html-report (write)"]
|
|
88
84
|
discover_data_space --> verify_stdm_availability
|
|
89
85
|
verify_stdm_availability --> discover_agents
|
|
90
|
-
discover_agents --> resolve_agent_label
|
|
91
86
|
verify_stdm_availability --> find_sessions
|
|
92
87
|
discover_agents --> find_sessions
|
|
93
88
|
find_sessions --> get_conversation_details
|
|
@@ -99,10 +94,10 @@ graph TD
|
|
|
99
94
|
obtain_sfap_token --> judge_function_args
|
|
100
95
|
replay_turn_prompts --> judge_text_responses
|
|
101
96
|
obtain_sfap_token --> judge_text_responses
|
|
102
|
-
score_exact_matches -->
|
|
103
|
-
judge_function_args -->
|
|
104
|
-
judge_text_responses -->
|
|
105
|
-
|
|
97
|
+
score_exact_matches --> generate_run_results
|
|
98
|
+
judge_function_args --> generate_run_results
|
|
99
|
+
judge_text_responses --> generate_run_results
|
|
100
|
+
generate_run_results --> generate_html_report
|
|
106
101
|
```
|
|
107
102
|
|
|
108
103
|
### Read operations
|
|
@@ -115,24 +110,12 @@ Discover active Data Cloud data spaces in the org
|
|
|
115
110
|
|
|
116
111
|
#### `discover-agents`
|
|
117
112
|
|
|
118
|
-
Query STDM for distinct
|
|
113
|
+
Query STDM for distinct agent + version combinations that have session traces
|
|
119
114
|
|
|
120
115
|
**Call:** `queryCdpAnsiSqlV2` — status: `implemented`
|
|
121
116
|
|
|
122
117
|
**Depends on:** `verify-stdm-availability`
|
|
123
118
|
|
|
124
|
-
#### `resolve-agent-label`
|
|
125
|
-
|
|
126
|
-
Enrich the selected agent API name with a human-readable MasterLabel
|
|
127
|
-
|
|
128
|
-
**Call:** `queryGenAiPlannerDefinition` — status: `implemented`
|
|
129
|
-
|
|
130
|
-
**Inputs:**
|
|
131
|
-
|
|
132
|
-
- `agent_api_name` *(`String`)* — Agent API name selected in discover-agents
|
|
133
|
-
|
|
134
|
-
**Depends on:** `discover-agents`
|
|
135
|
-
|
|
136
119
|
#### `list-available-models`
|
|
137
120
|
|
|
138
121
|
List Einstein LLM models configured in the org to help the user choose a target model
|
|
@@ -141,13 +124,14 @@ List Einstein LLM models configured in the org to help the user choose a target
|
|
|
141
124
|
|
|
142
125
|
#### `find-sessions`
|
|
143
126
|
|
|
144
|
-
Find recent Agentforce sessions in STDM filtered by agent API name and date range
|
|
127
|
+
Find recent Agentforce sessions in STDM filtered by agent API name, version, and date range
|
|
145
128
|
|
|
146
129
|
**Call:** `queryCdpAnsiSqlV2` — status: `implemented`
|
|
147
130
|
|
|
148
131
|
**Inputs:**
|
|
149
132
|
|
|
150
133
|
- `agent_api_name` *(`String`)* — Agent API name selected in discover-agents
|
|
134
|
+
- `agent_version_api_name` *(`String`)* — Agent version API name selected in discover-agents
|
|
151
135
|
- `start_date` *(`String`)*
|
|
152
136
|
- `end_date` *(`String`)*
|
|
153
137
|
- `max_sessions` *(`Integer`)*
|
|
@@ -209,29 +193,22 @@ LLM-as-judge scoring of text responses for turns that end with text output
|
|
|
209
193
|
|
|
210
194
|
### Write operations
|
|
211
195
|
|
|
212
|
-
#### `generate-
|
|
196
|
+
#### `generate-run-results`
|
|
213
197
|
|
|
214
|
-
|
|
198
|
+
sfap_replay.py produces the run directory with units.jsonl (one line per replay unit with request and golden), results.jsonl (one line per scored result), and summary.json (run config, model, counts, aggregate scores). Scoring happens inline during replay — no separate scoring step needed.
|
|
215
199
|
|
|
216
|
-
**Status:** `proposed`
|
|
217
|
-
|
|
218
|
-
**Inputs:**
|
|
219
200
|
|
|
220
|
-
|
|
201
|
+
**Status:** `proposed`
|
|
221
202
|
|
|
222
203
|
**Depends on:** `score-exact-matches`, `judge-function-args`, `judge-text-responses`
|
|
223
204
|
|
|
224
205
|
#### `generate-html-report`
|
|
225
206
|
|
|
226
|
-
Build a self-contained HTML analysis report with
|
|
207
|
+
Build a self-contained HTML analysis report with scorecards and failure breakdown
|
|
227
208
|
|
|
228
209
|
**Status:** `proposed`
|
|
229
210
|
|
|
230
|
-
**
|
|
231
|
-
|
|
232
|
-
- `html_output` *(`String`)*
|
|
233
|
-
|
|
234
|
-
**Depends on:** `generate-csv-report`
|
|
211
|
+
**Depends on:** `generate-run-results`
|
|
235
212
|
|
|
236
213
|
### Other operations
|
|
237
214
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Compare two replay runs of the same units, unit by unit, against the noise between repeats.
|
|
3
|
+
|
|
4
|
+
python3 scripts/bt_compare.py runs/base runs/cand [--noise-from runs/v0] [--out FILE]
|
|
5
|
+
|
|
6
|
+
Each unit x repeat scored in both runs is a pair. Per group (overall, step kind, node, golden tool)
|
|
7
|
+
the delta is in units: the sum of each unit's cand - base score, averaged over its repeats. Per
|
|
8
|
+
failure bucket, the net is the pairs that scored lower and ended in it, minus those that scored
|
|
9
|
+
higher and left it. A metric's tolerance is the largest difference on it between two repeats of
|
|
10
|
+
the noise run (default: BASE), at least 1 unit; a delta beyond it is a regression or a gain. A
|
|
11
|
+
bootstrap over sessions gives a 95% interval of the mean unit delta, for reading only. A failure
|
|
12
|
+
drops the pair from both runs, except a no answer: a timeout where the other run answered another
|
|
13
|
+
request or model scores 0, in the bucket no_answer.
|
|
14
|
+
|
|
15
|
+
Exit 0: no metric got worse beyond its tolerance. Exit 1: some did. Exit 2: the runs are not
|
|
16
|
+
comparable (other units, judge, k, seed, steps, router nodes, equivalent tools, timeout or btlib
|
|
17
|
+
code; or more than 10% infra errors, or more than 10% no answers, in a run). --force compares them
|
|
18
|
+
anyway, on the units both share. Exit 2 also when a dir is not a finished run, or bt_compare
|
|
19
|
+
fails: never a verdict.
|
|
20
|
+
|
|
21
|
+
Writes the comparison to --out (default CAND/compare.json, bt.compare/1). It lists the units that
|
|
22
|
+
moved by unit id, so keep it with the run dirs, out of git.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
import argparse
|
|
26
|
+
import os
|
|
27
|
+
import sys
|
|
28
|
+
import traceback
|
|
29
|
+
|
|
30
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
31
|
+
|
|
32
|
+
from btlib import compare as comparelib # noqa: E402
|
|
33
|
+
from btlib import results # noqa: E402
|
|
34
|
+
from btlib.redact import redact # noqa: E402
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def parse_args(argv=None):
|
|
38
|
+
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
39
|
+
p.add_argument("base", help="run dir of the baseline (sfap_replay.py --out-dir)")
|
|
40
|
+
p.add_argument("cand", help="run dir of the candidate, on the same units")
|
|
41
|
+
p.add_argument("--noise-from", metavar="DIR",
|
|
42
|
+
help="run dir whose repeats set the tolerances (default: BASE); same units, judge, steps, "
|
|
43
|
+
"router nodes, equivalent tools and btlib code as BASE")
|
|
44
|
+
p.add_argument("--out", metavar="FILE", help="where to write the comparison (default CAND/compare.json)")
|
|
45
|
+
p.add_argument("--force", action="store_true",
|
|
46
|
+
help="compare runs that are not comparable, on the units both share (recorded in the output)")
|
|
47
|
+
p.add_argument("--bootstrap-samples", type=int, default=comparelib.BOOTSTRAP_SAMPLES, metavar="N",
|
|
48
|
+
help="session resamples for the 95%% intervals (default %(default)s; 0: none)")
|
|
49
|
+
args = p.parse_args(argv)
|
|
50
|
+
if args.bootstrap_samples < 0:
|
|
51
|
+
p.error("--bootstrap-samples must be >= 0")
|
|
52
|
+
return args
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def main(argv=None):
|
|
56
|
+
args = parse_args(argv)
|
|
57
|
+
out = args.out or os.path.join(args.cand, "compare.json")
|
|
58
|
+
try:
|
|
59
|
+
res = comparelib.compare(args.base, args.cand, args.noise_from, force=args.force,
|
|
60
|
+
samples=args.bootstrap_samples)
|
|
61
|
+
results.write_json(out, res) # 0600: unit ids name sessions
|
|
62
|
+
lines = comparelib.report_lines(res)
|
|
63
|
+
except comparelib.CompareError as e:
|
|
64
|
+
print(f"error: {redact(str(e))}", file=sys.stderr)
|
|
65
|
+
return 2
|
|
66
|
+
except OSError as e:
|
|
67
|
+
print(f"error: cannot write {out}: {e.strerror or e}", file=sys.stderr)
|
|
68
|
+
return 2
|
|
69
|
+
except Exception as e: # a bug, or a run dir it did not foresee: exit 1 would read as a regression
|
|
70
|
+
frame = traceback.extract_tb(e.__traceback__)[-1]
|
|
71
|
+
print(f"error: bt_compare failed ({type(e).__name__} at {os.path.basename(frame.filename)}:{frame.lineno}); "
|
|
72
|
+
"no verdict (exit 2)", file=sys.stderr)
|
|
73
|
+
return 2
|
|
74
|
+
for line in lines:
|
|
75
|
+
print(redact(line))
|
|
76
|
+
print(f"comparison: {out}")
|
|
77
|
+
return comparelib.exit_code(res)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
sys.exit(main())
|