observing-agentforce

Analyze Agentforce session traces from Data Cloud to diagnose production failures.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/sf-skills --skill observing-agentforce-forcedotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observing-agentforce
Source: https://github.com/forcedotcom/sf-skills/tree/main/skills/observing-agentforce
Command: npx skills add https://github.com/forcedotcom/sf-skills --skill observing-agentforce-forcedotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Troubleshoots Agentforce agents in production by analyzing session trace data (STDM via Data Cloud) or, when unavailable, using local preview/test traces to pinpoint misroutes, missing actions, variable capture bugs, and low instruction adherence.

Core Features & Use Cases

  • Production observability (STDM): Queries Agentforce session traces in Data Cloud to surface failures, regressions, performance concerns, and adherence problems.
  • Local reproduction & validation: Uses sf agent preview with generated scenarios to reproduce issues and confirm whether failures are consistent or intermittent.
  • Guided agent improvement: Maps detected symptoms back to the .agent authoring bundle structure and provides a safe deployment + verification loop to apply fixes.

Quick Start

Run the observing-agentforce workflow by telling it your org alias and agent name (or the .agent file path) and ask it to analyze the last 7 days of sessions.

Frequently Asked Questions about observing-agentforce

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Agentforce agent failures in production?

To debug Agentforce production failures, analyze STDM session trace data from Data Cloud to surface action errors, subagent misroutes, and variable capture bugs. This approach queries session traces to pinpoint production regressions and performance issues.

What causes low instruction adherence in Agentforce sessions?

Low instruction adherence in Agentforce sessions is diagnosed by classifying STDM session traces and mapping symptoms back to the .agent authoring bundle structure. It often indicates missing actions, incorrect inputs, or publish drift requiring bundle edits.

Can I reproduce Agentforce production issues locally without Data Cloud?

You can reproduce Agentforce production issues locally using sf agent preview with generated scenarios when Data Cloud STDM is unavailable. This uses fallback local preview traces to confirm whether failures are consistent or intermittent.

How do I diagnose abandoned Agentforce sessions and subagent misroutes?

Diagnose abandoned Agentforce sessions and subagent misroutes by extracting and classifying session traces from Data Cloud. The process resolves the agent identity, discovers the Data Space, and optionally deploys an STDM helper Apex class to query the traces.

Do I need an STDM helper Apex class to analyze Agentforce session traces?

An STDM helper Apex class is required to analyze Agentforce session traces only when needed by your Data Cloud setup. The workflow discovers your Data Space and deploys the helper class to extract STDM session trace data for diagnosis.

What is the best way to fix publish drift in an Agentforce agent?

The best way to fix Agentforce publish drift is to validate fixes by editing and publishing the .agent authoring bundle. This workflow maps detected symptoms from session traces back to the bundle structure to apply a safe deployment and verification loop.