agentleFS
KingKongRoboticsKingKongRobotics/jumper/.claude/skills/setup-env/SKILL.md

setup-env

Skill3.1k starsChanged 33 days agoApache-2.0View on GitHub

Set up, verify or repair the mjrl-lab development environment on Linux, Windows or macOS, with or without an NVIDIA GPU -- the Python environment and the Rust toolchain the controller (deploy/fsm) builds with. Detects the machine, picks the right torch build, finds which of cargo, the wasm target, wasm-bindgen and CycloneDDS are missing, installs, and runs six verification gates. Use this whenever someone is getting this repository running on a new machine, onboarding, or hitting environment trouble: "ModuleNotFoundError: No module named 'mjlab'", torch not seeing the GPU, warp reporting only ['cpu'], `--list` showing no tasks, mujoco version conflicts, `cargo` not found, `idlc not found`, a wasm-bindgen version mismatch, the controller's tests skipping, or a suspicion that the wrong Python or the wrong checkout is being used. Reach for it before hand-rolling pip or cargo commands, because the failures here are quiet -- an environment that imports everything and trains happily can still be running another checkout's code or ignoring the GPU entirely, and a test suite on a machine without cargo is green because it skipped the controller.

  • Installs packages

4 other projects use a version of this.

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 4 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the KingKongRobotics/jumper repository that our weekly crawl found: only 4 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. Giskard-AI/giskard-oss★ 5.9ksame name
    2. akash-network/node★ 1.1ksame name
    3. ok-oldking/ok-script★ 831same name
    4. Jinchen-Yang/diansai-skill★ 9same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run it with the machine's existing interpreter — establishing whether that interpreter is usable at all is part of what it answers.

    line 41
  2. Distinctive:

    Read its output before continuing.

    line 46
  3. Very specific:

    Follow the commands detect.py printed.

    line 56
  4. Very specific:

    Only one step genuinely branches: which torch wheel.

    line 61
  5. Very specific:

    Before any pip, confirm the interpreter is the intended one:

    line 64
  6. Distinctive:

    Do not proceed past a failure.

    line 124

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Setting up mjrl-lab

The reference procedure is docs/AGENT_SETUP.md — about 600 lines, written to be read by an agent, with the full platform tables and a catalogue of known failures. This skill does not restate it. It sequences it, automates the two parts worth automating, and knows when to stop and read.

Two scripts carry the weight. Both are plain standard-library Python and run without this skill, so an agent that cannot load skills can still use them:

ScriptInterpreterAnswers
scripts/detect.pywhatever the machine already haswhat this machine is, and the exact commands that follow from it
scripts/gates.pythe environment's ownwhether the environment actually works, and what to fix

The shape of the problem

Almost everything here fails quietly. Installing a cu126 torch on a Blackwell card succeeds and dies later inside CUDA. An editable install pointing at a stale checkout imports cleanly and runs somebody else's code. A pip into the wrong interpreter reports success and changes nothing. A machine without cargo runs the test suite green, because the tests that build the controller skip. None of these announce themselves, and all of them surface much later as something that looks unrelated.

That is why this measures before deciding and verifies after acting, rather than running a sequence of commands and trusting that silence means success.

Procedure

1. Measure, before deciding anything

python3 .claude/skills/setup-env/scripts/detect.py

Run it with the machine's existing interpreter — establishing whether that interpreter is usable at all is part of what it answers. It reports OS, architecture, Python version, GPU and compute capability, any environment that already exists, which parts of the controller's toolchain are already here, and it ends with the exact command sequence for this machine.

Read its output before continuing. In particular:

  • Python out of range (needs 3.10–3.13): install a compliant interpreter first. Installing dependencies on an old one produces failures much later that read as unrelated.
  • An environment already exists: go to step 3 and verify it. The common case after the first run is not a bare machine but a broken environment, and building a second one hides the fault rather than fixing it.

2. Install

Follow the commands detect.py printed. They are section 1 of the reference doc with the branches already resolved for this machine; consult the doc when something does not match — the Debian ensurepip split, the Windows execution policy, and the MSVC prerequisite each have a paragraph there.

Only one step genuinely branches: which torch wheel. detect.py chose it from the measured compute capability, and its reasoning is on the torch_plan function if you need to check it.

Before any pip, confirm the interpreter is the intended one:

python -c "import sys; print(sys.prefix)"

It must be the environment you just made. Pip reports success regardless of where it installs, so this is the cheapest place to catch a mistake that otherwise surfaces three steps later.

pip install -e . is not optional and is not a convenience: the vendored mjlab and rsl_rl live under rl/, which is not on sys.path. That editable install is the mechanism that makes them importable.

The controller's toolchain is part of the install, on every machine — sections 2.1 and 2.2 of the reference doc. It is additive rather than per-checkout, so detect.py prints only the steps this machine is missing, and "nothing missing" is a normal answer on a second checkout. Two of its parts are easy to get subtly wrong:

  • wasm-bindgen's version comes from deploy/fsm/Cargo.lock, exactly — not from Cargo.toml's "0.2", a range every 0.2.x satisfies and cargo install --version refuses. Take the command detect.py printed; scripts/deploy.py refuses any other version.
  • CycloneDDS is a source build (11.0.1, the soname the board carries) and needs sudo ldconfig after installing into /usr/local. It is not needed for deploy.py, but once cargo exists tests/test_deploy_sources.py stops skipping and fails without it.
  • Rockchip's NPU header is per checkout, not per machine. bash deploy/fsm/vendor/rknpu2/fetch.sh puts it in the repository, git-ignored because its licence is Rockchip's. detect.py prints that step whenever it is missing, a second checkout included.

3. Verify

.venv/bin/python .claude/skills/setup-env/scripts/gates.py

Six gates, exit code = number of failures. Each prints what it measured and, on failure, the remedy and where the long form lives:

  • A — warp device enumeration. On a GPU machine cuda:0 must appear in the device list. wp.init() also prints a banner naming the card; that banner appears even when CUDA is unusable, so the list is the criterion and the banner is not.
  • B — native MuJoCo's batch interface. native:cpu is built on mujoco.rollout, so importing mujoco is not sufficient evidence.
  • C — the vendored copies are this checkout's. Stricter than the doc's version, which only rules out site-packages. An editable install left pointing at an older copy of the repository satisfies that and still executes another checkout's code — measured on a training machine on 2026-09-04, where tasks came from the current repository and mjlab from a snapshot three days stale. Everything imported; the seam being edited simply was not the seam being run.
  • D — the task registry. Loads no simulation dependencies, so it passes even where the GPU is broken. A failure here is a packaging problem, not a simulation one — which is worth knowing before looking in the wrong place.
  • E — the Rust toolchain builds the controller's host targets. cargo check of the browser's wasm and of play --app's extension, and the wasm-bindgen CLI against Cargo.lock. It builds rather than reading versions, because a missing target or linker passes cargo --version.
  • F — the device build links and loads. cargo test --lib -- --list with the default features: CycloneDDS, libclang, Rockchip's NPU header and a libddsc the loader finds. --list runs the binary without running a test, so a failing crate test is not reported as an environment fault.

E and F take about 30 s together, cold, on the i9-14900KF with the crates already downloaded; a first run also downloads them.

Do not proceed past a failure. Each remedy is printed; the long forms are section 6 of the reference doc.

4. Smoke test

With all six gates green, run training end to end — the commands are section 4 of the reference doc, and --headless keeps the test independent of whether a display exists.

# with a GPU
python scripts/train.py --task jumper.flat --num_envs 256 --max-iterations 5 --headless
# without
python scripts/train.py --task jumper.flat --backend native --device cpu --num_envs 64 --max-iterations 3 --headless

Expect the actor/critic structure, several Iteration time: lines, exit code 0. The banner on the first line reports the backend actually chosen — worth reading, because auto resolving to native:cpu on a machine with a GPU means gate A was passed too generously.

When something fails

Work from the measurement, not from the symptom. detect.py and gates.py both print what they observed, and the reference doc's section 6 is indexed by the exact error text — search it for the message rather than reasoning from the traceback, because several of these have causes that the traceback does not mention (the njmax overflow, the wandb start_method rejection, and select_gpus raising IndexError are all in that class).

Two rules survive every platform, and both are in section 7 of the doc:

  • Never pip install mjlab or rsl-rl-lib. They exist as modifiable copies under rl/. A PyPI copy in the same environment shadows them ambiguously and is very hard to notice.
  • Never install into an existing Isaac Lab environment. mjlab needs mujoco~=3.11, Isaac Lab ships 3.10, and they break each other.

Reporting back

Say which branch the machine took, which gates passed, and what the smoke test measured. If a gate was skipped or a step was worked around, say so plainly — an environment reported as ready when one gate was quietly skipped is worse than one reported as broken, because the next failure will be attributed to the code instead of the setup.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.