Skip to content

Guide · Agent skill

How to use the PufferLib RL Guide agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The PufferLib agent skill gives an AI coding agent specific, version-aware guidance for PufferLib, a reinforcement-learning library. It covers environments, vectorization, policies, training, evaluation and checkpoint review, and it makes the agent identify which PufferLib profile you are using before it writes code. This guide shows you how to install the skill, trigger it with plain requests, and use its bundled local checks.

PufferLib RL GuideK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download and unzip the skill. Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into the project's .claude/skills/ folder for one project.
  2. 2Or upload it in the Claude apps. In the Claude apps, open Settings, go to Capabilities, and upload the skill under Skills.
  3. 3Ask a natural question. Name PufferLib and describe your task, such as checking an environment's reset and step contract.
  4. 4Run the local contract check. From the skill folder, run the environment contract validator with a fixed seed to get strict JSON output.
  5. 5Benchmark vectorization locally. Run the vectorization benchmark on the serial backend to get a baseline before changing any settings.
  6. 6Review before loading anything. Hash checkpoints and review environment packages before loading them, and do so only in a sandbox.

What the skill makes the agent do

An agent skill is a folder of instructions and reference files that an AI agent loads when a task matches the skill's description. This one is about PufferLib. Once it is loaded, the agent reads the skill's guidance before answering questions about PufferLib and chooses between three profiles: the native current source build, the published PyPI adaptation, or a pinned historical source snapshot.

The skill's main focus is the Gymnasium-style environment contract: reset returns an observation and info, and step returns observation, reward, terminated, truncated and info. It explains how to validate that contract, how to wrap an existing Gymnasium or PettingZoo environment in the published release, how to run vectorized environments, and how to review checkpoints before loading them.

  • Pick the correct PufferLib profile before writing code
  • Check the step and reset contract, including the difference between terminated and truncated
  • Wrap Gymnasium or PettingZoo Parallel environments in the published release
  • Explain vectorization settings and how to benchmark them
  • Guide training and evaluation with separate environments and seeds
  • Review checkpoints and external logging with safety defaults

Install the skill on your computer

Download the skill ZIP from this page and unzip it. For a personal install, put the unzipped skill folder inside ~/.claude/skills/. For a single project, put it inside the project's .claude/skills/ folder instead, so it only applies to that project.

If you use the Claude apps rather than a local agent, open Settings, go to Capabilities, and upload the skill under Skills.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP
unzip pufferlib.zip -d ~/.claude/skills/

Trigger the skill with natural requests

You do not need a special command. Name PufferLib and describe the task in ordinary language, and the agent should load the skill when the request matches its description. Mention the version or profile you care about if you know it, because the skill asks the agent to choose the version before choosing an API.

Good requests name the task and the constraint. For example, ask the agent to check whether your environment follows the reset and step contract, or to explain which PufferLib profile fits a reproduction of an existing experiment.

  • Check whether my PufferLib environment follows the Gymnasium reset and step contract.
  • Which PufferLib version should I use to reproduce a pinned 4.0 setup?
  • Wrap this Gymnasium environment for PufferLib 3.0 and show me the wrapper.
  • Review this checkpoint file and tell me whether it is safe to load.
  • Explain how to set num_envs and batch size for vectorized training.

Run the bundled local checks

The skill ships small Python command-line tools. They use only the standard library, need Python 3.10 or newer, and run synthetic environments locally. They do not install PufferLib, use the network, or start a training run. Run them from the skill folder so the relative paths resolve.

The contract validator checks an environment against the Gymnasium-style rules, and the vectorization benchmark times fixed work on a serial backend. Both print strict JSON, which makes their results easy for the agent to read and compare.

  • env_contract_validator.py: checks spaces, step/reset behaviour, seeding and cleanup on a synthetic environment
  • benchmark_vectorization.py: benchmarks vectorization on a serial backend
  • env_template.py, train_template.py and repro_plan.py: templates and dry-run planning helpers
python3 scripts/env_contract_validator.py --steps 64 --episodes 8 --seed 42

Review checkpoints and external logging safely

Treat checkpoints, pickles, ROMs, maps and environment packages as untrusted until you have verified them. The skill says metadata inspection is not proof of safety. Hash the checkpoint bytes first, and only load them in a sandbox if you trust the source.

If you enable external logging to Weights & Biases or Neptune, the skill's rules say credentials must never be passed on the command line, in config files, in tags or run names, or printed. Keep logging local unless you have deliberately opted in.

  • Hash checkpoint bytes before any trusted, sandboxed loading
  • Never import an environment by an arbitrary dotted path; the bundled tools accept only allowlisted built-ins and slug identifiers
  • Cap steps, environments, workers, memory, disk and wall time
  • Keep training and evaluation environments and seeds separate

Install PufferLib itself only after reviewing the source

The skill can guide installation, but it does not replace reviewing the source. The published PyPI release is a source archive, so it needs a native build with a C or CUDA toolchain and specific NumPy and Gymnasium limits. The skill's commands are illustrative and were not executed during review, so run them in a sandbox without credentials or sensitive mounts, and verify the archive digest and resolved dependencies first.

  • Use uv with a committed pyproject.toml and uv.lock
  • Verify the archive digest before building
  • Do not run a remote installer directly from a pipe
uv add --exact --no-sync "pufferlib==3.0.0"

What people use it for

  • Check a custom Gymnasium environment for reset, step, seeding and terminated versus truncated handling before training
  • Decide which PufferLib profile to use when reproducing a published experiment
  • Wrap a PettingZoo Parallel environment for the published release after reviewing it
  • Benchmark serial vectorization on a synthetic environment to get a baseline
  • Review a shared checkpoint file and decide whether it can be loaded in a sandbox

Frequently asked questions

Is the PufferLib agent skill free and what is its licence?

The skill is listed under the MIT licence in the source. The skill itself does not cost anything to download or use, but PufferLib and any required dependencies have their own requirements.

What do I need to use the PufferLib skill?

The bundled Python tools need Python 3.10 or newer and use only the standard library. To install PufferLib itself, the published release needs a native C or CUDA toolchain, NumPy below 2 and Gymnasium at or below 0.29.1.

How do I install the skill in Claude?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload it under Settings, then Capabilities, then Skills.

Does the skill run code or use the network?

Yes on both counts. The bundled scripts run locally, and the skill's guidance covers installation steps that use the network. The bundled checks are synthetic, CPU-only and do not need network access, but installing PufferLib does.

Will the skill launch a training run for me?

No. The bundled plan tool does not launch training, and the native and PufferLib training examples were not executed in review. You will need to run and check training yourself.

Is it safe to load a PufferLib checkpoint from someone else?

Not without review. The skill says to hash checkpoint bytes and only load them in a sandbox, because pickles and checkpoints can run arbitrary code. Metadata inspection alone does not prove a file is safe.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are building or porting reinforcement-learning environments with PufferLib, comparing versions, or reviewing whether an external environment or checkpoint is safe to load. Pick something else if you want a turnkey training run or guaranteed results from untrusted checkpoints, since the skill does not launch training and its install and training examples were not executed in review.

Download the skill