Close the loop: spec → sim → package → Hub → robot. You are training a 61→14 PPO policy, not an LLM. Hub publish is not the end — deploy is in scope. A published repo is a deliverable for whoever owns a duck, not a baked-in official weight.
Canonical playbook: AGENTS.md in pollen-robotics/microduck_rl. This skill is the job ticket; that file wins if they disagree.
$SKILL = directory that contains this SKILL.md. Always invoke scripts with that absolute path. The skill id is microduck-skill.
Preconditions
- Run
$SKILL/scripts/doctor.sh(add--clone --syncif there is no checkout). It must printdoctor ok. - Default compute is Hugging Face Jobs. Require
HF_TOKEN(orhf auth login) andMICRODUCK_HF_NAMESPACE(user or org). No namespace → Jobs prompts and the agent hangs. - Local train only if
MICRODUCK_TRAIN_LOCAL=1and CUDA is present. Smoke uses the same switch. - Stop if doctor fails. Do not invent another trainer (Isaac Sim, AutoTrain, Colab-only hacks).
Hard rules
- Never skip the 64-env × 5-iter smoke test (
$SKILL/scripts/smoke.sh). - Never hand-convert a
.ptto ONNX. Only upstreamscripts/export.py. - Observation stays 61D; action stays 14D. Unused command slots are zero-padded, never deleted.
- Do not hardcode joint indices. Servo helpers in
mdp.pyonly. - Community publish is constant-command episodic/perpetual only. Phase / posture-flag stay official.
- Do not run
robotctl/ SSH unless the user explicitly says to install on a real robot. Print the commands.
Workflow (do not skip stages)
- Spec — one-line behavior,
kind(episodic|perpetual), closest template. references/TRAIN.md. - Sim — edit env → CPU
pytest tests/→$SKILL/scripts/smoke.sh→$SKILL/scripts/train.sh. If wandb is logged in, watch the run page (curves; Jobs cannot record--video— no GL in the image). Keep penaltyEpisode_Reward/*≤ 0. If not, tensorboard +--no-wandbso Jobs do not hang. Replay a checkpoint with$SKILL/scripts/play.sh(Viser + local mp4). - Package —
$SKILL/scripts/export_publish.sh. references/PUBLISH.md. After a tensorboard run, export from--checkpoint-file(or an already-gated--onnx), not a wandb path. - Deploy — always this stage after publish. Print the install lines from references/DEPLOY.md for this run's
--repo(never a hardcoded test repo). If the user explicitly says to install on a Microduck they own, run thoserobotctllines. If they have no robot or did not ask, stop after printing. Do not claim hardware success until they report it.
Scripts
| Script | Does |
|---|---|
scripts/doctor.sh [--clone] [--sync] |
Tools, checkout, Jobs env. |
scripts/smoke.sh <TASK_ID> |
64×5. Jobs unless MICRODUCK_TRAIN_LOCAL=1. wandb → curves; --video only on local CUDA. |
scripts/train.sh <TASK_ID> [args…] |
Same compute switch. Default 4096 envs. Same wandb/video rules. |
scripts/play.sh <TASK_ID> --checkpoint-file|--wandb-run-path … |
Local Viser webpage + mp4. Not Jobs. |
scripts/gate_check.py <policy.onnx> |
[1,61]→[1,14]; skip initializers. Called via uv run --with onnx. |
scripts/export_publish.sh … |
Official export to $RL_ROOT/.microduck-plugin-export.onnx only, then Hub. |
Report back
Say what rolled out ("bows, then face-plants 1 in 3"), not "it works". Training is hours — submit Jobs, then wait.