/sf-platform:platform-metadata-discovery-getfrom Salesforce — Platform & Apex
Discovers existing Salesforce metadata before creating or modifying objects, fields, picklists, permission sets, pages, apps, or flows. Routes queries to metadata grounding, scoped SOQL, sf data query, sf sobject list/describe, sf org list metadata, source retrieval, or local files.
Ships in Salesforce — Platform & Apex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before you create metadata, change it, or write code that references it, know what already exists in the org. This skill picks the tool for each question. Metadata grounding finds metadata by meaning when you do not know its name. It needs Salesforce Catalog and a connected grounding server, and many orgs and setups have neither. Every other route works with the sf CLI alone.
Skip discovery when the request only changes local files and adds no new references to org metadata.
Do this once per session, before the first lookup.
sf org display --json to see the default org and its id. If no org is authenticated, ask the user to run sf org login web and wait. If you cannot run commands at all, read references/h360-routes.md.search_metadata, query_metadata, describe_metadata) or the Salesforce MCP is connected. The Salesforce MCP is shown in Setup today as the Headless360 (H360) MCP Server. Its tools are describe, dispatch, and dispatch_readonly, which are different from the Metadata Grounding MCP tools.sf org display, tell the user and ask which org to use before you combine results.| Intent | Use | If that is not available |
|---|---|---|
| Find metadata by meaning, check a name you are guessing, or check for something to reuse | Metadata grounding search. Load platform-metadata-grounding-get, which picks the server. | Name and label fallback, below. Notify. |
| Explain how something is configured, or who can access it | Metadata grounding query | Scoped SOQL on EntityParticle, FieldPermissions, ObjectPermissions, or Tooling ValidationRule. Notify. |
| Check names, types, or picklist values you know. Every field on one object. Data records | Scoped SOQL with sf data query. If it returns nothing, search by meaning. | See the note below the table. |
| Full shape of one object, including relationships | sf sobject describe --sobject <Type>, only when you need all of it. It is very large. | Same |
| Every object in the org | sf sobject list --sobject all or --sobject custom | Same |
| Every member of a type, or a count ("all flows", "how many flows") | sf org list metadata --metadata-type <Type> | Same |
| Source to edit or deploy, including changes to existing metadata | Load platform-metadata-retrieve. Grounding never returns source. | Tell the user this needs the sf CLI. |
| Metadata you are already editing locally | Local files | |
| Compare orgs, find drift, or an overview of a whole org when the user asks for one | dx-org-analyze. It takes minutes and returns names and counts. | Tell the user this needs the sf CLI. |
| Where is this used, what depends on it, what breaks if I change it, or is it safe to delete | Comprehensive analysis is not available yet. State that boundary before offering explicitly labeled partial checks. |
Without the CLI. If you cannot run commands but the Salesforce MCP is connected, use references/h360-routes.md for rows 3 to 6. If neither is available, tell the user the lookup needs the sf CLI or the Salesforce MCP.
These routes apply even when a connected server says to use it first for every Salesforce task. Use the CLI for rows 3 to 7 when you can run commands.
A question about a topic or purpose ("what do we have for loyalty") is discovery, not an overview. Do not run an org analysis for it, even when grounding is not available.
This skill covers core platform metadata. For Data Cloud DLO and DMO schema, use data360-code-extension-generate.
When a request mixes intents, use the right tool for each part. "Add a tier discount step to our order flow" means finding the flow and the field, then retrieving the flow to edit.
Scoped SOQL is a targeted query on setup objects, filtered to what you need. It is exact, real time, and far smaller than a describe. It never returns source.
sf data query --json --query "SELECT QualifiedApiName, Label, DataType FROM EntityParticle WHERE EntityDefinition.QualifiedApiName = 'Contact'"
sf data query --json --query "SELECT Value, Label, IsDefaultValue, IsActive FROM PicklistValueInfo WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Contact' AND EntityParticle.QualifiedApiName = 'Loyalty_Tier__c'"
AND QualifiedApiName IN ('Loyalty_Tier__c', 'Lifetime_Orders__c'). For custom fields only, add AND QualifiedApiName LIKE '%__c'.EntityParticle includes parts of compound fields, such as MailingCity.--use-tooling-api for CustomField and ValidationRule.EntityDefinition, EntityParticle, and FieldDefinition do not accept OR. Run one scoped query per condition instead of broadening the query or removing its object/type filters.More patterns, including access and automation, are in references/scoped-soql.md.
Say the line below once per session, in your answer, next to the results of the name and label search. Do not announce the fallback before you search, and do not repeat it later in the session. Use the line that matches the cause, word for word, including the last sentence. Do not shorten or rephrase it. If you stop before you can report results, say it in that message instead.
| Cause | Say |
|---|---|
| No grounding server connected | "Metadata Grounding isn't connected, so I matched by name and label, which can miss metadata named differently. Connect the Metadata Grounding MCP to search by meaning." |
| Catalog not enabled | "Salesforce Catalog isn't turned on in this org, so I matched by name and label, which can miss metadata named differently. An admin can turn on Salesforce Catalog through Feature Manager in Data Cloud Setup." |
| Permission missing | "Catalog search needs the Customize Application permission, so I matched by name and label, which can miss metadata named differently." |
Then search names and labels. Try two or three likely words, one LIKE per query.
sf data query --json --query "SELECT QualifiedApiName, Label FROM EntityDefinition WHERE Label LIKE '%loyalty%'"
sf data query --json --query "SELECT QualifiedApiName, Label, DataType FROM EntityParticle WHERE EntityDefinition.QualifiedApiName = 'Contact' AND Label LIKE '%tier%'"
sf data query --json --use-tooling-api --query "SELECT DeveloperName, EntityDefinition.QualifiedApiName FROM CustomField WHERE DeveloperName LIKE '%tier%' AND NamespacePrefix = null"
sf data query --json --query "SELECT ApiName, Label, ProcessType, IsActive FROM FlowDefinitionView WHERE Label LIKE '%order%'"
CustomField query searches custom fields on every object. DeveloperName has no __c. Drop rows with no object name. They are Data Cloud fields.sf org list metadata and scan them.Everything else in this skill still applies.
Before you create an object, field, picklist, permission set, page, app, or flow:
SObject for the exact object API name, then pass that result's returned identifier as parentIdentifier to the SObjectField search. Never pass the raw object API name as parentIdentifier. A proposed API name or label is only an exact collision check and does not prove that equivalent metadata is absent. Similar words alone are not enough to declare a match.Treat namespaced items, such as force__ permission sets or managed package components, as references, not things to edit. Say so when a match is managed.
Before you write Apex, LWC, SOQL, or Flow logic, confirm every object, field, and picklist value it references.
Account.Name or Contact.Email).To find automation by what it does, search Flow or ApexClass by meaning. A grounding query on a flow shows its trigger object, trigger type, and active status.
To list everything that runs on an object before adding automation:
sf data query --json --query "SELECT Name, Status FROM ApexTrigger WHERE TableEnumOrId = 'Contact'"
sf data query --json --query "SELECT ApiName, Label, TriggerType, IsActive FROM FlowDefinitionView WHERE TriggerObjectOrEventId = 'Contact'"
To understand what a flow or trigger does, retrieve its source and read it.
| Question | Answer with |
|---|---|
| What exists that does X | Grounding search |
| How a field, object, or validation rule is configured | Grounding query, or EntityParticle and Tooling ValidationRule |
| Who can read or edit a field or object | Grounding on FieldPermissions, or SOQL on FieldPermissions and ObjectPermissions for a complete list. These records prove configured access, not actual use; a permission container's name does not prove an integration or dependency is active. |
| Sharing rules, roles, groups, and which package a component came from | Grounding |
| What a flow is | Grounding gives the header only (type, trigger, active). For its steps, retrieve the source. |
| What an Apex class does | Grounding gives signatures only. Retrieve the source. |
| Why a save failed | A partial answer. Check validation rules on the object, then retrieve the automation that runs on it. |
| Page layouts, reports, custom metadata types, custom settings | Not in the catalog. Use sf org list metadata and retrieve. |
| Where something is used, what depends on it, what breaks if it changes, or whether it is safe to delete | Comprehensive analysis is not available yet. Say so before any checks. You may offer narrow checks, but label each one as partial and never present their union as complete or conclude that the change is safe. |
sfdx-project.json and search those directories. Exclude response exports, logs, generated output, caches, and agent configuration unless the user explicitly asks to inspect them.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub reej-consulting/reej-sf-skills --plugin sf-platform43 skills in this plugin
/crm-analytics-wave-generateUse to build a Wave Recipe, deploy a CRM Analytics dataset or dashboard, or author the full CRMA asset stack — apps, Wave Recipes (.wdpr), datasets, and dashboards — against a connected Salesforce org via REST and Metadata APIs, without CRM Analytics Studio or Dashboard Builder. TRIGGER when: user asks to build or create a Wave Recipe, generate a .wdpr or .wdpr-meta.xml, deploy a .wdash or .wapp, run a recipe or dataflowjob programmatically, upload CSV data via InsightsExternalData, validate a dataset schema with synthetic data, fetch dataset XMD, audit dashboard SAQL re-encoding, or find unused dataset fields. TRIGGER on keywords: Wave Recipe, CRMA, CRM Analytics, wdpr, wdash, wapp, WaveRecipe, Wave dataflow, dataflowjob, InsightsExternalData, SAQL, dataset XMD, Analytics Studio, R3 format, wave/recipes, wave/dashboards, or analytics on Salesforce objects (opportunities, leads, cases, accounts, sales). DO NOT TRIGGER for standard Salesforce reports or LWC components unrelated to CRM Analytics./design-systems-slds2-migrateMigrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or styling hook selection. Covers all styling hook categories — color, spacing, sizing, typography, borders, radius, and shadows. Also use when users mention no-hardcoded-values, no-slds-class-overrides, lwc-to-slds-hooks, no-deprecated-tokens-slds1, or ask about SLDS component migration — even if they don't explicitly say "uplift" or "migration"./design-systems-slds-validateAudit Lightning Web Components for SLDS design-system compliance and produce a scored quality report. Runs the SLDS linter and analyzes CSS for theming hook usage and pairing, scoring SLDS findings across categories into an overall grade. Use when asked to "score my component's SLDS", "SLDS scorecard", "SLDS quality report", "audit SLDS compliance", "how good is my SLDS", "check SLDS quality", "rate my SLDS styling", "evaluate my component's SLDS", "is this component's SLDS ready to ship?", "look at my LWC for SLDS issues", "audit SLDS before I submit", "review my component's SLDS before code review", or any time a user wants an SLDS quality assessment or SLDS production-readiness check on an LWC. Not for fixing violations (use design-systems-slds2-migrate), building new components (use design-systems-slds-apply), or accessibility/WCAG/ARIA audits (use experience-accessibility-validate)./dx-apexguru-scanRun an ApexGuru performance scan on a Salesforce Apex project via the ApexGuru SFAP Scan API. Zips the project's Apex (any layout), submits it, polls to completion, decodes the base64 report, and presents performance antipattern violations (SOQL in loop, DML in loop, Schema.getGlobalDescribe(), SOQL without WHERE/LIMIT, unused SOQL fields) grouped by rule with severity, file:line, and suggested fixes — clearly attributed as 'Static only' or 'Production insights'. TRIGGER when the user says 'run ApexGuru', 'ApexGuru scan', 'check Apex performance', 'find governor-limit / performance antipatterns', 'SOQL in loop', 'scan my Apex for performance', or 'ApexGuru performance insights'. DO NOT TRIGGER for general static analysis or security scans (use dx-code-analyzer-run), for fixing code without scanning, or for onboarding an org to ApexGuru./dx-code-analyzer-configureSet up, configure, and troubleshoot Salesforce Code Analyzer for any project. Handles installation, prerequisite checks, diagnosing broken setups, creating and editing code-analyzer.yml overrides, engine-specific settings, ignore patterns, severity overrides, and CI/CD pipeline setup. TRIGGER when: user says 'set up code analyzer', 'configure code analyzer', 'install code analyzer', 'code analyzer not working', 'fix my setup', 'scan failing', 'check my setup', 'enable/disable engine', 'exclude files', 'change severity', 'set up GitHub Actions', 'set up CI/CD', 'add to pipeline', 'pipeline fail', 'update my workflow', 'quality gate', 'fail on violations', 'scan changed files only', 'add SARIF', 'code-analyzer.yml', 'ESLint config', 'increase SFGE memory', or reports errors running Code Analyzer. DO NOT TRIGGER when: user wants to run a scan (use dx-code-analyzer-run), fix violations, explain rules, create custom rules (use dx-code-analyzer-custom-rule-create), or suppress violations./dx-code-analyzer-custom-rule-createCreate custom Code Analyzer rules for Regex (pattern matching), PMD (XPath/AST for Apex and metadata XML), and ESLint (LWC/JavaScript/TypeScript). Use when users want to enforce coding standards, ban patterns, detect hardcoded values, govern metadata, or add rules not in the built-in set. TRIGGER when: user says 'create a rule', 'ban System.debug', 'enforce naming convention', 'detect hardcoded IDs', 'custom rule', 'xpath rule', 'regex rule', 'add a PMD rule', 'enforce a policy', 'create a check for', 'flag this pattern', 'make a rule that catches', 'metadata rule', 'check permissions', 'enforce API version', 'eslint rule', 'lwc rule', 'override rule threshold', 'customize complexity', or describes a pattern to enforce. DO NOT TRIGGER when: user wants to run a scan (use dx-code-analyzer-run), configure engines (use dx-code-analyzer-configure), or explain existing rules (use dx-code-analyzer-run).Other plugins' skills for the same job