Agent Skillsforcedotcom/sf-skills › platform-quick-deploy

platform-quick-deploy

GitHub

将已验证的Salesforce元数据快速部署至生产环境,跳过测试重跑。需严格校验目标为生产环境、验证ID有效且新鲜,并获取用户显式确认后方可执行部署。

plugins/builder/salesforce-development/skills/platform-quick-deploy/SKILL.md forcedotcom/sf-skills

Trigger Scenarios

用户希望部署到生产环境 用户输入'quick deploy'或'promote' 用户刚完成验证并希望推送更改上线

Install

npx skills add forcedotcom/sf-skills --skill platform-quick-deploy -g -y
More Options

Non-standard path

npx skills add https://github.com/forcedotcom/sf-skills/tree/main/plugins/builder/salesforce-development/skills/platform-quick-deploy -g -y

Use without installing

npx skills use forcedotcom/sf-skills@platform-quick-deploy

指定 Agent (Claude Code)

npx skills add forcedotcom/sf-skills --skill platform-quick-deploy -a claude-code -g -y

安装 repo 全部 skill

npx skills add forcedotcom/sf-skills --all -g -y

预览 repo 内 skill

npx skills add forcedotcom/sf-skills --list

SKILL.md

Frontmatter
{
    "name": "platform-quick-deploy",
    "description": "Deploy validated metadata to a Production Salesforce org without re-running tests. TRIGGER when the user wants to deploy to production, says 'quick deploy', 'promote', 'ship to prod', or has just validated and wants to push the change live. REQUIRES a recent `sf project deploy validate` job ID (≤10 days old, ≤3 days for --use-most-recent). DO NOT TRIGGER for sandbox\/scratch deploys (use platform-metadata-deploy) or unvalidated deploys (use platform-deploy-validate first).",
    "allowed-tools": [
        "Bash",
        "Read"
    ]
}

Quick Deploying to Prod

Promote a validated deploy to a Production org using the job ID from a prior sf project deploy validate. No tests re-run, no components re-validated — just the promotion.

Preconditions (gate strictly)

Before doing ANYTHING, verify all four:

  1. Target is Production

    sf org display --target-org <alias> --json
    

    Confirm the target really is production. The reliable check is the gate's classifier (returns production|sandbox|scratch|trial|devhub|unknown):

    sf org display --target-org <alias> --json | "${CLAUDE_PLUGIN_ROOT}/scripts/sf-deploy-gate" classify
    

    Production means isSandbox=false AND isScratch=false AND instance URL has no -- (sandbox marker) AND no test.salesforce.com AND it is not a trial/Developer Edition host (orgfarm-*, *.develop.my.salesforce.com, *.pc-rnd.*, or a trialExpirationDate in the response — these report isSandbox/isScratch as null and must not be taken for production).

    If target is NOT production (classifier returns anything other than production) → STOP and redirect to platform-metadata-deploy (which handles non-prod natively).

  2. A validation exists

    • Read .sfdx/last-validation.json if it exists (left there by platform-deploy-validate)
    • OR ask the user for the job ID
    • OR fall back to --use-most-recent (validates within last 3 days)
  3. Validation is fresh enough

    • Explicit --job-id: must be ≤10 days old per Salesforce's quick-deploy window
    • --use-most-recent: must be ≤3 days old
    • If the recorded createdAt exceeds the window → STOP and run platform-deploy-validate first
  4. Explicit user confirmation

    • Print a confirmation block (alias, instance URL, edition, validated component count, test results) and ask: "Confirm deploy to PRODUCTION? (yes/no)"
    • Do NOT proceed without an explicit "yes"

Workflow

Step 1 — Display the production confirmation banner

Format exactly:

┌─ PRODUCTION DEPLOY ─────────────────────────────┐
│ Org alias:      <alias>                         │
│ Instance:       <instanceUrl>                   │
│ Edition:        <edition>                       │
│ Validation ID:  <jobId>                         │
│ Validated:      <createdAt> (X days ago)        │
│ Components:     <componentCount> queued         │
│ Tests:          <run>/<passed>/<failed>         │
└─────────────────────────────────────────────────┘
Confirm deploy to PRODUCTION? (yes/no)

Step 2 — Run the quick deploy

After "yes":

sf project deploy quick --job-id <id> --target-org <alias> --wait 30 --json

Or with --use-most-recent if the user opted in.

The quick deploy will:

  • Promote the validated components to the org
  • NOT re-run tests (per Salesforce platform behavior)
  • Return final deploy status

Step 3 — Capture the deploy report

After completion, persist for audit:

mkdir -p .sfdx/deploy-history
sf project deploy report --job-id <id> --target-org <alias> --json > ".sfdx/deploy-history/<id>.json"

Surface to the user:

  • ✅ Deploy succeeded — components deployed, time taken
  • ⚠️ Deploy failed — error summary; recommend looking at the report

Step 4 — Post-deploy guidance

After a successful prod deploy, suggest:

  • Smoke-test critical paths in the org (provide direct URLs if known)
  • Monitor the prod environment for the next 30 min
  • Check Setup → Deployment Status to confirm
  • If anything regressed: prepare a rollback plan (re-deploy the previous version's package)

Rules

  • NEVER run sf project deploy start against a Production target (always validate then quick-deploy)
  • NEVER use --ignore-errors or --ignore-warnings on production
  • NEVER auto-confirm — require an explicit "yes" from the user
  • NEVER quick-deploy a job ID older than its validity window — re-validate instead
  • ALWAYS persist the deploy report to .sfdx/deploy-history/ for the audit trail
  • If the prod-check hook denies the operation, do NOT bypass it — surface the denial to the user and recommend platform-deploy-validate first

Version History

  • 1.33.0 Current 2026-08-05 13:01

Same Skill Collection

plugins/builder/salesforce-development/skills/automation-flow-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-apex-logs-debug/SKILL.md
plugins/builder/salesforce-development/skills/platform-capability-search/SKILL.md
plugins/builder/salesforce-development/skills/platform-custom-application-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-custom-tab-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-deploy-validate/SKILL.md
plugins/builder/salesforce-development/skills/platform-destructive-deploy/SKILL.md
plugins/builder/salesforce-development/skills/platform-lightning-app-coordinate/SKILL.md
plugins/builder/salesforce-development/skills/platform-list-view-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-metadata-deploy/SKILL.md
plugins/builder/salesforce-development/skills/platform-permission-set-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-validation-rule-generate/SKILL.md
skills/automation-flow-generate/SKILL.md
skills/commerce-b2b-open-code-components-integrate/SKILL.md
skills/commerce-b2b-store-create/SKILL.md
skills/data360-activate/SKILL.md
skills/data360-code-extension-generate/SKILL.md
skills/data360-prepare/SKILL.md
skills/data360-schema-get/SKILL.md
skills/design-systems-slds-apply/SKILL.md
skills/dx-org-permission-set-assign/SKILL.md
skills/dx-org-switch/SKILL.md
skills/experience-lwc-generate/SKILL.md
skills/experience-ui-bundle-file-upload-generate/SKILL.md
skills/experience-ui-bundle-site-generate/SKILL.md
skills/external-diagram-mermaid-generate/SKILL.md
skills/external-diagram-visual-generate/SKILL.md
skills/platform-apex-logs-debug/SKILL.md
skills/platform-custom-application-generate/SKILL.md
skills/platform-custom-lightning-type-generate/SKILL.md
skills/platform-custom-tab-generate/SKILL.md
skills/platform-lightning-app-coordinate/SKILL.md
skills/platform-list-view-generate/SKILL.md
skills/platform-metadata-deploy/SKILL.md
skills/platform-permission-set-generate/SKILL.md
skills/platform-validation-rule-generate/SKILL.md
plugins/builder/salesforce-development/skills/agentforce-generate/SKILL.md
plugins/builder/salesforce-development/skills/agentforce-observe/SKILL.md
plugins/builder/salesforce-development/skills/agentforce-test/SKILL.md
plugins/builder/salesforce-development/skills/dx-code-analyzer-configure/SKILL.md
plugins/builder/salesforce-development/skills/dx-code-analyzer-custom-rule-create/SKILL.md
plugins/builder/salesforce-development/skills/dx-code-analyzer-run/SKILL.md
plugins/builder/salesforce-development/skills/dx-org-manage/SKILL.md
plugins/builder/salesforce-development/skills/dx-project-create/SKILL.md
plugins/builder/salesforce-development/skills/platform-apex-anonymous-run/SKILL.md
plugins/builder/salesforce-development/skills/platform-apex-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-apex-test-generate/SKILL.md
plugins/builder/salesforce-development/skills/platform-apex-test-run/SKILL.md
plugins/builder/salesforce-development/skills/platform-architecture-analyze/SKILL.md

Metadata

Files
0
Version
1.33.0
Hash
916a7669
Indexed
2026-08-05 13:01

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-05 19:14
浙ICP备14020137号-1 $Гость$