• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdevelopment

platform-quick-deploy

プラグイン
salesforce-development
ソース
GitHub で見る ↗
説明

検証済みのメタデータ(Salesforce内の設定情報)を本番環境に展開し、テストの再実行をスキップします。 **次のような場合に使用:** - ユーザーが本番環境への展開を希望している - 「クイックデプロイ」「プロモート」「本番環境に送出」などの指示がある - 検証済みの状態で、その変更をすぐに反映させたい **必須条件:** 最近実行した `sf project deploy validate` コマンドのジョブID(10日以内、または `--use-most-recent` オプション使用時は3日以内)が必要です。 **使用してはいけない場合:** - サンドボックス環境やスクラッチ環境への展開(代わりに platform-metadata-deploy を使用) - 未検証の状態での展開(事前に platform-deploy-validate を使用してください)

原文を表示

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

ユースケース
  • 検証済みメタデータを本番環境に展開する
  • クイックデプロイやプロモートを実行する
  • 変更をすぐに本番環境に反映させたい
本文(日本語訳)

本番環境への迅速なデプロイ

事前に検証済みのデプロイを、sf project deploy validate コマンドで得たジョブIDを使って、本番環境(プロダクション)の組織に昇格させます。テストの再実行や コンポーネント(ソフトウェアの構成要素)の再検証は行わず、昇格のみを実施します。

前提条件チェック(厳密に実施)

何よりもまず、以下の4つすべてを確認してください:

  1. 対象が本番環境であること

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

    対象が確実に本番環境かを確認します。確実な判定方法は、ゲート(アクセス制御)の分類機能を使うことです(production|sandbox|scratch|trial|devhub|unknown を返します):

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

    本番環境とは、isSandbox=false かつ isScratch=false で、インスタンスのURLに --(サンドボックスの標識)や test.salesforce.com がなく、かつ試用版・Developer Edition(開発者向け無料環境)のホストではない(orgfarm-*、*.develop.my.salesforce.com、*.pc-rnd.* のようなホスト、または trialExpirationDate フィールドがある場合は、isSandbox/isScratch が null と報告されるため本番環境とみなしてはいけません)ことを意味します。

    対象が本番環境でない場合(分類機能が production 以外を返す場合)→ 処理を中止し、platform-metadata-deploy(非本番環境に対応)にリダイレクトしてください。

  2. 検証済みのデプロイが存在すること

    • .sfdx/last-validation.json を読み込む(存在する場合は、platform-deploy-validate で作成されたもの)
    • またはユーザーにジョブIDを入力させる
    • または --use-most-recent(過去3日以内の検証)にフォールバック
  3. 検証が十分に新しいこと

    • 明示的な --job-id の場合:Salesforceの迅速デプロイウィンドウ(10日以内)を満たすこと
    • --use-most-recent の場合:3日以内であること
    • 記録された createdAt がウィンドウを超えている場合 → 処理を中止し、先に platform-deploy-validate を実行してください
  4. ユーザーの明示的な確認

    • 確認画面(エイリアス、インスタンスのURL、エディション、検証済みコンポーネント数、テスト結果)を表示し、「本番環境へのデプロイを確認しますか?(yes/no)」と尋ねます
    • 明示的な「yes」がないまま進めてはいけません

ワークフロー

ステップ1 — 本番環境デプロイの確認画面を表示

以下の形式で表示します:

┌─ PRODUCTION DEPLOY ─────────────────────────────┐
│ Org alias:      <alias>                         │
│ Instance:       <instanceUrl>                   │
│ Edition:        <edition>                       │
│ Validation ID:  <jobId>                         │
│ Validated:      <createdAt> (X days ago)        │
│ Components:     <componentCount> queued         │
│ Tests:          <run>/<passed>/<failed>         │
└─────────────────────────────────────────────────┘
本番環境へのデプロイを確認しますか?(yes/no)

ステップ2 — 迅速なデプロイを実行

「yes」と答えた後:

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

ユーザーが選択した場合は --use-most-recent を使用します。

迅速なデプロイは以下を行います:

  • 検証済みコンポーネントを組織に昇格させる
  • テストを再実行しない(Salesforceプラットフォームの仕様)
  • 最終的なデプロイの状態を返す

ステップ3 — デプロイレポートを保存

完了後、監査証跡のため以下を実行して保存します:

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

ユーザーに以下を表示します:

  • ✅ デプロイ成功 — デプロイされたコンポーネント、所要時間
  • ⚠️ デプロイ失敗 — エラーの概要;レポートを確認するよう勧める

ステップ4 — デプロイ後のガイダンス

本番環境でのデプロイが成功した後は、以下を提案してください:

  • 組織内の重要な機能について軽い動作確認を実施(既知のURLがあれば直接提供)
  • 本番環境を今後30分間監視する
  • Setup(設定)→ Deployment Status(デプロイ状態)で確認する
  • 問題が発生した場合:ロールバック計画(以前のバージョンのパッケージを再デプロイ)を準備する

ルール

  • 本番環境を対象に sf project deploy start を実行してはいけません(必ず検証してから迅速デプロイを使用)
  • 本番環境で --ignore-errors や --ignore-warnings を使ってはいけません
  • 自動確認を行ってはいけません — ユーザーの明示的な「yes」を必須にしてください
  • 有効期限が過ぎたジョブIDで迅速デプロイを実行してはいけません — 代わりに再検証してください
  • 常にデプロイレポートを .sfdx/deploy-history/ に保存し、監査証跡を残してください
  • 本番環境チェックのゲートが操作を拒否した場合、ゲートを回避してはいけません — ユーザーに拒否を伝え、先に platform-deploy-validate を実施するよう勧めてください
原文(English)を表示

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

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。