/sf-platform:platform-mcp-tool-widget-coordinatefrom Salesforce — Platform & Apex
Orchestrates object-based Custom Lightning Types and HXL widget generation to render the output of a custom MCP server tool backed by an Apex Invocable Action. Coordinates leaf skills in dependency order.
Ships in Salesforce — Platform & Apex. 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.
Coordinate two object-based Custom Lightning Types (CLTs) and an HXL widget to render the output of a custom MCP server tool whose implementation is an Apex @InvocableMethod. This skill never authors content directly — it loads and invokes leaf skills in dependency order, gates progress on user approval, and runs validation gates before reporting completion.
Ownership boundary — this skill owns only:
renderer.json — the one artifact it authors inline, bridging the envelope to the widget.The CLTs are authored by platform-custom-lightning-type-generate, and all widget metadata (schema + body + .uiwidget-meta.xml) is authored and validated by platform-widget-generate. This skill never writes widget metadata and never modifies the Apex class — it supplies each leaf skill its inputs and wires the result together.
Custom MCP server tools backed by an Apex Invocable Action only. The MCP tool returns the platform's invocable-action result envelope — an object with actionName, isSuccess, and an outputValues node that carries the tool's real payload. To render this envelope with a widget, model it as two object-based CLTs (lightning__objectType) of equal standing — the only reason there are two is that one must reference the other by name (a CLT cannot reference itself), so they need distinct deployed names. Name and describe each by what it actually models — never by an invented role-label pair like "Payload CLT"/"Envelope CLT" or "Inner CLT"/"Outer CLT":
<toolApiName>. Its outputValues property is typed to the other CLT via c__<responseCLT> (the CLT-reference prefix — see the namespace note below).@InvocableVariable fields on the @InvocableMethod response class), named <toolApiName>Response — "Response" is not an invented role word; it is the word the Apex source itself uses for that class.The widget grounds on the response fields (flat), and the default renderer.json in the envelope CLT bridges the envelope nesting to the flat widget via {!$attrs.outputValues.<field>}.
Namespace prefix provenance (
c__/@apexClassType/<ns>__…): the Actions REST describe returns bare, unprefixed class names (Outer$Inner) and no namespace — the prefix is the org's CLT namespace, added by this skill. It isc__in a namespace-less org (the common case, used literally throughout this doc) or the package namespace<ns>__in a packaged org (read from the class'sNamespacePrefix; default toconly when the org has none). Everyc__below is this prefix.
Out of scope, route elsewhere:
@apexClassType/..., single CLT, surface-specific renderer) → platform-lightning-type-widget-coordinate.platform-widget-generate.platform-custom-lightning-type-generate / platform-apex-generate.Beta cardinality: the invocable-action result is a bulk array (
content[]). For the beta release this skill models and renders a single response — the first element ofcontent[]. The CLT envelope models one result object, not thecontent[]wrapper.
platform-lightning-type-widget-coordinate| Dimension | agent-action flow (...lightning-type-widget-coordinate) | this MCP-tool flow |
|---|---|---|
| CLT kind | Apex-backed (@apexClassType/...) | Object-based (lightning__objectType) |
| Number of CLTs | one | two (envelope + response) |
| Field source | @AuraEnabled | @InvocableVariable on the top-level response class (referenced inner classes: public/@AuraEnabled — see Hard Rule 6) |
| Renderer location | lightningTypes/<T>/lightningDesktopGenAi/renderer.json (surface-specific) | lightningTypes/<toolCLT>/renderer.json (default, parallel to schema.json) |
| Renderer binding | flat {!$attrs.<field>} | nested {!$attrs.outputValues.<field>} |
| Phase | Purpose | Output |
|---|---|---|
| 1 — Input selection | Determine the payload source: an invocable action API name (preferred), an Apex Invocable class, or a pasted tool-output JSON sample. | source (action | apex | sample), tool API name |
| 2 — Payload discovery | Describe the invocable action via the Actions REST API and read its typed outputs (or parse the response class from source, or outputValues from the sample). | payloadFields (name + lightning:type) |
| 3 — Build plan | Print the plan in full; proceed unless the next reply explicitly pushes back. | printed plan |
| 4 — Generation | Load and invoke leaf skills: response CLT → envelope CLT → widget → inline default renderer in the envelope CLT. | files written |
| 5 — Validation | Run hard gates (block) and warn gates (advisory). | gate report |
| 6 — Summary | Files, validations, deploy order, preview readiness. | summary |
Per-phase pattern: load the skill fresh → execute its workflow → verify outputs → checkpoint before the next phase. Even if you remember a leaf skill's content, skills evolve — always load fresh.
Determine where the payload shape comes from. Prefer the sources top-to-bottom:
| Source | Trigger | Phase 2 action |
|---|---|---|
action | Prompt gives an invocable action API name — directly, or via an Apex class name that resolves to one — AND an authenticated org is available. Preferred. | Describe the action via the Actions REST API and read its typed outputs. |
sample | No reachable org (or the describe 404s), but a pasted tool-output JSON sample is available. | Parse the outputValues object from the sample. |
apex | Only the Apex class is available (no action name resolvable, no reachable org, no sample) — fallback only, may be stale relative to what's deployed. | Resolve the response class and enumerate @InvocableVariable fields. |
Capture the tool API name (used to name all artifacts — see the naming convention below).
Source priority: live/authoritative schema sources beat parsing a local class, which beats a pasted example. In order:
action if an action API name and an authenticated org are available. The Actions REST API describe is the same schema the platform itself exposes, so it needs no request/helper filtering and gives real field types.sample if a runtime JSON sample is pasted (runtime response — explicit and current).apex if an Apex class exists locally AND none of the above apply (fallback only — may be stale relative to what's actually deployed behind the action).If none are available, STOP and ask the user for an action name, a class, a sample, or a schema.
FIRST Read references/mcp-tool-output-discovery.md (REQUIRED — do NOT run Phase 2 from this summary alone), then execute the procedure for the chosen source. The reference is authoritative for the full per-source procedures, the field-type mapping tables, and the nested/list handling; the pointers below are only a map to it:
action (preferred): describe via sf api request rest '/services/data/v<APIVER>/actions/custom/apex/<ActionApiName>' -o <org>; use the outputs array only (ignore inputs — the request wrapper); map each type → CLT lightning:type case-insensitively. An entry with "type": null and an "apexClass": "<Outer>$<Inner>" key is an Apex-class-typed field (not a describe gap): maxOccurs: 1 → single nested object, maxOccurs > 1 → top-level list. If the describe 404s, fall back to sample then apex.apex (fallback): locate the class, identify the response class (the @InvocableMethod return List<...> element type), enumerate its @InvocableVariable fields (exclude the request class and private helpers), map Apex type → CLT type.sample (fallback): parse the outputValues object; infer each field's lightning:type from its JSON value.Nested-object and list fields (every source, additive to the flat-primitive case): a field typed as another Apex class — a single object (maxOccurs: 1), a top-level list (maxOccurs > 1), or a list inside a wrapper object (the describe returns one maxOccurs: 1 apexClass output and hides the interior list) — is in scope and is never modeled as a bare {"type":"object"} or an inlined lightning__objectType. Type it @apexClassType/c__<Outer>$<Inner> in the response CLT (never a CLT-level lightning__listType/items), enumerate a referenced/inner class by its public / @AuraEnabled members (Hard Rule 6), and recurse when a leaf is itself a class. The CLT typing and renderer binding depth per shape live in references/mcp-tool-output-discovery.md and references/two-clt-modeling.md ("Top-level list vs list-inside-wrapper") — also Hard Rules 4, 6, 14 — and the examples/nested-object-*-source-prompt.md walkthroughs.
Capture payloadFields — the ordered list of { name, title, lightning:type } that defines the response CLT and the widget schema. Record which source produced it in the build plan.
Staleness: do NOT maintain a cross-session cache. Read the local project fresh and re-retrieve from the org per session.
Print a build plan using the template in references/build-plan-format.md. The plan must list:
PLAN: line).actionName (text), isSuccess (boolean), and outputValues (typed c__<responseCLT>, the load-bearing field the renderer bridges through) — actionName/isSuccess are envelope-only and never appear on the widget (Hard Rule 5) — plus the response fields the response CLT + widget will carry.Print the plan in full, then proceed unless the user's next reply explicitly pushes back. Explicit pushback = no, stop, wait, change X, use Y instead, or an equivalent rejection / revision request. Explicit approval is welcome but NOT required — silence, an unrelated follow-up, or the natural continuation of a single-turn eval all count as implicit approval. The invariant is the plan being visible in the transcript. If pushback arrives, revise and re-print before moving on.
Load and invoke leaf skills in this order. For each: load the skill, execute its workflow against the Phase 3 spec, verify the outputs, checkpoint before the next.
Response CLT — load platform-custom-lightning-type-generate. Author an object-based CLT <responseCLT> (convention: <toolApiName>Response) whose properties are the payloadFields from Phase 2. Root is lightning__objectType, with root-level "lightning:tags": ["mcp"].
outputs[] names (or, for apex/sample, the response class's @InvocableVariable fields — the same set the describe would surface). A describe with N sibling outputs → N flat properties; a describe with one output → one property named after that output. A single-property CLT is correct only when the describe itself returns a single output.action source — the response-class name never appears in outputs[]. Each response CLT property name must trace to a describe output name (see field-trace / clt-reference-integrity).@apexClassType/c__<Outer>$<ElementClass>), not wrapped — see "List of nested objects" above.Envelope CLT — load platform-custom-lightning-type-generate. Author an object-based CLT <toolCLT> (convention: <toolApiName>, the envelope), also with root-level "lightning:tags": ["mcp"], and:
actionName → lightning__textTypeisSuccess → lightning__booleanTypeoutputValues → c__<responseCLT> (the referenced-CLT pattern; the response CLT must be deployed before the envelope CLT)Widget — load platform-widget-generate. Author a flat widget whose schema.json properties are the payloadFields (name + primitive type) — a standalone widget contract, not derived from or coupled to any Lightning Type. It renders only outputValues data fields: never actionName/isSuccess (envelope-only). The widget body binds each field via {!$attrs.<field>} — the widget is envelope-agnostic and never references outputValues itself.
Default renderer (authored inline in the ENVELOPE CLT — never optional). FIRST Read platform-custom-lightning-type-generate/references/widget-rendition.md (REQUIRED — do NOT author from memory or copy an existing sample, which may use a deprecated shape). Then author <pkgDir>/lightningTypes/<toolCLT>/renderer.json — the default renderer, at the bundle root, parallel to schema.json (NOT under lightningDesktopGenAi/). Its renderer.componentOverrides["$"] sets definition to @widget/c/<widgetName> and maps every widget schema property to the matching payload field nested under the envelope's outputValues node via {!$attrs.outputValues.<payloadField>} — the nested binding that bridges the envelope CLT to the flat widget. Do NOT duplicate the widget body inside renderer.json. The worked JSON is in references/two-clt-modeling.md.
Existing-renderer handling: if renderer.json already exists at the target path, read it first. If it references the same widget with the same bindings, leave it. If it references a different widget or a custom-LWC root override (c/<component>), STOP and surface the conflict before overwriting.
Read references/validation-gates.md (REQUIRED — it holds the RUN procedure and exact pass/fail predicates for each gate) and run every gate. Widget-bundle-internal checks (schema parse, root keys, leaf types, {!$attrs.X} resolution, .uiwidget-meta.xml well-formedness) are owned by platform-widget-generate and run in its own self-validation.
Hard — block on failure:
clt-reference-integrity — envelope outputValues typed c__<responseCLT>, the response CLT exists and both parse, no $schema/items, every non-primitive response property an @apexClassType/... reference (never a bare object or CLT-level lightning__listType).renderer-wires-widget — the bundle-root renderer.json wires @widget/c/<widgetName> and binds every widget property under outputValues at the depth the describe dictates (two segments for a top-level primitive or list output, three for a leaf/list inside a wrapper object). Bidirectional: missing or extra bindings both fail.nested-list-coverage — every nested-object and list field discovered in Phase 2 is rendered by the widget and bound at the correct depth. "Out of scope" / "beta single-response" are NOT valid drop rationales.Warn — advisory:
field-trace — RUN the trace in references/validation-gates.md: enumerate response fields, jq the widget schema keys, classify INVENTED vs OMITTED. Invented widget fields fail; an omitted response data field warns.Report each gate result by name in Phase 6 (pass, fail (<reason>), warn (<reason>), not run). Do not summarize as "all passed". This skill produces metadata only — it does not deploy; deployment is the caller's responsibility.
MCP Tool Widget Build Complete: <widgetName>
FILES GENERATED:
Response CLT:
<pkgDir>/lightningTypes/<responseCLT>/schema.json
Envelope CLT:
<pkgDir>/lightningTypes/<toolCLT>/schema.json
<pkgDir>/lightningTypes/<toolCLT>/renderer.json # default renderer — wires the widget
Widget bundle:
<pkgDir>/uiWidgets/<widgetName>/<widgetName>.json
<pkgDir>/uiWidgets/<widgetName>/schema.json
<pkgDir>/uiWidgets/<widgetName>/<widgetName>.uiwidget-meta.xml
VALIDATIONS:
widget self-validation (platform-widget-generate gates): <pass | fail — see sub-skill report>
clt-reference-integrity (envelope.outputValues → c__<responseCLT>; nested → @apexClassType): <pass | fail (<reason>)>
renderer-wires-widget (nested {!$attrs.outputValues.X} bindings): <pass | fail (<reason>)>
nested-list-coverage (every discovered nested/list field rendered): <pass | fail (<reason>)>
field-trace (INVENTED + OMITTED lists printed): <pass | warn (<reason>) | fail (invented: <list>)>
outputValues is typed via c__<responseCLT>, never inlined as a nested lightning__objectType. Both CLTs carry root-level "lightning:tags": ["mcp"] (see platform-custom-lightning-type-generate/assets/primitive-types-and-constraints.md).lightningTypes/<toolCLT>/renderer.json — the default renderer, parallel to schema.json. Never lightningDesktopGenAi/renderer.json (that is the agent-action flow's surface-specific path), never in the response CLT.{!$attrs.outputValues.<field>}, not {!$attrs.<field>}. The widget schema stays flat; the renderer does the bridging.outputValues) fields. The widget never references actionName or isSuccess — those are envelope-only fields on the envelope CLT.@InvocableVariable — the describe surfaces exactly those fields, so a top-level field carrying only @AuraEnabled (or no annotation) is correctly not an output; enumerate the top-level response class by @InvocableVariable and exclude the request class and private helper classes. An inner/referenced class reached via @apexClassType/<ns>__<Outer>$<Inner> is enumerated by its public / @AuraEnabled members instead — its leaves are never in the describe and @InvocableVariable is not used there, so grepping it for @InvocableVariable yields zero leaves (empty CLT + widget).@InvocableVariable outputs plus the public/@AuraEnabled leaves of any referenced inner class — never a property no class exposes. field-trace prints both lists.content[] bulk wrapper.pass without executing a gate is a hard violation; report not run instead.Bash tool call emitted by this orchestrator and by any leaf skill it invokes, do NOT use command substitution ($(…) or backticks), process substitution (<(…), >(…)), brace expansion ({a,b,c} or {1..N}), or eval / exec. These force manual approval even under Bypass mode and stall the eval. Run separate commands (mkdir -p a && mkdir -p b), print each intermediate value with its own command and reason about the result, and use plain shell variables (X=literal) or here-strings when a value must be reused.action schema from the Actions REST API describe, never from raw HTTP to the MCP endpoint or from credential extraction. Use sf api request rest against the org's Actions REST API (which uses the existing sf org auth). Never read a4d_mcp_settings.json or any MCP settings file, never extract an org access token, never curl an MCP server endpoint directly — that requires credentials the session doesn't have and targets a URL the runtime doesn't actually expose that way.sample instead of invoking anything.{"type":"object"}. Type it @apexClassType/<ns>__<OuterClass>$<InnerClass> in the response CLT, flatten to its leaf fields in the widget, and bind the renderer two levels deep ({!$attrs.outputValues.<objectField>.<leaf>}). This is additive to the flat-primitive case (Hard Rule 5), not a replacement for it — see references/two-clt-modeling.md.| File | When to read |
|---|---|
references/mcp-tool-output-discovery.md | Phase 2 — the three sources, field enumeration, and type mapping. |
references/two-clt-modeling.md | Phase 4 — envelope + response CLTs, the nested renderer binding, naming convention, and nested-object handling. |
references/build-plan-format.md | Phase 3 — plan template. |
references/validation-gates.md | Phase 5 — full hard / warn gate table with RUN procedures. |
examples/action-name-source-prompt.md | Phase 3 — walkthrough from an invocable action API name (preferred). |
examples/apex-invocable-source-prompt.md | Phase 3 — walkthrough from an Apex Invocable class (fallback). |
examples/pasted-tool-output-prompt.md | Phase 3 — walkthrough from a pasted tool-output sample (fallback). |
examples/nested-object-single-source-prompt.md | Phase 3 — single Apex-class-reference payload field. |
examples/nested-object-list-source-prompt.md | Phase 3 — top-level list and list-inside-wrapper. |
examples/action-name-source-prompt.md (opens in a new tab)examples/apex-invocable-source-prompt.md (opens in a new tab)examples/nested-object-list-source-prompt.md (opens in a new tab)examples/nested-object-single-source-prompt.md (opens in a new tab)examples/pasted-tool-output-prompt.md (opens in a new tab)references/build-plan-format.md (opens in a new tab)references/mcp-tool-output-discovery.md (opens in a new tab)references/two-clt-modeling.md (opens in a new tab)references/validation-gates.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub reej-consulting/reej-sf-skills --plugin sf-platform43 skills in this plugin
/crm-analytics-wave-generateUse to build a Wave Recipe, deploy a CRM Analytics dataset or dashboard, or author the full CRMA asset stack — apps, Wave Recipes (.wdpr), datasets, and dashboards — against a connected Salesforce org via REST and Metadata APIs, without CRM Analytics Studio or Dashboard Builder. TRIGGER when: user asks to build or create a Wave Recipe, generate a .wdpr or .wdpr-meta.xml, deploy a .wdash or .wapp, run a recipe or dataflowjob programmatically, upload CSV data via InsightsExternalData, validate a dataset schema with synthetic data, fetch dataset XMD, audit dashboard SAQL re-encoding, or find unused dataset fields. TRIGGER on keywords: Wave Recipe, CRMA, CRM Analytics, wdpr, wdash, wapp, WaveRecipe, Wave dataflow, dataflowjob, InsightsExternalData, SAQL, dataset XMD, Analytics Studio, R3 format, wave/recipes, wave/dashboards, or analytics on Salesforce objects (opportunities, leads, cases, accounts, sales). DO NOT TRIGGER for standard Salesforce reports or LWC components unrelated to CRM Analytics./design-systems-slds2-migrateMigrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or styling hook selection. Covers all styling hook categories — color, spacing, sizing, typography, borders, radius, and shadows. Also use when users mention no-hardcoded-values, no-slds-class-overrides, lwc-to-slds-hooks, no-deprecated-tokens-slds1, or ask about SLDS component migration — even if they don't explicitly say "uplift" or "migration"./design-systems-slds-validateAudit Lightning Web Components for SLDS design-system compliance and produce a scored quality report. Runs the SLDS linter and analyzes CSS for theming hook usage and pairing, scoring SLDS findings across categories into an overall grade. Use when asked to "score my component's SLDS", "SLDS scorecard", "SLDS quality report", "audit SLDS compliance", "how good is my SLDS", "check SLDS quality", "rate my SLDS styling", "evaluate my component's SLDS", "is this component's SLDS ready to ship?", "look at my LWC for SLDS issues", "audit SLDS before I submit", "review my component's SLDS before code review", or any time a user wants an SLDS quality assessment or SLDS production-readiness check on an LWC. Not for fixing violations (use design-systems-slds2-migrate), building new components (use design-systems-slds-apply), or accessibility/WCAG/ARIA audits (use experience-accessibility-validate)./dx-apexguru-scanRun an ApexGuru performance scan on a Salesforce Apex project via the ApexGuru SFAP Scan API. Zips the project's Apex (any layout), submits it, polls to completion, decodes the base64 report, and presents performance antipattern violations (SOQL in loop, DML in loop, Schema.getGlobalDescribe(), SOQL without WHERE/LIMIT, unused SOQL fields) grouped by rule with severity, file:line, and suggested fixes — clearly attributed as 'Static only' or 'Production insights'. TRIGGER when the user says 'run ApexGuru', 'ApexGuru scan', 'check Apex performance', 'find governor-limit / performance antipatterns', 'SOQL in loop', 'scan my Apex for performance', or 'ApexGuru performance insights'. DO NOT TRIGGER for general static analysis or security scans (use dx-code-analyzer-run), for fixing code without scanning, or for onboarding an org to ApexGuru./dx-code-analyzer-configureSet up, configure, and troubleshoot Salesforce Code Analyzer for any project. Handles installation, prerequisite checks, diagnosing broken setups, creating and editing code-analyzer.yml overrides, engine-specific settings, ignore patterns, severity overrides, and CI/CD pipeline setup. TRIGGER when: user says 'set up code analyzer', 'configure code analyzer', 'install code analyzer', 'code analyzer not working', 'fix my setup', 'scan failing', 'check my setup', 'enable/disable engine', 'exclude files', 'change severity', 'set up GitHub Actions', 'set up CI/CD', 'add to pipeline', 'pipeline fail', 'update my workflow', 'quality gate', 'fail on violations', 'scan changed files only', 'add SARIF', 'code-analyzer.yml', 'ESLint config', 'increase SFGE memory', or reports errors running Code Analyzer. DO NOT TRIGGER when: user wants to run a scan (use dx-code-analyzer-run), fix violations, explain rules, create custom rules (use dx-code-analyzer-custom-rule-create), or suppress violations./dx-code-analyzer-custom-rule-createCreate custom Code Analyzer rules for Regex (pattern matching), PMD (XPath/AST for Apex and metadata XML), and ESLint (LWC/JavaScript/TypeScript). Use when users want to enforce coding standards, ban patterns, detect hardcoded values, govern metadata, or add rules not in the built-in set. TRIGGER when: user says 'create a rule', 'ban System.debug', 'enforce naming convention', 'detect hardcoded IDs', 'custom rule', 'xpath rule', 'regex rule', 'add a PMD rule', 'enforce a policy', 'create a check for', 'flag this pattern', 'make a rule that catches', 'metadata rule', 'check permissions', 'enforce API version', 'eslint rule', 'lwc rule', 'override rule threshold', 'customize complexity', or describes a pattern to enforce. DO NOT TRIGGER when: user wants to run a scan (use dx-code-analyzer-run), configure engines (use dx-code-analyzer-configure), or explain existing rules (use dx-code-analyzer-run).3 plugins in 2 repositories ship this exact skill · first indexed Aug 23, 2026
Other plugins' skills for the same job