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 sf-skills. 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
/sf-skills:agentforce-offline-experimentation-runfrom sf-skills
sf-skills@sf-skills-plugin is listed by ccmalcom/sf-skills-plugin — review the source before installing
npx claudepluginhub ccmalcom/sf-skills-plugin --plugin sf-skills266 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-architecture-analyzeDeclared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces).3 plugins ship this exact skill · first indexed Nov 24, 2026
Other plugins' skills for the same job