codex-rs/skills/src/assets/adapt-environment/SKILL.md
Adapt code to work with a GPU node's installed environment. Use when an experiment fails due to dependency version mismatches, import errors, missing packages, or API incompatibilities between the code's expected environment and what's actually installed on the GPU node. Triggered by errors like 'ModuleNotFoundError', 'ImportError', version conflicts, or when the user says 'adapt this code to the environment'.
npx skillsauth add agents2agentsai/ata adapt-environmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Port code to work with the dependencies installed on a GPU compute node. This skill is used reactively — when an experiment fails because the code expects different package versions or APIs than what the node provides.
ModuleNotFoundError, ImportError, or similarRead what's installed on the node:
experiment_run_command(<id>, "cat /etc/gpu-env-manifest.txt")
This file is baked into the Docker image at build time via uv pip freeze. It lists every installed package and version.
Read the experiment logs to find the exact failure:
experiment_logs(<id>, lines=50)
Look for the traceback and the specific import or version error.
Compare what the code expects vs what the manifest provides. Common patterns:
| Error pattern | Likely cause | Fix approach |
|---|---|---|
| ModuleNotFoundError: No module named 'X' | Package not installed | Add to requirements.txt or find an installed alternative |
| ImportError: cannot import name 'Y' from 'X' | API changed between versions | Update import path or use version-appropriate API |
| RuntimeError: CUDA error | CUDA version mismatch | Check nvcc --version vs code's expected CUDA |
| AttributeError: module 'torch' has no attribute 'Z' | PyTorch version difference | Use version-appropriate API call |
| isaacsim import errors | Isaac Sim path or version difference | Check installed version, update imports |
Make the minimum changes to the code to work with the installed versions. Priorities:
torch.old_function(), find the replacement.Re-run the experiment and check logs:
experiment_logs(<id>, lines=50)
If new errors appear, repeat from Step 2.
/etc/gpu-env-manifest.txt, that's the version the code must work with.uv pip install.# Old API (PyTorch < 2.0)
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=100)
# New API (PyTorch >= 2.0) — compile support
model = torch.compile(model) # Only available in 2.0+
Check installed version: look for torch==X.Y.Z in the manifest.
# Pip-installed Isaac Sim (current environment)
from isaacsim import SimulationApp
import omni.isaac.core
# Old NGC container path (don't use)
# sys.path.insert(0, "/opt/nvidia/isaac-sim/...")
Isaac Sim is pip-installed in /opt/venv. No path manipulation needed.
Given manifest contains torch==2.7.0 and numpy==1.26.4:
# Before (will cause conflicts)
torch>=2.0.0,<2.5.0
numpy==1.25.0
custom-library==1.0.0
# After (only additional packages)
custom-library==1.0.0
testing
Multi-repo workspace management: clone repos, create execution runs, track papers/datasets/artifacts, manage snapshots, and review audit logs. Use when the user wants to organize multi-repo work, run experiments in sandboxes, or track research resources.
tools
Build, edit, recalculate, import, and export spreadsheet workbooks with the preloaded @oai/artifact-tool JavaScript surface through the artifacts tool.
tools
Build, edit, render, import, and export presentation decks with the preloaded @oai/artifact-tool JavaScript surface through the artifacts tool.
development
Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).