agentforce-observe
БесплатноБез исполняемых скриптовНе проверенAnalyze production Agentforce agent behavior using session traces and Data Cloud, and manage Agent Health Monitoring (AHM) alerts. TRIGGER when: user queries…
от forcedotcom★ 1 200 звёзд на GitHubОб этом скилле
Agentforce Observability
Improve Agentforce agents using session trace data and live preview testing.
Three-phase workflow:
- Observe -- Query STDM sessions from Data Cloud (if available), OR run test suites + preview with local traces as fallback
- Reproduce -- Use
sf agent previewto simulate problematic conversations live - Improve -- Edit the
.agentfile directly, validate, publish, verify
Platform Notes
- Shell examples below use bash syntax. On Windows, use PowerShell equivalents or Git Bash.
- Replace
python3withpythonon Windows. - Replace
/tmp/with$env:TEMP\(PowerShell) or%TEMP%\(cmd). - Replace
jqwithpython -c "import json,sys; ..."if jq is not installed.
Routing
Gather these inputs before starting:
- Org alias (required) -- must be authenticated (else
sf org login web) - Agent API name (required for preview and deploy; ask if not provided)
- Agent file path (optional) -- path to the
.agentfile, typicallyforce-app/main/default/aiAuthoringBundles/<AgentName>/<AgentName>.agent. Auto-detect if not provided. - Session IDs (optional) -- analyze specific sessions; if absent, query last 7 days
- Days to look back (optional, default 7)
- Alert owner user (optional, alerts only) -- user whose alerts to list/manage; defaults to the current user
Determine intent from user input:
- No specific action -> run all three analysis phases: Observe -> surface issues -> ask if user wants to Reproduce and/or Improve
- "analyze" / "sessions" / "what's wrong" -> Phase 1 only, then suggest next steps
- "reproduce" / "test" / "preview" -> Phase 2 (run Phase 1 first if no issues in hand)
- "fix" / "improve" / "update" -> Phase 3 (run Phase 1 first if no issues in hand)
- "create alert" / "set up monitoring" / "alert me when" -> AHM (create)
- "list alerts" / "show my alerts" / "update alert" / "delete alert" -> AHM (list / update via PUT / delete)
- "get / list notifications" / "notifications for a specific alert" / "have my alerts fired" / "why isn't my alert firing" -> AHM: fetch notifications with header
X-UNS-Type-Filter: all, report status + list; for a specific alert, filter by alertId fromtargetPageRef.state.c__alertId(15/18-char-safe), not metricId (+ Incidents view + metric verify)
Resolve agent name
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>
MasterLabel= display name used by STDMfindSessionsand Agent Builder UI (e.g. "Order Service")DeveloperName= API name with version suffix used in metadata (e.g. "OrderService_v9")- The
--api-nameflag forsf agent preview/activate/publishusesDeveloperNamewithout the_vNsuffix (e.g. "OrderService")
Store these values:
AGENT_MASTER_LABEL-- forfindSessions()agent filterAGENT_API_NAME--DeveloperNamewithout_vNsuffix, forsf agentCLI commandsPLANNER_ID-- the Salesforce record ID for this agent
Locate the .agent file
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 startcreates 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:
system:block withinstructions:config:block withdeveloper_name:start_agentorsubagentblocks withreasoning: instructions:- Each subagent should have distinct
instructions:content (not identical across subagents)
Store the resolved path as AGENT_FILE for Phase 3.
Phase 0: Discover Data Space
Before running any STDM query, determine the correct Data Cloud Data Space API name.
sf api request rest "/services/data/v63.0/ssot/data-spaces" -o <org>
Note: sf api request rest is a beta command -- do not add --json (that flag is unsupported and causes an error).
The response shape is:
{
"dataSpaces": [
{
"id": "
Установить agentforce-observe в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditGlobGrepВложенные файлы
FAQ
Что делает скилл agentforce-observe?
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.
Как установить скилл agentforce-observe?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agentforce-observe запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic