@salesforce/afv-skills 1.33.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-architecture-analyze/SKILL.md +8 -0
  3. package/skills/agentforce-bot-upgrade/SKILL.md +0 -2
  4. package/skills/agentforce-d360-analyze/SKILL.md +8 -0
  5. package/skills/agentforce-observe/SKILL.md +3 -0
  6. package/skills/agentforce-test/SKILL.md +3 -0
  7. package/skills/automation-flow-generate/SKILL.md +1 -0
  8. package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +239 -0
  9. package/skills/automation-sandbox-post-copy-config-generate/assets/config_template.json +21 -0
  10. package/skills/automation-sandbox-post-copy-config-generate/assets/json_schema.json +90 -0
  11. package/skills/automation-sandbox-post-copy-config-generate/examples/sample_sop_excerpt.md +31 -0
  12. package/skills/automation-sandbox-post-copy-config-generate/examples/sample_sop_to_config.json +50 -0
  13. package/skills/automation-sandbox-post-copy-config-generate/references/configuration_catalog.md +76 -0
  14. package/skills/automation-sandbox-post-copy-config-generate/references/sop_parsing_patterns.md +157 -0
  15. package/skills/automation-sandbox-post-copy-config-generate/references/source_format_handling.md +230 -0
  16. package/skills/commerce-b2b-open-code-components-integrate/SKILL.md +8 -0
  17. package/skills/commerce-b2b-open-code-components-replace/SKILL.md +2 -0
  18. package/skills/commerce-b2b-store-create/SKILL.md +4 -1
  19. package/skills/data360-activate/SKILL.md +12 -0
  20. package/skills/data360-code-extension-generate/SKILL.md +6 -6
  21. package/skills/data360-connect/SKILL.md +11 -0
  22. package/skills/data360-harmonize/SKILL.md +11 -0
  23. package/skills/data360-orchestrate/SKILL.md +30 -0
  24. package/skills/data360-prepare/SKILL.md +14 -0
  25. package/skills/data360-query/SKILL.md +10 -0
  26. package/skills/data360-schema-get/SKILL.md +7 -0
  27. package/skills/data360-segment/SKILL.md +11 -0
  28. package/skills/design-systems-slds-validate/SKILL.md +8 -0
  29. package/skills/design-systems-slds2-migrate/SKILL.md +3 -0
  30. package/skills/dx-apexguru-scan/SKILL.md +403 -0
  31. package/skills/dx-apexguru-scan/examples/README.md +54 -0
  32. package/skills/dx-apexguru-scan/examples/sample-decoded-summary.json +176 -0
  33. package/skills/dx-apexguru-scan/examples/sample-full-no-runtime-response.json +26 -0
  34. package/skills/dx-apexguru-scan/examples/sample-succeeded-response.json +15 -0
  35. package/skills/dx-apexguru-scan/references/api-reference.md +81 -0
  36. package/skills/dx-apexguru-scan/references/authentication.md +134 -0
  37. package/skills/dx-apexguru-scan/references/error-handling.md +56 -0
  38. package/skills/dx-apexguru-scan/references/violation-catalog.md +28 -0
  39. package/skills/dx-apexguru-scan/scripts/build-zip.sh +87 -0
  40. package/skills/dx-apexguru-scan/scripts/decode-report.js +389 -0
  41. package/skills/dx-apexguru-scan/scripts/resolve-token.sh +151 -0
  42. package/skills/dx-apexguru-scan/scripts/run-scan.sh +153 -0
  43. package/skills/dx-apexguru-scan/scripts/scan.sh +96 -0
  44. package/skills/dx-apexguru-scan/scripts/validate-token.js +121 -0
  45. package/skills/dx-app-analytics-query/SKILL.md +5 -0
  46. package/skills/dx-code-analyzer-configure/SKILL.md +5 -5
  47. package/skills/dx-code-analyzer-custom-rule-create/SKILL.md +3 -1
  48. package/skills/dx-code-analyzer-run/SKILL.md +10 -2
  49. package/skills/dx-devops-pipeline-manage/SKILL.md +263 -0
  50. package/skills/dx-devops-pipeline-manage/examples/common-workflows.md +177 -0
  51. package/skills/dx-devops-pipeline-manage/references/cli-commands.md +298 -0
  52. package/skills/dx-devops-pipeline-manage/references/parsing-patterns.md +134 -0
  53. package/skills/dx-devops-pipeline-manage/scripts/check-activation-ready.sh +34 -0
  54. package/skills/dx-devops-pipeline-manage/scripts/validate-org-type.sh +17 -0
  55. package/skills/dx-devops-pipeline-manage/scripts/verify-operation.sh +82 -0
  56. package/skills/dx-devops-promote/SKILL.md +214 -0
  57. package/skills/dx-devops-promote/examples/promotion-workflows.md +212 -0
  58. package/skills/dx-devops-promote/references/cli-commands.md +303 -0
  59. package/skills/dx-devops-test-failures-analyze/SKILL.md +8 -0
  60. package/skills/dx-devops-test-pipeline-configure/SKILL.md +7 -0
  61. package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +9 -0
  62. package/skills/dx-devops-test-suite-run/SKILL.md +8 -0
  63. package/skills/dx-org-switch/SKILL.md +3 -0
  64. package/skills/experience-lwc-base-components-integrate/SKILL.md +176 -0
  65. package/skills/experience-lwc-base-components-integrate/references/lbc-expert-guidance.md +127 -0
  66. package/skills/experience-lwc-base-components-integrate/references/lightning-component-index.md +179 -0
  67. package/skills/experience-lwc-base-components-integrate/references/lightning-components.md +5429 -0
  68. package/skills/experience-lwc-base-components-integrate/scripts/extract-component-docs.sh +61 -0
  69. package/skills/experience-lwc-generate/SKILL.md +18 -0
  70. package/skills/experience-lwc-rtl-validate/SKILL.md +149 -0
  71. package/skills/experience-lwc-rtl-validate/references/rtl-expert.md +892 -0
  72. package/skills/experience-lwc-rtl-validate/scripts/scan-rtl-css.sh +206 -0
  73. package/skills/experience-lwc-typescript-migrate/SKILL.md +207 -0
  74. package/skills/experience-lwc-typescript-migrate/assets/dts-template.ts +15 -0
  75. package/skills/experience-lwc-typescript-migrate/assets/type-patterns.ts +44 -0
  76. package/skills/experience-lwc-typescript-migrate/scripts/find-consumers.sh +128 -0
  77. package/skills/experience-lwr-site-generate/SKILL.md +1 -1
  78. package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +5 -2
  79. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +1 -1
  80. package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +5 -0
  81. package/skills/experience-ui-bundle-localize/SKILL.md +323 -0
  82. package/skills/experience-ui-bundle-localize/references/gotchas.md +249 -0
  83. package/skills/experience-ui-bundle-localize/references/i18n-setup.md +169 -0
  84. package/skills/experience-ui-bundle-localize/references/interpolation.md +311 -0
  85. package/skills/experience-ui-bundle-localize/references/label-xml.md +282 -0
  86. package/skills/experience-ui-bundle-localize/references/verifying.md +219 -0
  87. package/skills/experience-ui-bundle-localize/scripts/check-i18n-wired.sh +195 -0
  88. package/skills/experience-ui-bundle-localize/scripts/check-manifest-registered.sh +100 -0
  89. package/skills/experience-ui-bundle-localize/scripts/check-org-api-version.sh +40 -0
  90. package/skills/experience-ui-bundle-localize/scripts/detect-bundle-type.sh +57 -0
  91. package/skills/experience-ui-bundle-metadata-generate/SKILL.md +1 -1
  92. package/skills/experience-ui-bundle-project-generate/SKILL.md +4 -4
  93. package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +11 -0
  94. package/skills/external-diagram-mermaid-generate/SKILL.md +21 -0
  95. package/skills/integration-connectivity-generate/SKILL.md +17 -0
  96. package/skills/integration-eventing-cdc-configure/SKILL.md +9 -0
  97. package/skills/integration-eventing-subscription-configure/SKILL.md +7 -0
  98. package/skills/mobile-apps-create/SKILL.md +5 -0
  99. package/skills/mobile-platform-native-capabilities-integrate/SKILL.md +3 -0
  100. package/skills/mobile-platform-offline-validate/SKILL.md +9 -0
  101. package/skills/omnistudio-callable-apex-generate/SKILL.md +14 -0
  102. package/skills/omnistudio-datamapper-generate/SKILL.md +13 -0
  103. package/skills/omnistudio-datapacks-deploy/SKILL.md +18 -0
  104. package/skills/omnistudio-dependencies-analyze/SKILL.md +12 -0
  105. package/skills/omnistudio-epc-catalog-generate/SKILL.md +15 -0
  106. package/skills/omnistudio-flexcard-generate/SKILL.md +11 -0
  107. package/skills/omnistudio-integration-procedure-generate/SKILL.md +11 -0
  108. package/skills/omnistudio-omniscript-generate/SKILL.md +9 -0
  109. package/skills/platform-agentexchange-partner-offers-configure/SKILL.md +8 -0
  110. package/skills/platform-agentsetup-categories-fetch/SKILL.md +3 -0
  111. package/skills/platform-apex-generate/SKILL.md +5 -0
  112. package/skills/platform-apex-logs-debug/SKILL.md +12 -0
  113. package/skills/platform-apex-test-generate/SKILL.md +5 -0
  114. package/skills/platform-apex-test-run/SKILL.md +14 -0
  115. package/skills/platform-custom-application-generate/SKILL.md +1 -0
  116. package/skills/platform-custom-field-generate/SKILL.md +1 -1
  117. package/skills/platform-custom-lightning-type-generate/SKILL.md +3 -0
  118. package/skills/platform-custom-lightning-type-generate/assets/primitive-types-and-constraints.md +1 -1
  119. package/skills/platform-custom-tab-generate/SKILL.md +1 -0
  120. package/skills/platform-data-manage/SKILL.md +15 -0
  121. package/skills/platform-dataspace-access-configure/SKILL.md +2 -2
  122. package/skills/platform-flexipage-generate/SKILL.md +3 -0
  123. package/skills/platform-lightning-app-coordinate/SKILL.md +18 -1
  124. package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +250 -0
  125. package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +74 -0
  126. package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +90 -0
  127. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +191 -0
  128. package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +85 -0
  129. package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +74 -0
  130. package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +184 -0
  131. package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +128 -0
  132. package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +181 -0
  133. package/skills/platform-metadata-api-context-get/SKILL.md +6 -2
  134. package/skills/platform-metadata-retrieve/SKILL.md +5 -0
  135. package/skills/platform-models-api-configure/SKILL.md +10 -0
  136. package/skills/platform-permission-set-generate/SKILL.md +1 -2
  137. package/skills/platform-policy-rule-generate/SKILL.md +2 -0
  138. package/skills/platform-report-generate/SKILL.md +1 -1
  139. package/skills/platform-sharing-rules-generate/SKILL.md +1 -1
  140. package/skills/platform-soql-query/SKILL.md +13 -0
  141. package/skills/platform-tracing-agentforce-configure/SKILL.md +5 -1
  142. package/skills/platform-tracing-configure/SKILL.md +4 -1
  143. package/skills/platform-trust-archive-manage/SKILL.md +3 -0
  144. package/skills/platform-validation-rule-generate/SKILL.md +1 -0
  145. package/skills/platform-widget-generate/SKILL.md +2 -1
  146. package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +3 -1
@@ -0,0 +1,74 @@
1
+ # Example: Invocable action name source (preferred)
2
+
3
+ A complete walkthrough when the user gives only the **invocable action API name** and the action is deployed to a reachable org (`source = action`). No `.cls` parsing — the Actions REST API describes the typed outputs directly.
4
+
5
+ ## The prompt
6
+
7
+ > My custom MCP server has a GetAccountSummary tool backed by the `GetAccountSummaryTest` invocable action in my org. Build a widget that renders its output as a rich account card.
8
+
9
+ ## Phase 1 — Input selection
10
+
11
+ - Source: `action` (prompt gives an action API name; an authenticated org is available).
12
+ - Tool API name: `getAccountSummary` (camelCase of the tool / action label).
13
+ - Action API name: `GetAccountSummaryTest` (the Apex class declaring `@InvocableMethod`).
14
+
15
+ ## Phase 2 — Payload discovery
16
+
17
+ Read `references/mcp-tool-output-discovery.md`, then describe the action:
18
+
19
+ ```bash
20
+ sf api request rest '/services/data/v63.0/actions/custom/apex/GetAccountSummaryTest' -o myOrg
21
+ ```
22
+
23
+ Read the `outputs` array (ignore `inputs` — that is `accountId`, the tool input). Map each `type`:
24
+
25
+ | output `name` | Actions API `type` | CLT `lightning:type` |
26
+ |---|---|---|
27
+ | status | STRING | `lightning__textType` |
28
+ | message | STRING | `lightning__textType` |
29
+ | accountId | ID | `lightning__textType` |
30
+ | accountName | STRING | `lightning__textType` |
31
+ | accountDescription | STRING | `lightning__textType` |
32
+ | accountIndustry | STRING | `lightning__textType` |
33
+ | accountPhone | STRING | `lightning__textType` |
34
+ | accountWebsite | STRING | `lightning__textType` |
35
+ | contactCount | INTEGER | `lightning__integerType` |
36
+ | opportunityCount | INTEGER | `lightning__integerType` |
37
+ | largestOpportunityId | ID | `lightning__textType` |
38
+ | largestOpportunityName | STRING | `lightning__textType` |
39
+ | largestOpportunityAmount | DOUBLE | `lightning__numberType` |
40
+ | totalOpportunityAmount | DOUBLE | `lightning__numberType` |
41
+
42
+ `payloadFields` = the 14 rows above — identical to what the `apex` source would enumerate, but resolved from the live org without parsing source or filtering the request/helper classes.
43
+
44
+ > If any output had `maxOccurs > 1`, it would be a list — flag it in the plan (beta renders a single response).
45
+
46
+ ## Phase 3 — Build plan (abridged)
47
+
48
+ ```text
49
+ MCP Tool Widget Build Plan: getAccountSummaryWidget
50
+
51
+ PLAN: Render the GetAccountSummary MCP tool output as an account-summary card.
52
+
53
+ TOOL / SOURCE:
54
+ Tool API name: getAccountSummary
55
+ Payload source: action: Actions REST describe of GetAccountSummaryTest
56
+
57
+ LIGHTNING TYPES:
58
+ Response CLT: getAccountSummaryResponse
59
+ Envelope CLT: getAccountSummary
60
+ Renderer (default, bundle root): .../lightningTypes/getAccountSummary/renderer.json
61
+ Envelope: actionName (text), isSuccess (boolean), outputValues (c__getAccountSummaryResponse)
62
+
63
+ WIDGET: getAccountSummaryWidget
64
+ Renderer binding: each attribute → {!$attrs.outputValues.<field>}
65
+ Properties omitted: status, message
66
+
67
+ GENERATION ORDER: response CLT → widget → envelope CLT
68
+ ```
69
+
70
+ Proceed unless the next reply pushes back.
71
+
72
+ ## Phases 4–5
73
+
74
+ Generation and validation are identical to the `apex` walkthrough (`apex-invocable-source-prompt.md`), since both produce the same `payloadFields`. In `field-trace`, `INVOCABLE_FIELDS` comes from `jq -r '.outputs[].name'` on the describe rather than a `grep` of the `.cls`.
@@ -0,0 +1,90 @@
1
+ # Example: Apex Invocable source
2
+
3
+ A complete walkthrough of the flow when the payload source is an Apex `@InvocableMethod` class that already exists in the project (`source = apex`). This is the fallback source — when the action is deployed to a reachable org, prefer `action` (describe it by name via the Actions REST API; see `action-name-source-prompt.md`). Use `apex` when no org is reachable or the describe 404s.
4
+
5
+ ## The prompt
6
+
7
+ > I have an MCP server tool backed by the `GetAccountSummaryTest` Apex invocable action. Build a widget that renders its output so the account summary shows up as a rich card.
8
+
9
+ ## Phase 1 — Input selection
10
+
11
+ - Source: `apex` (the prompt names an Apex Invocable class).
12
+ - Tool API name: `getAccountSummary` (from the class / invocable label `Get Account Summary`).
13
+
14
+ ## Phase 2 — Payload discovery
15
+
16
+ Read `references/mcp-tool-output-discovery.md`, then locate `.../classes/GetAccountSummaryTest.cls`.
17
+
18
+ The invocable method:
19
+
20
+ ```apex
21
+ @InvocableMethod(label='Get Account Summary')
22
+ global static List<GetAccountSummaryResponse> getAccountSummary(
23
+ List<GetAccountSummaryRequest> requests
24
+ ) { ... }
25
+ ```
26
+
27
+ - Response class = `GetAccountSummaryResponse` (the `List<...>` element type) → **payload source**.
28
+ - Request class = `GetAccountSummaryRequest` → excluded (tool input).
29
+ - `private class OpportunityMetrics` → excluded (internal helper, not part of the invocable schema).
30
+
31
+ Enumerate `@InvocableVariable` fields on `GetAccountSummaryResponse` and map to CLT types:
32
+
33
+ | Field | Apex type | CLT `lightning:type` |
34
+ |---|---|---|
35
+ | status | String | `lightning__textType` |
36
+ | message | String | `lightning__textType` |
37
+ | accountId | Id | `lightning__textType` |
38
+ | accountName | String | `lightning__textType` |
39
+ | accountDescription | String | `lightning__textType` |
40
+ | accountIndustry | String | `lightning__textType` |
41
+ | accountPhone | String | `lightning__textType` |
42
+ | accountWebsite | String | `lightning__textType` |
43
+ | contactCount | Integer | `lightning__integerType` |
44
+ | opportunityCount | Integer | `lightning__integerType` |
45
+ | largestOpportunityId | Id | `lightning__textType` |
46
+ | largestOpportunityName | String | `lightning__textType` |
47
+ | largestOpportunityAmount | Decimal | `lightning__numberType` |
48
+ | totalOpportunityAmount | Decimal | `lightning__numberType` |
49
+
50
+ `payloadFields` = the 14 rows above.
51
+
52
+ ## Phase 3 — Build plan (abridged)
53
+
54
+ ```text
55
+ MCP Tool Widget Build Plan: getAccountSummaryWidget
56
+
57
+ PLAN: Render the GetAccountSummary MCP tool output as an account-summary card.
58
+
59
+ TOOL / SOURCE:
60
+ Tool API name: getAccountSummary
61
+ Payload source: Apex Invocable class GetAccountSummaryTest
62
+ Response class FQN: GetAccountSummaryTest.GetAccountSummaryResponse
63
+
64
+ LIGHTNING TYPES:
65
+ Response CLT: getAccountSummaryResponse (14 payload properties)
66
+ Envelope CLT: getAccountSummary
67
+ Renderer (default, bundle root): .../lightningTypes/getAccountSummary/renderer.json
68
+ Envelope: actionName (text), isSuccess (boolean), outputValues (c__getAccountSummaryResponse)
69
+
70
+ WIDGET: getAccountSummaryWidget
71
+ Renderer binding: each attribute → {!$attrs.outputValues.<field>}
72
+ Properties omitted: status, message (envelope-status text, not rendered on the card)
73
+
74
+ GENERATION ORDER: response CLT → widget → envelope CLT
75
+ ```
76
+
77
+ Proceed unless the next reply pushes back.
78
+
79
+ ## Phase 4 — Generation order
80
+
81
+ 1. Response CLT `getAccountSummaryResponse` — `lightning__objectType`, all 14 `payloadFields` (1:1 with the response class's `@InvocableVariable` fields — the response CLT always models the complete response, including `status`/`message`).
82
+ 2. Envelope CLT `getAccountSummary` — `actionName`, `isSuccess`, `outputValues` → `c__getAccountSummaryResponse`.
83
+ 3. Widget `getAccountSummaryWidget` — flat schema over the 12 rendered payload fields (14 minus the two `Properties omitted:` status fields); body binds `{!$attrs.accountName}` etc.
84
+ 4. Default renderer at `lightningTypes/getAccountSummary/renderer.json` — `definition: @widget/c/getAccountSummaryWidget`, each attribute `{!$attrs.outputValues.<field>}`.
85
+
86
+ ## Phase 5 — Validation
87
+
88
+ - `clt-reference-integrity`: envelope `outputValues` → `c__getAccountSummaryResponse`, response CLT exists, no `$schema`/`items` → **pass**.
89
+ - `renderer-wires-widget`: bundle-root renderer present, definition `@widget/c/getAccountSummaryWidget`, every widget prop bound as `{!$attrs.outputValues.<prop>}` → **pass**.
90
+ - `field-trace`: INVENTED empty; OMITTED = `status, message` (both in `Properties omitted:`) → **pass**.
@@ -0,0 +1,191 @@
1
+ # Example: Nested-object payload field (Apex-class-typed response field)
2
+
3
+ A complete walkthrough of the flow when one `@InvocableVariable` field on the response class is
4
+ itself **another Apex class**, not a primitive (`source = apex`, nested-object branch). This is the
5
+ second, additive payload shape alongside the flat-primitive shape in `apex-invocable-source-prompt.md`
6
+ — read `references/mcp-tool-output-discovery.md` ("Nested-object payload fields") and
7
+ `references/two-clt-modeling.md` ("Nested-object payload fields (a second, additive case)") first.
8
+
9
+ ## The prompt
10
+
11
+ > I have an MCP server tool backed by the `GetFlightDetailsAction` Apex invocable action. Build a
12
+ > widget that renders its output as a flight details card.
13
+
14
+ ## Phase 1 — Input selection
15
+
16
+ - Source: `apex` (the prompt names an Apex Invocable class; no org describe needed for this walkthrough).
17
+ - Tool API name: `getFlightDetails` (from the class name `GetFlightDetailsAction`, stripping the
18
+ trailing `Action` suffix and lower-camelCasing — see the naming convention in
19
+ `references/two-clt-modeling.md`).
20
+
21
+ ## Phase 2 — Payload discovery
22
+
23
+ Read `references/mcp-tool-output-discovery.md`, then locate `.../classes/GetFlightDetailsAction.cls`.
24
+
25
+ The invocable method:
26
+
27
+ ```apex
28
+ @InvocableMethod(label='Get Flight Details' description='Returns flight details based on input ID, Origin, and Destination')
29
+ public static List<FlightDetailsResponse> getFlightDetails(List<FlightDetailsRequest> requests) { ... }
30
+
31
+ public class FlightDetailsResponse {
32
+ @InvocableVariable(label='Flight Details')
33
+ public SearchFlightsAction.Flight flightInfo;
34
+ }
35
+ ```
36
+
37
+ - Response class = `FlightDetailsResponse` (the `List<...>` element type) → **payload source**.
38
+ - Request class = `FlightDetailsRequest` → excluded (tool input).
39
+ - The single `@InvocableVariable` field, `flightInfo`, is declared `SearchFlightsAction.Flight` —
40
+ **another Apex class**, not `String`/`Integer`/etc. This is the nested-object branch: it does not
41
+ go in the primitive Apex→CLT mapping table.
42
+
43
+ Enumerate the referenced class (`SearchFlightsAction.Flight`) for its own `@InvocableVariable`
44
+ leaf fields — these become the widget's flat properties:
45
+
46
+ ```apex
47
+ public class Flight {
48
+ @InvocableVariable public String flightId;
49
+ @InvocableVariable public String origin;
50
+ @InvocableVariable public String destination;
51
+ @InvocableVariable public String departureTime;
52
+ @InvocableVariable public String arrivalTime;
53
+ @InvocableVariable public Long price;
54
+ }
55
+ ```
56
+
57
+ | Leaf field | Apex type | CLT / widget `lightning:type` |
58
+ |---|---|---|
59
+ | flightId | String | `lightning__textType` |
60
+ | origin | String | `lightning__textType` |
61
+ | destination | String | `lightning__textType` |
62
+ | departureTime | String | `lightning__textType` |
63
+ | arrivalTime | String | `lightning__textType` |
64
+ | price | Long | `lightning__numberType` (widget uses `lightning__numberType` for all numerics; the response CLT would use `lightning__integerType` if this leaf were typed directly on the response CLT — but it isn't, since it's flattened through `@apexClassType`, see below) |
65
+
66
+ `payloadFields` (top-level) = 1 field: `flightInfo`, typed as an Apex class → nested-object branch.
67
+ `payloadFields` (flattened, for the widget) = the 6 leaf rows above.
68
+
69
+ ## Phase 3 — Build plan (abridged)
70
+
71
+ ```text
72
+ MCP Tool Widget Build Plan: getFlightDetailsWidget
73
+
74
+ PLAN: Render the GetFlightDetails MCP tool output as a flight-details card.
75
+
76
+ TOOL / SOURCE:
77
+ Tool API name: getFlightDetails
78
+ Payload source: Apex Invocable class GetFlightDetailsAction
79
+ Response class FQN: GetFlightDetailsAction.FlightDetailsResponse
80
+
81
+ LIGHTNING TYPES:
82
+ Response CLT: getFlightDetailsResponse
83
+ Properties: flightInfo → "@apexClassType/c__SearchFlightsAction$Flight" # nested-object field, NOT {"type":"object"}
84
+ Envelope CLT: getFlightDetails
85
+ Renderer (default, bundle root): .../lightningTypes/getFlightDetails/renderer.json
86
+ Envelope: actionName (text), isSuccess (boolean), outputValues (c__getFlightDetailsResponse)
87
+
88
+ WIDGET: getFlightDetailsWidget
89
+ Schema: flattened to flightInfo's 6 leaf fields (flightId, origin, destination, departureTime, arrivalTime, price)
90
+ Renderer binding: each attribute → {!$attrs.outputValues.flightInfo.<leaf>} # two levels deep, not one
91
+ Properties omitted: none
92
+
93
+ GENERATION ORDER: response CLT → widget → envelope CLT
94
+ ```
95
+
96
+ Proceed unless the next reply pushes back.
97
+
98
+ ## Phase 4 — Generation order
99
+
100
+ 1. **Response CLT** `getFlightDetailsResponse`:
101
+
102
+ ```json
103
+ {
104
+ "title": "Get Flight Details Response",
105
+ "description": "Response fields from the GetFlightDetailsAction invocable-action (FlightDetailsResponse)",
106
+ "type": "object",
107
+ "lightning:type": "lightning__objectType",
108
+ "lightning:tags": ["mcp"],
109
+ "unevaluatedProperties": false,
110
+ "properties": {
111
+ "flightInfo": {
112
+ "title": "Flight Info",
113
+ "lightning:type": "@apexClassType/c__SearchFlightsAction$Flight"
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ 2. **Widget** `getFlightDetailsWidget` — flat schema over the 6 leaf fields (not the single
120
+ `flightInfo` field); body binds `{!$attrs.flightId}`, `{!$attrs.origin}`, etc.
121
+
122
+ 3. **Envelope CLT** `getFlightDetails`:
123
+
124
+ ```json
125
+ {
126
+ "title": "Get Flight Details",
127
+ "description": "Invocable-action result envelope for the GetFlightDetailsAction MCP tool",
128
+ "type": "object",
129
+ "lightning:type": "lightning__objectType",
130
+ "lightning:tags": ["mcp"],
131
+ "unevaluatedProperties": false,
132
+ "properties": {
133
+ "actionName": { "title": "Action Name", "lightning:type": "lightning__textType" },
134
+ "isSuccess": { "title": "Is Success", "lightning:type": "lightning__booleanType" },
135
+ "outputValues": { "title": "Output Values", "lightning:type": "c__getFlightDetailsResponse" }
136
+ }
137
+ }
138
+ ```
139
+
140
+ 4. **Default renderer** at `lightningTypes/getFlightDetails/renderer.json` —
141
+ `definition: @widget/c/getFlightDetailsWidget`, each attribute bound two levels deep through the
142
+ nested object:
143
+
144
+ ```json
145
+ {
146
+ "renderer": {
147
+ "componentOverrides": {
148
+ "$": {
149
+ "definition": "@widget/c/getFlightDetailsWidget",
150
+ "attributes": {
151
+ "flightId": "{!$attrs.outputValues.flightInfo.flightId}",
152
+ "origin": "{!$attrs.outputValues.flightInfo.origin}",
153
+ "destination": "{!$attrs.outputValues.flightInfo.destination}",
154
+ "departureTime": "{!$attrs.outputValues.flightInfo.departureTime}",
155
+ "arrivalTime": "{!$attrs.outputValues.flightInfo.arrivalTime}",
156
+ "price": "{!$attrs.outputValues.flightInfo.price}"
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ ```
163
+
164
+ ## Phase 5 — Validation
165
+
166
+ - `clt-reference-integrity`: envelope `outputValues` → `c__getFlightDetailsResponse`,
167
+ response CLT exists, `flightInfo` uses `@apexClassType/c__SearchFlightsAction$Flight` (not a
168
+ bare `{"type":"object"}` and not an inlined `lightning__objectType`), no `$schema`/`items` →
169
+ **pass**.
170
+ - `renderer-wires-widget`: bundle-root renderer present, definition `@widget/c/getFlightDetailsWidget`,
171
+ every widget property bound two levels deep as `{!$attrs.outputValues.flightInfo.<property>}` (not
172
+ one level, which would bind to an unresolvable object) → **pass**.
173
+ - `field-trace`: INVOCABLE_FIELDS (top-level, per the gate's literal definition) = `flightInfo` —
174
+ a single nested-object field, not a primitive. Because it resolves to `@apexClassType/...` (see
175
+ `clt-reference-integrity` above), it expands to its referenced class's own leaf fields before
176
+ comparing against the widget: `flightId, origin, destination, departureTime, arrivalTime, price`.
177
+ Widget properties match this expanded leaf set exactly; INVENTED empty; OMITTED empty → **pass**.
178
+
179
+ ## Notes
180
+
181
+ - **Why not a single-level CLT.** Typing `flightInfo` as `{"type":"object"}` on the response CLT
182
+ produces an opaque blob with no leaf fields — not renderable, and rejected by intent even where the
183
+ CLT metaschema would technically accept a generic object. The `@apexClassType/<ns>__<OuterClass>$<InnerClass>`
184
+ reference is what actually deploys (verified against a hand-fixed, successfully deployed bundle).
185
+ - **This is additive, not a replacement.** A response class with only primitive `@InvocableVariable`
186
+ fields (the `AccountSummary`/`GetOrderStatus` examples) still uses the flat mapping tables
187
+ unchanged. Check each field independently — a response class can mix primitive and Apex-class-typed
188
+ fields.
189
+ - **`List<ApexClass>` fields** (e.g. `SearchFlightsAction.FlightSearchResponse.availableFlights`, a
190
+ `List<Flight>`) are out of scope for this beta single-response flow — surface them in the build
191
+ plan the same way a `maxOccurs > 1` scalar is surfaced, rather than emitting a schema for them.
@@ -0,0 +1,85 @@
1
+ # Example: Pasted tool-output source
2
+
3
+ A complete walkthrough of the flow when the payload source is a pasted MCP tool-output JSON sample and no Apex class is available (`source = sample`).
4
+
5
+ ## The prompt
6
+
7
+ > Here's what my MCP tool returns. Build a widget for it.
8
+ >
9
+ > ```json
10
+ > {
11
+ > "actionName": "GetOrderStatus",
12
+ > "isSuccess": true,
13
+ > "outputValues": {
14
+ > "orderId": "80100000ABC",
15
+ > "orderNumber": "ORD-4471",
16
+ > "status": "Shipped",
17
+ > "itemCount": 3,
18
+ > "orderTotal": 249.95,
19
+ > "expedited": true
20
+ > }
21
+ > }
22
+ > ```
23
+
24
+ ## Phase 1 — Input selection
25
+
26
+ - Source: `sample` (the prompt pastes a tool-output envelope; no Apex class referenced).
27
+ - Tool API name: `getOrderStatus` (from `actionName`).
28
+
29
+ ## Phase 2 — Payload discovery
30
+
31
+ Read `references/mcp-tool-output-discovery.md`, then parse the `outputValues` object. Infer each `lightning:type` from the JSON value:
32
+
33
+ | Field | JSON value | Inferred CLT `lightning:type` |
34
+ |---|---|---|
35
+ | orderId | `"80100000ABC"` (string) | `lightning__textType` |
36
+ | orderNumber | `"ORD-4471"` (string) | `lightning__textType` |
37
+ | status | `"Shipped"` (string) | `lightning__textType` |
38
+ | itemCount | `3` (integer) | `lightning__integerType` |
39
+ | orderTotal | `249.95` (fractional) | `lightning__numberType` |
40
+ | expedited | `true` (boolean) | `lightning__booleanType` |
41
+
42
+ Envelope keys confirmed against the sample: `actionName`, `isSuccess`, `outputValues`. **No extra nesting** — `outputValues.<field>` is flat, so bindings will be `{!$attrs.outputValues.<field>}`.
43
+
44
+ > If the sample had nested the payload one level deeper (e.g. `outputValues.data.orderId`), the response CLT would model that `data` object and every renderer binding would be `{!$attrs.outputValues.data.<field>}`. Call this out in the plan.
45
+
46
+ `payloadFields` = the 6 rows above.
47
+
48
+ ## Phase 3 — Build plan (abridged)
49
+
50
+ ```text
51
+ MCP Tool Widget Build Plan: getOrderStatusWidget
52
+
53
+ PLAN: Render the GetOrderStatus MCP tool output as an order-status card.
54
+
55
+ TOOL / SOURCE:
56
+ Tool API name: getOrderStatus
57
+ Payload source: pasted tool-output sample
58
+
59
+ LIGHTNING TYPES:
60
+ Response CLT: getOrderStatusResponse (6 payload properties)
61
+ Envelope CLT: getOrderStatus
62
+ Renderer (default, bundle root): .../lightningTypes/getOrderStatus/renderer.json
63
+ Envelope: actionName (text), isSuccess (boolean), outputValues (c__getOrderStatusResponse)
64
+
65
+ WIDGET: getOrderStatusWidget
66
+ Renderer binding: each attribute → {!$attrs.outputValues.<field>}
67
+ Properties omitted: none
68
+
69
+ GENERATION ORDER: response CLT → widget → envelope CLT
70
+ ```
71
+
72
+ Proceed unless the next reply pushes back.
73
+
74
+ ## Phase 4 — Generation order
75
+
76
+ 1. Response CLT `getOrderStatusResponse` — `lightning__objectType`, 6 properties (numerics: `itemCount` → `lightning__integerType` in the CLT but `lightning__numberType` in the widget schema; `orderTotal` → `lightning__numberType` in both).
77
+ 2. Envelope CLT `getOrderStatus` — `actionName`, `isSuccess`, `outputValues` → `c__getOrderStatusResponse`.
78
+ 3. Widget `getOrderStatusWidget` — flat schema over the 6 payload fields; body binds `{!$attrs.orderNumber}` etc.
79
+ 4. Default renderer at `lightningTypes/getOrderStatus/renderer.json` — `definition: @widget/c/getOrderStatusWidget`, each attribute `{!$attrs.outputValues.<field>}`.
80
+
81
+ ## Phase 5 — Validation
82
+
83
+ - `clt-reference-integrity`: envelope `outputValues` → `c__getOrderStatusResponse`, response CLT exists, no `$schema`/`items` → **pass**.
84
+ - `renderer-wires-widget`: bundle-root renderer present, definition `@widget/c/getOrderStatusWidget`, all 6 bindings nested under `outputValues` → **pass**.
85
+ - `field-trace`: source is a sample, so INVOCABLE_FIELDS = `outputValues` keys; INVENTED empty, OMITTED empty → **pass**.
@@ -0,0 +1,74 @@
1
+ # Build Plan Format
2
+
3
+ Use this template in Phase 3 to print the plan before proceeding. Fill every section. Do not abbreviate. Do not print inside a code fence the user might mistake for output — the plan is conversational.
4
+
5
+ ---
6
+
7
+ ```text
8
+ MCP Tool Widget Build Plan: <widgetName>
9
+
10
+ PLAN: <one line in developer-facing terms, e.g.:
11
+ "Render the GetAccountSummary MCP tool output with an account-summary widget">
12
+
13
+ TOOL / SOURCE:
14
+ Tool API name: <toolApiName>
15
+ Payload source: <action: Actions REST describe of <ActionApiName> | apex: class <ClassName> | sample: pasted tool-output>
16
+ Response class FQN: <namespace>__<ClassName>.<ResponseClass> # apex source only; omit for action/sample
17
+
18
+ LIGHTNING TYPES (two object-based CLTs of equal standing — named for what each models, not by role; both carry root-level "lightning:tags": ["mcp"]):
19
+ Response CLT:
20
+ Name: <responseCLT> # convention: <toolApiName>Response
21
+ Path: <pkgDir>/lightningTypes/<responseCLT>/schema.json
22
+ Properties: <field: lightning:type, ...> # 1:1 with response @InvocableVariable fields
23
+ Envelope CLT:
24
+ Name: <toolCLT> # convention: <toolApiName>
25
+ Path: <pkgDir>/lightningTypes/<toolCLT>/schema.json
26
+ Renderer (default, at bundle root — wires the widget): <pkgDir>/lightningTypes/<toolCLT>/renderer.json
27
+ Envelope properties: actionName (text), isSuccess (boolean), outputValues (c__<responseCLT>), <plus any others>
28
+
29
+ WIDGET:
30
+ Name: <widgetName> # convention: <toolApiName>Widget
31
+ Output:
32
+ <pkgDir>/uiWidgets/<widgetName>/<widgetName>.json
33
+ <pkgDir>/uiWidgets/<widgetName>/schema.json
34
+ <pkgDir>/uiWidgets/<widgetName>/<widgetName>.uiwidget-meta.xml
35
+ Schema source: derived from the response field list (name + primitive type) — a standalone contract, not tied to any Lightning Type
36
+ Renderer binding: each widget attribute maps to {!$attrs.outputValues.<field>}
37
+ Layout intent: <one-line description of the widget composition>
38
+ Properties omitted: <response fields the widget intentionally drops, with rationale — or "none">
39
+ # actionName/isSuccess never appear here — they are envelope-only and never candidates for the widget.
40
+ # Default omissions to declare when present in the response: isSuccess, errorMessage, status, message
41
+ # (operational/status indicators, not display data) — each needs its own one-line rationale, not just the field name.
42
+
43
+ SUB-SKILLS THAT WILL RUN:
44
+ platform-custom-lightning-type-generate (response CLT, then envelope CLT)
45
+ platform-widget-generate (widget bundle)
46
+ (renderer.json authored inline in the envelope CLT by this orchestrator)
47
+
48
+ VALIDATIONS THAT WILL RUN AFTER GENERATION:
49
+ Widget bundle self-validation (run by platform-widget-generate):
50
+ - widget schema.json parses and has the required root keys
51
+ - every leaf in properties has a lightning:type
52
+ - every {!$attrs.X} resolves to a widget schema property
53
+ - <name>.uiwidget-meta.xml is well-formed, root <UiWidgetBundle>, declares <widgetType>JSON</widgetType>
54
+ Cross-skill checks (run by this orchestrator):
55
+ - clt-reference-integrity: envelope CLT outputValues → c__<responseCLT>; response CLT exists; no $schema/items
56
+ - renderer-wires-widget: envelope CLT renderer.json (bundle root) references the widget via @widget/c/<widgetName>,
57
+ binding every widget property as {!$attrs.outputValues.<property>}
58
+ - field-trace (advisory): print response @InvocableVariable fields and widget schema properties; print the diff.
59
+ Invented widget fields fail; omissions not declared above warn.
60
+
61
+ GENERATION ORDER: response CLT → widget → envelope CLT (response CLT must exist before the envelope CLT references it).
62
+
63
+ ----------------------------------------------------------------
64
+ Proceeding unless you push back (reply "no", "stop", "change X"). The plan above is the record of intent.
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Notes for the model
70
+
71
+ - If the user replies with edits or declines, revise the plan and reprint. Do not assume which sections changed.
72
+ - Approval applies only to the plan as printed. A later request for another tool starts a new planning cycle.
73
+ - "Properties omitted" makes intentional drops explicit — e.g. `status`, `message`, internal IDs that do not belong on the render surface.
74
+ - If the payload source is a pasted sample that nests under `outputValues.data`, record that extra level here — it changes the response CLT and every renderer binding to `{!$attrs.outputValues.data.<field>}`.