Agent skill

Platform Metadata Retrieve

by forcedotcom in forcedotcom/sf-skills

ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start.

Apache-2.0Auto-check passedSales & Support

Install Platform Metadata Retrieve

skills CLI
$ npx skills add forcedotcom/sf-skills --skill platform-metadata-retrieve -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills platform-metadata-retrieve --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/platform-metadata-retrieve .claude/skills/platform-metadata-retrieve && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
platform-metadata-retrieve
GitHub stars
1.1k
Token cost
~1.8k tokens
SKILL.md length
748 words
Files
5 (incl. references)
Skills in repo
248
Repo updated
First seen
Licence
Apache-2.0

At a glance

ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start.

  • Works in 3 steps: Match user request to command pattern… → Execute via Bash tool: sf project… → Return result with retrieved components…
  • Retrieve metadata from an org to your local project with sf project retrieve start
  • SKILL.md covers Tool Restrictions, Scope, Required Inputs and Workflow, plus 5 more sections
  • Calls sf

What it does

Platform Metadata Retrieve is an agent skill from forcedotcom/sf-skills. ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start. Supports retrieval by all changes, source directory, metadata type (wildcards), manifest (package.xml), or package name, in source or metadata (ZIP) format. Use when the user asks to retrieve, pull, sync, or download metadata, Apex classes, or custom objects. DO NOT TRIGGER for deploying metadata (use platform-metadata-deploy), listing metadata, or generating a package.xml (use platform-manifest-generate)…

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `examples/error_output.json`, `examples/success_output.json` and `references/cli_flags.md`).

It sits in Sales & Support, covering MCP servers. It works with Salesforce and Bash. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • Retrieve metadata from an org to your local project with sf project retrieve start
  • The user asks to retrieve
  • Download metadata
  • Deploying metadata (use platform-metadata-deploy)

Example prompts

  • “Use the platform-metadata-retrieve skill to alway USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start”
  • “/platform-metadata-retrieve”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Match user request to command pattern below
  2. Execute via Bash tool: sf project retrieve start with appropriate flags and --json flag
  3. Return result with retrieved components count and file paths

What it can do on your machine

Read from SKILL.md and the folder at commit 3c15867. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • sf

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Platform Metadata Retrieve loads about 1.8k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 142 tokens; SKILL.md has 748 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~142
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit 3c15867, republished under its Apache-2.0 licence (© forcedotcom). 748 words, ~1,767 tokens.

Download SKILL.mdSave it as .claude/skills/platform-metadata-retrieve/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
platform-metadata-retrieve
description
ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start. Supports retrieval by all changes, source directory, metadata type (wildcards), manifest (package.xml), or package name, in source or metadata (ZIP) format. Use when the user asks to retrieve, pull, sync, or download metadata, Apex classes, or custom objects. DO NOT TRIGGER for deploying metadata (use platform-metadata-deploy), listing metadata, or generating a package.xml (use platform-manifest-generate). NEVER use MCP tools.
metadata.version
1.0
metadata.domains
Platform, Developer Experience
metadata.relatedSkills
platform-metadata-deploy

platform-metadata-retrieve

Retrieves metadata from a Salesforce org to your local project using sf project retrieve start. Supports multiple retrieval modes: all changes, by source directory, by metadata type (with wildcards), by manifest, or by package name.


Tool Restrictions

Use ONLY the Bash tool to execute sf project retrieve start. Do NOT use MCP tools — ignore them completely.


Scope

  • In scope: Retrieving metadata via sf project retrieve start in all supported modes (all changes, source-dir, metadata type, manifest, package name), source and metadata format output
  • Out of scope: Deploying metadata (use platform-metadata-deploy), listing metadata types, generating package.xml files, source tracking commands (sf project retrieve preview)

Required Inputs

Infer from the user's request:

  • Retrieval mode: all changes | source directory | metadata type | manifest | package name
  • Target org: org alias/username (uses default if not specified)
  • Output format: source format (default) | metadata format (ZIP)
  • Additional options: ignore conflicts, output directory, wait time, API version

Workflow

  1. Match user request to command pattern below
  2. Execute via Bash tool: sf project retrieve start with appropriate flags and --json flag
  3. Return result with retrieved components count and file paths
Command Patterns
User intentExecute via Bash tool
Retrieve all remote changessf project retrieve start --json
Retrieve by source directorysf project retrieve start --source-dir <path> --target-org <alias> --json
Retrieve by metadata typesf project retrieve start --metadata <MetadataType:Name> --target-org <alias> --json
Retrieve by metadata type with wildcardsf project retrieve start --metadata '<MetadataType:Pattern*>' --target-org <alias> --json
Retrieve multiple metadata typessf project retrieve start --metadata <Type1> --metadata <Type2> --target-org <alias> --json
Retrieve by manifestsf project retrieve start --manifest <path/to/package.xml> --target-org <alias> --json
Retrieve by package namesf project retrieve start --package-name <PackageName> --target-org <alias> --json
Retrieve to metadata format (ZIP)sf project retrieve start --source-dir <path> --target-metadata-dir <output> --unzip --target-org <alias> --json
Ignore conflictssf project retrieve start --source-dir <path> --ignore-conflicts --target-org <alias> --json

Rules / Constraints

ConstraintRationale
Always use --json flagProvides structured output for reliable parsing and error handling
Must run from within Salesforce projectCommand requires sfdx-project.json at repo root
Wildcard patterns must be quotedShell expansion breaks unquoted wildcards like ApexClass:My*
Cannot mix --manifest with --metadata or --source-dirMutually exclusive flags — command will error
Retrieve all changes requires source trackingProduction orgs don't support source tracking — must use other retrieval modes
--ignore-conflicts only works on trackable orgsNo effect on production orgs; applies to scratch/sandbox only
--output-dir must be inside project directoryCommand validates output path is within project boundary
--output-dir cannot match package directoryCommand fails if target matches sfdx-project.json packageDirectories
Default wait time is 33 minutesUse --wait flag to override for large retrievals
Package retrieval is for reference onlyRetrieved package metadata should not be added to source control for development
CustomField retrieval auto-includes CustomObjectWhen retrieving CustomField, CLI automatically adds CustomObject to get full context

Show full SKILL.md (279 more words)Show less

Troubleshooting

IssueResolution
"This command is required to run from within an SFDX project"Not in Salesforce project directory — cd to project root with sfdx-project.json
"No org found for <alias>" errorOrg alias doesn't exist or isn't authenticated — verify with sf org list
"This org does not support source tracking"Production org doesn't allow "retrieve all changes" mode — use --source-dir, --metadata, or --manifest instead
"ERROR running project retrieve start: Cannot mix --manifest with --metadata or --source-dir"Remove conflicting flags — use one retrieval mode only
Wildcard pattern retrieves nothingPattern not quoted — wrap in single quotes: 'ApexClass:My*'
"The package directory path in sfdx-project.json does not exist"Output directory conflicts with package directory — use different path
"Output directory must be inside the project"--output-dir path is outside project boundary — use relative path inside project
Retrieve times outIncrease wait time with --wait 60 for large metadata volumes
Retrieved files overwrite local changesUse --output-dir to retrieve to separate location, or commit local changes first
SourceConflictError with conflict tableConflicts detected between local and remote on trackable org (scratch/sandbox) — resolve conflicts manually or use --ignore-conflicts to force overwrite

Output Expectations

The command returns JSON output with retrieved components details.

See examples/success_output.json and examples/error_output.json for response structures.


Cross-Skill Integration

NeedDelegate to
Deploy metadata to orgplatform-metadata-deploy skill
Preview retrieve without executingExecute sf project retrieve preview --target-org <alias> --json
List available metadata typesExecute sf org list metadata-types --target-org <alias> --json

Reference File Index

FileWhen to read
examples/success_output.jsonTo understand successful retrieve response structure
examples/error_output.jsonTo handle common error scenarios
references/retrieval_modes.mdFor detailed explanation of all retrieval modes and when to use each
references/cli_flags.mdFor complete flag reference with usage patterns

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/platform-metadata-retrieve of forcedotcom/sf-skills.

  • SKILL.md
  • examples/error_output.json
  • examples/success_output.json
  • references/cli_flags.md
  • references/retrieval_modes.md

Open the folder on GitHubat commit 3c15867

Compare with similar skills

Platform Metadata Retrieve next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Platform Metadata Retrieve compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Platform Metadata Retrieve this skillforcedotcom/sf-skills1.1k—~1.8kAutomated safety check: PassApache-2.0
Segment Audienceindranilbanerjee/digital-marketing-pro8541 repos~3.5kAutomated safety check: PassMIT
Agentforce GenerateSalesforceAIResearch/agentforce-adlc1121 repos~7.4kAutomated safety check: PassCustom licence
Services Extension Consumptionforcedotcom/salesforcedx-vscode1k—~5kAutomated safety check: PassBSD-3-Clause
Core Extension APIforcedotcom/salesforcedx-vscode1k—~842Automated safety check: PassBSD-3-Clause
Company Researchthesun4sky/jobstack143—~2.9kAutomated safety check: NotesMIT

Similar skills

  • Segment Audience

    indranilbanerjee/digital-marketing-pro

    Build or update audience segments in the brand's CRM, email, or ad platform (Salesforce, HubSpot, Mailchimp, Meta Custom Audiences, Google Customer Match, and more) via connected MCPs — with size…

    854 GitHub starsUsed in 1 repo~3.5k tokens
    Sales & SupportAuto-check passed
  • Agentforce Generate

    SalesforceAIResearch/agentforce-adlc

    Build, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent Script.

    112 GitHub starsUsed in 1 repo~7.4k tokens
    Agent WorkflowsAuto-check passed
  • Services Extension Consumption

    forcedotcom/salesforcedx-vscode

    Consume the salesforcedx-vscode-services extension API. An agent skill from forcedotcom/salesforcedx-vscode.

    1k GitHub stars~5k tokensUpdated today
    Sales & SupportAuto-check passed
  • Core Extension API

    forcedotcom/salesforcedx-vscode

    Public API exported by salesforcedx-vscode-core activate(). An agent skill from forcedotcom/salesforcedx-vscode.

    1k GitHub stars~842 tokensUpdated today
    Sales & SupportAuto-check passed
  • Company Research

    thesun4sky/jobstack

    기업 분석 스킬. An agent skill from thesun4sky/jobstack.

    143 GitHub stars~2.9k tokensUpdated 1 mo ago
    Sales & SupportAuto-check: notes
  • Sf Apex

    Jaganpro/sf-skills

    Generates and reviews Salesforce Apex code with 150-point scoring.

    424 GitHub stars~2k tokensUpdated 5 mo ago
    Sales & SupportAuto-check passed

More from forcedotcom/sf-skills

All 248 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~3.6k tokensUpdated 5 days ago
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~2.9k tokensUpdated 5 days ago
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated 5 days ago
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated 5 days ago
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated 5 days ago
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated 5 days ago
    Auto-check passed

Works with

Categories

Questions about Platform Metadata Retrieve

What does Platform Metadata Retrieve do?

ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start. Platform Metadata Retrieve is an agent skill from forcedotcom/sf-skills. ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start.

When should I use Platform Metadata Retrieve?

Platform Metadata Retrieve fits situations like: retrieve metadata from an org to your local project with sf project retrieve start; the user asks to retrieve; download metadata; deploying metadata (use platform-metadata-deploy).

How do I install Platform Metadata Retrieve in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill platform-metadata-retrieve -a claude-code`. Or copy the skill folder (skills/platform-metadata-retrieve in forcedotcom/sf-skills) into .claude/skills/platform-metadata-retrieve in your project. Claude Code loads it when a task matches its description.

How do I install Platform Metadata Retrieve in Codex?

Run `npx skills add forcedotcom/sf-skills --skill platform-metadata-retrieve -a codex`. Or copy the skill folder (skills/platform-metadata-retrieve in forcedotcom/sf-skills) into .agents/skills/platform-metadata-retrieve in your project. Codex loads it when a task matches its description.

Can I use Platform Metadata Retrieve in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill platform-metadata-retrieve -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/platform-metadata-retrieve, .gemini/skills/platform-metadata-retrieve, .github/skills/platform-metadata-retrieve and .opencode/skills/platform-metadata-retrieve in your project.

What does Platform Metadata Retrieve need to run?

Going by SKILL.md and its folder, Platform Metadata Retrieve needs the command-line tools its instructions call (sf).

Does Platform Metadata Retrieve access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Platform Metadata Retrieve safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Platform Metadata Retrieve use?

Platform Metadata Retrieve is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Platform Metadata Retrieve use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.4k tokens, read only when the agent opens those files.

What are the alternatives to Platform Metadata Retrieve?

Skills that share tags, products or a category with Platform Metadata Retrieve: Segment Audience (indranilbanerjee/digital-marketing-pro, 854 stars), Agentforce Generate (SalesforceAIResearch/agentforce-adlc, 112 stars), Services Extension Consumption (forcedotcom/salesforcedx-vscode, 1k stars) and Core Extension API (forcedotcom/salesforcedx-vscode, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Platform Metadata Retrieve?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,058 GitHub stars. The repository holds 248 skills in this directory. The repository was last updated on October 3, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.