Data storage

From lza6/Armor-piercing-system-prompts · View interactive version

Data storage is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Use ClearML Dataset, StorageManager, clearml-data CLI, storage backends, cache behavior, and HyperDataset/DataView routing for dataset versioning and retrieval.

How to use this skill

Skill file

ClearML Data and Storage

Use this sub-skill when the user needs to create, version, upload, finalize, retrieve, verify, or troubleshoot ClearML datasets, build clearml-data commands, manage remote storage URIs, or reason about StorageManager caching and HyperDataset/DataView routing.

Route First

Core Dataset Pattern

Use a two-stage mental model: a dataset version is mutable until finalized, and after finalization it should be retrieved or used as a parent for a new version.

from clearml import Dataset

base = Dataset.create(
    dataset_project="datasets/examples",
    dataset_name="images",
    dataset_version="1.0.0",
    output_uri="s3://bucket/clearml/images",
)
base.add_files(path="data/train", dataset_path="train")
base.upload(output_url="s3://bucket/clearml/images", verbose=True)
base.finalize()

child = Dataset.create(
    dataset_project="datasets/examples",
    dataset_name="images",
    dataset_version="1.1.0",
    parent_datasets=[base.id],
)
child.sync_folder(local_path="data/train", dataset_path="train", verbose=True)
child.upload(verbose=True)
child.finalize()

Prefer explicit IDs after creation. Dataset.get() can search by project/name/version, but dataset_id avoids ambiguity when multiple semantic versions or recent updates match.

CLI Planning

Use clearml-data when the user wants shell commands or quick dataset lifecycle operations. The CLI stores the most recent dataset ID in ~/.clearml_data.json; commands without --id may silently target the last accessed dataset, so production instructions should include --id after create unless the user intentionally wants one-shell stateful use.

clearml-data create --project datasets/examples --name images --version 1.0.0 --storage s3://bucket/clearml/images
clearml-data add --id DATASET_ID --dataset-folder train --files data/train
clearml-data upload --id DATASET_ID --storage s3://bucket/clearml/images --verbose
clearml-data close --id DATASET_ID --verbose

Use scripts/dataset_cli_plan.py to generate safe command sequences without running ClearML calls. Use scripts/validate_dataset_plan.py to check JSON plan invariants before translating a plan to Python or CLI.

Storage Guidance

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.