/sf-preflight:sf-preflightfrom sf-preflight
Analyzes Salesforce metadata changes for impact on automation, permissions, and Agentforce agents before deployment. Traces production errors back to the change that caused them.
Ships in sf-preflight. 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.
sf-preflight follows a Salesforce change through the org's automation (order of execution, flows, triggers, validation rules, roll-ups, permissions, Agentforce actions) and reports what it will set off, the risks, and the tests that matter. It's deterministic: every finding names the metadata that produced it.
Use whichever your environment has:
analyze_change, suggest_fixes, check_fix, generate_tests,
explain_save_order, find_field_references, explain_agent, plan_rollback.npx -y sf-preflight <command> from the SFDX project root (the folder with
sfdx-project.json). Add --format json when you need to read the result yourself.Command details and options: references/commands.md.
explain_save_order / npx -y sf-preflight explain <Object> --event update.find_field_references (MCP only; in a shell, search the project for the field name).explain_agent / npx -y sf-preflight agents <Agent>.HEAD):
analyze_change / npx -y sf-preflight analyze --base HEAD --format json.
Use --base origin/main (or the PR's base branch) to check a whole branch..preflight.json to pass.suggest_fixes / npx -y sf-preflight fix --base HEAD returns diffs that
sf-preflight has already verified (the finding goes away, nothing new appears). Apply the
safe ones; an undo fix reverses part of what was asked for, so confirm it with the user
first; read a review fix before applying it.check_fix (with finding set to the fix id or rule id) before writing them. Only
write it if the verdict is accepted; rejected says what is still reported or newly broken.generate_tests returns the Apex, which you write into the project;
npx -y sf-preflight tests --base HEAD writes the classes itself (to preflight-tests/, or
--out <dir>). Read their NOTE
comments and fill in any data the generator couldn't infer.When something broke in production after a deployment, see
references/production.md: incidents traces the errors to the
change that most likely caused them, and rollback plans a partial rollback that ships as a
pull request.
tests --validate deploys check-only and agent-tests runs Agentforce actions for real. Both
refuse production orgs. Never pass --allow-production unless the user explicitly asks.sf project deploy start yourself. rollback --restore only
edits local files: the user ships them through a pull request.sf org login.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub visparashar/sf-preflight --plugin sf-preflightOther plugins' skills for the same job