/sf-agentforce:agentforce-offline-experimentation-runfrom Salesforce — Agentforce & Data 360
Tests how different LLM models handle existing Agentforce agent conversations by fetching session traces from Data Cloud STDM, replaying prompts via SFAP AI Gateway, and scoring across four metrics.
Ships in Salesforce — Agentforce & Data 360. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
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. 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. 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).
Preconditions:
DataCloudProvisioned)EinsteinLlmEnabled)OrgAuthenticated)Operations grouped by purpose. Use these as the building blocks for the workflows above.
| Operation | Purpose | Status | Call | Depends on |
|---|---|---|---|---|
discover-data-space | read | implemented | getAllDataSpaces | — |
verify-stdm-availability | validate | implemented | querySql | discover-data-space |
discover-agents | read | implemented | querySql | verify-stdm-availability |
list-available-models | read | implemented | queryAiModel | — |
find-sessions | read | implemented | querySql | verify-stdm-availability, discover-agents |
get-conversation-details | read | proposed | querySql | find-sessions |
get-llm-step-details | read | proposed | querySql | get-conversation-details |
obtain-sfap-token | validate | proposed | — | — |
replay-turn-prompts | read | proposed | — | get-llm-step-details, obtain-sfap-token |
score-exact-matches | read | proposed | — | replay-turn-prompts |
judge-function-args | read | proposed | — | score-exact-matches, obtain-sfap-token |
judge-text-responses | read | proposed | — | replay-turn-prompts, obtain-sfap-token |
generate-run-results | write | proposed | — | score-exact-matches, judge-function-args, judge-text-responses |
generate-html-report | write | proposed | — | generate-run-results |
graph TD
discover_data_space["discover-data-space (read)"]
verify_stdm_availability["verify-stdm-availability (validate)"]
discover_agents["discover-agents (read)"]
list_available_models["list-available-models (read)"]
find_sessions["find-sessions (read)"]
get_conversation_details["get-conversation-details (read)"]
get_llm_step_details["get-llm-step-details (read)"]
obtain_sfap_token["obtain-sfap-token (validate)"]
replay_turn_prompts["replay-turn-prompts (read)"]
score_exact_matches["score-exact-matches (read)"]
judge_function_args["judge-function-args (read)"]
judge_text_responses["judge-text-responses (read)"]
generate_run_results["generate-run-results (write)"]
generate_html_report["generate-html-report (write)"]
discover_data_space --> verify_stdm_availability
verify_stdm_availability --> discover_agents
verify_stdm_availability --> find_sessions
discover_agents --> find_sessions
find_sessions --> get_conversation_details
get_conversation_details --> get_llm_step_details
get_llm_step_details --> replay_turn_prompts
obtain_sfap_token --> replay_turn_prompts
replay_turn_prompts --> score_exact_matches
score_exact_matches --> judge_function_args
obtain_sfap_token --> judge_function_args
replay_turn_prompts --> judge_text_responses
obtain_sfap_token --> judge_text_responses
score_exact_matches --> generate_run_results
judge_function_args --> generate_run_results
judge_text_responses --> generate_run_results
generate_run_results --> generate_html_report
discover-data-spaceDiscover active Data Cloud data spaces in the org
Call: getAllDataSpaces — status: implemented
discover-agentsQuery STDM for distinct agent + version combinations that have session traces
Call: querySql — status: implemented
Depends on: verify-stdm-availability
list-available-modelsList Einstein LLM models configured in the org to help the user choose a target model
Call: queryAiModel — status: implemented
find-sessionsFind recent Agentforce sessions in STDM filtered by agent API name, version, and date range
Call: querySql — status: implemented
Inputs:
agent_api_name (String) — Agent API name selected in discover-agentsagent_version_api_name (String) — Agent version API name selected in discover-agentsstart_date (String)end_date (String)max_sessions (Integer)Depends on: verify-stdm-availability, discover-agents
get-conversation-detailsFetch interactions (turns) for each session from the STDM Interaction DMO
Call: querySql — status: proposed
Depends on: find-sessions
get-llm-step-detailsFetch interaction steps including LLM inputs and outputs for each interaction
Call: querySql — status: proposed
Depends on: get-conversation-details
replay-turn-promptsExtract structured messages (system/assistant/user) from STDM LLM step inputs, convert to OpenAI-format messages array preserving role positions, extract tool definitions dynamically from gen_ai.request.tools, classify each step as router (topic) or action based on tool signatures, and replay via SFAP REST API POST /ai/gpt/v1/chat/generations with tool_choice=required
Status: proposed
Inputs:
target_model (String) — Target model ID (llmgateway__ prefix, e.g. llmgateway__OpenAIGPT41)Depends on: get-llm-step-details, obtain-sfap-token
score-exact-matchesCompute exact-match scores for topic agreement and function name accuracy
Status: proposed
Depends on: replay-turn-prompts
judge-function-argsLLM-as-judge scoring of function arguments when function names match (exact or lenient)
Status: proposed
Depends on: score-exact-matches, obtain-sfap-token
judge-text-responsesLLM-as-judge scoring of text responses for turns that end with text output
Status: proposed
Depends on: replay-turn-prompts, obtain-sfap-token
generate-run-resultssfap_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.
Status: proposed
Depends on: score-exact-matches, judge-function-args, judge-text-responses
generate-html-reportBuild a self-contained HTML analysis report with scorecards and failure breakdown
Status: proposed
Depends on: generate-run-results
verify-stdm-availabilityVerify STDM (Session Trace Data Model) is queryable in Data Cloud
Call: querySql — status: implemented
Depends on: discover-data-space
obtain-sfap-tokenObtain an SFAP JWT token via org session authentication and the /ide/auth endpoint
Status: proposed
Inputs:
org_alias (String) — Authenticated org alias for token resolutionscripts/bt_compare.py (opens in a new tab)scripts/bt_fetch.py (opens in a new tab)scripts/bt_patch_agent.py (opens in a new tab)scripts/btlib/__init__.py (opens in a new tab)scripts/btlib/agentpatch.py (opens in a new tab)scripts/btlib/agentsrc.py (opens in a new tab)scripts/btlib/cache.py (opens in a new tab)scripts/btlib/compare.py (opens in a new tab)scripts/btlib/fetch.py (opens in a new tab)scripts/btlib/judge.py (opens in a new tab)scripts/btlib/messages.py (opens in a new tab)scripts/btlib/patch.py (opens in a new tab)scripts/btlib/redact.py (opens in a new tab)scripts/btlib/results.py (opens in a new tab)scripts/btlib/scoring.py (opens in a new tab)scripts/btlib/sfap.py (opens in a new tab)scripts/btlib/splits.py (opens in a new tab)scripts/btlib/stdm.py (opens in a new tab)scripts/btlib/tokens.py (opens in a new tab)scripts/btlib/units.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agentforce, offline-experimentation, llm-evaluation, data-cloud, sfap
16 skills in this plugin
/afcc-setup-coordinateOrchestrates end-to-end headless setup of Agentforce Contact Center (AFCC) on a Salesforce org. Scans the org first, presents a delta plan for approval, then sequentially provisions demo users, Omni-Channel base settings, a human queue with routing config and members, presence statuses, permission sets, a PSTN voice number, and an active PstnVoice MessagingChannel wired to the queue. Interactive at key decision points — never assumes country, number type, queue names, or user counts. TRIGGER: set up AFCC, configure Agentforce Contact Center, stand up voice contact center, AFCC migration setup, provision AFCC org headlessly./agentforce-bot-upgradeUse this skill to upgrade Einstein Bots into Agentforce agents end-to-end in a single pass, orchestrating per-bot Agent Spec generation, agentforce-generate authoring, and post-conversion .agent enhancements. TRIGGER when: user asks to migrate, upgrade, or convert one or more Einstein Bots (BotDefinition/BotVersion chatbots) to Agentforce agents; runs a multi-bot bot-to-agent upgrade; needs Einstein Bot metadata turned into Agent Spec handoffs and generated .agent agents; convert bots to agents; upgrade my service bots; move bots to Agentforce. DO NOT TRIGGER when: user already has an approved Agent Spec and only wants direct .agent authoring, deploy, test, or observe flows; user wants to migrate or upgrade an EXISTING Agentforce agent from a legacy GenAiPlannerBundle to an NGA aiAuthoringBundle (that is agentforce-generate's 'Migrate a Legacy Agent to Agent Script' flow, not an Einstein Bot upgrade); the request is unrelated to Einstein Bot migration./agentforce-d360-analyzeData Cloud 360° view of a single Agentforce session. TRIGGER when user asks to trace, inspect, summarize, or describe a specific Agentforce session by session id (Agent Session UUID `019d…` or MessagingSession id `0Mw…`). Also triggers on session discovery — find/list/search sessions by time, agent, channel, outcome, or conversation text — when the user has no session id yet. DO NOT TRIGGER for design-time architecture questions (use agentforce-architecture-analyze instead) or for runtime perf/latency/SLO questions that require platform telemetry beyond Data Cloud./agentforce-hyperclassifier-configureOnboard a customer org and evaluate or improve Agentforce HyperClassifier routing descriptions against labeled utterances. TRIGGER for classifier evaluation, expected-versus-actual routing reports, repeated regressions, or description optimization with customer ECA authentication. DO NOT TRIGGER for general agent conversation testing, runtime session tracing, or automatic agent deployment./agentforce-observeAnalyze 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./agentforce-persona-generateUse to design an AI agent persona — identity, voice, tone, behavioral style, guardrails — and encode it into Agent Script (.agent files) or Agentforce Builder field values. Runs four sequenced phases (DRAFT, REFINE, SCORE, ENCODE) plus five spokes (NAME, FILL OUT, ADJUST, CHECKLIST, WORKSHOP). Supports greenfield (brand input to a starter .agent file) and brownfield (audit an existing .agent file and re-encode persona fields only), with a 100-point evaluation rubric. Trigger when a user designs a new agent persona, retrofits persona consistency, translates brand guidelines into agent voice, defines tone/register/formality/warmth/humor/personification, encodes a persona for Agent Script or Agentforce Builder, or scores or audits an existing .agent file for persona quality. Do not trigger for building Agentforce actions/metadata, authoring Agent Script flow control without persona work, or testing agent conversations.npx claudepluginhub reej-consulting/reej-sf-skills --plugin sf-agentforce3 plugins ship this exact skill · first indexed Nov 24, 2026
Other plugins' skills for the same job