Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

PufferLib RL Guide

Version-aware guidance for PufferLib: wrapping environments, vectorization, PuffeRL training plans, and safe checkpoint review across the 3.0.0 release and the 4.0 source line.

Dev & CodingAdvanced33,0303,248AI score 8/10Last updated: Aug 9, 2026

What it does

PufferLib speeds up reinforcement-learning simulation and training. This skill keeps you on one explicit version profile at a time — the published PyPI release 3.0.0 versus the redesigned upstream 4.0 source — so you never mix incompatible imports, configs, and CLI flags.

  • Correct wrapping of Gymnasium / PettingZoo environments via GymnasiumPufferEnv and PettingZooPufferEnv
  • Vectorization workflow: start on Serial, then move to Multiprocessing, with a checklist for shapes, masks, and agent slots
  • Policy contracts for Torch modules, recurrent composition, and nativize_dtype usage
  • A dry-run workflow that emits a strict-JSON training plan and validates it before anything executes
  • Checkpoint inspection by hash and metadata only, never calling torch.load
  • Hard rules for W&B / Neptune credentials: named env vars only, never in args, configs, or logs

Every bundled CLI is standard-library only, CPU-only, synthetic, and network-free.

Who it's for

  • RL researchers and engineers running large-scale environment simulation with PufferLib
  • Teams porting existing Gymnasium or PettingZoo environments into PufferLib
  • Security-conscious setups that must vet third-party checkpoints, ROMs, or environment packages
  • MLOps folks who care about reproducibility: separate seeds, pinned commits, committed lockfiles

Examples

  1. Validate an environment contract: run python3 scripts/env_contract_validator.py --steps 64 --episodes 8 --seed 42 to check spaces, dtypes, finite rewards, seeding, and the terminated vs truncated distinction.
  2. Plan before you train: scripts/train_template.py --profile pypi-3.0.0 --device cpu --total-timesteps 10000 emits a config plan without launching, and validate_plan.py rejects mixed-version options, unbounded resources, dotted env paths, and coupled train/eval seeds.
  3. Vet a downloaded checkpoint: scripts/inspect_checkpoint.py checkpoint.pt --expected-sha256 ... hashes and classifies the file without unpickling, so you only load it in a sandbox after the digest matches.

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/pufferlib folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pufferlib/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/pufferlib ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and clone the skills repository:
    git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
    
  2. Create the Claude Code skills directory if it does not exist:
    mkdir -p ~/.claude/skills
    
  3. Copy just the pufferlib skill folder:
    cp -r scientific-agent-skills/skills/pufferlib ~/.claude/skills/
    
  4. Confirm Python 3.10 or newer with python3 --version. The bundled scripts need no extra packages.
  5. Restart Claude Code and ask something like "validate my PufferLib environment" to trigger the skill.
  6. For real training, install PufferLib in its own pinned virtualenv: uv venv --python 3.11 then uv add --exact "pufferlib==3.0.0". Because the sdist compiles native code, do the resolve/build inside a sandbox with no credentials mounted.