
Stable Baselines3 RL Training
Train, evaluate and checkpoint reinforcement learning agents with Stable Baselines3 in Python
- Repository
- K-Dense-AI/scientific-agent-skills
- Stars
- 55,780
- Licence
- MIT
- Files
- 8 files
What it does
Once installed, the agent knows how to set up and run reinforcement learning experiments using the Stable Baselines3 library: picking an algorithm such as PPO, SAC or DQN, building custom Gymnasium environments, running parallel environments, adding training callbacks, and saving or evaluating checkpoints. Reinforcement learning means teaching a program to improve through trial and reward, and this skill gives the agent tested code patterns and guidance so it does not have to reconstruct the library's API from memory.
Great for
- Machine learning engineers or researchers running reproducible RL experiments in Python
- Students learning reinforcement learning who want working training templates
- Developers building custom environments for control or grid-world style problems
Skip it if
- Non-programmers or people wanting a finished RL product, since the output is code the user must run and interpret
- Multi-agent or large-scale production systems, which the skill says it does not cover (single-agent only)
- Evaluating untrusted model files: the evaluation and normalization helpers load serialized Python objects, which can execute arbitrary code if the file is malicious
Try asking
- “Train a PPO agent on CartPole-v1 with a held-out evaluation environment and save the best checkpoint”
- “Build a custom Gymnasium grid-world environment and check it with SB3's env_checker”
- “Set up 8 parallel environments with SubprocVecEnv for a compute-heavy continuous control task”
- “Evaluate a saved SAC checkpoint with fixed seeds and report mean and standard deviation of returns”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 8 original files, the MIT licence and an attribution note.
stable-baselines3.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip stable-baselines3.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip stable-baselines3.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Run the training and evaluation scripts from a file with an if __name__ == '__main__' guard when using SubprocVecEnv, and use separate seeds for final testing than for training-time evaluation.
- Only load checkpoints and VecNormalize statistics from sources you trust, and keep normalization files paired with the exact checkpoint they came from.
- Start with device='cpu' and small timesteps to confirm the setup works before running long experiments.
What's inside
- references/algorithms.md
- references/callbacks.md
- references/custom_environments.md
- references/vectorized_envs.md
- scripts/custom_env_template.py
- scripts/evaluate_agent.py
- scripts/train_rl_agent.py
- SKILL.md
Redistributed unmodified from K-Dense-AI/scientific-agent-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.