Deploy
Deploy or validate Salesforce metadata against the project's default org (or another org if specified) using the `sf` CLI. Honors per-environment config overrides via `--env`.From its SKILL.md
npx -y skills add vhmarquez/argo --skill deployAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.5 KB, as published. Nobody here has run it
You are deploying Salesforce metadata for this project. Always read the project config first.
Read Project Config
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/sf-cli.sh"
sf_cli_check || exit 2
ORG="$(sf_config_get '.platform.defaultTargetOrg' "$ENV")"
LWC_SRC="$(sf_config_get '.paths.lwcSource' "$ENV")"
APEX_SRC="$(sf_config_get '.paths.apexSource' "$ENV")"
REACT_SRC="$(sf_config_get '.paths.reactSource // ""' "$ENV")"
TEST_SUFFIX="$(sf_config_get '.naming.apex.testSuffix // "Test"' "$ENV")"
--env <name> merges .claude/sf-project.<name>.json over the base; in particular it pulls defaultTargetOrg from the env file so deploys land in the right org.
Input
The user provided: $ARGUMENTS
Targets:
- An LWC component name — deploy the component bundle and any Apex dependencies
- An Apex class name — deploy the Apex class plus its test class (if one exists)
- A React component name — deploy the React bundle (when react is in scope)
- A file path — deploy that specific path
- The word
all— deploy the full project - (empty) — prompt the user to specify what to deploy
Modifiers:
validateor--validate— run validation only (--dry-run); no actual deploy--target-org <alias>— overrideplatform.defaultTargetOrg--env <name>— read the env override; in particular pullsdefaultTargetOrgfrom the env file--ci— non-interactive; machine-readable output; no prompts--format json|sarif— output format in CI mode (defaultjson)--out <path>— write CI output to file instead of stdout--testsRunSpecifiedTests|RunLocalTests|RunAllTestsInOrg|NoTestRun— test level on the deploy (default:RunSpecifiedTestsfor class-targeted deploys,NoTestRunfor component-only deploys,RunLocalTestsforall)
Steps
1. Parse the input
Determine target kind, validation-only or real deploy, target org alias.
2. Resolve source paths
- LWC name:
${LWC_SRC}/<component>/- Find Apex dependencies by grepping the JS for
@salesforce/apex/<Class>.<method>imports; include each<Class>.cls+ meta + test class
- Find Apex dependencies by grepping the JS for
- Apex name:
${APEX_SRC}/<ClassName>.cls+<ClassName>.cls-meta.xml- Include the test class
${APEX_SRC}/<ClassName><TEST_SUFFIX>.cls+ meta if it exists
- Include the test class
- React name:
${REACT_SRC}/<ComponentName>/(refuse with ruleDEPLOY-NO-REACTifplatform.frontend = "lwc")- Find Apex dependencies the same way as LWC (grep the React source for
@salesforce/apex/and@salesforce/react/apex/imports)
- Find Apex dependencies the same way as LWC (grep the React source for
- File path: deploy that path verbatim
all: fullforce-appdirectory
Verify all resolved paths exist before deploying. Refuse with rule DEPLOY-PATH-MISSING (severity: error) if any do not.
3. Build and run the deploy
sf project deploy start \
--target-org "$ORG" \
--source-dir "$P1" --source-dir "$P2" \
${VALIDATE:+--dry-run} \
--test-level "$TEST_LEVEL" \
--wait 30 --json
Returns JSON. Capture deploy id, status, error/test failure arrays.
4. Production confirmation
Before deploying (not validating) to an org whose alias matches prod* / production* or whose username domain looks production-shaped, prompt for confirmation in interactive mode. In --ci mode, refuse and exit with rule DEPLOY-PROD-REQUIRES-EXPLICIT (severity: error) unless --target-org was set explicitly to that alias on the command line.
5. Append to deploy history
${CLAUDE_PLUGIN_DATA}/argo/deploy-history/<project>.jsonl
One JSON line per deploy: { deployId, org, env, mode (deploy|validate), targetCount, status, durationSec, timestamp }. /argo:quick-deploy reads this to find a recent successful validation.
6. Output
Default Markdown:
# Deploy: <project> → <org>
Mode: deploy (or validate)
Targets: 3 paths, 12 components
## Result
✅ Succeeded — Deploy Id 0Af...
• 12 components deployed
• 4 test methods run, 4 passed, 0 failed
• Duration: 47s
## Components
- ApexClass:OrderController
- ApexClass:OrderControllerTest
- LightningComponentBundle:acmeOrderList
- ...
CI mode JSON:
{
"deployId": "0Af...",
"org": "DevVM",
"mode": "deploy",
"status": "Succeeded",
"componentCount": 12,
"testRunCount": 4,
"testFailureCount": 0,
"durationSec": 47,
"findings": []
}
CI mode SARIF: surfaces deploy errors and test failures as findings (ruleId: DEPLOY-COMPONENT-ERROR, DEPLOY-TEST-FAILURE).
7. Exit codes
- 0 — deploy / validate succeeded; no findings at or above
--fail-on - 1 — deploy / validate failed, OR findings at or above
--fail-on - 2 — invocation error (config missing, target not found, refusal in CI mode)
Rules
- Default to
platform.defaultTargetOrgfrom config unless the user specifies--target-org - Never deploy to production without explicit confirmation; in CI mode, require the alias on the command line
- Always verify source paths exist before running the deploy command
- Include Apex dependencies automatically when deploying an LWC or React component
- Include the matching test class when deploying an Apex production class
- Append every run to deploy history so
/argo:quick-deploycan find the validation id later - Report results clearly: components deployed, status, any errors