This gives Claude the knowledge to work with Stable Baselines3, the PyTorch RL library. It covers training agents with PPO, SAC, DQN and other algorithms, building custom Gym environments with proper validation, setting up vectorized environments for parallel training, and implementing callbacks for monitoring. The skill includes actual code patterns for common workflows like saving models, evaluating policies, and recording videos. Use this when you need to prototype RL experiments, train agents on custom tasks, or integrate reinforcement learning into a project without digging through docs. The guidance on environment constraints and vectorized env gotchas is genuinely helpful since those trip people up constantly.

skills.sh installs
338
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill stable-baselines3 --agent claude-code

Installs into .claude/skills of the current project.

Files

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:

import gymnasium as gym
from stable_baselines3 import PPO

# Create environment
env = gym.make("CartPole-v1")

# Initialize agent
model = PPO("MlpPolicy", env, verbose=1)

# Train the agent
model.learn(total_timesteps=10000)

# Save the model
model.save("ppo_cartpole")

# Load the model (without prior instantiation)
model = PPO.load("ppo_cartpole", env=env)

Important Notes:

  • total_timesteps 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

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Categories
DevOps & CI/CD, AI & Agent Building, Automation & Workflows, Design & UI/UX
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1jezweb avatargoogle-gemini-embeddingsjezweb/claude-skillsBuild RAG systems and semantic search with Gemini embeddings (gemini-embedding-001). 768-3072 dimension vectors, 8 task types, Cloudflare Vectorize integration.337skills.sh installs
2casper-studios avatarliquid-glasscasper-studios/casper-marketplaceBuild native macOS/iOS apps with Apple's Liquid Glass design language and Human Interface Guidelines. Use when creating SwiftUI interfaces, implementing translu336skills.sh installs
3bayramannakov avatarremotion-video-directorbayramannakov/remotion-video-directorInteractive guide for creating Remotion videos - from strategic concept to rendered MP4. Use when the user wants to create a video, make a Remotion project, bui335skills.sh installs
4jezweb avatartypescript-mcpjezweb/claude-skillsBuild MCP servers with TypeScript on Cloudflare Workers. Covers tools, resources, prompts, tasks, authentication (API keys, OAuth, Zero Trust), and Cloudflare s335skills.sh installs
5jwynia avatarnpm-packagejwynia/agent-skillsBuild and publish npm packages using Bun as the primary toolchain with npm-compatible output. Use when the user wants to create a new npm library, set up a Type334skills.sh installs
6secondsky avatarbun-bundlersecondsky/claude-skillsThis skill should be used when the user asks about "bun build", "Bun.build", "bundling with Bun", "code splitting", "tree shaking", "minification", "sourcemaps"334skills.sh installs