/sf-experience-extras:experience-afv-analytics-queryfrom sf-experience-extras
Retrieves Agentforce Vibes (AFV) usage and instrumentation metrics from the Salesforce Lightning Instrumentation Headless Connect REST API. Supports local filtering of results by period, org type, record type, and model name.
Ships in sf-experience-extras. 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.
Use this skill when a user asks to retrieve Agentforce Vibes (AFV) usage or instrumentation metrics for the current Salesforce org.
This skill describes one public, read-only Connect API operation:
GET /instrumentation/afv-metrics (operationId: getAFVMetrics).The route is available at external API version v68.0 or later. Call it at
v68.0; do not infer a lower version from the source
spec's generic info.version or servers example. v67.0 returns
404 NOT_FOUND. A version above the org's own maximum also returns 404;
that is an org limit, not a reason to call a version below v68.0.
GET /services/data/v68.0/instrumentation/afv-metrics.AFVMetricsOutputRepresentation:
success — whether the metrics download succeeded.message — an optional status or failure message.rows — an array of metric maps; each map can contain heterogeneous
metric names and values.success is false, surface message and the raw response. Do not
present the rows as a successful metrics result or retry automatically.success is true and rows is empty, report the no-data result and
stop. Do not retry, treat it as an API error, or fall back to an internal
API.recordType before reading class-specific fields.
Do not assume that any particular record class is present. Preserve unknown
record types and fields instead of dropping them.Users can narrow the displayed metrics with optional result filters. These
filters control local processing after the complete response is received; they
are not Connect API query parameters or get-afv-metrics dispatch inputs.
| Filter | Accepted value | Matching rule |
|---|---|---|
period | current (default) or prior | Exact match on rows[*].period. Reject another explicit value before calling the API. |
orgType | All (default) or an org-type value returned by the API | Case-insensitive exact match on rows[*].orgType. All is a literal roll-up value, not a wildcard. |
recordType | One or more record-type names | Exact match on rows[*].recordType. Known values include aggregate, dailyTimeSeries, modelMetrics, orgBreakdown, userMetrics, and weeklyActiveUsers, but accept an exact future value when the user supplies it. |
modelName | All (default) or a model name returned by the API | Case-insensitive exact match on rows[*].modelName. All is a literal roll-up value, not a wildcard. |
| Other returned row field | Explicit field name and value supplied by the user | Exact match only when that field is present. Do not invent aliases or assume the field exists on every record type. |
If the user does not supply period, apply period=current; if the user does
not supply orgType, apply orgType=All; if the user does not supply
modelName, apply modelName=All. These are default local result filters. An
explicit value overrides its corresponding default. A request that compares
the current and prior periods explicitly selects both values and therefore
overrides the single-period default. Likewise, a request to compare or rank
models explicitly selects the concrete model names present in the response
instead of the All model roll-up. If the user supplies more than one filter
name, combine them with AND. If the user supplies multiple values for the same
field, match any of those values. Each default still applies when the user
supplies another filter but omits one of these three fields.
Apply filters only after checking HTTP status, success, and the unfiltered
rows array:
period=current, orgType=All, and modelName=All when those
fields were omitted and the request does not imply a multi-value comparison.get-afv-metrics once with no arguments and no query string.success is false or the complete rows array is empty, follow the
normal response handling without filtering.A successful response with rows but zero filter matches, including when a
default filter finds no rows, is a successful zero-match view, not an empty
API response. Report that the complete response
contained no matching rows. Do not retry, change the request URL, infer zero
metric values, or report that the API itself returned no data. When the
requested recordType is userMetrics, also apply the permission-dependent
guidance below instead of treating the absence as proof of zero user activity.
HTTP status is part of the gate and permission contract. Do not treat every
denial as HTTP 200 with success: false.
The route returns a metrics body only when the org gate is enabled and the caller passes the user access check. The user access check passes when any of these is true:
the caller has both Customize Application and Modify All Data, or
the caller has Lifecycle Center Developer-Level Insights, or
the caller has Lifecycle Center User.
Org gate disabled, or the caller fails the user access check: the
route returns HTTP 403. Surface the response as an access denial.
Recommend verifying that AFV metrics are enabled for the org and that the
caller has Lifecycle Center User, Lifecycle Center Developer-Level Insights, or both Customize Application and Modify All Data. Do not retry,
and do not present a 403 as an empty dataset or as success: false.
Lifecycle Center User only: the call can return HTTP 200 with
success: true, but userMetrics rows are omitted. The message then
includes Some per-user metrics were omitted because you do not have permission to view them. Other record classes remain subject to data
availability. Absence of userMetrics does not prove that no users used
AFV.
Lifecycle Center Developer-Level Insights, or Customize Application
together with Modify All Data: the caller is eligible to receive rows
whose recordType is userMetrics when that class has data. A populated
System Administrator probe returned those rows with message
AFV metrics retrieved successfully. and no omission sentence.
When the user specifically asks for per-user results and no userMetrics
rows are visible, explain that the class can be absent because
Lifecycle Center Developer-Level Insights is not assigned or because the
current dataset has no rows of that class. Recommend verifying
Lifecycle Center Developer-Level Insights; do not report zero per-user
activity from an absent record class.
Production exports show that successful populated responses can contain only a
subset of the known record classes. Treat aggregate, dailyTimeSeries,
modelMetrics, orgBreakdown, userMetrics, and weeklyActiveUsers as
independently optional collections. For a requested class that is absent,
report that the current response contains no rows of that class. Do not infer a
zero value, fail the whole response, or retry. Row counts are data-dependent.
On success, report the server message when present, the number of rows, and the rows themselves. Preserve the keys returned in each row; the schema intentionally permits arbitrary metric-name/value pairs.
## AFV metrics
- Success: `<success>`
- Message: `<message, when present>`
- Result filters: `<filters, including period=current, orgType=All, and modelName=All defaults when applicable>`
- Rows returned by API: `<unfiltered rows.length>`
- Rows matched: `<filtered rows.length, when filters are present>`
<render the rows without inventing or renaming fields>
For every successful populated response with no user-supplied result filters,
append a compact filter-discovery block even though the default
period=current AND orgType=All AND modelName=All view was applied. Compute
distinct values from the full, unfiltered API response and include only fields
that occur in at least one row. Do not present known-but-absent values as
available in the current result, and do not make a second API call.
### Available result filters in this response
- `period`: `<distinct rows[*].period values>` (default: `current`)
- `orgType`: `<distinct rows[*].orgType values>` (default: `All`)
- `recordType`: `<distinct rows[*].recordType values>`
- `modelName`: `<distinct rows[*].modelName values>` (default: `All`)
Example: `Get AFV metrics for period=prior, orgType=Sandbox, recordType=modelMetrics, and modelName=<returned model name>.`
When user-supplied filters were provided, show the effective filters in
Result filters and omit the discovery block. The default
period=current AND orgType=All AND modelName=All filters alone do not
suppress discovery. The filter list and example are part of the same final
result, not a follow-up question. Available orgType and modelName values
are data-dependent; never hardcode values observed in one org.
An empty rows array is a valid successful response. The no-data result is
HTTP 200 with success: true, message
No AFV metrics are available yet for this org., and rows: []. Report
that no metric rows were returned, include the server's message, and stop
without retrying. Distinguish this from success: false with rows: [],
which is a service failure, and from HTTP 403, which is an access denial.
400 — surface the returned AFV result as a bad request.401 — authentication is missing or invalid; ask the user to reconnect to
the org, then retry only when they request it.403 — the org gate is disabled or the caller fails the user access check.
Surface the response and recommend verifying org enablement plus
Lifecycle Center User, Lifecycle Center Developer-Level Insights, or
both Customize Application and Modify All Data. Do not retry automatically.500 — the metrics service failed internally; surface the response and
advise retrying later.200 with success: false — surface message and rows as returned.
The caller-facing service-failure message is
Unable to retrieve AFV metrics at this time. Please try again later.
This is not a permission or gate denial. Do not recommend a permission
change for it.200 with success: true and the per-user omission sentence — follow
the permission-dependent guidance. Do not treat the remaining rows as a
failure.404. Do not probe a matrix of versions automatically.parameters: []. Apply optional user filters only after the full response is
received, including the default
period=current AND orgType=All AND modelName=All view.userMetrics can be omitted by permission-based filtering.Operations this skill uses — routing and dependency reference.
| Operation | Purpose | Status | Call | Depends on |
|---|---|---|---|---|
get-afv-metrics | read | — | GET /services/data/v68.0/instrumentation/afv-metrics | — |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub cloudzlab/sf-team-skills --plugin sf-experience-extras10 skills in this plugin
/experience-app-mcp-delivery-generatePackage and deliver an existing Salesforce hosted MCP server/App MCP for an Experience Site as an MCP configuration file or a Claude plugin repository. Discover the serving URL and External Client Application client ID, generate client configuration, optionally bundle skills in a plugin, and provide local testing and private GitHub handoff instructions. Plugin packaging supports Claude only; reject requests for Codex, ChatGPT, or other plugin platforms. Use for connecting clients and packaging delivery, not for creating or activating the Salesforce MCP server./experience-app-mcp-generateCreate, extend, deploy, review readiness for, or activate an App MCP, a Salesforce custom hosted MCP server for an Aura Experience Site. Trigger when the user wants to expose an Experience UI or backend action to agents, create local ECA and server metadata, add eligible global invocable Apex or autolaunched Flow tools, add Prompt Builder templates as MCP prompts or tools, preview or perform server activation, deploy the existing MCP stack, or review its readiness. For server setup, always ask whether the user wants HXL widgets for eligible Apex-backed tools through platform-mcp-tool-widget-coordinate. For a standalone request to generate Custom Lightning Types or widgets for an Apex-backed MCP tool, route directly to platform-mcp-tool-widget-coordinate; do not trigger this skill for HXL generation alone. Do not trigger for remote MCP registration or generic Apex and Flow work unrelated to Experience Site agent access./experience-cms-brand-createAuthor a Salesforce Digital Experience brand (a "brand.json") so the VS Code Brand Toolkit can load, edit, and preview it. Use this skill whenever someone wants to: create a brand, make a new brand, generate a brand from a description or a color/logo/mood, add a brand to a project so the Brand Toolkit picks it up, scaffold a brand.json, theme a Digital Experience site, or turn a brand idea ("a dark luxury brand", "match our logo", "coral + rounded + friendly") into a loadable brand. Also use it when the user mentions "Brand Toolkit", "theme manager brand", "brand token", "colorScheme", "primaryAccent", ".digitalExperience/brands", "sfdc_cms:title", or a "brand.json" that should show up in the Brand Toolkit. Do NOT use this skill to apply an existing brand's voice, tone, or guidelines to generated content (use experience-cms-brand-apply), to search Salesforce CMS for existing brands, or to search for images, media, or logos (use experience-search-coordinate)./experience-design-validateUse this skill to run a visual-craft audit of a rendered UI and produce an evidence-grounded Craft Report across Useful, Usable, Reliable, Coherent, and Well-Crafted. Invoke it for craft audits, visual critiques, design comparisons, felt-quality reviews, or visual-craft readiness checks on screenshots (.png, .jpg, .jpeg, .webp, .gif), Figma frames, rendered prototypes, and live URLs. Do not use it for source-code review, SLDS compliance (use design-systems-slds-validate), or accessibility compliance (use experience-accessibility-validate)./experience-lwc-widget-assessAssess whether a specific Lightning web component can serve its user's purpose as an HXL declarative widget. Use for LWC-to-widget feasibility, portability audits, and candidate screening; use experience-lwc-widget-migrate when the user wants the widget built./experience-lwc-widget-migrateConvert a specific existing Lightning web component (LWC) into a declarative HXL / Agentforce widget, end to end. Gates on experience-lwc-widget-assess and stops when a widget cannot serve the LWC's purpose; otherwise hands the derived field shape to platform-widget-generate and wires the widget as the Lightning Type renderer. TRIGGER when: the user wants to convert, migrate, port, rebuild, or turn a named LWC into a widget or declarative Agentforce widget, or asks for a widget built from an existing LWC component. DO NOT TRIGGER when: the user only wants to know whether an LWC can become a widget (use experience-lwc-widget-assess), or wants a widget for a data shape, entity, or Lightning Type with no existing LWC (use platform-widget-generate or platform-lightning-type-widget-coordinate).3 plugins ship this exact skill · first indexed Nov 10, 2026
Other plugins' skills for the same job