📦idmp-data
- プラグイン
- idmp-plugin
- ソース
- GitHub で見る ↗
説明
IDMP(医薬品規制データ管理)データの入出力スキル。 次のような場合に使用: - 出力可能な基本要素を確認したい - 入出力の記録を確認したい - ファイルやデータをダウンロードしたい - パッケージの出力、ファイルのダウンロード、データの入力という3つの流れを区別して処理したい
原文を表示
IDMP data import/export skill. Use it to inspect exportable root elements, review import/export records, download artifacts, and distinguish package export, artifact download, and import flows.
ユースケース
- ✓出力可能な基本要素を確認したい
- ✓入出力の記録を確認したい
- ✓ファイルやデータをダウンロードしたい
- ✓パッケージの出力、ファイルのダウンロード、データの入力を区別して処理したい
本文(日本語訳)
データ
まず ../idmp-shared/SKILL.md をお読みください。
このスキルがカバーする内容
- パッケージのインポート/エクスポートで利用可能なトップレベルの要素を見つける
- ファイルをダウンロードする前、または失敗を調査する前に、インポート/エクスポートの記録を確認する
- パッケージエクスポート、ファイルダウンロード、パッケージインポート、単一のインポート/エクスポート操作を区別する
- ステータス、ファイル名、エラーメッセージについて、記録を運用者の信頼できる情報源として活用する
- 2つの有効なエクスポート結果の両方を受け入れる: 記録に基づいたファイルか、標準出力に直接ストリーミング(配信)されたZIPアーカイブ
推奨ショートカット
| ショートカット | 用途 |
|---|---|
+roots |
インポート/エクスポートで表示される第1階層の要素を一覧表示 |
+records |
インポート/エクスポートの記録を一覧表示 |
+download |
既知の記録に対するファイルをダウンロード |
推奨参考資料
インポート/エクスポート前に解決すべき重要な情報
| 情報の種類 | インポート/エクスポート前に確認が必要な理由 |
|---|---|
| ワークフロー種別 | パッケージエクスポート、パッケージインポート、データベースCSVインポートでは異なる処理の流れになる |
| 対象範囲 | 最終的な elementIds、elementTemplateIds、またはデータベースのスコープを事前に把握する必要がある |
| 想定される成果物 | エクスポートはZIPを標準出力に直接ストリーミングするか、後から fileName で参照できる記録を作成するかのいずれか |
| データベース情報 | CSVインポートには、事前に検証された connectionId、dbName、テーブル名または安定した名前が必要 |
| 検証タイミング | 処理後に data records list を再度確認する時期と方法を決める |
制約付きの動作ルール
- パッケージエクスポート、パッケージインポート、データベースCSVインポートは、推測で設定された内容やファイル名を共有してはいけない
data records listは毎回の処理後の公式な確認手段。簡潔な成功応答は最終状態ではないdata download getでは、推測したパスではなく、実際の記録ファイル名をnameパラメータとして使用する- エクスポートの成功には2つの有効な終わり方がある: 標準出力に出されたZIPバイトか、後から
fileNameで確認できる記録に基づいたファイル - 大きな影響を持つインポート/エクスポート作業は、本番処理の前にスキーマ確認または
--dry-runで試行する - 試験的なインポートで不要な資産が作成された場合、削除は記録削除ではなく、対象となる資産の管理ワークフローで行う
運用手順
- インポート/エクスポートの判断を行う前に
first-level-elementsから始める - ファイルをダウンロードする前、失敗を確認する前、または生成されたファイル名を確認する前に、
recordsを読む - パッケージ作成には
import-and-export export、記録がfileNameを持つ場合のダウンロードにはdownload get、アップロードにはimport-and-export importまたはsingle-import createを使用する - エクスポートとインポートは長時間実行または非同期で進むと予想される。CLIの応答だけでは最終確認ではない
- エクスポートが既に標準出力にZIPバイトをストリーミングしている場合は、そのストリームを成果物として扱い、監査履歴のために
recordsを再確認する - 毎回の処理後に
recordsを再確認して、ステータス、ファイル名、失敗の詳細を確認する
主要コマンド
idmp-cli schema data.first-level-elements.list
idmp-cli data first-level-elements list
idmp-cli schema data.records.list
idmp-cli data records list
idmp-cli schema data.import-and-export.export
idmp-cli data import-and-export export --ack-risk --data '{"elementIds":[123]}'
idmp-cli schema data.download.get
idmp-cli data download get --params '{"name":"export.zip"}'
idmp-cli schema data.import-and-export.import
# `data.import-and-export.import` は現在のスキーマではマルチパート形式。
# スキーマ出力をまず確認して、JSON本体を推測するのではなく、
# 正確な転送方式とフィールド(例:`jsonFile` / `taosgenFiles[]`)を使用してリクエストを構築する
idmp-cli data import-and-export import --ack-risk --data '{...}'
idmp-cli schema data.single-import.create
# `data.single-import.create` も現在のスキーマではマルチパート形式。
# スキーマ出力をまず確認して、JSON形式を推測するのではなく、
# 正確なアップロードフィールドを使用する
idmp-cli data single-import create --ack-risk --data '{...}'
例外的な状況への対応
first-level-elementsが空の場合: 現在のアカウントがインポート/エクスポートのルートを見ることができるか確認してから、ファイルの問題のトラブルシューティングを行う- エクスポート呼び出しが素早く返るが、使用可能な記録が現れない場合: 標準出力に既にZIPファイルが含まれていないか確認してから再試行する
- ダウンロードがファイル不見当エラーで失敗する場合:
recordsを再度読み、nameに正確なファイル名を使用するか、エクスポートが既にZIPバイトをストリーミングしている場合はダウンロードをスキップする - インポートが検証に失敗する場合: スキーマをまず確認してから、アップロード手順からの推測ではなく、
recordsから実際の失敗原因を読む - パッケージインポート/エクスポートと単一インポート/エクスポートの結果が異なる場合: 運用者が正しいフローを選択したか確認してから再試行する
検証シナリオ
1. エクスポート元の発見
エクスポート範囲を選ぶ前に、第1階層の要素を一覧表示する:
idmp-cli data first-level-elements list
2. 記録の基準確認
何かを処理する前に、インポート/エクスポートの記録を読む:
idmp-cli data records list
3. パッケージエクスポート
既知の要素パッケージを1つエクスポートする:
idmp-cli data import-and-export export --ack-risk --data '{"elementIds":[123]}'
4. 成果物の出力先判定
記録を再度読んで、記録に基づいたファイルと、既に標準出力にストリーミングされたZIPを区別する:
idmp-cli data records list
5. 記録が fileName を持つ場合のみダウンロード
エクスポートがダウンロード可能な記録を作成した場合、報告されたファイルをダウンロードする:
idmp-cli data download get --params '{"name":"export.zip"}'
原文(English)を表示
data
Read ../idmp-shared/SKILL.md first.
What this skill covers
- Discover which top-level elements are available for package import/export.
- Review import/export records before downloading artifacts or investigating failures.
- Distinguish package export, artifact download, package import, and single import/export operations.
- Use records as the operator’s source of truth for status, filenames, and error messages.
- Accept both valid export outcomes: a record-backed artifact or a ZIP archive streamed directly to stdout.
Recommended shortcuts
| Shortcut | Purpose |
|---|---|
+roots |
List first-level elements visible to import/export |
+records |
List import/export records |
+download |
Download the artifact for a known record |
Recommended reference
Missing context to resolve first
| Context | Why it must be resolved before import or export |
|---|---|
| Workflow type | Package export, package import, and datasource CSV import are different mutation chains. |
| Scope | You need the final elementIds, elementTemplateIds, or datasource scope before the write. |
| Expected artifact | Exports can either stream a ZIP directly to stdout or create a record that later exposes fileName. |
| Datasource context | CSV import needs a validated connectionId, dbName, and table or stable names from earlier reads. |
| Verification window | Decide when and how you will reread data records list after the write. |
Constrained live behaviors
- Package export, package import, and datasource CSV import must not share guessed payloads or filenames.
data records listis the authoritative confirmation after every write; a quick success response is not the final state.data download getmust use the real record artifact name as thenamepath parameter, not a guessed path.- A successful export can end in two valid ways: ZIP bytes on stdout or a later record-backed artifact with
fileName. - High-impact import or export work should start with schema inspection or
--dry-runbefore the real write. - If a probe import creates assets you do not want to keep, cleanup belongs to the owning asset workflow, not to record deletion.
Operator workflow
- Start with
first-level-elementsbefore any export or import decision. - Read
recordsbefore downloading an artifact, reviewing a failure, or confirming the generated filename. - Use
import-and-export exportfor package creation,download getonly when a record exposesfileName, andimport-and-export importorsingle-import createfor uploads. - Expect exports and imports to be long-running or asynchronous; the CLI response alone is not the final confirmation.
- If export already streamed ZIP bytes to stdout, treat that stream as the artifact and still re-check
recordsfor audit history. - Re-check
recordsafter every write to confirm status, artifact name, and failure details.
Key commands
idmp-cli schema data.first-level-elements.list
idmp-cli data first-level-elements list
idmp-cli schema data.records.list
idmp-cli data records list
idmp-cli schema data.import-and-export.export
idmp-cli data import-and-export export --ack-risk --data '{"elementIds":[123]}'
idmp-cli schema data.download.get
idmp-cli data download get --params '{"name":"export.zip"}'
idmp-cli schema data.import-and-export.import
# `data.import-and-export.import` is multipart/form-data in the current schema.
# Inspect the schema output first and build the request with the exact transport and fields
# (for example `jsonFile` / `taosgenFiles[]`) instead of assuming a plain JSON body.
idmp-cli data import-and-export import --ack-risk --data '{...}'
idmp-cli schema data.single-import.create
# `data.single-import.create` is also multipart/form-data in the current schema.
# Inspect the schema output first and use the exact upload fields instead of guessing a JSON DTO.
idmp-cli data single-import create --ack-risk --data '{...}'
Exception paths
first-level-elementsis empty: confirm the current account can see any import/export roots before troubleshooting files.- The export call returns quickly but no usable record appears: check whether stdout already contains a ZIP artifact before retrying.
- A download fails with file-not-found behavior: re-read
records, use the exact artifact name asname, or skip download when the export already streamed ZIP bytes. - An import fails validation: inspect the schema first, then read
recordsfor the real failure reason instead of guessing from the upload step. - Package and single import/export results differ: confirm the operator chose the correct flow before retrying.
Validation scenarios
1. Export root discovery
List first-level elements before choosing an export scope:
idmp-cli data first-level-elements list
2. Record baseline
Read import/export records before writing anything:
idmp-cli data records list
3. Package export
Export one known element package:
idmp-cli data import-and-export export --ack-risk --data '{"elementIds":[123]}'
4. Artifact branch detection
Re-read records and distinguish a record-backed artifact from a ZIP that was already streamed to stdout:
idmp-cli data records list
5. Download only when the record exposes fileName
Download the reported artifact when the export created a downloadable record:
idmp-cli data download get --params '{"name":"export.zip"}'
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。