Skip to main content
Technology & EngineeringData Science33 lines

Reproducible Google Colab Notebooks

Set up, run and recover Colab notebooks with explicit dependencies, durable outputs and fresh-runtime checks.

Quick Summary7 lines
Use this skill when a notebook must work for someone other than its author. Collect the notebook, input data location, expected output, package constraints and available runtime. Do not promise a particular GPU or uninterrupted session: Colab resources and runtime limits vary.

## Key Points

- [Colab FAQ](https://research.google.com/colaboratory/faq.html)
skilldb get data-science-skills/google-colabFull skill: 33 lines
Paste into your CLAUDE.md or agent config

Reproducible Google Colab Notebooks

Use this skill when a notebook must work for someone other than its author. Collect the notebook, input data location, expected output, package constraints and available runtime. Do not promise a particular GPU or uninterrupted session: Colab resources and runtime limits vary.

Make setup explicit

List required packages and tested versions in the first executable setup section. Separate installation from imports and explain when a runtime restart is required. Print a compact environment record: Python version, relevant library versions, selected device and input dataset version. Seed stochastic operations where appropriate, while stating any remaining nondeterminism.

Use paths relative to an explicit project directory. Treat the runtime disk as temporary. Keep a deliberate distinction between scratch files and durable Drive or other authorized storage. A shared notebook does not share the original virtual machine, installed packages or private files. Include retrieval instructions and a small public or synthetic fixture when real data cannot be redistributed.

Protect the notebook's inputs

Never put credentials in saved cells, printed URLs, output tables or exception dumps. Retrieve secrets through an approved secret facility at runtime and expose only required permissions. Inspect notebook code before mounting a user's Drive because that code may then access mounted files. Use a minimal project folder rather than assuming access to unrelated documents.

Validate input existence, size, schema and checksum before expensive work. Fail with an actionable message when the required runtime or dataset is absent. A CPU fallback is valid only if the operation supports it; do not silently report a GPU benchmark from CPU execution.

Execute and recover

Run every cell in order on a fresh runtime. Check intermediate shapes and a known small result before scaling up. Save checkpoints to a temporary durable destination, verify them, then update the pointer to the latest good checkpoint. Include the configuration and progress needed to resume, not just a model filename.

After a disconnect, inspect completed artifacts before rerunning costly or externally mutating cells. Notebook output from an earlier session is not evidence of this run. Export the final artifact and open or parse it from its durable location.

Deliver the notebook, environment record, input references, fresh-run result and recovery instructions. Remove sensitive cell output before sharing; preserve error evidence separately when it helps reproduce a failure.

References

Install this skill directly: skilldb add data-science-skills

Get CLI access →