
Generating Flexipage
Create or change Salesforce Lightning FlexiPages via CLI-backed templates and valid metadata XML instead of hand-written pages that fail deployment.
Install
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-flexipageWhat is this skill?
- HARD-GATE: new FlexiPages must start from Salesforce CLI template generation, never from scratch XML
- Covers RecordPage, AppPage, and HomePage metadata patterns
- Adds and configures components, regions, and flexipage-meta.xml edits
- Troubleshoots deployment errors tied to FlexiPage structure
- Triggered by Lightning page, FlexiPage, or *.flexipage-meta.xml work in Salesforce context
Adoption & trust: 733 installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Frontend Designanthropics/skills
Vercel React Best Practicesvercel-labs/agent-skills
Remotion Best Practicesremotion-dev/skills
Vercel Composition Patternsvercel-labs/agent-skills
Develop Userscriptsxixu-me/skills
Next Best Practicesvercel-labs/next-skills
Journey fit
Common Questions / FAQ
Is Generating Flexipage safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Generating Flexipage
## When to Use This Skill Use this skill when you need to: - Create Lightning pages (RecordPage, AppPage, HomePage) - Generate FlexiPage metadata XML - Add components to existing FlexiPages - Troubleshoot FlexiPage deployment errors - Understand FlexiPage structure and component configuration - Work with page layouts or Lightning page customization - Edit or update ANY *.flexipage-meta.xml file ## Specification # FlexiPage Generation Guide ## 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. --- ## Quick Start Workflow ### 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 <PageName> \ --template <RecordPage|AppPage|HomePage> \ --sobject <SObject> \ --primary-field <Field1> \ --secondary-fields <Field2,Field3> \ --detail-fields <Field4,Field5,Field6,Field7> \ --output-dir force-app/main/default/flexipages ``` **CRITICAL:** If the `sf template generate flexipage` command fails, **STOP**. 1. Install the templates plugin: ```bash sf plugins install templates ``` 2. Retry the `sf template generate flexipage` command 3. Verify the FlexiPage XML file was created Do NOT continue to Step 2 until the template command succeeds. The generated XML is required for the entire workflow. #### **Template-specific requirements** **RecordPage:** - Requires `--sobject` (e.g., Account, Custom_Object__c) - Requires field parameters: - `--primary-field`: Most important identifying field (e.g., Name) - `--secondary-fields`: Record summary (recommended 4-6, max 12) - `--detail-fields`: Full record details, including required fields (e.g., Name) **AppPage:** - No additional requirements **HomePage:** - No additional requirements #### **Field Selection Rules** - **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 - **Include required fields in detail-fields**: Always include object required fields (like `Name`) in the `--detail-fields` parameter, even if they're also used in `--primary-field` or `--secondary-fields` #### **What you get** - Valid FlexiPage XML with correct structure - Pre-configured regions and basic components - Proper field references and facet structure - Ready to deploy as-is or enhance further ### Step 2: Deploy Base Page Run a **dry-run** deployment of the entire project to validate the page and dependencies: ```bash sf project deploy start --dry-run -d "force-app/main/