@salesforce/afv-skills 1.31.0 → 1.32.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 (98) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-bot-upgrade/SKILL.md +217 -0
  3. package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
  4. package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
  5. package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
  6. package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
  7. package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
  8. package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
  9. package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
  10. package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
  11. package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
  12. package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
  13. package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
  14. package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
  15. package/skills/dx-org-manage/SKILL.md +8 -5
  16. package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
  17. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
  18. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -9
  19. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
  20. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
  21. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
  22. package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
  23. package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
  24. package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
  25. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
  26. package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
  27. package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
  28. package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
  29. package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
  30. package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
  31. package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
  32. package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
  33. package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
  34. package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
  35. package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
  36. package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
  37. package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
  38. package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
  39. package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
  40. package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
  41. package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
  42. package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
  43. package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
  44. package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
  45. package/skills/platform-widget-generate/SKILL.md +241 -0
  46. package/skills/platform-widget-generate/examples/conditional.json +73 -0
  47. package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
  48. package/skills/platform-widget-generate/examples/single-object.json +64 -0
  49. package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
  50. package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
  51. package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
  52. package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
  53. package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
  54. package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
  55. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
  56. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
  57. package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
  58. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
  59. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
  60. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
  61. package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
  62. package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
  63. package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
  64. package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
  65. package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
  66. package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
  67. package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
  68. package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
  69. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
  70. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
  71. package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
  72. package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
  73. package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
  74. package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
  75. package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
  76. package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
  77. package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
  78. package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
  79. package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
  80. package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
  81. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
  82. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
  83. package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
  84. package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
  85. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
  86. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
  87. package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
  88. package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
  89. package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
  90. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
  91. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
  92. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
  93. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
  94. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
  95. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
  96. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
  97. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
  98. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
@@ -1,124 +1,40 @@
1
- # Widget Generation Guide
1
+ # Widget Rendition Pattern for CLT renderer.json
2
2
 
3
3
  ## Overview
4
- Widgets are reusable pieces of UI similar to templates, with placeholders for actual data values. The purpose of this file is to assist developers in creating mosaic renditions for CLTs.
5
4
 
6
- ## Purpose
7
- Widgets render data in a structured and unified way across various Salesforce experiences like Slack, Mobile, LEX etc.
5
+ When a Custom Lightning Type needs to render through a Widget bundle (authored by `platform-widget-generate`), the `renderer.json` uses a flat widget-reference pattern. The renderer points at the widget by developer name and maps each CLT schema property to the widget's attribute contract.
8
6
 
9
- ## Schema Grounding
10
- Widget generation is **always schema-grounded** using a CLT's schema. The schema describes the data shape the widget should render. Extract property names, types, required vs optional, and nesting from the schema; then follow the full **Workflow** below, using this extracted structure to guide every step. Do not add or remove properties relative to the schema.
7
+ > **For full widget generation** (Apex → Lightning Type → Widget pipeline), use the `platform-lightning-type-widget-coordinate` orchestrator. This file documents only the renderer.json wiring pattern for CLTs that reference an existing widget.
11
8
 
12
- ## Composition
13
- A widget is a UEM (Unified Experience Model) tree of blocks and regions. The widget you return must follow the Typescript interfaces below:
9
+ ## renderer.json Shape
14
10
 
15
- ```ts
16
- interface BlockType {
17
- type: 'block'
18
- definition: string // {namespace}/{blockName}
19
- attributes?: Record<string, any>
20
- children?: (BlockType | RegionType)[]
21
- }
22
-
23
- interface RegionType {
24
- type: 'region'
25
- name: string
26
- children: BlockType[]
11
+ ```json
12
+ {
13
+ "renderer": {
14
+ "componentOverrides": {
15
+ "$": {
16
+ "definition": "@widget/c/<widgetDeveloperName>",
17
+ "attributes": {
18
+ "<widgetAttrKey>": "{!$attrs.<schemaPropertyName>}"
19
+ }
20
+ }
21
+ }
22
+ }
27
23
  }
28
24
  ```
29
- ---
30
-
31
- ## Available Metadata Actions
32
-
33
- ### When to Use Each Action
34
-
35
- #### discoverUiComponents
36
-
37
- **Purpose:** Discover the palette of available blocks that can be used in widget composition.
38
-
39
- **Use for:** Finding available blocks before building your widget structure.
40
-
41
- **Input Parameters:**
42
- - `actionName` (**required***): "discoverUiComponents"
43
- - `metadataType` (**required**): "FRAGMENT"
44
- - `parameters` (**required**): JSON object with the below fields
45
- - `pageType` (**required**): "FRAGMENT"
46
- - `pageContext` (optional): JSON object - not required for FRAGMENT type
47
- - `searchQuery` (optional): String to filter components by name or description
48
-
49
- **Returns:** List of components with:
50
- - `definition`: Fully qualified name (e.g., "namespace/definiton")
51
- - `description`: Component description
52
- - `label`: Human-readable label
53
- - `attributes`: Optional attribute metadata
54
-
55
- #### getUiComponentSchemas
56
-
57
- **Purpose:** Get detailed JSON schemas for component configuration, including property types, required vs optional fields, and validation rules.
58
-
59
- **Use for:** You know which components you want but need to understand their properties before adding them to your widget.
60
-
61
- **Input Parameters:**
62
- - `actionName` (**required***): "getUiComponentSchemas"
63
- - `metadataType` (**required**): "FRAGMENT"
64
- - `parameters` (**required**): JSON object with the below fields
65
- - `pageType` (**required**): "FRAGMENT"
66
- - `componentDefinitions` (**required**): List of fully qualified names (e.g., ["namespace/definition"])
67
- - **CRITICAL**: NEVER include "tile/mosaic" in this list. "tile/mosaic" is a container component used in renderer.json structure and **should not** be passed to getUiComponentSchemas
68
- - `pageContext` (optional): JSON object - not required for FRAGMENT type
69
- - `includeKnowledge` (optional): Boolean, defaults to true - includes additional component-specific guidance
70
-
71
- **Returns:**
72
- - `componentSchemas`: List of results (supports partial failures)
73
- - **Success entries**: Contains JSON schema with property definitions, types, constraints
74
- - **Failure entries**: Contains error message explaining why schema couldn't be retrieved
75
- - `$defs`: Schema definitions and references (if schema transformation applied)
76
-
77
- **Key Feature:** Supports partial failures - if some components can't be found, you still get schemas for the successful ones.
78
-
79
- ---
80
-
81
- ## Attribute binding using placeholder syntax
82
-
83
- - **Where to use:** When block properties must display or pass runtime data from the grounding schema, use the **Placeholder Syntax** below so that the runtime binds values into the widget. Check each block's schema (from `getUiComponentSchemas`) for the correct property name (e.g. `value`, `text`, `label`).
84
- - **Placeholder Syntax:** Use `{!$attrs.<attrName>}` as the placeholder for each block property that should receive data.
85
- `<attrName>` **must** match the property name from the grounding schema so that the runtime can resolve its value.
86
- Example: for a schema property `title`, set the block property to `{!$attrs.title}`.
87
- - **List / iterative data:** Only the children (list items) hold bound values; the parent list block does not. For each item inside a list (e.g. `tile/listItem`), use `{!$attrs.<listAttrName>.item}` so the runtime binds the current item. `<listAttrName>` MUST match the schema property name of the list. Example: for `icons`, use `"{!$attrs.icons.item}"` on the list item.
88
-
89
- ---
90
-
91
- ## Workflow
92
-
93
- 1. **Schema Parsing**
94
- - Parse the schema and extract: property names, types, required vs optional, and nested structure. Use this as the **widget spec**.
95
-
96
- 2. **Discover Available Blocks** (**REQUIRED** - do NOT skip)
97
- - Use **discoverUiComponents metadata action** above to explore what blocks are available.
98
- - Use property types from the **widget spec** to inform `searchQuery` (e.g. text → "text", number → "number").
99
-
100
- 3. **Select Components**
101
- - Choose blocks that can represent each property in the **widget spec** from the results of step 2.
102
-
103
- 4. **Get Component Schemas** (**REQUIRED** - do NOT skip)
104
- - Use **getUiComponentSchemas metadata action** with the selected block definitions from step 3 and review block properties' metadata.
105
25
 
106
- 5. **Build Widget**
107
- - Construct the UEM tree. Map each property in the **widget spec** to block properties and preserve order of the **widget spec**.
108
- - For block properties that must show or pass runtime data, use the placeholder syntax (see **Attribute binding using placeholder syntax** above).
109
- - Use block properties from the schemas retrieved in step 4.
26
+ - `<widgetDeveloperName>` matches the widget bundle directory name under `uiWidgets/`.
27
+ - `<widgetAttrKey>` is a property under the widget's `schema.json` `properties.attributes.properties`.
28
+ - `<schemaPropertyName>` is a property on the Custom Lightning Type's schema.
29
+ - One attribute mapping per widget property — the set of attributes must match the widget's schema contract.
110
30
 
111
- 6. **Write output to CLT Bundle**
112
- - Always write to `lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json` (or the correct target subfolder for the product surface, e.g. `experienceBuilder/`, `lightningMobileGenAi/`, `enhancedWebChat/` when applicable).
113
- Check **required root override pattern** below -
114
- `renderer.componentOverrides["$"] = { "type": "mosaic", "definition": "tile/mosaic", "children": [ ... ] — array of UEM nodes - contains the widget UEM generated using the **Workflow** steps 1-5 above }`
31
+ ## Attribute Binding
115
32
 
116
- ---
33
+ Use `{!$attrs.<name>}` syntax in attribute values. `<name>` must match a property defined in the CLT's own `schema.json`. At runtime the renderer resolves these bindings and passes the live data to the widget.
117
34
 
118
- ## Important Notes
35
+ ## Constraints
119
36
 
120
- - **widget spec** includes both required and optional attributes - review carefully to ensure valid configuration.
121
- - When using **`execute_metadata_action`** tool, always supply **`parameters`** with the required fields above; missing `parameters` or required keys causes hard failures, not partial results.
122
- - Block definitions always follow the `{namespace}/{blockName}` convention.
123
- - Use the same definition format returned by `discoverUiComponents` when calling `getUiComponentSchemas`
124
- - Placeholder syntax for non-list properties is `{!$attrs.<attrName>}` and for list properties is `{!$attrs.<listAttrName>.item}`.
37
+ - Do NOT duplicate the widget UEM body inside `renderer.json` the widget bundle owns its own UEM tree.
38
+ - The widget bundle (`<pkgDir>/uiWidgets/<widgetDeveloperName>/`) must exist and be deployed before the Lightning Type that references it.
39
+ - Every attribute key in the renderer must resolve to a property in the widget's `schema.json` `properties.attributes.properties`.
40
+ - Write the renderer to `lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json` (or the correct target subfolder for the product surface).
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: platform-lightning-type-widget-coordinate
3
+ description: "Orchestrate Apex-backed Lightning Type + HXL widget generation. TRIGGER only when the prompt EXPLICITLY invokes Lightning Types: user says 'Lightning Type', 'CLT', 'Custom Lightning Type', 'Apex-backed type', references '@apexClassType/...', asks to build a widget or card for a named Lightning Type, asks to create a new Lightning Type and widget together, or grounds a widget in a specific Apex class as its schema. DO NOT TRIGGER when the prompt names only a subject, domain, feature, or entity noun. Also DO NOT TRIGGER when: authoring only a Custom Lightning Type (use platform-custom-lightning-type-generate), only an Apex class (use platform-apex-generate), editing an existing widget without any Lightning Type change, or grounding a widget on an object/JSON-based Lightning Type (lightning__objectType with primitives)."
4
+ metadata:
5
+ version: "1.1"
6
+ minApiVersion: "68.0"
7
+ relatedSkills:
8
+ - "platform-widget-generate"
9
+ - "platform-custom-lightning-type-generate"
10
+ - "platform-apex-generate"
11
+ cliTools:
12
+ - tool: ["jq"]
13
+ semver: ">=1.6.0"
14
+ - tool: ["sf"]
15
+ semver: ">=2.0.0"
16
+ ---
17
+
18
+ # Building a Lightning Type With a Widget
19
+
20
+ Coordinate Lightning Type, Apex class, and HXL widget generation across the two paths below. 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.
21
+
22
+ ## Scope
23
+
24
+ Apex-backed Lightning Types only — root `lightning:type` of the form `@apexClassType/<namespace>__<ClassName>` (outer class). The class itself carries the `@AuraEnabled` fields that define the payload shape; nested list-element types live as inner classes referenced by `List<Inner>` fields on the outer class. Object/JSON-based Lightning Types (root `lightning__objectType` with primitive `properties`) are out of scope; route those to `platform-custom-lightning-type-generate` and `platform-widget-generate` separately.
25
+
26
+ ---
27
+
28
+ ## Phase Graph
29
+
30
+ | Phase | Purpose | Runs in | Output |
31
+ |---|---|---|---|
32
+ | 1 — Path selection | Pick the path (`existing-lightning-type-with-widget` · `new-lightning-type-with-widget`) from the user prompt. | All paths | `path` |
33
+ | 2 — Lightning Type discovery | Local project first; then `sf project retrieve --metadata LightningTypeBundle:<name>`; ambiguity resolution; in-scope verification. | **`existing-lightning-type-with-widget` only** | `lightningTypeSchema` (path + SHA-256 + Apex class FQN) |
34
+ | 3 — Build plan | Print the plan in full; proceed unless the next reply explicitly pushes back. | All paths | printed plan |
35
+ | 4 — Generation | Load and invoke leaf skills per path. | All paths | files written |
36
+ | 5 — Validation | Run hard gates (block) and warn gates (advisory). | All paths | gate report |
37
+ | 6 — Summary | Files, validations, preview readiness, next steps. | All paths | summary |
38
+
39
+ **Per-phase pattern:**
40
+
41
+ | Step | What to do |
42
+ |---|---|
43
+ | 1. Load skill | Invoke the named skill. Even if you remember its content, skills evolve — always load fresh. |
44
+ | 2. Execute | Follow the loaded skill's workflow. |
45
+ | 3. Verify | Confirm outputs exist and match the spec. |
46
+ | 4. Checkpoint | Confirm phase completion before moving on. |
47
+
48
+ ---
49
+
50
+ ## Phase 1 — Path selection
51
+
52
+ Determine the path from the user prompt and pick the corresponding leaf-skill load order:
53
+
54
+ | Path | Trigger | Phase 4 sub-skill load order |
55
+ |---|---|---|
56
+ | `existing-lightning-type-with-widget` | Prompt names a Lightning Type and treats it as existing (no *create*, *generate*, or *new* qualifier on the type). Phase 2 confirms it exists and is in scope. | `platform-widget-generate` (renderer wiring is authored inline per the Phase 4 "Renderer.json wiring step" — no separate skill load) |
57
+ | `new-lightning-type-with-widget` | Prompt asks for a new Lightning Type (verbs: *create*, *generate*, *build*, *make a new*) **or** Phase 2 finds nothing in the local project or in the org. | `platform-apex-generate` → `platform-custom-lightning-type-generate` (schema authoring) → `platform-widget-generate` (renderer wiring authored inline afterwards per the Phase 4 "Renderer.json wiring step") |
58
+
59
+ If the prompt names no Lightning Type at all (just a widget against prompt-provided fields or sample data), this orchestrator should not have been triggered — route the user to `platform-widget-generate` directly.
60
+
61
+ If the prompt is ambiguous between the two paths, ask **one** clarifying question max and pick. The `new-lightning-type-with-widget` path's `platform-apex-generate` step is engaged automatically — do not prompt the user to confirm Apex.
62
+
63
+ ---
64
+
65
+ ## Phase 2 — Lightning Type discovery (`existing-lightning-type-with-widget` only)
66
+
67
+ Skipped for `new-lightning-type-with-widget` (the Lightning Type does not yet exist).
68
+
69
+ **For `existing-lightning-type-with-widget`, FIRST Read `references/lightning-type-discovery.md` (REQUIRED — do NOT skip; do not run Phase 2 from this summary alone), then execute its find → verify → ensure-class procedure step by step.** The bullets below are a reminder, not a substitute for the reference:
70
+
71
+ - Local project first: search `force-app/**/lightningTypes/<TypeName>/schema.json`.
72
+ - If not found, run `sf project retrieve --metadata LightningTypeBundle:<TypeName>` against the connected org.
73
+ - If multiple candidates surface, list them with FQNs and paths. Ask the user to pick.
74
+ - After locating the schema, verify it is in scope (root `lightning:type` starts with `@apexClassType/`). If the type is object/JSON-based, surface that and stop.
75
+ - **Ensure the backing Apex class is in the local project.** Parse `<ClassName>` from the `@apexClassType/<ns>__<ClassName>` root. If `<pkgDir>/classes/<ClassName>.cls` is absent, run `sf project retrieve --metadata ApexClass:<ClassName>`. This runs whether the Lightning Type was found locally or retrieved from the org — a locally-present Lightning Type can still reference an absent class. If the class exists nowhere, surface it and stop (the type is unrenderable). See the reference for the full procedure.
76
+ - If retrieval fails, surface the CLI error and offer: (a) ask the user to run retrieve manually and re-run, or (b) downgrade to `new-lightning-type-with-widget` if appropriate. Never silently downgrade.
77
+ - If retrieval finds nothing, prompt the user to confirm flipping to `new-lightning-type-with-widget` before continuing.
78
+
79
+ Capture the Lightning Type `schema.json` SHA-256 and the Apex class FQN (parsed from `@apexClassType/...`) at the end of this phase. The Phase 5 `lightning-type-unchanged` gate compares the SHA against the on-disk SHA at end of Phase 4 to enforce no silent schema edits.
80
+
81
+ > Staleness: do NOT maintain a cross-session cache. Always read the local project fresh and always re-retrieve from the org per session.
82
+
83
+ ---
84
+
85
+ ## Phase 3 — Build plan + approval gate
86
+
87
+ Print a build plan using the template in `references/build-plan-format.md`. The plan must list:
88
+
89
+ - A one-line developer-facing summary of what will be built (the `PLAN:` line in the template).
90
+ - Lightning Type name and source (existing in local project · retrieved from org · newly created), plus the Apex class FQN it references.
91
+ - Files about to be created or modified, with absolute paths.
92
+ - Sub-skills that will run after approval.
93
+ - Validations that will run after generation.
94
+
95
+ The plan is read by the developer. Keep it concrete: name the artifacts, files, sub-skills, and validations.
96
+
97
+ **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 (`yes`, `approve`, `go`, `looks good`, `ok`) 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 plan being visible in the transcript is the invariant; blocking on interactive approval is not. If pushback arrives, revise the plan and re-print before moving on.
98
+
99
+ ---
100
+
101
+ ## Phase 4 — Generation
102
+
103
+ Execute the sub-skill load order from the chosen path's row in the Phase 1 table. For each sub-skill:
104
+
105
+ 1. Load the skill.
106
+ 2. Execute the leaf skill's authoring workflow against the spec from Phase 3. The leaf skill is authoritative for its own deliverables.
107
+ 3. Verify the outputs match what the build plan promised.
108
+ 4. Checkpoint before invoking the next sub-skill.
109
+
110
+ **`new-lightning-type-with-widget` handoff contract:**
111
+
112
+ - Apex authors a class whose `@AuraEnabled` fields define the desired Lightning Type shape. Inner classes are used only for nested list-element types. Capture the **outer class FQN** (`<namespace>__<ClassName>`).
113
+ - The Custom Lightning Type references the outer class via `lightning:type: "@apexClassType/<namespace>__<ClassName>"`.
114
+ - Widget grounds on the outer class's `@AuraEnabled` fields and binds attributes via `{!$attrs.X}`.
115
+ - After the widget bundle is written, author the Lightning Type's renderer wiring per the **renderer.json wiring step** below.
116
+
117
+ **`existing-lightning-type-with-widget` handoff contract:**
118
+
119
+ - Hand the widget skill the Lightning Type `schema.json` path and the Apex class FQN captured in Phase 2. The widget skill derives its own `schema.json` from the Apex class's `@AuraEnabled` fields (see `platform-widget-generate/references/schema-from-lightning-type.md`).
120
+ - After the widget bundle is written, author the Lightning Type's renderer wiring per the **renderer.json wiring step** below. The Lightning Type `schema.json` is NOT modified (`lightning-type-unchanged` enforces this) — only `lightningDesktopGenAi/renderer.json` is written.
121
+
122
+ **Renderer.json wiring step (BOTH flows — never optional):**
123
+
124
+ **First, Read `platform-custom-lightning-type-generate/references/widget-rendition.md` (REQUIRED — do NOT skip; do not author `renderer.json` from memory or by copying an existing project sample, which may use a deprecated shape).**
125
+
126
+ After the widget bundle exists, author `<pkgDir>/lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json` using the **widget-rendition pattern** documented in `platform-custom-lightning-type-generate/references/widget-rendition.md`. The renderer file is a thin wrapper — its first child references the widget via `"definition": "@widget/c/<widgetName>"` and maps **every widget schema property** to the Lightning Type instance's matching attribute via `{!$attrs.<schemaPropertyName>}`. Do **NOT** duplicate the widget body inside `renderer.json`; the widget bundle is the single source of truth for the rendering tree.
127
+
128
+ Existing-renderer handling (`existing-lightning-type-with-widget` only): if `renderer.json` already exists at the target path, read it first.
129
+
130
+ - If it already references the same widget (same `@widget/c/<widgetName>`) with the same attribute mapping, leave it alone.
131
+ - If it references a **different** widget OR uses a custom-LWC root override (`c/<componentName>`), STOP and surface the conflict to the user before overwriting. Do not silently replace the user's existing rendition.
132
+ - If the file exists but is not a widget-rendition (e.g. property-level overrides only), surface that and ask whether to merge or replace.
133
+
134
+ Without this wiring the widget is unreachable from the Lightning Type — the widget bundle ships dead. `renderer-wires-widget` enforces existence and binding correctness.
135
+
136
+ ---
137
+
138
+ ## Phase 5 — Validation gates
139
+
140
+ Read `references/validation-gates.md` and **run every gate**. The orchestrator runs cross-skill gates only — widget-bundle-internal checks (schema parse, root keys, leaf `lightning:type`, `{!$attrs.X}` resolution, `.uiwidget-meta.xml` well-formedness, `<UiWidgetBundle>` root, `<masterLabel>`, `<description>`, and `<widgetType>JSON</widgetType>`) are owned by `platform-widget-generate` and run as part of its own self-validation step.
141
+
142
+ **Hard — block on failure:**
143
+
144
+ 1. `lightning-type-unchanged` — **`existing-lightning-type-with-widget` only.** Recompute SHA-256 of the on-disk Lightning Type `schema.json` and compare against the SHA captured in Phase 2. Mismatch = orchestrator silently edited the type.
145
+ 2. `renderer-wires-widget` — **both paths.** Confirm `<pkgDir>/lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json` exists, parses as JSON, wires this widget via `componentOverrides["$"].definition === "@widget/c/<widgetName>"`, and `componentOverrides["$"].attributes` binds every widget schema property as `{!$attrs.<schemaPropertyName>}`. See "renderer.json wiring step" in Phase 4 and `validation-gates.md` for the required shape.
146
+
147
+ **Warn — advisory:**
148
+
149
+ 1. `field-trace` — **both paths.** RUN the trace procedure in `references/validation-gates.md` (grep `@AuraEnabled` from the outer .cls, `jq` widget schema property keys, print both lists, classify INVENTED vs OMITTED). PRINT both lists in the gate report — asserting `pass` without printing the lists is a hard violation. Silent omissions (Apex field absent from widget AND absent from the Phase 3 `Properties omitted:` plan) warn.
150
+ 2. `deploy-check` — **`new-lightning-type-with-widget` only.** RUN `sf project deploy --check-only --source-dir <pkgDir>/classes/<ClassName>.cls,<pkgDir>/lightningTypes/<TypeName>` and report the result. Reporting `pass` without running this command is a hard violation. See `validation-gates.md` for the "not yet deployed is not a valid skip reason" rule.
151
+
152
+ Report each gate result by name in Phase 6 (`pass`, `fail (<reason>)`, `warn (<reason>)`, `not run`). Do **not** summarize as "all passed" — list each gate explicitly.
153
+
154
+ ---
155
+
156
+ ## Phase 6 — Summary
157
+
158
+ Report. The summary is read by the developer — list only the files actually written; group by bundle so the developer can locate them quickly.
159
+
160
+ ```text
161
+ Lightning Type + Widget Build Complete: <widgetName>
162
+
163
+ FILES GENERATED:
164
+ Widget bundle:
165
+ <pkgDir>/uiWidgets/<widgetName>/<widgetName>.json
166
+ <pkgDir>/uiWidgets/<widgetName>/schema.json
167
+ <pkgDir>/uiWidgets/<widgetName>/<widgetName>.uiwidget-meta.xml
168
+
169
+ Lightning Type bundle:
170
+ <pkgDir>/lightningTypes/<TypeName>/schema.json # only when newly created
171
+ <pkgDir>/lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json # always — wires the Lightning Type to the widget
172
+
173
+ Apex (only when newly created):
174
+ <pkgDir>/classes/<ClassName>.cls
175
+ <pkgDir>/classes/<ClassName>.cls-meta.xml
176
+
177
+ VALIDATIONS:
178
+ widget self-validation (platform-widget-generate gates): <pass | fail — see sub-skill report>
179
+ Lightning Type schema unchanged from before this run: <pass | fail | n/a (newly created)>
180
+ Lightning Type renderer wires this widget: <pass | fail (<reason>)>
181
+ widget↔apex field trace (INVENTED + OMITTED lists printed): <pass | warn (<reason>) | fail (invented: <list>)>
182
+ sf project deploy --check-only: <pass | warn | n/a (no new Apex or Lightning Type to deploy)>
183
+
184
+ NEXT STEPS:
185
+ - Deploy: sf project deploy start --source-dir <pkgDir>
186
+ - Preview: <preview-surface guidance>
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Hard Rules (always apply)
192
+
193
+ 1. **Plan-first, then proceed.** Print the full Phase 3 build plan before writing any file. If the next turn contains explicit rejection or a change request, stop and revise; otherwise continue to Phase 4. The invariant is the plan being visible in the transcript — not an interactive human approval — so this rule holds in manual chat, in agent-to-agent flows, and in single-turn eval runs where no follow-up user message arrives.
194
+ 2. **No silent schema edits** to existing Lightning Types. Phase 5 `lightning-type-unchanged` enforces this for `existing-lightning-type-with-widget`.
195
+ 3. **No silent Apex changes** to existing Apex. If Phase 4 needs to modify a pre-existing class, surface it in Phase 3. **A leaf skill that hits a shape gap mid-Phase-4 MUST stop and surface to the orchestrator instead of editing `.cls` directly** — Phase 3 covers gaps the orchestrator already knew about; this clause covers gaps discovered later by a leaf skill.
196
+ 4. **No invented fields, no silent omissions.** Every `{!$attrs.X}` must trace to the widget `schema.json`, and the widget `schema.json` must be a subset of the Apex class's `@AuraEnabled` fields. Default disposition for every Apex field is **include**; omission requires the field to appear in the Phase 3 build plan's `Properties omitted:` section with a rationale the user has approved. `field-trace` prints both APEX_FIELDS and WIDGET_PROPS lists and warns on silent omissions. `List<InnerClass>` fields are NEVER candidates for silent omission.
197
+ 5. **One clarification at most** when Lightning Type lookup is ambiguous.
198
+ 6. **Always load the leaf skill** before generation. Do not author from memory.
199
+ 7. **Out-of-scope types stop the orchestrator.** If Phase 2 discovers an object/JSON-based Lightning Type, route the user to `platform-custom-lightning-type-generate` and `platform-widget-generate` separately.
200
+ 8. **Run gates, do not describe them.** Phase 5 gates are concrete checks/commands. Reporting `pass` without executing the gate is a hard violation; report `not run` instead.
201
+ 9. **Lightning Type rendition is mandatory, never optional.** Both paths end with `<pkgDir>/lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json` wiring the Lightning Type to the widget via `@widget/c/<widgetName>` with attribute mapping per the widget-rendition pattern. Without this, the widget bundle ships dead. `renderer-wires-widget` enforces existence and binding.
202
+ 10. **No shell metacharacters that trigger the Vibes safe-shell filter.** In every `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 patterns force manual approval even under Bypass mode and stall the eval. Instead: run separate commands (`mkdir -p a && mkdir -p b`, not `mkdir -p {a,b}`); print each intermediate value with its own command and reason about the result rather than capturing it (`jq … file` on its own, not `X=$(jq … file)`); use plain shell variables (`X=literal`) or here-strings when a value must be reused across commands.
203
+
204
+ ---
205
+
206
+ ## Reference File Index
207
+
208
+ | File | When to read |
209
+ |------|--------------|
210
+ | `references/lightning-type-discovery.md` | Phase 2 — local-project scan, org retrieve, ambiguity handling, in-scope verification, and ensuring the backing Apex class is in the local project. |
211
+ | `references/build-plan-format.md` | Phase 3 — plan template the model fills before STOP. |
212
+ | `references/validation-gates.md` | Phase 5 — full hard / warn gate table with error→fix mapping. |
213
+ | `examples/existing-lightning-type-with-widget-prompt.md` | Phase 3 — before drafting the build plan, read this for a complete `existing-lightning-type-with-widget` walkthrough. |
214
+ | `examples/new-lightning-type-with-widget-prompt.md` | Phase 3 — before drafting the build plan, read this for a complete `new-lightning-type-with-widget` walkthrough. |
@@ -0,0 +1,80 @@
1
+ # Worked Example — Render an Existing Apex-Backed Lightning Type
2
+
3
+ ## User prompt
4
+
5
+ > Build a widget for the OrderSummary Lightning Type — show order id, customer, total, and a list of line items.
6
+
7
+ ## Walkthrough
8
+
9
+ **Phase 1 — Path selection.** The prompt names a Lightning Type (`OrderSummary`) and treats it as existing → pick the `existing-lightning-type-with-widget` path. Phase 4 will load `platform-widget-generate` only, after Phase 2 confirms the type is Apex-backed.
10
+
11
+ **Phase 2 — Lightning Type discovery.** Find first, verify after.
12
+
13
+ ```bash
14
+ $ rg -l 'lightning:type' force-app/**/lightningTypes/OrderSummary/
15
+ force-app/main/default/lightningTypes/OrderSummary/schema.json
16
+ ```
17
+
18
+ Found in the local project. Now verify in scope — read `schema.json`. Root is `"lightning:type": "@apexClassType/orders__OrderSummary"`. Apex-backed → continue. Capture path + SHA-256 + Apex class FQN `orders__OrderSummary` (outer-class form; an inner-class root like `orders__OrderResponses$CreateResult` is also in scope and would scope the trace to that inner class). Source = `existing in local project`.
19
+
20
+ > If the root had been `lightning__objectType` (object/JSON-based), the orchestrator would have stopped here and routed the user to use `platform-custom-lightning-type-generate` and `platform-widget-generate` separately.
21
+
22
+ **Phase 3 — Build plan.** Print:
23
+
24
+ ```text
25
+ Lightning Type + Widget Build Plan: orderSummaryWidget
26
+
27
+ PLAN: Generate a widget that renders the existing OrderSummary Lightning Type.
28
+
29
+ LIGHTNING TYPE:
30
+ Name: OrderSummary
31
+ Source: existing in local project
32
+ Path: force-app/main/default/lightningTypes/OrderSummary/schema.json
33
+ Renderer (wires the Lightning Type to the widget): force-app/main/default/lightningTypes/OrderSummary/lightningDesktopGenAi/renderer.json
34
+ Schema fingerprint (captured before any sub-skill runs): <hex>
35
+ Apex class FQN: orders__OrderSummary
36
+
37
+ WIDGET:
38
+ Name: orderSummaryWidget
39
+ Output:
40
+ force-app/main/default/uiWidgets/orderSummaryWidget/orderSummaryWidget.json
41
+ force-app/main/default/uiWidgets/orderSummaryWidget/schema.json
42
+ force-app/main/default/uiWidgets/orderSummaryWidget/orderSummaryWidget.uiwidget-meta.xml
43
+ Schema source: derived from Apex class @AuraEnabled fields via the Lightning Type
44
+ Layout intent: card with header (id + customer), body (total + shipping-address fields), footer (line items list with forEach)
45
+ Properties omitted: lastUpdatedTime (audit field, not relevant to render — proposed omission)
46
+
47
+ SUB-SKILLS THAT WILL RUN:
48
+ platform-widget-generate
49
+
50
+ VALIDATIONS THAT WILL RUN AFTER GENERATION:
51
+ Widget bundle self-validation (run by platform-widget-generate):
52
+ - widget schema.json parses, root keys correct, every leaf has lightning:type
53
+ - every {!$attrs.X} (and {!$attrs.shippingAddress.city} for the singular nested address object) resolves
54
+ - <name>.uiwidget-meta.xml is well-formed XML, root is <UiWidgetBundle>, and declares <widgetType>JSON</widgetType>
55
+ Cross-skill checks (run by this orchestrator):
56
+ - lightning-type-unchanged: existing schema.json is byte-identical to the captured fingerprint
57
+ - renderer-wires-widget: renderer.json references @widget/c/orderSummaryWidget with one {!$attrs.<schemaPropertyName>} mapping per widget schema property
58
+ - field-trace: print @AuraEnabled fields, widget properties (with nested dot paths and list-item paths expanded), and the diff
59
+
60
+ ----------------------------------------------------------------
61
+ STOP — wait for the user to Approve or Decline.
62
+ ```
63
+
64
+ User picks Approve.
65
+
66
+ **Phase 4 — Generation.** Load `platform-widget-generate`. Hand it the Lightning Type schema path, the Apex class FQN (`orders__OrderSummary`), and the widget name. The widget skill derives its `schema.json` from the Apex class's `@AuraEnabled` fields:
67
+
68
+ - Primitive fields → primitive `lightning:type`.
69
+ - Singular nested inner class (e.g. `Address shippingAddress`) → `lightning__objectType`; bound in the widget body via dot-notation `{!$attrs.shippingAddress.city}`, `{!$attrs.shippingAddress.zip}`.
70
+ - `List<LineItem> lineItems` → `lightning__listType`; iterated with `forEach`/`forItem` and bound via `{!$item.<innerField>}`.
71
+
72
+ The skill omits `lastUpdatedTime` per the build plan and writes the three widget files. Then author `force-app/main/default/lightningTypes/OrderSummary/lightningDesktopGenAi/renderer.json` using the widget-rendition pattern, binding each widget attribute via `{!$attrs.<schemaPropertyName>}`. (If `renderer.json` already exists referencing a different widget or a custom LWC, STOP and surface the conflict.)
73
+
74
+ **Phase 5 — Validation.** The widget skill reports its own self-validation results. This orchestrator runs:
75
+
76
+ - `lightning-type-unchanged` — confirms the Lightning Type was untouched.
77
+ - `renderer-wires-widget` — confirms the renderer points at this widget and binds every widget schema property.
78
+ - `field-trace` — prints APEX_FIELDS / WIDGET_PROPS / INVENTED / OMITTED. The omission of `lastUpdatedTime` is in the build plan and emits no warning.
79
+
80
+ **Phase 6 — Summary.** Print files generated and each validation result by name (`lightning-type-unchanged: pass`, `renderer-wires-widget: pass`, `field-trace: pass`), followed by the deploy command.
@@ -0,0 +1,75 @@
1
+ # Worked Example — Create a New Apex-Backed Lightning Type With a Widget
2
+
3
+ ## User prompt
4
+
5
+ > Generate a Lightning Type and a widget for an account briefing — fields: account name, owner, last activity date, top three open opportunities.
6
+
7
+ > Note: the user did not mention Apex. This orchestrator only supports Apex-backed Lightning Types, so the `new-lightning-type-with-widget` path implicitly engages `platform-apex-generate` because the new typed Lightning Type requires a backing Apex class. The orchestrator surfaces this Apex step in the Phase 3 build plan so the developer sees what it intends to do.
8
+
9
+ ## Walkthrough
10
+
11
+ **Phase 1 — Path selection.** User asks for a new Lightning Type plus a widget. Pick the `new-lightning-type-with-widget` path: `platform-apex-generate` → `platform-custom-lightning-type-generate` → `platform-widget-generate`. Apex backing for the typed payload is implied; do not ask the user to confirm Apex is wanted.
12
+
13
+ **Phase 2 — Lightning Type discovery.** **Skipped.** The prompt is explicit about creating a new Lightning Type, so there is no existing schema to discover and no fingerprint to capture.
14
+
15
+ **Phase 3 — Build plan.** Print:
16
+
17
+ ```text
18
+ Lightning Type + Widget Build Plan: accountBriefingWidget
19
+
20
+ PLAN: Create a new Apex class, Lightning Type, and widget for AccountBriefing.
21
+
22
+ LIGHTNING TYPE:
23
+ Name: AccountBriefing
24
+ Source: newly created
25
+ Path: force-app/main/default/lightningTypes/AccountBriefing/schema.json
26
+ Renderer (wires the Lightning Type to the widget): force-app/main/default/lightningTypes/AccountBriefing/lightningDesktopGenAi/renderer.json
27
+ Apex class FQN: c__AccountBriefing
28
+
29
+ APEX (only when creating a new Lightning Type — auto-engaged because this orchestrator only supports Apex-backed Lightning Types):
30
+ Class name: AccountBriefing
31
+ Class FQN: c__AccountBriefing
32
+ Shape: outer class with @AuraEnabled fields (accountName, ownerName, lastActivityDate, primaryContact: Contact, openOpportunities: List<OpenOpportunity>). Contact is an inner class for a singular nested object. OpenOpportunity is an inner class for nested list elements. The Apex shape itself is owned by platform-apex-generate.
33
+ Returns: typed payload shaped to AccountBriefing
34
+
35
+ WIDGET:
36
+ Name: accountBriefingWidget
37
+ Output:
38
+ force-app/main/default/uiWidgets/accountBriefingWidget/accountBriefingWidget.json
39
+ force-app/main/default/uiWidgets/accountBriefingWidget/schema.json
40
+ force-app/main/default/uiWidgets/accountBriefingWidget/accountBriefingWidget.uiwidget-meta.xml
41
+ Schema source: derived from Apex class @AuraEnabled fields via the Lightning Type
42
+ Layout intent: header card (name + owner + last activity + primary contact name/title via dot-notation), body list (top opportunities with forEach over List<OpenOpportunity>)
43
+ Properties omitted: none
44
+
45
+ SUB-SKILLS THAT WILL RUN:
46
+ platform-apex-generate
47
+ platform-custom-lightning-type-generate
48
+ platform-widget-generate
49
+
50
+ VALIDATIONS THAT WILL RUN AFTER GENERATION:
51
+ Widget bundle self-validation (run by platform-widget-generate):
52
+ - widget schema.json parses, root keys correct, every leaf has lightning:type
53
+ - every {!$attrs.X} (and {!$attrs.primaryContact.name} for the singular nested contact object, {!$item.X} inside forEach) resolves
54
+ - <name>.uiwidget-meta.xml is well-formed XML, root is <UiWidgetBundle>, and declares <masterLabel>, <description>, and <widgetType>JSON</widgetType>
55
+ Cross-skill checks (run by this orchestrator):
56
+ - renderer-wires-widget: renderer.json references @widget/c/accountBriefingWidget with one {!$attrs.<schemaPropertyName>} mapping per widget schema property
57
+ - field-trace: print @AuraEnabled fields from AccountBriefing plus inner classes Contact and OpenOpportunity, widget properties (with nested dot paths and list-item paths expanded), and the diff
58
+ - deploy-check: `sf project deploy --check-only --source-dir force-app/main/default/classes/AccountBriefing.cls,force-app/main/default/lightningTypes/AccountBriefing` (RUN the command — do not assume).
59
+
60
+ ----------------------------------------------------------------
61
+ STOP — wait for the user to Approve or Decline.
62
+ ```
63
+
64
+ User picks Approve.
65
+
66
+ **Phase 4 — Generation.**
67
+
68
+ 1. Load `platform-apex-generate`. Author `AccountBriefing.cls` (outer class with `@AuraEnabled` fields including `Contact primaryContact` as a singular nested object and `List<OpenOpportunity> openOpportunities` as a list-element collection; `Contact` and `OpenOpportunity` are inner classes). Capture FQN `c__AccountBriefing` (outer-class form for this example).
69
+ 2. Load `platform-custom-lightning-type-generate`. Author `lightningTypes/AccountBriefing/schema.json` with `lightning:type: "@apexClassType/c__AccountBriefing"` (outer-class form).
70
+ 3. Load `platform-widget-generate`. Pass the Lightning Type schema path, the Apex class FQN, and the widget name. The widget skill derives its `schema.json` and writes the three widget files. `Contact primaryContact` becomes a `lightning__objectType` property bound via `{!$attrs.primaryContact.name}` etc.; `List<OpenOpportunity>` becomes a `lightning__listType` property whose body iterates with `forEach`/`forItem` and binds `{!$item.<innerField>}`.
71
+ 4. Author `lightningTypes/AccountBriefing/lightningDesktopGenAi/renderer.json` using the **widget rendition pattern** (see `platform-custom-lightning-type-generate/SKILL.md` step 4): a thin wrapper whose first child is `"definition": "@widget/c/accountBriefingWidget"` with attribute mappings binding each widget attribute to a Lightning Type schema property via `{!$attrs.<schemaPropertyName>}`.
72
+
73
+ **Phase 5 — Validation.** The widget skill reports its own self-validation results. This orchestrator runs `renderer-wires-widget`, `field-trace`, and `deploy-check` (the `sf project deploy --check-only ...` command above). Reporting `pass` without running `deploy-check` is a hard violation — report `not run` instead.
74
+
75
+ **Phase 6 — Summary.** Print each validation result by name and value (`renderer-wires-widget: pass`, `field-trace: pass`, `deploy-check: pass`), files generated, and the deploy command.
@@ -0,0 +1,67 @@
1
+ # Build Plan Format
2
+
3
+ Use this template in Phase 3 to print the plan before the STOP gate. Fill every section. Do not abbreviate.
4
+
5
+ ---
6
+
7
+ ```text
8
+ Lightning Type + Widget Build Plan: <widgetName>
9
+
10
+ PLAN: <one line in developer-facing terms, e.g.:
11
+ "Generate a widget that renders the existing OrderStatusResponse Lightning Type"
12
+ OR
13
+ "Create a new Apex class, Lightning Type, and widget for AppointmentSummary">
14
+
15
+ LIGHTNING TYPE:
16
+ Name: <TypeName>
17
+ Source: <existing in local project | retrieved from org | newly created>
18
+ Path: <pkgDir>/lightningTypes/<TypeName>/schema.json
19
+ Renderer (wires the Lightning Type to the widget): <pkgDir>/lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json
20
+ Schema fingerprint (captured before any sub-skill runs): <hex SHA-256> # omit when source is "newly created"
21
+ Apex class FQN: <namespace>__<ClassName>[$<InnerClass>] # outer-class form, or inner-class form when the CLT roots on a specific inner class
22
+
23
+ APEX (only when creating a new Lightning Type — auto-engaged because this orchestrator only supports Apex-backed Lightning Types):
24
+ Class name: <ClassName>
25
+ Class FQN: <namespace>__<ClassName>
26
+ Shape: outer class with @AuraEnabled fields matching the desired Lightning Type payload. Inner classes are used for nested list-element types (e.g. List<OpenOpportunity>) and for singular nested objects (e.g. Address address). The Apex shape itself is owned by platform-apex-generate; this plan records the FQN and field summary, not the class body.
27
+ Returns: typed payload shaped to <TypeName>
28
+
29
+ WIDGET:
30
+ Name: <widgetName>
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 Apex class @AuraEnabled fields via the Lightning Type | derived from prompt fields>
36
+ Layout intent: <one-line description of the widget composition>
37
+ Properties omitted: <list any Apex class fields the widget intentionally drops, e.g. lastUpdatedTime, audit fields — or "none">
38
+
39
+ SUB-SKILLS THAT WILL RUN:
40
+ <list per the chosen path's row in SKILL.md — skill IDs only>
41
+
42
+ VALIDATIONS THAT WILL RUN AFTER GENERATION:
43
+ Widget bundle self-validation (run by platform-widget-generate):
44
+ - widget schema.json parses and has the required root keys
45
+ - every leaf in properties has a lightning:type
46
+ - every {!$attrs.X} (and {!$attrs.<outer>.<inner>} for nested objects, {!$item.X} inside forEach) resolves
47
+ - <name>.uiwidget-meta.xml is well-formed XML, root is <UiWidgetBundle>, and declares <widgetType>JSON</widgetType>
48
+ Cross-skill checks (run by this orchestrator):
49
+ - lightning-type-unchanged: when an existing Lightning Type was used as input, its schema.json is byte-identical to the version captured before this run
50
+ - renderer-wires-widget: the Lightning Type's renderer.json exists and references this widget via `@widget/c/<widgetName>`, with one {!$attrs.<schemaPropertyName>} mapping per widget schema property
51
+ - field-trace (advisory): print the @AuraEnabled fields from the outer Apex class plus every inner class referenced as a singular nested object or List<InnerClass>; print the widget schema properties (expanded for nested objects and list items); print the diff. Invented widget fields fail; omissions not declared above warn.
52
+ - deploy-check (advisory, new-type path only): `sf project deploy --check-only --source-dir <pkgDir>/classes/<ClassName>.cls,<pkgDir>/lightningTypes/<TypeName>` is run and the result reported.
53
+
54
+ ----------------------------------------------------------------
55
+ STOP — wait for the user to Approve or Decline.
56
+ The host surface may render Approve/Decline as buttons; a text reply ("approve", "yes", "go") is also accepted.
57
+ A Decline (or edits to the plan) reprints the plan; the orchestrator does not write any file until an explicit Approve.
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Notes for the model
63
+
64
+ - If the user replies with edits or declines, revise the plan and reprint it. Do not assume which sections changed.
65
+ - Approval applies only to the plan as printed. If the user later asks for additional widgets or Lightning Types, start a new planning cycle for the new ask.
66
+ - Do not print this plan inside a code fence that the user might mistake for output. The plan is conversational, not a file.
67
+ - "Properties omitted" makes intentional drops explicit. Examples of fields that often do not belong on a render surface: `lastUpdatedTime`, `createdBy`, audit timestamps, internal IDs.