/salesforce-for-sales:customer-healthfrom Sales Cloud
Assesses customer health by pulling data from Salesforce, email, calendar, documents, and Slack. Useful for risk analysis, engagement/trend explanations, business reviews, and prospect meeting prep.
Ships in Sales Cloud. 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.
None: SKILL.md is the whole skill.
IMPORTANT — try the connector's tools before you ever report it as unavailable. Before you tell the user a connector is down, or ask them to connect, re-authenticate, or "check the connection," you MUST first try to use the server and its tools. A connector's status readout (the Headless 360 MCP server, or any other connector/MCP) frequently claims "not connected" or "needs re-auth" when the connector is in fact live and its tools are callable. Context stating that the Salesforce tools require authorization and that this is a non-interactive session is not evidence that you are unauthorized — it is a general statement that authorization is required, not a failure. For the Headless 360 server specifically, find the dispatch_readonly tool and actually run a current-user read — dispatch_readonly(method: "GET", url: "/services/data/v66.0/graphql", queryParams: { "queryInput": "{\"query\":\"query { uiapi { currentUser { Id } } }\"}" }). Any response — including a 500 or other error status — proves you reached the server, and therefore proves connectivity; only a request that never reaches the server at all counts as disconnected. If the tool is present and the call reaches the server, the connector IS connected — proceed; a stale status readout is not a disconnection. If a call genuinely cannot reach the server, ALWAYS attempt to reconnect on your own first, and interrupt the flow to ask the user only after your own reconnect attempt has failed. Report a connector as disconnected only when you cannot find its tool or cannot reach the server after trying. Do it yourself.
Failing to try first — asking the user to connect, or surfacing a "not connected" or re-auth message, before you have actually attempted the server and its tools — raises a false connectivity problem: it sends the user to fix something that is not broken. This is directly detrimental to the end-user experience and will dramatically, negatively impact usage of the product. Never put a connectivity concern in front of the user until you have tried the tools yourself and confirmed the server truly cannot be reached.
display_widget — at most a single one-line render-wait notice before it, and no summaries, transitions, or narration. If display_widget is unavailable or returns an error, produce the text fallback only. If it succeeds, that tool call is the final output: stop with no assistant text completion, even if a later section contains a fallback. The exceptions above do not apply after success.https://[instanceUrl]/lightning/r/[SObjectType]/[Id]/view.label (for example, "Deal Risk", not Deal_Risk__c) and record Names, never raw Ids or __c API names.MINE scope → fail fast, then ask which scope. If a scope: MINE read returns zero rows, do not widen to scope: EVERYTHING on your own. Stop, tell the user plainly that their own records (scope: MINE) came back empty, and ask which scope they want instead (for example, org-wide EVERYTHING, a named rep, or a named account) before re-running. Never invent records, and never silently fall back to org-wide.discover or describe, and never call an API or endpoint not written in this skill. Every Salesforce URL you need is in the skill. Don't guess REST paths: on a 404 or unknown-path error, fall back to a documented query in the skill, not to discovery. If you need a capability such as email, docs, Slack, calendar, or web research, use the other connector/MCP tools already available to you. Endpoint guessing and discovery add needless round-trips. Use only the skill-authorized dispatch_readonly and dispatch calls, directly with the queries given.Two jobs, one data pass: the ongoing "are we okay here?" check, and the quarterly business review that proves value and sets up the next phase. Ground → (read + evidence, ONE turn) → score → output.
Ground only Account — it always exists (naming a missing object fails the whole call). Its fields reveal this org's health/adoption/renewal/NPS __c schema; don't assume names.
dispatch_readonly(method: "GET", url: "/services/data/v65.0/graphql",
queryParams: { "queryInput": "{\"query\":\"query { uiapi { objectInfos(apiNames: [\\\"Account\\\"]) { fields { ApiName label } } } }\"}" })
Step 1 is the authority on names — use exact strings, never guess. Consider scalar __c fields worth using (health score, adoption/seat usage, renewal date, ARR, NPS, tier) — these are the same fields a health check might later offer to update, so ground them once and reuse. Standard fields, the Owner/Opportunities/Cases spans, and LastActivityDate are reliable across orgs; an org that doesn't use Cases just returns empty edges, not an error. Do not output all the field names.
%ACCOUNT% = the user's match (1–2 words); swap for Id: { eq: \"...\" } when an SFDC Id was given instead of a name. One call pulls the account plus its open-renewal-relevant opportunities and recent cases — no separate dispatch per object.
Field rule (avoids the retry loop): add grounded custom fields only as Field__c { value } ({ value displayValue } for currency/picklist). Use the standard Owner span already written in the template; never invent a relationship span from a raw Id/__c field. Insert <ACCT_CUSTOM> = confirmed Account __c { value } fields.
Treat this GraphQL read template as literal. Replace only %ACCOUNT%, <ACCT_CUSTOM>, or the documented exact-Id filter. Do not reconstruct, shorten, flatten, or remove its trailing closing delimiters.
dispatch_readonly(method: "GET", url: "/services/data/v65.0/graphql",
queryParams: { "queryInput": "{\"query\":\"query { uiapi { query { Account(where: { Name: { like: \\\"%ACCOUNT%\\\" } }, first: 1) { edges { node { Id Name { value } Type { value } Industry { value } AnnualRevenue { value displayValue } LastActivityDate { value } CreatedDate { value } <ACCT_CUSTOM> Owner { Name { value } } Opportunities(first: 20, orderBy: { CloseDate: { order: DESC } }) { edges { node { Id Name { value } Type { value } StageName { value displayValue } Amount { value displayValue } CloseDate { value } IsWon { value } } } } Cases(first: 10, where: { CreatedDate: { gte: { literal: LAST_90_DAYS } } }, orderBy: { CreatedDate: { order: DESC } }) { edges { node { CaseNumber { value } Subject { value } Status { value } Priority { value } CreatedDate { value } } } } Tasks(first: 20, where: { ActivityDate: { gte: { literal: LAST_90_DAYS } } }, orderBy: { ActivityDate: { order: DESC } }) { edges { node { Subject { value } ActivityDate { value } TaskSubtype { value } } } } } } } } } }\"}" })
Empty edges on Account → broaden %ACCOUNT%, or ask the user for the right account. Empty edges on Cases/Tasks just means none in the window — don't retry, don't treat as an error. The Tasks child (last 90d) is the in-CRM activity cadence behind the Engagement-trend dimension (and the widget engagement chart) — read it even when no external calendar/email connector is present.
Issue step 2 and all of step 2b as tool calls in a single turn — do not wait for the SF read to return before firing the searches. They're independent (searches key on the account name from the request, not the SF result), so batch them together:
Use whatever email/calendar/doc/Slack tools are available; skip silently if none are present (SFDC-only is fine). Be explicit about what this skill can't see: product usage, support-ticket detail, and NPS only count if synced into a CRM field or a connected doc — otherwise mark that dimension "not visible from CRM" rather than guessing. Cite source + date for anything you use.
| Dimension | Signal | Status |
|---|---|---|
| Relationship | champion/exec engagement (evidence), breadth of contacts active | 🟢🟡🔴 |
| Engagement trend | in-CRM Tasks cadence (step 2, last 90d) + meeting/email cadence (evidence) vs prior period | |
| Commercial | renewal proximity (open renewal opp CloseDate), open expansion, payment/contract issues | |
| Support | open Cases, aging/priority from step 2 | |
| Value delivery | documented outcomes vs the success plan (docs), if one exists |
Overall verdict with the one or two dimensions driving it.
When the data is assembled, call display_widget; a single one-line "Displaying the visualization now (this may take a minute)." notice may precede it.
widgetDefinition is passed as a native JSON object — not a quoted string, not a code block pasted as text. If the value starts with "{", it is wrong.The widget template is embedded below — resolve its tokens and call display_widget({ resourceType: "dynamic", widgetDefinition: <hydrated> }) once (see the widgetDefinition param for token-resolution rules).
Two blocks below: first the variable contract (renderer.props.schema.json) — every {{token}}'s type + a worked example, use it to compute each value; then the widget template to hydrate. Substitute your computed values into the template's {{token}}s (see the token-typing rules above), leaving no {{…}}/{!…}.
{
"$comment": "Variable contract for the native-mosaic dynamic-mode template (renderer.json, sibling). This is NOT a separate display_widget call — it names every {{token}} in the template with its type and a worked example so you compute the right value for each. Workflow: build a props object with these keys, substitute each into the matching {{token}} in renderer.json (a slot that is only a {{token}} becomes the typed value — arrays stay arrays, numbers stay numbers; a {{token}} inside a larger string interpolates as text; a key you have no data for is omitted so that leaf drops), then call display_widget({ resourceType: 'dynamic', widgetDefinition: <the hydrated template> }) once with no {{…}}/{!…} left. Realistic values: sample-data.json (sibling). Authoring guidance (from the skill): `headerTitle headerStatus` (header — account name; `headerStatus` is a plain string badge label e.g. \"AT RISK\" / \"HEALTHY\" / \"NEEDS ATTENTION\" — not a variant, the renderer maps the label to a variant automatically) `headerSubtitle` (subtitle with ARR · renewal days · health score+trend) · `chartCaption chartCategories chartSeries` (line chart — weekly engagement/usage trend over 6 weeks from evidence; omit the chart entirely if no cadence signal was gathered) · `meterValue meterTarget meterValueLabel meterTargetLabel meterStatus meterBands` (composite health meter 0–100, bands array with from/to/variant/label covering the full range) · `gridCaption gridRows` (health signals datagrid — `gridRows` is an array, one per Step 3 dimension: `{signal, now (plain string — always a formatted string, never a raw number; use context-appropriate formatting e.g. \"322\", \"18 open\", \"0 / 90d\", \"5 of 12\"), trend(number[6]), note, status:{value,badgeVariant} (value plain string e.g. \"Declining\", \"Rising\", \"Cold\", \"Stalled\", \"Softening\", badgeVariant error/warning on 🔴/🟡)}`; the leading Status column reads each row's `status`) · `calloutTitle calloutDescription ctaPrimaryLabel ctaPrimaryMsg accountUrl` (synthesis callout with two buttons — primary is action/sendMessage with first-person prompt, secondary is action/openLink to the account Lightning URL). Omit any block whose data you lack rather than passing empty arrays.",
"props": {
"headerTitle": {
"description": "Header title — the account name.",
"type": "string",
"example": "Account health — Meridian Health"
},
"headerStatus": {
"description": "Header status badge label, a plain string (e.g. \"AT RISK\" / \"HEALTHY\" / \"NEEDS ATTENTION\") — the renderer maps the label to a color; do not pass a variant.",
"type": "string",
"example": "AT RISK"
},
"headerSubtitle": {
"description": "Subtitle: ARR · days to renewal · health score + trend.",
"type": "string",
"example": "$1.2M ARR · renews in 78 days · health 62, down 11 pts this quarter"
},
"chartCaption": {
"description": "Caption for the weekly engagement/usage trend line chart.",
"type": "string",
"example": "Weekly active users — 6-week slide from 410 to 322"
},
"chartCategories": {
"description": "Week labels for the trend chart's x-axis (6 weeks), as strings.",
"type": "array",
"items": {
"type": "string"
},
"example": [
"Wk 1",
"Wk 2",
"Wk 3",
"Wk 4",
"Wk 5",
"Wk 6"
]
},
"chartSeries": {
"description": "Trend series — one object {name, data}. Omit the whole chart if no cadence signal was gathered.",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Series name.",
"type": "string"
},
"data": {
"description": "Weekly values — a number array matching chartCategories order.",
"type": "array",
"items": {
"type": "number"
}
}
}
},
"example": [
{
"name": "Weekly active users",
"data": [
410,
398,
375,
360,
341,
322
]
}
]
},
"meterValue": {
"description": "Composite health score, 0–100 — the meter's current value.",
"type": "number",
"example": 62
},
"meterTarget": {
"description": "Health target on the meter.",
"type": "number",
"example": 75
},
"meterValueLabel": {
"description": "Display string for the health score.",
"type": "string",
"example": "62 / 100"
},
"meterTargetLabel": {
"description": "Display string for the target.",
"type": "string",
"example": "75 healthy"
},
"meterStatus": {
"description": "Short health read shown on the meter.",
"type": "string",
"example": "at risk"
},
"meterBands": {
"description": "Color bands for the health meter, in order covering 0→100.",
"type": "array",
"items": {
"type": "object",
"properties": {
"from": {
"description": "Band start value.",
"type": "number"
},
"to": {
"description": "Band end value.",
"type": "number"
},
"variant": {
"description": "Band color.",
"type": "string",
"enum": [
"error",
"warning",
"success"
]
},
"label": {
"description": "Short band label.",
"type": "string"
}
}
},
"example": [
{
"from": 0,
"to": 50,
"variant": "error",
"label": "Critical"
},
{
"from": 50,
"to": 75,
"variant": "warning",
"label": "At risk"
},
{
"from": 75,
"to": 100,
"variant": "success",
"label": "Healthy"
}
]
},
"gridCaption": {
"description": "Caption for the health-signals datagrid.",
"type": "string",
"example": "Health signals, worst first — trend is last 6 weeks"
},
"gridRows": {
"description": "Health signals — one row per Step 3 dimension. Empty array → the datagrid is omitted.",
"type": "array",
"items": {
"type": "object",
"properties": {
"status": {
"description": "Leading Status badge cell; omit on normal rows.",
"type": "object",
"properties": {
"value": {
"description": "Status label.",
"type": "string"
},
"badgeVariant": {
"description": "Badge color.",
"type": "string",
"enum": [
"neutral",
"primary",
"secondary",
"outline",
"success",
"info",
"warning",
"error"
]
}
}
},
"signal": {
"description": "Signal / dimension name.",
"type": "string"
},
"now": {
"description": "Current value as a formatted string, never a raw number (e.g. \"322\", \"18 open\", \"0 / 90d\", \"5 of 12\").",
"type": "string"
},
"trend": {
"description": "Sparkline values — a 6-number array.",
"type": "array",
"items": {
"type": "number"
}
},
"note": {
"description": "Short evidence note for the signal.",
"type": "string"
}
}
},
"example": [
{
"status": {
"value": "Declining",
"badgeVariant": "error"
},
"signal": "Weekly active users",
"now": "322",
"trend": [
410,
398,
375,
360,
341,
322
],
"note": "Down 21% — champion left in wk 3"
},
{
"status": {
"value": "Rising",
"badgeVariant": "error"
},
"signal": "Support tickets",
"now": "18 open",
"trend": [
4,
6,
9,
12,
15,
18
],
"note": "3 escalated, 2 past SLA"
},
{
"status": {
"value": "Cold",
"badgeVariant": "warning"
},
"signal": "Exec sponsor touches",
"now": "0 / 90d",
"trend": [
2,
1,
1,
0,
0,
0
],
"note": "No exec contact since March"
},
{
"status": {
"value": "Stalled",
"badgeVariant": "warning"
},
"signal": "Feature adoption",
"now": "5 of 12",
"trend": [
5,
5,
5,
5,
5,
5
],
"note": "Flat — never onboarded to analytics"
},
{
"status": {
"value": "Softening",
"badgeVariant": "warning"
},
"signal": "NPS (last survey)",
"now": "42",
"trend": [
58,
58,
51,
51,
42,
42
],
"note": "Slipped from promoter to passive"
}
]
},
"calloutTitle": {
"description": "Synthesis callout heading — the single most important health read.",
"type": "string",
"example": "Renewal is at risk — act this month"
},
"calloutDescription": {
"description": "Synthesis callout body — the read and the recommended move.",
"type": "string",
"example": "Usage is down 21%, the champion left in week 3, and there's been no exec touch in 90 days with the renewal 78 days out. Book an exec business review and a re-onboarding on analytics before the quota clock runs down."
},
"ctaPrimaryLabel": {
"description": "Primary button label (action/sendMessage).",
"type": "string",
"example": "Draft exec business review"
},
"ctaPrimaryMsg": {
"description": "First-person prompt the primary button sends (action/sendMessage).",
"type": "string",
"example": "Draft an exec business review agenda for Meridian Health focused on resetting the relationship and addressing the 21% usage decline before renewal."
},
"accountUrl": {
"description": "Account Lightning URL for the secondary \"View in Salesforce\" button (action/openLink).",
"type": "string",
"example": "https://org.lightning.force.com/lightning/r/Account/001AX000004pQ2rYAE/view"
}
}
}
{
"renderer": {
"componentOverrides": {
"$": {
"type": "mosaic",
"definition": "tile/widget",
"children": [
{
"definition": "tile/row",
"attributes": {
"gap": "sm",
"align": "center",
"justify": "between",
"isWrapped": true
},
"children": [
{
"definition": "tile/row",
"attributes": {
"gap": "sm",
"align": "center"
},
"children": [
{
"definition": "tile/icon",
"attributes": {
"name": "activity",
"size": "xl",
"alt": ""
}
},
{
"definition": "tile/text",
"attributes": {
"text": "{{headerTitle}}",
"variant": "h1"
}
}
]
},
{
"definition": "tile/badge",
"attributes": {
"label": "{{headerStatus}}",
"variant": "error"
}
}
]
},
{
"definition": "tile/text",
"attributes": {
"text": "{{headerSubtitle}}",
"variant": "caption",
"color": "muted"
}
},
{
"definition": "tile/separator"
},
{
"definition": "tile/column",
"attributes": {
"gap": "md"
},
"children": [
{
"definition": "tile/chart",
"attributes": {
"chartType": "line",
"caption": "{{chartCaption}}",
"categories": "{{chartCategories}}",
"series": "{{chartSeries}}",
"valueFormat": "number",
"showValues": false,
"showLegend": false
}
},
{
"definition": "tile/meter",
"attributes": {
"label": "Composite health",
"value": "{{meterValue}}",
"min": 0,
"max": 100,
"target": "{{meterTarget}}",
"valueFormat": "number",
"valueLabel": "{{meterValueLabel}}",
"targetLabel": "{{meterTargetLabel}}",
"status": "{{meterStatus}}",
"size": "lg",
"bands": "{{meterBands}}"
}
}
]
},
{
"definition": "tile/datagrid",
"attributes": {
"caption": "{{gridCaption}}",
"appearance": "striped",
"columns": [
{
"key": "status",
"header": "Status",
"type": "badge"
},
{
"key": "signal",
"header": "Signal",
"type": "text"
},
{
"key": "now",
"header": "Current",
"type": "text",
"align": "right"
},
{
"key": "trend",
"header": "6-wk trend",
"type": "sparkline"
},
{
"key": "note",
"header": "Read",
"type": "text"
}
],
"rows": "{{gridRows}}"
}
},
{
"definition": "tile/callout",
"attributes": {
"variant": "error",
"title": "{{calloutTitle}}",
"description": "{{calloutDescription}}"
},
"children": [
{
"definition": "tile/row",
"attributes": {
"gap": "sm",
"align": "center",
"isWrapped": true
},
"children": [
{
"definition": "tile/button",
"attributes": {
"label": "{{ctaPrimaryLabel}}",
"variant": "primary",
"actions": {
"click": [
{
"definition": "action/sendMessage",
"attributes": {
"content": "{{ctaPrimaryMsg}}"
}
}
]
}
}
},
{
"definition": "tile/button",
"attributes": {
"label": "View in Salesforce",
"iconName": "open-in-new",
"variant": "secondary",
"actions": {
"click": [
{
"definition": "action/openLink",
"attributes": {
"url": "{{accountUrl}}"
}
}
]
}
}
}
]
}
]
}
]
}
}
}
}
display_widget SUCCEEDEDHealth check mode:
# Health: <Account> — 🟢/🟡/🔴
<verdict sentence>
<dimension table with evidence>
## Watch items
- <specific signal, why it matters, suggested action>
## Suggested SFDC updates
- <health/status fields, if grounded> - these live on the Account record: show before/after and confirm before writing, or output as a checklist on a read-only connector
QBR prep mode: add the meeting kit —
expansion-whitespace) and renewal framing (renewal-radar) worth raisingschedule-meeting.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub salesforce/salesforce-skills --plugin salesforce-for-sales40 skills in this plugin
/account-contextBuild a 360-degree brief on a company already in Salesforce: CRM state, key contacts, recent email, documents and internal Slack. Use when asked to tell about, catch up on, or give the full picture on an existing account. Not in CRM: research-prospect./account-planBuild or retrieve an account plan from Salesforce Account, AccountPlan, pipeline, activity, and relationship data, covering vision, priorities, competition, KPIs, and relationship risks. Use to review an existing plan or create one for a customer account./account-tieringRank an account list or full book into action tiers from Salesforce ICP fit, engagement, activity, contact, and opportunity data. Use to score accounts, prioritize coverage, decide where to focus, or identify accounts to activate, qualify, or deprioritize.Other plugins' skills for the same job