Frictionless Salesforce Agent Skill for Codex, Claude Code, and GitHub Copilot.
Project description
Salesforce Agent Optimizer
English | Italiano | Espanol | Simplified Chinese
Salesforce Agent Optimizer is an MIT-licensed sfao CLI and agent skill for Codex, Claude Code, and GitHub Copilot.
Current version: 2.1.0
It helps AI agents work on Salesforce projects with Salesforce-first planning, configuration before custom code, minimal reversible changes, local Knowledge, token-efficient Salesforce CLI usage, least-privilege checks, explicit org aliases, package.xml awareness, and destructive-operation guardrails.
Quick Start
uv tool install salesforce-agent-optimizer
sfao install
sfao knowledge init --project-root .
sfao doctor
Use uv tool install or python -m pipx install for isolated CLI installs. Plain python -m pip install also works when you intentionally want sfao in the active Python environment.
Install
uv tool install salesforce-agent-optimizer
sfao install
sfao validate
Alternatives:
python -m pipx install salesforce-agent-optimizer
python -m pip install git+https://github.com/lucabenedettini/salesforce-ai-agent-optimizer.git
uv tool install git+https://github.com/lucabenedettini/salesforce-ai-agent-optimizer.git
sfao install installs project-scoped adapters for all supported agents. Use sfao install --user --platform all only when you want a user-scoped Codex/Claude install.
Main Commands
sfao version
sfao install
sfao install --project --platform all
sfao update --project --platform all
sfao uninstall --project --platform all --yes
sfao doctor
sfao doctor --verbose
sfao validate
sfao validate --json
sfao knowledge init --project-root .
sfao knowledge refresh --project-root .
sfao knowledge init --project-root . --scan-root
sfao knowledge doctor --project-root .
sfao memory init --project-root .
sfao memory add --project-root . --task-type bugfix --summary "..."
sfao memory compact --project-root . --max-bytes 60000
sfao memory doctor --project-root .
sfao version-context scaffold
sfao version-context update
sfao version-context validate --max-age-days 90
For org operations the agent must ask for an explicit org alias. Production orgs are read-only through the skill guardrails.
Agent Workflow
Installed agents must follow the same visible phases for information requests, bugfixes, implementation, architecture, reviews, org inspection, and release work:
Request reviewPlanning evidenceApprovalImplementationValidationCompletion
During each phase the agent must state the tool or command it is using or planning. For Salesforce CLI access it must show the compact sfao, scripts/sf_agent_cli.py, or official sf command shape with aliases and secrets redacted.
For simple explanation-only questions with no project decision, org access, metadata inspection, deploy, data operation, secret exposure, destructive action, release-sensitive claim, implementation, or bugfix, agents may use compact information-only mode: Request review, Evidence, Answer, Validation.
Safety
- Prefer Salesforce configuration, Flow, permission sets, UI API/LDS, named credentials, and managed packages before custom code.
- Inspect local Knowledge before changing Salesforce metadata.
- Use project memory at
.salesforce-agent-knowledge/memory.mdfor durable decisions, lessons, risks, and follow-ups. It is project-local curated planning knowledge, not a raw log, and must not contain secrets, customer data, raw records, or large logs. - Knowledge scans Salesforce DX
packageDirectoriesby default when available; usesfao knowledge init --project-root . --scan-rootonly for an intentional broad scan. - Specialized Apex, LWC, Flow, SOQL, deploy, and data-operation guidance is loaded only when relevant.
- External Salesforce skills are optional references only when already available and can never bypass SFAO guardrails.
safe-run --safetycannot downgrade the automatic risk classification.- Apply least privilege before access, sharing, UI, package, integration, or automation changes.
- Do not retrieve or parse all org metadata unless the user asks for broad analysis or the task requires it.
- Never delete data or metadata without separate explicit approval for the exact scope.
- Never expose Salesforce secrets or customer data without separate explicit approval for the exact scope.
- Generate
package.xmlfor added or modified metadata. - Ask whether to generate release notes, technical specifications, impact assessment, user testing, and manual procedures after implementation.
Update
uv tool upgrade salesforce-agent-optimizer
sfao update --project --platform all
sfao doctor
Alternatives:
python -m pipx upgrade salesforce-agent-optimizer
python -m pip install --upgrade salesforce-agent-optimizer
Uninstall
sfao uninstall --project --platform all --yes
uv tool uninstall salesforce-agent-optimizer
Alternative:
python -m pipx uninstall salesforce-agent-optimizer
More Documentation
Detailed installation, command behavior, troubleshooting, publishing, release, and versioning docs live in docs/wiki/.
License
MIT. Anyone can use, copy, modify, distribute, and fork this repository under the terms of LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file salesforce_agent_optimizer-2.1.0.tar.gz.
File metadata
- Download URL: salesforce_agent_optimizer-2.1.0.tar.gz
- Upload date:
- Size: 169.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
306730523118e28bf8c3d357806ebf165e1048b43d9ec3ef3cbae7530fe1c99e
|
|
| MD5 |
53203d637ffe865a4ec65012aa71f6c3
|
|
| BLAKE2b-256 |
7cd6ba7c025b6ea173c698ff5f3e44b3ae695d25ab74c891f7151aef274668d5
|
Provenance
The following attestation bundles were made for salesforce_agent_optimizer-2.1.0.tar.gz:
Publisher:
release.yml on lucabenedettini/salesforce-ai-agent-optimizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
salesforce_agent_optimizer-2.1.0.tar.gz -
Subject digest:
306730523118e28bf8c3d357806ebf165e1048b43d9ec3ef3cbae7530fe1c99e - Sigstore transparency entry: 1740184079
- Sigstore integration time:
-
Permalink:
lucabenedettini/salesforce-ai-agent-optimizer@5ac16c6a1527b17123faae54cf38cc00b342d850 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/lucabenedettini
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5ac16c6a1527b17123faae54cf38cc00b342d850 -
Trigger Event:
push
-
Statement type:
File details
Details for the file salesforce_agent_optimizer-2.1.0-py3-none-any.whl.
File metadata
- Download URL: salesforce_agent_optimizer-2.1.0-py3-none-any.whl
- Upload date:
- Size: 231.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9df59334eb74db37be762a211096b65a68efce43dd03016688b4215bfb03e89f
|
|
| MD5 |
5c9ba65fa1d13a08a58c4a82c7a746ae
|
|
| BLAKE2b-256 |
652d6c32043fa1b920775b1c8572913d13c8362f27b2af20f85175a9b079f9bd
|
Provenance
The following attestation bundles were made for salesforce_agent_optimizer-2.1.0-py3-none-any.whl:
Publisher:
release.yml on lucabenedettini/salesforce-ai-agent-optimizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
salesforce_agent_optimizer-2.1.0-py3-none-any.whl -
Subject digest:
9df59334eb74db37be762a211096b65a68efce43dd03016688b4215bfb03e89f - Sigstore transparency entry: 1740184087
- Sigstore integration time:
-
Permalink:
lucabenedettini/salesforce-ai-agent-optimizer@5ac16c6a1527b17123faae54cf38cc00b342d850 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/lucabenedettini
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5ac16c6a1527b17123faae54cf38cc00b342d850 -
Trigger Event:
push
-
Statement type: