commerce-b2b-open-code…
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce…
Analyze production Agentforce agent behavior using session traces and Data Cloud, and manage Agent Health Monitoring (AHM) alerts. TRIGGER when: user queries STDM session data or Data Cloud trace records; investigates production agent failures, regressions, or performance
$ npx -y skills add forcedotcom/sf-skills --skill agentforce-observe --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agentforce-observeContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyze production Agentforce agent behavior using session traces and Data Cloud, and manage Agent Health Monitoring (AHM) alerts. TRIGGER when: user queries STDM session data or Data Cloud trace records; investigates production agent failures, regressions, or performance
name: agentforce-observe
description: "Analyze production Agentforce agent behavior using session traces and Data Cloud, and manage Agent Health Monitoring (AHM) alerts. TRIGGER when: user queries STDM session data or Data Cloud trace records; investigates production agent failures, regressions, or performance issues; asks about session traces, conversation logs, or agent metrics; wants to reproduce a reported production issue in preview; runs findSessions or trace analysis queries; creates, lists, updates, or deletes an AHM data alert on an agent metric (escalation rate, deflection, etc.); asks why an alert is not firing or wants to check whether alerts have fired (notification counts, or the per-alert Incidents view). DO NOT TRIGGER when: user creates, modifies, or debugs .agent files during development (use agentforce-generate); writes or runs test specs (use agentforce-test); uses sf agent preview for local development iteration; deploys or publishes agents."
allowed-tools: Bash Read Write Edit Glob Grep
metadata:
relatedSkills:
- "agentforce-generate"
- "agentforce-test"
version: "0.9"
domains: ["Agentforce", "Data 360"]
cliTools:
- tool: ["git"]
semver: ">=2.0.0"
- tool: ["jq"]
semver: ">=1.6.0"
- tool: ["python3"]
semver: ">=3.10.0"
- tool: ["sf"]
semver: ">=2.136.8"Improve Agentforce agents using session trace data and live preview testing.
**Three-phase workflow:**
---
---
Gather these inputs before starting:
Determine intent from user input:
Before any STDM query, resolve the user-provided agent name against the org to get the exact `MasterLabel` and `DeveloperName`:
sf data query --json \ --query "SELECT Id, MasterLabel, DeveloperName FROM GenAiPlannerDefinition WHERE MasterLabel LIKE '%<user-provided-name>%' OR DeveloperName LIKE '%<user-provided-name>%'" \ -o <org>
Store these values:
**Step 1 -- Search locally:**
find <project-root>/force-app/main/default/aiAuthoringBundles -name "*.agent" 2>/dev/null
If the user provided an agent file path, use that directly. Otherwise, search for files matching `AGENT_API_NAME`.
**Step 2 -- If not found locally, retrieve from the org:**
sf project retrieve start --json --metadata "AiAuthoringBundle:<AGENT_API_NAME>" -o <org>
> **Known bug:** `sf project retrieve start` creates a double-nested path: `force-app/main/default/main/default/aiAuthoringBundles/...`. Fix it immediately after retrieve:
if [ -d "force-app/main/default/main/default/aiAuthoringBundles" ]; then
mkdir -p force-app/main/default/aiAuthoringBundles
cp -r force-app/main/default/main/default/aiAuthoringBundles/* \
force-app/main/default/aiAuthoringBundles/
rm -rf force-app/main/default/main
fi**Step 3 -- Validate the retrieved file:**
Read the `.agent` file and verify it has proper Agent Script structure:
Store the resolved path as `AGENT_FILE` for Phase 3.
---
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/afv-library
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce…
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in site…
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's…
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines,…
Use to list, view, or manage DevOps Center projects in a Salesforce org — show all projects,…
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure…