• 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-data-manage

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

Salesforce データ操作(130ポイント評価) レコード(Salesforceに保存されたデータ)の作成、更新、削除、一括取り込み/書き出し、テストデータ生成、および組織内の不要なレコード削除を、sf CLI(コマンドライン操作ツール)と無名Apex(実行スクリプト言語)を通じて実行します。 **次のような場合に使用:** - テストデータを生成する - 一括でレコードを取り込みまたは書き出す - sf data CLIコマンドを使用する - Apexテスト用のデータ生成パターンを利用する - 組織内のテストレコードの初期設定または削除を行う **使用しない場合:** - SOQL(Salesforceのデータベース検索言語)クエリの記述のみ → platform-soql-queryを使用 - Apexテストの実行 → platform-apex-test-runを使用 - メタデータ(構成情報)の配置 → platform-metadata-deployを使用

原文を表示

Salesforce data operations with 130-point scoring. Use to create, update, delete, bulk import/export, generate test data, and clean up org records via sf CLI and anonymous Apex. TRIGGER on creating test data, bulk import/export, sf data CLI commands, data-factory patterns for Apex tests, or seeding/cleaning org records. DO NOT TRIGGER for SOQL query writing only (use platform-soql-query), Apex test execution (use platform-apex-test-run), or metadata deployment (use platform-metadata-deploy).

ユースケース
  • テストデータを生成する
  • レコードを一括で取り込む
  • レコードを一括で書き出す
  • 組織内のテストレコードを削除する
  • sf data CLIコマンドを実行する
本文(日本語訳)

Salesforce データ操作専門家(platform-data-manage)

次のような場合に使用: ユーザーがSalesforce のデータ操作を必要としている場合。具体的には、レコードの作成・更新・削除、一括インポート・エクスポート、テストデータの生成、データクリーンアップスクリプト、または Apex・Flow・統合処理の動作を検証するためのデータファクトリーパターン(テストデータ生成テンプレート)。

このスキルが担当する作業

platform-data-manage は以下の作業を担当します:

  • sf data CLI コマンド
  • レコードの作成、更新、削除、アップサート(更新または作成)、エクスポート、ツリーインポート・エクスポート
  • 実用的なテストデータの生成
  • 一括データ操作とクリーンアップ
  • Apex 無名スクリプト(データシード処理・ロールバック)

以下の場合は他のスキルに委譲してください:

  • SOQL のみを記述している → platform-soql-query
  • Apex テストを実行・修復している → platform-apex-test-run
  • メタデータの展開を優先している → platform-metadata-deploy
  • カスタムオブジェクト・フィールドを作成・変更している → platform-custom-object-generate または platform-custom-field-generate

重要:実行モードの決定

ユーザーが希望するモードを確認してください:

モード 使用場面
スクリプト生成 ユーザーがまだ組織に変更を加えず、再利用可能な .apex、CSV、JSON ファイルが欲しい場合
リモート実行 ユーザーが実際の組織に今すぐレコードを作成・変更したい場合

ユーザーがスクリプトのみを望んでいる可能性がある場合は、リモート実行を前提としないでください。


最初に集めるべき必須情報

以下の情報を確認または推測してください:

  • 対象オブジェクト
  • 組織のエイリアス(リモート実行が必要な場合)
  • 操作の種類:クエリ、作成、更新、削除、アップサート、インポート、エクスポート、クリーンアップ
  • 予想されるデータ量
  • これがテストデータなのか、移行データなのか、単一の問題解決用データなのか
  • あらかじめ存在する必要がある親レコードと子レコード間の関係

コア運用ルール

  • platform-data-manage は、ユーザーが明示的にローカルスクリプト生成を希望しない限り、リモート組織のデータに対して実行します。
  • データを作成する前に、オブジェクトとフィールドが既に存在していることを確認してください。
  • 自動化テストでは、一括処理の動作が重要な場合は 251 件以上のレコードを作成してください。
  • 大規模または不要なデータセットを作成する前に、クリーンアップ計画を立ててください。追跡されないレコードが蓄積し、組織の状態を汚します。
  • テストレコードには合成データ(架空の情報)を使用してください。実在する個人情報の使用はコンプライアンス上のリスクであり、一括インポート後に安全に削除できません。
  • 単純な CRUD 操作では CLI 優先を使用してください。サーバー側の調整が本当に必要な場合のみ無名 Apex を使用してください。

メタデータが不足している場合は、以下に委譲してください:

  • platform-custom-object-generate または platform-custom-field-generate でスキーマ(組織内のデータ構造定義)を作成し、platform-metadata-deploy で展開してからデータ操作を再度実行してください。

推奨ワークフロー

1. 前提条件の確認

オブジェクト・フィールドの利用可能性、組織の認証、必須の親レコードを確認してください。

2. スキーマが不明な場合は describe-first 事前検証を実行

レコードを作成・更新する前に、オブジェクト説明データを使用して以下を検証してください:

  • 必須フィールド
  • 作成可能か非作成可能かの状態
  • ピックリスト(選択肢)の値
  • 関連フィールドと親レコード要件

詳細は references/sf-cli-data-commands.md を参照してください。sf sobject describe コマンドと jq フィルターパターンを使用してフィールド、ピックリスト値、作成可能制約を検査できます。

3. 最も適切で最小限のメカニズムを選択

必要な操作 デフォルトの方法
小規模な単発 CRUD sf data 単一レコードコマンド
大量のインポート・エクスポート Bulk API 2.0(sf data ... bulk 経由)
親子関係のあるデータセット ツリーインポート・エクスポート
再利用可能なテストデータセット ファクトリー・無名 Apex スクリプト
実験の可逆性確保 クリーンアップスクリプトまたはセーブポイント(保存点)ベースの方法

4. アセット(定型ファイル)を実行または生成

assets/ 下のテンプレートを活用してください:

  • assets/factories/ — Apex テストデータファクトリースクリプト
  • assets/bulk/ — Bulk API 2.0 Apex テンプレート
  • assets/cleanup/ — クリーンアップ・ロールバックスクリプト
  • assets/soql/ — SOQL クエリテンプレート
  • assets/csv/ — CSV インポートテンプレート
  • assets/json/ — JSON ツリーインポートテンプレート

5. 結果の確認

作成・更新後、件数、関連性、レコード ID を確認してください。

6. 制限付きリトライ戦略を適用

作成に失敗した場合:

  1. プライマリ CLI 形式を 1 回試行
  2. 修正されたパラメータで 1 回リトライ
  3. describe を再実行・前提を検証
  4. 別のメカニズムに切り替えるか、手動の回避策を提示

同じ失敗コマンドを無限に繰り返さないでください。

7. クリーンアップ指示を提示

データが作成された場合は、常に正確なクリーンアップコマンドまたはロールバックアセットを提示してください。


重要チェックリスト

一括操作の安全性

  • 大規模ボリュームには一括操作を使用
  • 必要に応じて 251 件以上のレコードで自動化に敏感な動作をテスト
  • 大量処理シナリオで 1 レコードずつのパターンを避ける

データ整合性

  • 必須フィールドを含める
  • 作成前にピックリスト値を検証
  • 親 ID と関連性の整合性を確認
  • 検証ルール(バリデーション)と重複排除制約を考慮
  • 非作成可能フィールドを入力ペイロードから除外

クリーンアップの規律

以下のいずれかを選択:

  • ID で削除
  • パターンマッチで削除
  • 作成日時の時間枠で削除
  • スクリプトベースのテスト実行のロールバック・セーブポイント

よくある失敗パターン

エラー 原因の可能性 デフォルトの対処方向
INVALID_FIELD 間違ったフィールド API 名または FLS(フィールドレベルセキュリティ)の問題 スキーマとアクセス権を検証
REQUIRED_FIELD_MISSING 必須フィールドの欠落 describe データから必須値を含める
INVALID_CROSS_REFERENCE_KEY 無効な親 ID 親をまず作成・検証
FIELD_CUSTOM_VALIDATION_EXCEPTION 検証ルールがレコードをブロック 有効なテストデータを使用、またはセットアップを調整
ピックリスト値が無効 推測した値(describe データに基づかない) ピックリスト値をまず確認
非書き込み可能フィールドエラー フィールドが作成・更新不可 ペイロードから削除
一括制限・タイムアウト ボリュームに対して間違ったツール 一括・段階的インポートに切り替え

出力形式

完了時は以下の順序で報告してください:

  1. 実行した操作
  2. オブジェクトと件数
  3. 対象の組織またはローカルアーティファクトパス
  4. レコード ID・出力ファイル
  5. 検証結果
  6. クリーンアップ指示

推奨の形式:

データ操作: <作成/更新/削除/エクスポート/シード>
オブジェクト: <オブジェクト + 件数>
対象: <組織エイリアスまたはローカルパス>
アーティファクト: <レコード ID・CSV・Apex・JSON ファイル>
検証: <成功/部分的/失敗>
クリーンアップ: <正確な削除またはロールバック指示>

他のスキルとの連携

必要な作業 委譲先 理由
カスタムオブジェクトの作成 platform-custom-object-generate データ操作の前にスキーマが存在する必要がある
カスタムフィールドの作成 platform-custom-field-generate データ作成の前にフィールドレベルのスキーマが必要
一括に敏感な Apex 検証の実行 platform-apex-test-run テスト実行とカバレッジ
欠落スキーマの展開 platform-metadata-deploy メタデータの準備状態
データを処理する本番 Apex ロジックの実装 platform-apex-generate Apex クラス・トリガーの作成
データを処理する Flow ロジックの実装 automation-flow-generate Flow の作成と自動化

リファレンスマップ

まずここから

  • references/sf-cli-data-commands.md
  • references/test-data-best-practices.md
  • references/orchestration.md
  • references/test-data-patterns.md
  • references/test-data-factory-usage.md

クエリ・一括・クリーンアップ

  • references/soql-relationship-guide.md
  • references/relationship-query-examples.md
  • references/bulk-operations-guide.md
  • references/cleanup-rollback-guide.md
  • references/cleanup-rollback-example.md

例・制限

  • references/crud-workflow-example.md
  • references/bulk-testing-example.md
  • references/anonymous-apex-guide.md
  • references/governor-limits-reference.md

検証スクリプト

  • scripts/soql_validator.py — 実行前に SOQL クエリを検証
  • scripts/validate_data_operation.py — データ操作の事前チェック(必須フィールド、ピックリスト値、作成可能フィールド)

アセットテンプレート

  • assets/factories/ — Apex テストデータファクトリースクリプト(取引先、連絡先、商談、リード、ユーザーなど)
  • assets/bulk/ — Bulk API 2.0 Apex テンプレート(200、500、10000 件のレコード挿入;外部 ID でアップサート)
  • assets/cleanup/ — クリーンアップ・ロール
原文(English)を表示

Salesforce Data Operations Expert (platform-data-manage)

Use this skill when the user needs Salesforce data work: record CRUD, bulk import/export, test data generation, cleanup scripts, or data factory patterns for validating Apex, Flow, or integration behavior.

When This Skill Owns the Task

Use platform-data-manage when the work involves:

  • sf data CLI commands
  • record creation, update, delete, upsert, export, or tree import/export
  • realistic test data generation
  • bulk data operations and cleanup
  • Apex anonymous scripts for data seeding / rollback

Delegate elsewhere when the user is:

  • writing SOQL only → platform-soql-query
  • running or repairing Apex tests → platform-apex-test-run
  • deploying metadata first → platform-metadata-deploy
  • creating or modifying custom objects / fields → platform-custom-object-generate or platform-custom-field-generate

Important Mode Decision

Confirm which mode the user wants:

Mode Use when
Script generation they want reusable .apex, CSV, or JSON assets without touching an org yet
Remote execution they want records created / changed in a real org now

Do not assume remote execution if the user may only want scripts.


Required Context to Gather First

Ask for or infer:

  • target object(s)
  • org alias, if remote execution is required
  • operation type: query, create, update, delete, upsert, import, export, cleanup
  • expected volume
  • whether this is test data, migration data, or one-off troubleshooting data
  • any parent-child relationships that must exist first

Core Operating Rules

  • platform-data-manage acts on remote org data unless the user explicitly wants local script generation.
  • Objects and fields must already exist before data creation.
  • For automation testing, prefer 251+ records when bulk behavior matters.
  • Plan cleanup before creating large or noisy datasets — untracked records accumulate across runs and pollute org state.
  • Use synthetic, non-identifying data in test records — real PII creates compliance risk and cannot be safely removed after bulk import.
  • Prefer CLI-first for straightforward CRUD; use anonymous Apex when the operation truly needs server-side orchestration.

If metadata is missing, stop and hand off to:

  • platform-custom-object-generate or platform-custom-field-generate to create the missing schema, then platform-metadata-deploy to deploy it before retrying the data operation

Recommended Workflow

1. Verify prerequisites

Confirm object / field availability, org auth, and required parent records.

2. Run describe-first pre-flight validation when schema is uncertain

Before creating or updating records, use object describe data to validate:

  • required fields
  • createable vs non-createable fields
  • picklist values
  • relationship fields and parent requirements

See references/sf-cli-data-commands.md for the sf sobject describe command and jq filter patterns for inspecting fields, picklist values, and createable constraints.

3. Choose the smallest correct mechanism

Need Default approach
small one-off CRUD sf data single-record commands
large import/export Bulk API 2.0 via sf data ... bulk
parent-child seed set tree import/export
reusable test dataset factory / anonymous Apex script
reversible experiment cleanup script or savepoint-based approach

4. Execute or generate assets

Use the built-in templates under assets/ when they fit:

  • assets/factories/
  • assets/bulk/
  • assets/cleanup/
  • assets/soql/
  • assets/csv/
  • assets/json/

5. Verify results

Check counts, relationships, and record IDs after creation or update.

6. Apply a bounded retry strategy

If creation fails:

  1. try the primary CLI shape once
  2. retry once with corrected parameters
  3. re-run describe / validate assumptions
  4. pivot to a different mechanism or provide a manual workaround

Do not repeat the same failing command indefinitely.

7. Leave cleanup guidance

Provide exact cleanup commands or rollback assets whenever data was created.


High-Signal Rules

Bulk safety

  • use bulk operations for large volumes
  • test automation-sensitive behavior with 251+ records where appropriate
  • avoid one-record-at-a-time patterns for bulk scenarios

Data integrity

  • include required fields
  • validate picklist values before creation
  • verify parent IDs and relationship integrity
  • account for validation rules and duplicate constraints
  • exclude non-createable fields from input payloads

Cleanup discipline

Prefer one of:

  • delete-by-ID
  • delete-by-pattern
  • delete-by-created-date window
  • rollback / savepoint patterns for script-based test runs

Common Failure Patterns

Error Likely cause Default fix direction
INVALID_FIELD wrong field API name or FLS issue verify schema and access
REQUIRED_FIELD_MISSING mandatory field omitted include required values from describe data
INVALID_CROSS_REFERENCE_KEY bad parent ID create / verify parent first
FIELD_CUSTOM_VALIDATION_EXCEPTION validation rule blocked the record use valid test data or adjust setup
invalid picklist value guessed value instead of describe-backed value inspect picklist values first
non-writeable field error field is not createable / updateable remove it from the payload
bulk limits / timeouts wrong tool for the volume switch to bulk / staged import

Output Format

When finishing, report in this order:

  1. Operation performed
  2. Objects and counts
  3. Target org or local artifact path
  4. Record IDs / output files
  5. Verification result
  6. Cleanup instructions

Suggested shape:

Data operation: <create / update / delete / export / seed>
Objects: <object + counts>
Target: <org alias or local path>
Artifacts: <record ids / csv / apex / json files>
Verification: <passed / partial / failed>
Cleanup: <exact delete or rollback guidance>

Cross-Skill Integration

Need Delegate to Reason
create missing custom objects platform-custom-object-generate schema must exist before data operations
create missing custom fields platform-custom-field-generate field-level schema must exist before data creation
run bulk-sensitive Apex validation platform-apex-test-run test execution and coverage
deploy missing schema first platform-metadata-deploy metadata readiness
implement production Apex logic consuming the data platform-apex-generate Apex class / trigger authoring
implement Flow logic consuming the data automation-flow-generate Flow authoring and automation

Reference Map

Start here

  • references/sf-cli-data-commands.md
  • references/test-data-best-practices.md
  • references/orchestration.md
  • references/test-data-patterns.md
  • references/test-data-factory-usage.md

Query / bulk / cleanup

  • references/soql-relationship-guide.md
  • references/relationship-query-examples.md
  • references/bulk-operations-guide.md
  • references/cleanup-rollback-guide.md
  • references/cleanup-rollback-example.md

Examples / limits

  • references/crud-workflow-example.md
  • references/bulk-testing-example.md
  • references/anonymous-apex-guide.md
  • references/governor-limits-reference.md

Validation scripts

  • scripts/soql_validator.py — validate SOQL queries before execution
  • scripts/validate_data_operation.py — pre-flight check for data operations (required fields, picklist values, createable fields)

Asset templates

  • assets/factories/ — Apex test data factory scripts (account, contact, opportunity, lead, user, etc.)
  • assets/bulk/ — Bulk API 2.0 Apex templates (insert 200, 500, 10000 records; upsert by external ID)
  • assets/cleanup/ — Cleanup and rollback scripts (delete by name, date, pattern; transaction rollback)
  • assets/soql/ — SOQL query templates (aggregate, subquery, parent-to-child, child-to-parent, polymorphic)
  • assets/csv/ — CSV import templates for Account, Contact, Opportunity, custom objects
  • assets/json/ — JSON tree import templates (account-contact, account-opportunity, full hierarchy)

Score Guide

Score Meaning
117+ strong production-safe data workflow
104–116 good operation with minor improvements possible
91–103 acceptable but review advised
78–90 partial / risky patterns present
< 78 blocked until corrected

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