Salesforce Org Explorer
Quick answer
This skill teaches an AI assistant to explore a Salesforce org read only and explain it in plain language. It discovers objects and fields through MCP schema tools or the sf CLI, finds the triggers, flows and validation rules on an object, and reports risks and anything it could not see. It never writes data or metadata.
What this skill does
- Finds objects with the MCP getObjectSchema two-phase discovery (index first, then one object) or sf sobject list and sf sobject describe.
- Summarizes an object: key fields, lookup and master-detail relationships, child relationships, record types and picklist values.
- Lists the Apex triggers, validation rules and flows on an object through read-only Tooling API queries and sf org list metadata.
- Traces where a field is used with the Tooling API MetadataComponentDependency object, and says when the result may be incomplete.
- Flags risks such as several triggers or record-triggered flows on one object, and lists what it could not see with the permissions in use.
When to use it
- You joined a project and need a quick map of an unfamiliar org or object.
- You are about to change a field and want to know what depends on it.
- You want to know what automation fires when a record is saved before you add more.
- You need a plain-language summary of an object for documentation or a design review.
What you need
- Connection: A Salesforce MCP server with schema tools (for example the hosted platform/sobject-reads server) or the Salesforce CLI logged in to an org. Without a connection it works only from output you paste in.
- Permissions: Read access to the objects you ask about. Listing metadata with the CLI needs Modify Metadata Through Metadata API Functions or Modify All Data, so some steps may be unavailable to a restricted user. The skill reports what it could not see.
How it works
- It reads the org context (getUserInfo or sf org display) and says whether the org is production.
- It narrows the question to one object, one area or one field, asking one short question if the name is ambiguous.
- It finds and describes the object with getObjectSchema or sf sobject describe and keeps only the fields that explain it.
- It queries triggers, validation rules and flows on the object with read-only Tooling API queries, checking real field names with a describe when a query fails.
- It traces field usage with the dependency object, and can retrieve specific metadata into a temporary project when you need a formula or definition.
- It writes a map with risks and a clear list of what it could not see.
Safety rules built into the skill
- Read-only: no DML, no deploys, no anonymous Apex, and no tool or command that creates, updates or deletes records or metadata.
- It uses only object and field names it has seen in tool output and never guesses an API name.
- It separates "no access", "empty result" and "does not exist" instead of presenting gaps as facts.
- It asks before writing retrieved metadata files into your project folder.
- It reads structure and configuration, not record data, and treats metadata as sensitive.
Try asking
- Give me a map of the Opportunity object: key fields, record types, and every trigger, flow and validation rule on it.
- Where is Contract_Value__c used in this org?
- Which custom objects exist in this sandbox, and which ones look unused?
- What automation fires when a Case is closed? Flag anything risky.
How to install a skill
A skill is a folder with a SKILL.md file: YAML frontmatter with a name and a
description, then plain Markdown instructions. An assistant reads the description to decide when the skill
applies and loads the rest only then. The format is the open
Agent Skills specification.
- Claude Code: unzip the download so the folder lands in
~/.claude/skills/salesforce-org-explorer/for all projects, or.claude/skills/salesforce-org-explorer/inside one project. Start a new session. - Claude app (web and desktop): upload the zip in the Skills section of your settings. Availability depends on your plan, and the menu names change, so check Anthropic's current help pages.
- Other assistants that support Agent Skills: copy the folder into the skills directory that assistant documents.
- Any other LLM: open
SKILL.mdand paste its contents into the system prompt, custom instructions or project instructions. You lose automatic loading, but the guidance works the same.
Skills that work with your org need a connection: a Salesforce MCP server added to your assistant, or the Salesforce CLI logged in to an org. Start with a sandbox or scratch org, and give the connection the least access that does the job.
The skill file (SKILL.md)
This is the exact file in the download. Read it before you install it.
---
name: salesforce-org-explorer
description: Read-only exploration of a Salesforce org's data model and configuration. Use when the user asks what objects exist, what fields, relationships, record types or picklist values an object has, which validation rules, Apex triggers or flows run on an object, or where a field is used. Uses MCP schema discovery first, then the sf CLI, and returns a plain-language map plus what could not be seen. Never writes.
license: MIT
metadata:
version: "1.0.0"
publisher: SFDX Talk (sfdxtalk.com)
---
# Salesforce Org Explorer
Build an accurate, plain-language map of part of a Salesforce org: the objects, the fields that matter, how they relate, and the automation that fires on them. Read only. Report what you could not see.
## Connection
Use whichever connection is available, in this order:
1. A Salesforce MCP server with schema tools (for example the hosted `platform/sobject-reads` server). `getUserInfo` returns the identity, profile and org details of the connected user. `getObjectSchema` is two-phase: call it with no object name for a lightweight index of accessible objects, then with an object name for that object's fields, record types and relationships. `soqlQuery` runs read-only queries. If a Headless 360 server is connected, `discover`, `describe` and `dispatch_readonly` (GET only) can reach other read endpoints. Tool names differ between servers: pick tools by what they do.
2. The Salesforce CLI logged in to an org, using `--target-org <alias>`. Check the login first with `sf org list`. Commands are in the workflow and query sections below.
3. No connection: say so, ask the user to paste describe output or retrieved metadata, and work only from that.
Never call a tool that creates, updates or deletes records or metadata, deploys, or runs anonymous Apex. If the connection could write, still only read.
## Workflow
1. **Get the org context.** With MCP call `getUserInfo`. With the CLI run `sf org display --target-org <alias>`. Note the org type (production, sandbox or scratch), the API version and the user's profile. Say if this is production.
2. **Pin down the question.** Is it one object, a whole area (for example "everything about quoting"), or one field? Ask one short question if the object name is ambiguous. Never guess an API name.
3. **Find the object.** MCP: `getObjectSchema` with no object name, then match the user's words to API names. CLI: `sf sobject list --sobject custom --target-org <alias>` (the `--sobject` value is `all`, `standard` or `custom`).
4. **Describe the object.** MCP: `getObjectSchema` with the object name. CLI: `sf sobject describe --sobject <Object> --target-org <alias> --json`. Record: label, key prefix, whether it is custom, field count, required fields, lookup and master-detail fields (and the object each points to), child relationships, record types, and picklist values with their active status. Summarize; do not paste hundreds of fields. Show the 10 to 20 fields that explain the object.
5. **Find the automation on the object.** Run the read-only Tooling API queries in the section below. Count active and inactive items separately.
6. **Find where a field is used (when asked).** Use the dependency query below, then confirm important hits by reading the component. Say the result may be incomplete.
7. **Optionally retrieve metadata.** When the user needs the actual formula, Apex or flow definition, retrieve into a scratch folder with `sf project retrieve start --metadata "<Type>:<Name>" --target-org <alias>` (the `--metadata` and `--manifest` flags select what to retrieve; check `sf project retrieve start --help`). This downloads files to the local project and does not change the org. Ask before writing files into the user's project folder; prefer a temporary project.
8. **Assess risk and write the map** using the output format below.
## Read-only queries
Run these with `sf data query --query "<SOQL>" --use-tooling-api --target-org <alias>` unless noted. Replace `Account` with the object. For custom objects use the API name ending in `__c`. If a query fails, run `sf sobject describe --sobject <ToolingObject> --use-tooling-api` to see the real fields, and adjust. Do not assume a field exists.
- **Apex triggers on the object:** `SELECT Name, Status, TableEnumOrId, UsageBeforeInsert, UsageAfterInsert, UsageBeforeUpdate, UsageAfterUpdate, UsageBeforeDelete, UsageAfterDelete, UsageAfterUndelete, ApiVersion FROM ApexTrigger WHERE TableEnumOrId = 'Account'`. For custom objects `TableEnumOrId` may hold the object ID rather than its name; if no rows return, look up the ID (`SELECT DurableId FROM EntityDefinition WHERE QualifiedApiName = 'Obj__c'`) and filter on it.
- **Validation rules on the object:** `SELECT ValidationName, Active, ErrorDisplayField, ErrorMessage FROM ValidationRule WHERE EntityDefinition.QualifiedApiName = 'Account'`. The rule formula lives in the `Metadata` field, which Tooling API only returns when you query a single record by `Id`. Retrieve the rule with `sf project retrieve start` if the formula is needed.
- **Flows:** `FlowDefinitionView` lists flows with their status and type. Describe it first (`sf sobject describe --sobject FlowDefinitionView`; add `--use-tooling-api` if that fails) and select the fields you see, such as `ApiName`, `Label`, `ProcessType`, `TriggerType` and `ActiveVersionId`. Filter to the object using the trigger-object field if the describe shows one. Otherwise list record-triggered flows and open the likely ones, because the object a flow runs on is stored in the flow's own metadata.
- **Other metadata by type:** `sf org list metadata --metadata-type <Type> --target-org <alias>` lists components of a type (for example `CustomObject`, `Flow`, `ApexTrigger`, `ValidationRule`, `WorkflowRule`). Listing metadata needs the Modify Metadata Through Metadata API Functions permission or Modify All Data.
- **Fields on an object (alternative to describe):** `SELECT QualifiedApiName, DataType, IsCalculated FROM FieldDefinition WHERE EntityDefinition.QualifiedApiName = 'Account'`. `FieldDefinition` needs a filter on the object. Use `sf sobject describe` first when you can, since it is the more complete source.
- **Where a field is used:** `SELECT MetadataComponentName, MetadataComponentType FROM MetadataComponentDependency WHERE RefMetadataComponentName = 'My_Field__c'` through the Tooling API. This object is documented as beta, caps a Tooling query at 2,000 records, may not cover every component type (reports are not included), and filters on `RefMetadataComponentName` may be rejected on some API versions. Treat the answer as "found at least these". Also search the local project with text search for the field API name when the project is available.
## Rules
- Read only. No DML, no deploy, no anonymous Apex, no metadata deploy or delete commands, no `sf org create` or login changes.
- Use only object and field names you have seen in a tool result.
- Do not make claims about what you could not query. Missing access, an empty result and "does not exist" are three different things. Say which.
- Do not run unbounded queries on large objects. Do not count records with a full scan on huge objects without telling the user; `SELECT COUNT() FROM Obj` is fine when asked.
- Do not read or repeat record data. This skill is about structure and configuration. If the user wants data, hand over to a query skill.
- Treat metadata as sensitive: it can reveal business rules and integrations. Do not paste it into other tools.
- Say plainly when you are in production.
## Output format
1. **Object summary:** label, API name, custom or standard, record types, rough field count.
2. **Key fields:** a short table (label, API name, type, notes such as required, unique, formula).
3. **Relationships:** parents (lookup or master-detail), important children, and the record types.
4. **Picklists:** active values of the picklists that drive behavior.
5. **Automation on the object:** triggers (events, active or not), flows (type, active), validation rules (active, plain-language meaning), with counts.
6. **Risks and observations:** for example several triggers on one object (ordering is not guaranteed), a trigger and several record-triggered flows on the same event, many active validation rules that can block integrations and data loads, old API versions, inactive automation that looks forgotten. Mention the site's governor limits tool at /tools/governor-limits/ when automation stacking could hit limits.
7. **Could not see:** every query that failed or returned nothing because of permissions, beta status or API gaps, and what that leaves unknown (for example, flows or managed package logic you could not inspect).
8. **Suggested next step:** one or two follow-up questions or commands the user could run.
Files in the download: salesforce-org-explorer/SKILL.md
Frequently asked questions
Can this skill change anything in my org?
No. The skill only reads schema and configuration and tells the assistant never to run DML, deploys, anonymous Apex or any write tool. Instructions are not a security control, so use a read-only server or a user without edit access, and a sandbox first.
What is two-phase discovery in getObjectSchema?
Calling the tool without an object name returns a lightweight index of accessible objects. Calling it with an object name returns that object's fields, record types and relationships. It keeps large orgs from flooding the assistant's context.
Will it find every place a field is used?
Not always. It uses the Tooling API MetadataComponentDependency object, which is documented as beta, limits Tooling queries to 2,000 records and does not cover reports. The skill presents the result as the places it found and says the list may be incomplete.
Why might some steps fail for me?
Listing and retrieving metadata needs extra permissions such as Modify Metadata Through Metadata API Functions or Modify All Data. When a query is refused or a field is not available, the skill continues with what it can see and lists the gap under what it could not see.
Does it work with assistants other than Claude?
Yes. Assistants that support the Agent Skills format can load the folder. For any other model, paste SKILL.md into the system prompt and give it a Salesforce MCP server or CLI access.
Related tools
Related guides
Official sources
- https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_sobject_describe.html
- https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_org_list_metadata.html
- https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_metadatacomponentdependency.htm
- https://agentskills.io/specification
SFDX Talk is unofficial documentation. It is not affiliated with, endorsed by, or sponsored by Salesforce, Inc. Skills are provided as is, under the MIT license. Review what a skill does and test it in a sandbox before you rely on it. All skills