claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 1h ago
スキルOfficialdevelopment

🛠️idmp-shared

プラグイン
idmp-plugin

説明

共有されたIDMP(統合データ管理プラットフォーム)のコマンドラインツール向けルール。要素モード(個別の項目を編集する方式)とテンプレートモード(型板を使う方式)の使い分け、ビジネスルートの根本となる要素IDの解決、危険な書き込み操作の確認、および結果の検証に対応しています。

原文を表示

Shared IDMP CLI rules for choosing element mode vs template mode, resolving business-root rootElementId, acknowledging risky writes, and verifying results.

ユースケース

  • 個別の項目を編集する必要があるとき
  • 型板を使って一括編集するとき
  • ビジネスルートの要素IDを解決するとき
  • 危険な書き込み操作を確認するとき
  • 編集結果を検証するとき

本文(日本語訳)

共通 IDMP CLI ルール

🛑 破壊的な操作の実行確認(必須)

DELETE、書き込み可能な POST / PUT / PATCH--ack-risk コマンド、またはローカル破壊ヘルパー(config remove / profile remove / auth logout --clear)を実行する前に、エージェントは以下の 4 項目を表示してから、ユーザーが明確に「yes」と入力するまで待機してから実行する必要があります。

  1. 対象 — リソースタイプ + ID + 名前 + 所有する要素・テンプレート・プロファイル。
  2. 操作 — HTTP メソッド + パス + schemaPath + パラメータの概要(シークレット情報はマスク)。
  3. 理由 — この操作が必要な背景(ユーザーのリクエストを遡って確認;失敗した前のステップをやり直す場合はその旨を明記)。
  4. 影響範囲 — 依存する分析・パネル・ダッシュボード・アラート・通知、その操作が取り消し可能か、サブオブジェクトが自動削除されるか、プロファイル間への影響。

読み取り専用コマンド(getlistsearchpathtreenew-name*-search*-queryforecast)は確認が不要です。詳細な文言と使用可能なテンプレートについては references/idmp-safety-rules.md を参照してください。

2 つの動作モード

モード CLI ファミリ 次のような場合に使用
要素モード idmp-cli element ...attribute ...analysis ...panel ...dashboard ...event ... 対象が実際の要素、本番データ、本番ダッシュボード、または本番イベント
テンプレートモード idmp-cli template ...attr-template ...analysis-template ...panel-template ... 対象が再利用可能なテンプレート、テンプレート属性、またはテンプレート分析

モードを最初に選択してください。elementIdelementTemplateId を混在させないでください。

準備作業

idmp-cli config init --server http://your-idmp:6042 --username admin@example.com
idmp-cli doctor --offline
idmp-cli auth check
idmp-cli auth list
idmp-cli doctor

ログインが必要な場合:

printf '%s\n' "$IDMP_E2E_PASSWORD" | idmp-cli auth login --username "$IDMP_E2E_USERNAME" --password-stdin

推奨される共通参考資料

先に解決すべき文脈情報

文脈 明確にする理由
動作モード 作成・更新の処理は「要素モード」か「テンプレートモード」かの選択に依存する
所有者 名前の検索やトリガータイプ・関連オブジェクトを調べる前に、最終的な elementId または elementTemplateId が必要
ビジネスルート 要素モードの書き込みは、実際の書き込みが子要素に移る場合でも、element path の上位 rootElementId が必要なことが多い。rootElementId は最終的な葉の所有者ではなく、ビジネス上の祖先として扱う
名前の候補 analysis.analyses.new-namepanel.panels.new-namedashboard.dashboards.new-name はいずれも提案 name が必要。所有者 ID だけでは呼び出さない
スコープ詳細 applyOnSelf、子テンプレートのスコープ、ワークフローが実データを持つ葉を対象とするかを、書き込み前に決定する
検証対象 どの getlist、実行時状態確認、イベント、または配信再確認でワークフローが完了したことを証明するかを決定する

本番環境での行動制約

  • すべての書き込みは、後続の getlist、実行時チェック、または配信再確認がバックエンドの変更を確認するまで未完了と扱う。
  • 過去の demo ルートが存在すると仮定しない。現在見えている最初のレベルのルートから開始し、共有の葉を所有するそのツリーの配下に必要なテンポラリスコープを作成する。
  • 現在の所有者の trigger-types list が空の場合、作成フローをデータを持つ葉の要素に移し、ビジネスルートを rootElementId として保持する。
  • new-name は正しいペイロード形式でのみ使用する。分析・パネル・ダッシュボードは所有者と候補 name が必要、属性 new-name は所有者スコープだけで OK。analysis.analyses.new-name は POST リザーブコールのため --ack-risk が必須、パネル・ダッシュボード・属性の new-name コマンドは読み取り専用のままです。
  • 共有環境ではテンプレート再利用が必要です。通知ルールは通常その場で更新されます。ここでは作成・更新パスに合致する削除フローが提供されていないためです。
  • アラート検証では、event.events.list --params '{"analysisId":...}' はノイズの多い共有環境で status=Unack だけでフィルタリングするより確実です。
  • 設定書き込みの成功は実行時動作を証明しません。分析は Ready のまま残る可能性、アラートは fill-history が必要な可能性、通知履歴は再送信または新規イベント作成より遅れる可能性があります。

完了の証拠

  • CLI の成功メッセージだけは証拠になりません。
  • 作成フローでは、オブジェクトを再度読み取り、最終的な id、所有者スコープ、予約された名前、予期されたステータスビットを確認する。
  • 更新フローでは、同じオブジェクトを再度読み取り、変更フィールドがバックエンドに保持されているか確認する。
  • 削除フローでは、スコープ限定の list 再確認または構造化された不在 get で削除を証明する。
  • 要素モード書き込みでは、rootElementId を再利用する前に element elements pathelement fullpath get でビジネスルート境界を証明する。

標準的な読み取り後の書き込みフロー

  1. searchlist、または path で対象を特定する。
  2. getattributesanalyses list、または関連リストエンドポイントで現在の状態を読み取る。
  3. new-namesub-templatestrigger-types、連絡先ポイント・イベントテンプレートの前提条件など、依存関係を解決する。
  4. スキーマを検査し、--dry-run でプレビューし、読み取り専用でない生成コマンドに --ack-risk を追加する。
  5. get または list で検証し、製品が実行状態を期待する場合はオブジェクトを再開する。

主要な製品ルール

  • 要素モードでは、rootElementId は現在の葉要素からではなく、要素パスのビジネスルートから来る。葉の所有者とビジネスルートは別の書き込み入力。
  • applyOnSelf=false は設定が子テンプレートまたは階層スコープに依存することを意味する。sub-templatestrigger-types を先に読む。
  • そのヘルパーが存在する場合、属性・分析・パネル・ダッシュボード作成前に new-name を使用し、そのヘルパーに対して正しいペイロード形式を提供する。
  • 認証情報はプロファイル・環境変数・標準入力にのみ保持する。
  • 構造化されたコマンドで十分でない場合のみ idmp-cli api を使用する。生成されたサービスコマンドを優先する。

主要コマンド

idmp-cli schema element.elements.sub-templates
idmp-cli schema analysis.analyses.create
idmp-cli schema attribute.elements.attributes-post
idmp-cli element elements search --params '{"keyword":"beijing","current":1,"limitSize":20}'
idmp-cli element elements path --params '{"elementId":123}'
idmp-cli analysis analyses list --params '{"elementId":123,"current":1,"size":20}'

例外とエラーハンドリング

  • idmp-cli auth check または idmp-cli doctor が失敗する場合、セッションと接続が正常になるまで書き込み作業を停止する。
  • タスクがテンプレートで始まるが、コマンドが elementId を期待する場合(またはその逆)、リクエストを強制するのではなくモードを切り替える。
  • パス検索がビジネスルートを明確に示さない場合、葉要素を rootElementId として再利用しない。パスを先に解決する。不明確なパスとは、element elements pathelement fullpath getelement by-path list がルートから葉へのチェーンで一貫していないもの。
  • 作成フローがテンポラリ出力属性またはデフォルト名を予約し、メインオブジェクトがキャンセルまたは拒否された場合、再試行の前にテンポラリ成果物をクリーンアップする。
  • 書き込みが成功を報告するが、後続の get または list が変更を表示しない場合、ワークフローを未完了と扱い、別の変更を送信する前に再読み込みする。

ライブテスト環境変数

以下のみを使用:

  • IDMP_E2E_ENABLED
  • IDMP_BASE_URL
  • IDMP_E2E_USERNAME
  • IDMP_E2E_PASSWORD

検証シナリオ

  1. idmp-cli doctor --offline でローカル準備状況を確認する。
  2. idmp-cli auth check でアクティブなセッションを確認する。
  3. idmp-cli schema element.elements.searchidmp-cli schema template.elements.get を比較して、選択したモードを検証する。
  4. idmp-cli element elements path --params '{"elementId":123}' で書き込み前にビジネスルートを解決する。
  5. idmp-cli schema analysis.analyses.create に続いて idmp-cli analysis analyses list --params '{"elementId":123,"current":1,"size":20}' で変更ワークフローをプレビューおよび検証する。
原文(English)を表示

Shared IDMP CLI rules

🛑 Destructive op confirmation (mandatory)

Before executing any DELETE, non-readonly POST / PUT / PATCH, --ack-risk command, or local destructive helper (config remove / profile remove / auth logout --clear), the agent MUST print the 4 items below and then wait for an explicit user yes before running the command:

  1. Target — resource type + id + name + owning element / template / profile.
  2. Action — HTTP method + path + schemaPath + param summary (mask secrets).
  3. Reason — why this operation is needed (trace it back to the user's request; if it is a rollback of a failed previous step, say so).
  4. Blast radius — dependent analyses / panels / dashboards / alerts / notifications; whether the action is reversible; whether sub-objects are deleted transitively; cross-profile impact.

Read-only commands (get, list, search, path, tree, new-name, *-search, *-query, forecast) do not require this confirmation. For detailed wording and the ready-to-use template, see references/idmp-safety-rules.md.

Two working modes

Mode CLI families Use when
element mode idmp-cli element ..., attribute ..., analysis ..., panel ..., dashboard ..., event ... The target is a real element, live data, a live dashboard, or a live event.
template mode idmp-cli template ..., attr-template ..., analysis-template ..., panel-template ... The target is a reusable template, template attribute, or template analysis.

Pick the mode first. Do not mix elementId and elementTemplateId.

Preflight

idmp-cli config init --server http://your-idmp:6042 --username admin@example.com
idmp-cli doctor --offline
idmp-cli auth check
idmp-cli auth list
idmp-cli doctor

If login is required:

printf '%s\n' "$IDMP_E2E_PASSWORD" | idmp-cli auth login --username "$IDMP_E2E_USERNAME" --password-stdin

Recommended shared references

Missing context to resolve first

Context Why it must be explicit
Working mode Every create and update path depends on choosing element mode or template mode first.
Owner You need the final elementId or elementTemplateId before you can discover names, trigger types, or related objects.
Business root Element-mode writes often need a higher rootElementId from element path, even when the real write must move to a leaf owner. Treat rootElementId as the business-root ancestor, not as a synonym for the final leaf owner.
Candidate name seed analysis.analyses.new-name, panel.panels.new-name, and dashboard.dashboards.new-name all need a proposed name; do not call them with only the owner ID.
Scope details Decide applyOnSelf, child-template scope, and whether the workflow targets a real data-bearing leaf before any mutating request.
Verification target Decide which get, list, runtime state, event, or delivery reread will prove that the workflow really finished.

Constrained live behaviors

  • Treat every write as incomplete until a follow-up get, list, runtime check, or delivery reread proves the backend kept the change.
  • Do not assume a historical demo root exists. Start from the currently visible first-level root that owns the shared leaf fixtures, then create any temporary middle-scope owners under that real tree.
  • If trigger-types list is empty on the current owner, move the create flow to a data-bearing leaf element and keep the business root as rootElementId.
  • Use new-name only with the correct payload shape. Analyses, panels, and dashboards need both the owner and a candidate name; attribute new-name only needs the owner scope. analysis.analyses.new-name is a POST reserve call and still requires --ack-risk, while panel/dashboard/attribute new-name commands remain readonly.
  • Shared environments often require fixture reuse. Notify rules are typically updated in place because the documented create and update paths do not come with a matching delete flow here.
  • For alert validation, event.events.list --params '{"analysisId":...}' is more reliable than filtering only by status=Unack in a noisy shared environment.
  • Successful config writes do not prove runtime behavior. Analyses can remain Ready, alerts can need fill-history, and notification history can lag behind resend or new-event creation.

Evidence of completion

  • A CLI success line is not proof by itself.
  • For create flows, reread the object and confirm the final id, owner scope, reserved name, and expected status bits.
  • For update flows, reread the same object and confirm the changed field persisted on the backend.
  • For delete flows, prove absence through a scoped list reread or a structured not-found get.
  • For element-mode writes, prove the business-root boundary with element elements path plus element fullpath get before you reuse rootElementId.

Standard read-before-write flow

  1. Locate the target with search, list, or path.
  2. Read the current state with get, attributes, analyses list, or the relevant list endpoint.
  3. Resolve dependencies such as new-name, sub-templates, trigger-types, and any contact-point or event-template prerequisites.
  4. Inspect the schema, preview with --dry-run, and add --ack-risk for non-read-only generated commands.
  5. Verify with get or list; resume the object if the product expects a running state.

Key product rules

  • In element mode, rootElementId comes from the business root in the element path, not from the current leaf element. The leaf owner and the business root are separate write inputs.
  • applyOnSelf=false means the configuration depends on child-template or hierarchical scope; read sub-templates and trigger-types first.
  • Use new-name before creating attributes, analyses, panels, or dashboards when that helper exists, and provide the correct payload shape for that helper.
  • Keep credentials in profiles, environment variables, or stdin only.
  • Prefer generated service commands; use idmp-cli api only when no structured command is sufficient.

Key commands

idmp-cli schema element.elements.sub-templates
idmp-cli schema analysis.analyses.create
idmp-cli schema attribute.elements.attributes-post
idmp-cli element elements search --params '{"keyword":"beijing","current":1,"limitSize":20}'
idmp-cli element elements path --params '{"elementId":123}'
idmp-cli analysis analyses list --params '{"elementId":123,"current":1,"size":20}'

Exception and failure handling

  • If idmp-cli auth check or idmp-cli doctor fails, stop mutating work until the session and connectivity are healthy again.
  • If the task starts with a template but the command expects elementId (or the reverse), switch modes instead of forcing the request.
  • If the path lookup does not clearly show the business root, do not reuse the leaf element as rootElementId; resolve the path first. An unclear path is one where element elements path, element fullpath get, and element by-path list do not round-trip to the same root-to-leaf chain.
  • If a create flow reserves a temporary output attribute or default name and the main object is canceled or rejected, clean up the temporary artifact before retrying.
  • If a write reports success but the follow-up get or list does not show the change, treat the workflow as incomplete and re-read before sending another mutation.

Live test environment variables

Only use:

  • IDMP_E2E_ENABLED
  • IDMP_BASE_URL
  • IDMP_E2E_USERNAME
  • IDMP_E2E_PASSWORD

Validation scenarios

  1. Confirm local readiness with idmp-cli doctor --offline.
  2. Confirm the active session with idmp-cli auth check.
  3. Validate the chosen mode by comparing idmp-cli schema element.elements.search and idmp-cli schema template.elements.get.
  4. Resolve the business root before a write with idmp-cli element elements path --params '{"elementId":123}'.
  5. Preview and verify a mutating workflow with idmp-cli schema analysis.analyses.create followed by idmp-cli analysis analyses list --params '{"elementId":123,"current":1,"size":20}'.

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

idmp-plugin:idmp-shared — Anthropic公式 Claude Skill 日本語版