agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/salesforce-cli/SKILL.md

salesforce-cli

Skill8 starsChanged 7 months agoApache-2.0View on GitHub

Perform Salesforce operations using the Salesforce CLI (sf). Use for querying orgs, records, metadata, and deployments.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the org alias table and rules below when constructing all sf commands.

    line 8
  2. Distinctive:

    Update the table below with your Salesforce org aliases before using this skill:

    line 12
  3. Distinctive:

    If the target org is unclear, ask the user before running any command.

    line 19
  4. Distinctive:

    If not already authenticated, inform the user that setup is required and ask them to complete the following steps manually.

    line 23
  5. Very specific:

    Always pass --target-org explicitly — never rely on the default org:

    line 33
  6. Distinctive:

    NEVER target an org alias not listed in the configuration table above.

    line 84
  7. Very specific:

    Always pass --target-org explicitly on every command — never rely on the default org set via sf config set target-org.

    line 85
  8. Very specific:

    NEVER run sf project deploy start or any bulk data mutation against the production org alias without explicit user instruction.

    line 86
  9. Very specific:

    NEVER print, display, or store OAuth tokens, session IDs, or client secrets from sf org display --verbose.

    line 87
  10. Very specific:

    If a record ID, object type, or org alias is unfamiliar, look it up with a read-only sf data query first.

    line 88
  11. Very specific:

    Always wrap SOQL queries in double quotes and use LIMIT when exploring unfamiliar data to avoid excessive result sets.

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Salesforce CLI Skill

Use the org alias table and rules below when constructing all sf commands.

Configuration

Update the table below with your Salesforce org aliases before using this skill:

EnvironmentOrg Alias
Production<your-prod-org-alias>
Staging / Sandbox<your-sandbox-org-alias>

If the target org is unclear, ask the user before running any command.

Prerequisites (one-time setup by user)

If not already authenticated, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.

brew install sf
sf org login web --alias <your-org-alias> --instance-url <your-instance-url>
sf org list

Command Format

Always pass --target-org explicitly — never rely on the default org:

sf <topic> <command> --target-org <org-alias> [options]

Examples

# Query records (SOQL)
sf data query --query "SELECT Id, Name FROM Account LIMIT 10" --target-org <your-sandbox-org-alias>

# List installed metadata components
sf project retrieve start --metadata ApexClass --target-org <your-sandbox-org-alias>

Available Commands

Read-only (safe, no confirmation needed)

CommandDescription
sf org listList authenticated orgs
sf org display --target-org <alias>Show org details
sf data query --query "<SOQL>"Run a SOQL query
sf data get record --sobject <type> --record-id <id>Get a specific record
sf project retrieve start --metadata <type>Retrieve metadata (read from org, writes locally)
sf apex run --file <file> (read-only Apex, e.g. System.debug)Execute anonymous Apex — only if the script has no DML
sf org open --target-org <alias> --url-onlyGet the org login URL without opening a browser

Mutating operations (confirm with user before running)

CommandDescription
sf data create recordCreate a new record
sf data update recordUpdate an existing record
sf project deploy startDeploy metadata to an org
sf apex run --file <file> (with DML statements)Execute anonymous Apex that modifies data

Never run — requires explicit human approval

CommandReason
sf data delete recordIrreversible record deletion
sf data delete bulkBulk-deletes records — irreversible
sf project deploy start against production orgDeploys code/config changes to live production
sf org delete scratchIrreversibly deletes a scratch org and its data
sf force:data:tree:import (bulk load) against productionBulk-mutates production data

Rules

  • NEVER target an org alias not listed in the configuration table above. If a command references an unfamiliar org, stop and ask the user to confirm.
  • Always pass --target-org explicitly on every command — never rely on the default org set via sf config set target-org.
  • NEVER run sf project deploy start or any bulk data mutation against the production org alias without explicit user instruction.
  • NEVER print, display, or store OAuth tokens, session IDs, or client secrets from sf org display --verbose.
  • If a record ID, object type, or org alias is unfamiliar, look it up with a read-only sf data query first.
  • Always wrap SOQL queries in double quotes and use LIMIT when exploring unfamiliar data to avoid excessive result sets.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.