agentleFS
vhmarquezvhmarquez/argo/skills/deploy/SKILL.md

deploy

Skill1 starsChanged 7 months agoMITView on GitHub

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`.

155 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pm-discovery, qa-phase and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ww-w-aiSkill

    pm-discovery

    PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.

    Also in 3 projects that use this

  • ww-w-aiSkill

    qa-phase

    Run QA tests at various levels (L1-L5) for features under PDCA management. Integrates with MCP tools to execute structured test plans.

    Also in 3 projects that use this

  • +10 more from ww-w-ai

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 139 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Verify all resolved paths exist before deploying.

    line 62
  2. Distinctive:

    Always verify source paths exist: before running the deploy command

    line 138
  3. Distinctive:

    Include the matching test class: when deploying an Apex production class

    line 140

“Common” is measured: kept by at least 6 in 10 of the 139 edited versions of this file we could read. “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

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:

  • validate or --validate — run validation only (--dry-run); no actual deploy
  • --target-org <alias> — override platform.defaultTargetOrg
  • --env <name> — read the env override; in particular pulls defaultTargetOrg from the env file
  • --ci — non-interactive; machine-readable output; no prompts
  • --format json|sarif — output format in CI mode (default json)
  • --out <path> — write CI output to file instead of stdout
  • --tests RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg|NoTestRun — test level on the deploy (default: RunSpecifiedTests for class-targeted deploys, NoTestRun for component-only deploys, RunLocalTests for all)

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
  • Apex name: ${APEX_SRC}/<ClassName>.cls + <ClassName>.cls-meta.xml
    • Include the test class ${APEX_SRC}/<ClassName><TEST_SUFFIX>.cls + meta if it exists
  • React name: ${REACT_SRC}/<ComponentName>/ (refuse with rule DEPLOY-NO-REACT if platform.frontend = "lwc")
    • Find Apex dependencies the same way as LWC (grep the React source for @salesforce/apex/ and @salesforce/react/apex/ imports)
  • File path: deploy that path verbatim
  • all: full force-app directory

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.defaultTargetOrg from 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-deploy can find the validation id later
  • Report results clearly: components deployed, status, any errors

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.