Agent skill · research science · aiskillstore
stable-baselines3
Use this skill for reinforcement learning tasks including training RL agents (PPO, SAC, DQN, TD3, DDPG, A2C, etc.), creating custom Gym environments, implementing callbacks for monitoring and control, using vectorized environments for parallel training, and integrating with deep RL workflows. This skill should be used when users request RL algorithm implementation, agent training, environment design, or RL experimentation.
Why this skill is useful
Provides specific implementation patterns and custom environment design guidelines for reinforcement learning that the AI wouldn't reliably generate on its own.
What it needs
Requires gymnasium, stable-baselines3 installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Stable Baselines3 Overview Stable Baselines3 (SB3) is a PyTorch-based library providing reliable implementations of reinforcement learning algorithms. This skill provides comprehensive guidance for training RL agents, creating custom environments, implementing callbacks, and optimizing training workflows using SB3's unified API. Core Capabilities 1. Training RL Agents Basic Training Pattern: Important Notes: totaltimesteps is a lower bound; actual training may exceed this due to batch collection Use model.load() as a static method, not on an existing instance The replay buffer is NOT saved with the model to save space Algorithm Selection: Use references/algorithms.md for detailed algorithm characteristics and selection guidance. Quick reference: PPO/A2C: General-purpose, supports all action space types, good for multiprocessing SAC/TD3: Continuous control, off-policy, sample-efficient DQN: Discrete actions, off-policy HER: Goal-conditioned tasks See scripts/trainrlagent.py for a complete training template with best practices. 2. Custom Environments Requirements: Custom environments must inherit from gymnasium.Env and implement: init(): Define actionspace and observationspace reset(seed, options): Return initial observation and info dict step(action): Return observation, reward, terminated, truncated, info render(): Visualization (optional) close(): Cleanup resources Key Constraints: Image observations must be np.uint8 in range [0, 255] Use channel-first format when possible (channels, height, width) SB3 normalizes images automatically by dividing by 255 Set normalizeimages=False in policykwargs if pre-normalized SB3 does NOT support Discrete or MultiDiscrete spaces with start!=0 Validation: See scripts/customenvtemplate.py for a complete custom environment template and references/customenvironments.md for comprehensive guidance. 3. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/stable-baselines3