From f8799ac74ad61c74f0a09d79f9ecd12f1bcd2047 Mon Sep 17 00:00:00 2001 From: Ethan Clapham Date: Tue, 24 Mar 2026 23:22:07 -0700 Subject: [PATCH] W-21707233 Make template command use required (#102) * @W-21707233 make template instructions more explicit * convert escaped quotes to single quotes in frontmatter --------- Co-authored-by: Hemant Singh Bisht --- skills/generating-flexipage/SKILL.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/skills/generating-flexipage/SKILL.md b/skills/generating-flexipage/SKILL.md index b0c5c99..7706cb2 100644 --- a/skills/generating-flexipage/SKILL.md +++ b/skills/generating-flexipage/SKILL.md @@ -1,6 +1,6 @@ --- name: generating-flexipage -description: "Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like \"create a Lightning page\", \"add a component to a page\", \"customize the record page\", \"generate a FlexiPage\", or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention \"page\" in the context of Salesforce." +description: "Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like 'create a Lightning page', 'add a component to a page', 'customize the record page', 'generate a FlexiPage', or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention 'page' in the context of Salesforce." --- ## When to Use This Skill @@ -20,6 +20,8 @@ Use this skill when you need to: ## Overview +**CRITICAL: When creating NEW FlexiPages, you MUST ALWAYS start with the CLI template command.** Never create FlexiPage XML from scratch - the CLI provides valid structure, proper regions, and correct component configuration that prevents deployment errors. + Generate Lightning pages (RecordPage, AppPage, HomePage) using CLI bootstrapping for component discovery and configuration. --- @@ -28,6 +30,8 @@ Generate Lightning pages (RecordPage, AppPage, HomePage) using CLI bootstrapping ### Step 1: Bootstrap with CLI +**MANDATORY FOR NEW PAGES: This step is NOT optional.** Always use the CLI template command when creating a new FlexiPage. The CLI generates valid XML structure, proper regions, and correct metadata that prevents common deployment errors. Only skip this step if you're editing an existing FlexiPage file. + ```bash sf template generate flexipage \ --name \ @@ -39,6 +43,10 @@ sf template generate flexipage \ --output-dir force-app/main/default/flexipages ``` +**Field Selection Guidelines:** +- **Validate fields exist**: Use MCP tools or describe commands to discover available fields for the object before specifying them in the command +- **Prefer compound fields**: Use `Name` (not `FirstName`/`LastName`), `BillingAddress` (not `BillingStreet`/`BillingCity`/`BillingState`), `MailingAddress`, etc. when available + **Template-specific requirements:** - **RecordPage**: Requires `--sobject` (e.g., Account, Custom_Object__c) - **RecordPage**: Requires `--primary-field` and `--secondary-fields` for dynamic highlights, `--detail-fields` for full record details. Use the most important identifying field as primary, e.g. Name. Use the secondary fields (max 12, recommended 4-6) to show a summary of the record. Use detail fields to show the full details of the record. @@ -474,7 +482,7 @@ Identifier Pattern: flexipage_richText or flexipage_richText_{sequence} ## Validation Checklist Before deploying: -- [ ] Used CLI to bootstrap (don't start from scratch) +- [ ] **[NEW PAGES ONLY]** Used CLI to bootstrap - NEVER create FlexiPage XML from scratch - [ ] **ALL identifiers are unique** - no duplicate `` values anywhere in file - [ ] **ALL region/facet names are unique** - no duplicate `` values in `` - [ ] **Multiple components in same facet are combined** - ONE region with multiple ``, NOT separate regions with same name