platform-report-generate
forcedotcom/sf-skills
Generate and validate Salesforce Lightning Report metadata (.report-meta.xml) for tabular, summary, matrix, and joined reports.
What is platform-report-generate?
Creates or validates Salesforce Lightning Report metadata files (.report-meta.xml) for various report formats including tabular, summary, matrix, and joined reports. Use this when building reports with columns, groupings, filters, charts, buckets, or time-frame filters—but not for Custom Report Types, dashboards, or list views.
- Generate .report-meta.xml files for Tabular, Summary, Matrix, and Joined report formats
- Define columns, row/column groupings, filters, and aggregations with platform-specific column names
- Add charts, cross-filters, buckets, and time-frame filters to reports
- Validate report metadata against deployment rules (grouping conflicts, column names, scope, filter syntax)
- Create corresponding folder metadata with sharing settings for report organization
How to install platform-report-generate
npx skills add https://github.com/forcedotcom/sf-skills --skill platform-report-generate- Salesforce project with sfdx-project.json configured
- Access to valid report type API names (standard or custom)
- Understanding of report format requirements (Tabular, Summary, Matrix, Joined)
How to use platform-report-generate
- 1.Gather report requirements: object, fields, groupings, filters, and chart type
- 2.Determine report format based on grouping needs (no groupings=Tabular, row groupings=Summary, row+column=Matrix, multi-object=Joined)
- 3.Call MCP tools (get_metadata_type_sections or get_metadata_type_context) to confirm valid platform column names for your report type
- 4.Author the .report-meta.xml file using the appropriate example template and adapt for your columns, filters, and groupings
- 5.Create the folder structure (reports/<FolderName>/<ReportName>.report-meta.xml and reports/<FolderName>-meta.xml) with folder sharing metadata
- 6.Validate against the verification checklist: no grouping fields in columns, correct column names, valid scope, flat filter names, proper filter syntax
- 7.Deploy and verify the report renders correctly in Salesforce
Use cases
- Build a summary report grouped by Stage with aggregated opportunity amounts and a chart
- Create a matrix report showing opportunities by Stage (rows) and Quarter (columns)
- Generate a filtered tabular report of accounts created in the current year
- Add cross-filters to a joined report combining data from multiple objects
- Validate and fix deployment errors in existing .report-meta.xml files
- Salesforce developers building reports programmatically
- Admins automating report creation in CI/CD pipelines
- Teams generating reports from metadata templates
- Developers validating report metadata before deployment
platform-report-generate FAQ
This skill generates Lightning Report metadata (.report-meta.xml) that uses existing report types. Use platform-custom-report-type-generate to define the structure of a custom report type itself.
Fields used in <groupingsDown> or <groupingsAcross> must NOT also appear in <columns>—this is a critical deployment rule. Remove the field from columns if it's already a grouping.
Call the MCP tool get_metadata_type_sections or get_metadata_type_context with your report type API name. Do not use raw API field names like 'CloseDate'—use platform report column names like 'CLOSE_DATE'.
No. Filter <column> values must use flat platform names (e.g., INDUSTRY, TYPE) without dot notation. Dot notation will cause deployment failures.
Summary reports have row groupings only (<groupingsDown>). Matrix reports have both row groupings (<groupingsDown>) and column groupings (<groupingsAcross>). Charts and aggregates work in both.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: platform-report-generate description: "Use when users create, generate, or validate Salesforce Lightning Report metadata (.report-meta.xml) — tabular, summary, matrix, or joined reports with columns, groupings, filters, charts, cross-filters, buckets, formulas, or time-frame filters. Triggers on "create a report", "build a report", "add a chart", or .report-meta.xml deploy errors. Do NOT trigger for Custom Report Type metadata (use platform-custom-report-type-generate), dashboards, list views, running reports in the UI, or SOQL." metadata: version: "1.0" domains: ["Platform"] minApiVersion: "60.0" relatedSkills: - "platform-custom-report-type-generate" mcpTools: salesforce-api-context: tools: ["get_metadata_type_context", "get_metadata_type_sections", "get_metadata_type_shape"] semver: ">=1.0.0"
Overview
Lightning Reports define how Salesforce data is queried, grouped, filtered, and displayed. Each report is a single .report-meta.xml file placed under reports/<FolderName>/ within the project's source directory (check sfdx-project.json → packageDirectories[].path for the source root).
Critical Rules (Read First)
TOP DEPLOYMENT KILLERS — check these BEFORE generating any report:
- Grouping fields in columns — Fields in
<groupingsDown>or<groupingsAcross>must NEVER also appear in<columns> - Wrong column names — Column names are report-type-specific. ALWAYS call MCP tools to verify (see
references/column-names.md) - Wrong scope — LeadList uses
org, notorganization - Filter column dot notation — Filter
<column>values use FLAT names (INDUSTRY,TYPE) NOT dot notation (ACCOUNT.INDUSTRYis INVALID) - Multi-value picklist filters — Use ONE
<criteriaItems>with comma-separated<value>(e.g.,Technology,Financial Services). Do NOT split into multiple criteriaItems with booleanFilter
Rule 1: Format Determines Required Elements
| Format | <groupingsDown> | <groupingsAcross> | <block> |
|---|---|---|---|
Tabular | Not allowed | Not allowed | No |
Summary | At least 1 (max 3) | Not allowed | No |
Matrix | At least 1 (max 3) | At least 1 (max 3) | No |
Joined | Not at top level | Not at top level | At least 2 (max 5) |
Rule 2: Use Platform Column Names
Report metadata uses platform report column names, NOT raw API field names. ALWAYS call get_metadata_type_sections or get_metadata_type_context to confirm valid column names. See references/column-names.md for common mappings per report type.
Rule 3: Valid Report Type Required
<reportType> must be a standard API name (e.g., Opportunity, AccountList, CaseList, LeadList, AccountContactRole) or a deployed custom report type developer name.
Rule 4–5: Chart & Aggregates Require Summary/Matrix
Charts and <aggregateTypes> (Sum, Average, etc.) only work in Summary and Matrix reports.
Rule 6–8: Limits
- Max 3 cross-filters per report, each with up to 5 criteria items
<filterLogic>must reference all filters sequentially (e.g.,1 AND (2 OR 3))- Joined reports: 2–5 blocks, each block format must be Summary or Matrix (not Tabular)
Rule 9: Folder Structure
Reports must live inside a folder with a corresponding folder metadata file:
<sourceDir>/reports/<FolderName>/<ReportName>.report-meta.xml
<sourceDir>/reports/<FolderName>-meta.xml
Determine <sourceDir> from sfdx-project.json (commonly force-app/main/default, but this is configurable).
Rule 10–11: Date Columns & Scope
- Date columns use platform names (
CLOSE_DATE, notCloseDate) - LeadList scope is
org; Opportunity/AccountList/CaseList useorganization
Rule 12–13: Description & Groupings
<description>max 255 characters- Grouping fields must NOT appear in
<columns>— automatic deployment failure
Rule 14: Folder Metadata Requires <sharedTo>
<?xml version="1.0" encoding="UTF-8"?>
<ReportFolder xmlns="http://soap.sforce.com/2006/04/metadata">
<folderShares>
<accessLevel>Manage</accessLevel>
<sharedTo>AllInternalUsers</sharedTo>
<sharedToType>Group</sharedToType>
</folderShares>
<name>My Report Folder</name>
</ReportFolder>
Rule 15: Valid Date Intervals Only
Use INTERVAL_CURRENT for "this quarter", INTERVAL_CURY for "this year", INTERVAL_LAST30 for last 30 days. Do NOT use INTERVAL_CURQ — it is not valid. See references/date-intervals.md for the full list.
Top-Level Elements
| Element | Required | Notes |
|---|---|---|
<name> | Yes | Report name (max 40 chars) |
<reportType> | Yes | Report type API name |
<format> | Yes | Tabular, Summary, Matrix, or Joined |
<scope> | Recommended | organization (or org for LeadList) |
<columns> | Yes | Field columns — each has <field> and optional <aggregateTypes> |
<filter> | No | Contains <criteriaItems> with <column>, <operator>, <value> |
<groupingsDown> | Conditional | Row groupings: <field>, <dateGranularity>, <sortOrder> |
<groupingsAcross> | Conditional | Column groupings (Matrix only) |
<timeFrameFilter> | Recommended | <dateColumn>, <interval>, optional <startDate>/<endDate> |
<chart> | No | See references/chart-types.md |
<buckets> | No | Bucket field definitions |
<crossFilters> | No | Cross-object filters (with/without) |
<showDetails> | Recommended | true/false |
<showGrandTotal> | Recommended | true/false |
<showSubTotals> | Recommended | true/false |
<description> | Recommended | Business purpose (max 255 chars) |
<block> | Conditional | Joined format blocks |
Filter Syntax
<filter>
<criteriaItems>
<column>STAGE_NAME</column>
<operator>equals</operator>
<value>Closed Won</value>
</criteriaItems>
</filter>
Multi-value picklist: Use ONE criteriaItem with comma-separated values:
<criteriaItems>
<column>INDUSTRY</column>
<operator>equals</operator>
<value>Technology,Financial Services</value>
</criteriaItems>
Common operators: equals, notEqual, lessThan, greaterThan, contains, startsWith, includes, excludes, isBlank, notBlank. Full list in references/filter-operations.md.
Generation Workflow
- Gather Requirements — object, fields, groupings, filters, chart needs
- Determine Format — no groupings → Tabular; row groupings → Summary; row + column → Matrix; multiple objects → Joined
- Identify Column Names — call
get_metadata_type_sectionsMCP tool to get valid platform column names for the report type - Author Metadata — start from closest example in
examples/and adapt - Create Folder — generate folder directory +
<FolderName>-meta.xmlwith<folderShares> - Validate — run through
references/verification-checklist.md
Reference File Index
| File | When to read |
|---|---|
references/column-names.md | Step 3 — column name mappings per report type |
references/date-intervals.md | When setting timeFrameFilter intervals |
references/chart-types.md | When adding a chart — all 17 types + legendPosition rules |
references/filter-operations.md | When building filters — complete operator reference |
references/verification-checklist.md | Step 6 — pre-deploy validation |
references/errors-and-troubleshooting.md | When fields are missing or deployment fails |
examples/TabularOpportunitiesReport.report-meta.xml | Tabular report template |
examples/OpportunitiesByStageReport.report-meta.xml | Summary report with chart |
examples/OpportunitiesByStageAndQuarter.report-meta.xml | Matrix report template |
examples/AccountsCreatedThisYear.report-meta.xml | Filtered report with time frame |
Related skills
More from forcedotcom/sf-skills and the wider catalog.

platform-sandbox-configure
Manage Salesforce sandbox lifecycle—create, refresh, activate, and delete sandboxes via Connect REST API.

platform-sharing-owd-configure
Retrieve and update Organization-Wide Default (OWD) sharing settings for Salesforce objects.

platform-sharing-rules-generate
Create, edit, and delete Salesforce Sharing Rules metadata for record-level access control.

platform-soql-query
Generate, optimize, and debug Salesforce SOQL/SOSL queries with relationship, aggregate, and performance analysis.

platform-tracing-agentforce-configure
Generate AgentforcePlatformTracingSettings metadata to enable or disable Agentforce agent execution trace spans to Data Cloud.

platform-tracing-configure
Generate EventSettings metadata to enable or disable Platform Tracing (TraceSpanEvent publishing) in Event Monitoring.