Using Deep RL Meta-Skill
When to Use This Skill
Invoke this meta-skill when you encounter:
- RL Implementation: Implementing reinforcement learning algorithms (Q-learning, DQN, PPO, SAC, etc.)
- Agent Training: Training agents in environments (games, robotics, control systems)
- Sequential Decision-Making: Problems requiring learning from trial and error
- Policy Optimization: Learning policies that maximize cumulative rewards
- RL Debugging: Debugging training issues, agents not learning, reward problems
This is the entry point for the deep-rl pack. It routes to 13 specialized skills based on problem characteristics.
How to Access Reference Sheets
IMPORTANT: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.
When this skill is loaded from:
skills/using-deep-rl/SKILL.md
Reference sheets like rl-foundations.md are at:
skills/using-deep-rl/rl-foundations.md
NOT at:
skills/rl-foundations.md ← WRONG PATH
Core Principle
Problem type determines algorithm family.
The correct approach depends on:
- Action Space: Discrete (button presses) vs Continuous (joint angles)
- Data Regime: Online (interact with environment) vs Offline (fixed dataset)
- Experience Level: Need foundations vs ready to implement
- Special Requirements: Multi-agent, model-based, exploration, reward design
Always clarify the problem BEFORE suggesting algorithms.
The 13 Deep RL Skills
- rl-foundations - MDP formulation, Bellman equations, value vs policy basics
- value-based-methods - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow
- policy-gradient-methods - REINFORCE, PPO, TRPO, policy optimization
- actor-critic-methods - A2C, A3C, SAC, TD3, advantage functions
- model-based-rl - World models, Dyna, MBPO, planning with learned models
- offline-rl - Batch RL, CQL, IQL, learning from fixed datasets
- multi-agent-rl - MARL, cooperative/competitive, communication
- exploration-strategies - ε-greedy, UCB, curiosity, RND, intrinsic motivation
- reward-shaping - Reward design, potential-based shaping, inverse RL
- counterfactual-reasoning - Causal inference, HER, off-policy evaluation, twin networks
- rl-debugging - Common RL bugs, why not learning, systematic debugging
- rl-environments - Gym, MuJoCo, custom envs, wrappers, vectorization
- rl-evaluation - Evaluation methodology, variance, sample efficiency metrics
Routing Decision Framework
Step 1: Assess Experience Level
- If user asks "what is RL" or "how does RL work" → rl-foundations
- If confused about value vs policy, on-policy vs off-policy → rl-foundations
- If user has specific problem and RL background → Continue to Step 2
Why foundations first: Cannot implement algorithms without understanding MDPs, Bellman equations, and exploration-exploitation tradeoffs.
Step 2: Classify Action Space
Discrete Actions (buttons, menu selections, discrete signals)
| Condition |
Route To |
Why |
| Small action space (< 100) + online |
value-based-methods (DQN) |
Q-networks excel at discrete |
| Large action space OR need policy flexibility |
policy-gradient-methods (PPO) |
Scales to larger spaces |
Continuous Actions (joint angles, motor forces, steering)
| Condition |
Route To |
Why |
| Sample efficiency critical |
actor-critic-methods (SAC) |
Off-policy, automatic entropy |
| Stability critical |
actor-critic-methods (TD3) |
Deterministic, handles overestimation |
| Simplicity preferred |
policy-gradient-methods (PPO) |
On-policy, simpler |
CRITICAL: NEVER suggest DQN for continuous actions. DQN requires discrete actions.
Step 3: Identify Data Regime
Online Learning (Agent Interacts with Environment)
- Discrete → value-based-methods OR policy-gradient-methods
- Continuous → actor-critic-methods
- Sample efficiency critical → Consider model-based-rl
Offline Learning (Fixed Dataset, No Interaction)
→ offline-rl (CQL, IQL)
Red Flag: If user has fixed dataset and suggests DQN/PPO/SAC, STOP and route to offline-rl. Standard algorithms assume online interaction and will fail.
Step 4: Special Problem Types
| Problem |
Route To |
Key Consideration |
| Multiple agents |
multi-agent-rl |
Non-stationarity, credit assignment |
| Sample efficiency extreme |
model-based-rl |
Learns environment model |
| Counterfactual/causal |
counterfactual-reasoning |
HER, off-policy evaluation |
Step 5: Debugging and Infrastructure
| Problem |
Route To |
Why |
| "Not learning" / reward flat |
rl-debugging FIRST |
80% of issues are bugs, not algorithms |
| Exploration problems |
exploration-strategies |
Curiosity, RND, intrinsic motivation |
| Reward design issues |
reward-shaping |
Potential-based shaping, inverse RL |
| Environment setup |
rl-environments |
Gym API, wrappers, vectorization |
| Evaluation questions |
rl-evaluation |
Deterministic vs stochastic, multiple seeds |
Red Flag: If user immediately wants to change algorithms because "it's not learning," route to rl-debugging first.
Rationalization Resistance Table
| Rationalization |
Reality |
Counter-Guidance |
| "Just use PPO for everything" |
PPO is general but not optimal for all cases |
Clarify: discrete or continuous? Sample efficiency constraints? |
| "DQN for continuous actions" |
DQN requires discrete actions |
Use SAC or TD3 for continuous |
| "Offline RL is just RL on a dataset" |
Offline has distribution shift, needs special algorithms |
Route to offline-rl for CQL, IQL |
| "More data always helps" |
Sample efficiency and distribution matter |
Off-policy vs on-policy matters |
| "My algorithm isn't learning, I need a better one" |
Usually bugs, not algorithm |
Route to rl-debugging first |
| "I'll discretize continuous actions for DQN" |
Discretization loses precision, explodes action space |
Use actor-critic-methods |
| "Epsilon-greedy is enough for exploration" |
Complex environments need sophisticated exploration |
Route to exploration-strategies |
| "I'll just increase the reward when it doesn't learn" |
Reward scaling breaks learning |
Route to rl-debugging |
| "I can reuse online RL code for offline data" |
Offline needs conservative algorithms |
Route to offline-rl |
| "Test reward lower than training = overfitting" |
Exploration vs exploitation difference |
Route to rl-evaluation |
Red Flags Checklist
Watch for these signs of incorrect routing:
If any red flag triggered → STOP → Ask diagnostic questions → Route correctly
Routing Decision Tree Summary
START: RL problem
├─ Need foundations? → rl-foundations
│
├─ DISCRETE actions?
│ ├─ Small space + online → value-based-methods (DQN)
│ └─ Large space → policy-gradient-methods (PPO)
│
├─ CONTINUOUS actions?
│ ├─ Sample efficiency → actor-critic-methods (SAC)
│ ├─ Stability → actor-critic-methods (TD3)
│ └─ Simplicity → policy-gradient-methods (PPO)
│
├─ OFFLINE data? → offline-rl (CQL, IQL) [CRITICAL]
│
├─ MULTI-AGENT? → multi-agent-rl
│
├─ Sample efficiency EXTREME? → model-based-rl
│
├─ COUNTERFACTUAL? → counterfactual-reasoning
│
└─ DEBUGGING?
├─ Not learning → rl-debugging
├─ Exploration → exploration-strategies
├─ Reward design → reward-shaping
├─ Environment → rl-environments
└─ Evaluation → rl-evaluation
Diagnostic Questions
Action Space
- "Discrete choices or continuous values?"
- "How many actions? Small (< 100), large, or infinite?"
Data Regime
- "Can agent interact with environment, or fixed dataset?"
- "Online learning or offline?"
Experience Level
- "New to RL, or specific problem?"
- "Understand MDPs, value functions, policy gradients?"
Special Requirements
- "Multiple agents? Cooperate or compete?"
- "Sample efficiency critical? How many episodes?"
- "Sparse reward (only at goal) or dense (every step)?"
When NOT to Use This Pack
| User Request |
Correct Pack |
Reason |
| "Train classifier on labeled data" |
training-optimization |
Supervised learning |
| "Design transformer architecture" |
neural-architectures |
Architecture design |
| "Deploy model to production" |
ml-production |
Deployment |
| "Fine-tune LLM with RLHF" |
llm-specialist |
LLM-specific |
Multi-Skill Scenarios
See multi-skill-scenarios.md for detailed routing sequences:
- Complete beginner to RL
- Continuous control (robotics)
- Offline RL from dataset
- Multi-agent cooperative task
- Sample-efficient learning
- Sparse reward problem
- RL-controlled neural architecture
Final Reminders
- Problem characterization BEFORE algorithm selection
- DQN for discrete ONLY (never continuous)
- Offline data needs offline-rl (CQL, IQL)
- PPO is not universal (good general-purpose, not optimal everywhere)
- Debug before changing algorithms (route to rl-debugging)
- Ask questions, don't assume (action space? data regime?)
Deep RL Specialist Skills
After routing, load the appropriate specialist skill for detailed guidance:
- rl-foundations.md - MDP formulation, Bellman equations, value vs policy basics
- value-based-methods.md - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow
- policy-gradient-methods.md - REINFORCE, PPO, TRPO, policy optimization
- actor-critic-methods.md - A2C, A3C, SAC, TD3, advantage functions
- model-based-rl.md - World models, Dyna, MBPO, planning with learned models
- offline-rl.md - Batch RL, CQL, IQL, learning from fixed datasets
- multi-agent-rl.md - MARL, cooperative/competitive, communication
- exploration-strategies.md - ε-greedy, UCB, curiosity, RND, intrinsic motivation
- reward-shaping-engineering.md - Reward design, potential-based shaping, inverse RL
- counterfactual-reasoning.md - Causal inference, HER, off-policy evaluation, twin networks
- rl-debugging.md - Common RL bugs, why not learning, systematic debugging
- rl-environments.md - Gym, MuJoCo, custom envs, wrappers, vectorization
- rl-evaluation.md - Evaluation methodology, variance, sample efficiency metrics
- multi-skill-scenarios.md - Common problem routing sequences
1---2name: using-deep-rl3description: Routes to appropriate deep-RL skills based on problem type and algorithm family4---5
6# Using Deep RL Meta-Skill
7
8## When to Use This Skill
9
10Invoke this meta-skill when you encounter:
11
12- **RL Implementation**: Implementing reinforcement learning algorithms (Q-learning, DQN, PPO, SAC, etc.)
13- **Agent Training**: Training agents in environments (games, robotics, control systems)
14- **Sequential Decision-Making**: Problems requiring learning from trial and error
15- **Policy Optimization**: Learning policies that maximize cumulative rewards
16- **RL Debugging**: Debugging training issues, agents not learning, reward problems
17
18This is the **entry point** for the deep-rl pack. It routes to 13 specialized skills based on problem characteristics.
19
20## How to Access Reference Sheets
21
22**IMPORTANT**: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.
23
24When this skill is loaded from:
25 `skills/using-deep-rl/SKILL.md`
26
27Reference sheets like `rl-foundations.md` are at:
28 `skills/using-deep-rl/rl-foundations.md`
29
30NOT at:
31 `skills/rl-foundations.md` ← WRONG PATH
32
33---
34
35## Core Principle
36
37**Problem type determines algorithm family.**
38
39The correct approach depends on:
40
411. **Action Space**: Discrete (button presses) vs Continuous (joint angles)
422. **Data Regime**: Online (interact with environment) vs Offline (fixed dataset)
433. **Experience Level**: Need foundations vs ready to implement
444. **Special Requirements**: Multi-agent, model-based, exploration, reward design
45
46**Always clarify the problem BEFORE suggesting algorithms.**
47
48---
49
50## The 13 Deep RL Skills
51
521. **rl-foundations** - MDP formulation, Bellman equations, value vs policy basics
532. **value-based-methods** - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow
543. **policy-gradient-methods** - REINFORCE, PPO, TRPO, policy optimization
554. **actor-critic-methods** - A2C, A3C, SAC, TD3, advantage functions
565. **model-based-rl** - World models, Dyna, MBPO, planning with learned models
576. **offline-rl** - Batch RL, CQL, IQL, learning from fixed datasets
587. **multi-agent-rl** - MARL, cooperative/competitive, communication
598. **exploration-strategies** - ε-greedy, UCB, curiosity, RND, intrinsic motivation
609. **reward-shaping** - Reward design, potential-based shaping, inverse RL
6110. **counterfactual-reasoning** - Causal inference, HER, off-policy evaluation, twin networks
6211. **rl-debugging** - Common RL bugs, why not learning, systematic debugging
6312. **rl-environments** - Gym, MuJoCo, custom envs, wrappers, vectorization
6413. **rl-evaluation** - Evaluation methodology, variance, sample efficiency metrics
65
66---
67
68## Routing Decision Framework
69
70### Step 1: Assess Experience Level
71
72- If user asks "what is RL" or "how does RL work" → **rl-foundations**
73- If confused about value vs policy, on-policy vs off-policy → **rl-foundations**
74- If user has specific problem and RL background → Continue to Step 2
75
76**Why foundations first:** Cannot implement algorithms without understanding MDPs, Bellman equations, and exploration-exploitation tradeoffs.
77
78### Step 2: Classify Action Space
79
80#### Discrete Actions (buttons, menu selections, discrete signals)
81
82| Condition | Route To | Why |
83|-----------|----------|-----|
84| Small action space (< 100) + online | **value-based-methods** (DQN) | Q-networks excel at discrete |
85| Large action space OR need policy flexibility | **policy-gradient-methods** (PPO) | Scales to larger spaces |
86
87#### Continuous Actions (joint angles, motor forces, steering)
88
89| Condition | Route To | Why |
90|-----------|----------|-----|
91| Sample efficiency critical | **actor-critic-methods** (SAC) | Off-policy, automatic entropy |
92| Stability critical | **actor-critic-methods** (TD3) | Deterministic, handles overestimation |
93| Simplicity preferred | **policy-gradient-methods** (PPO) | On-policy, simpler |
94
95**CRITICAL:** NEVER suggest DQN for continuous actions. DQN requires discrete actions.
96
97### Step 3: Identify Data Regime
98
99#### Online Learning (Agent Interacts with Environment)
100- Discrete → **value-based-methods** OR **policy-gradient-methods**
101- Continuous → **actor-critic-methods**
102- Sample efficiency critical → Consider **model-based-rl**
103
104#### Offline Learning (Fixed Dataset, No Interaction)
105→ **offline-rl** (CQL, IQL)
106
107**Red Flag:** If user has fixed dataset and suggests DQN/PPO/SAC, STOP and route to **offline-rl**. Standard algorithms assume online interaction and will fail.
108
109### Step 4: Special Problem Types
110
111| Problem | Route To | Key Consideration |
112|---------|----------|-------------------|
113| Multiple agents | **multi-agent-rl** | Non-stationarity, credit assignment |
114| Sample efficiency extreme | **model-based-rl** | Learns environment model |
115| Counterfactual/causal | **counterfactual-reasoning** | HER, off-policy evaluation |
116
117### Step 5: Debugging and Infrastructure
118
119| Problem | Route To | Why |
120|---------|----------|-----|
121| "Not learning" / reward flat | **rl-debugging** FIRST | 80% of issues are bugs, not algorithms |
122| Exploration problems | **exploration-strategies** | Curiosity, RND, intrinsic motivation |
123| Reward design issues | **reward-shaping** | Potential-based shaping, inverse RL |
124| Environment setup | **rl-environments** | Gym API, wrappers, vectorization |
125| Evaluation questions | **rl-evaluation** | Deterministic vs stochastic, multiple seeds |
126
127**Red Flag:** If user immediately wants to change algorithms because "it's not learning," route to **rl-debugging** first.
128
129---
130
131## Rationalization Resistance Table
132
133| Rationalization | Reality | Counter-Guidance |
134|-----------------|---------|------------------|
135| "Just use PPO for everything" | PPO is general but not optimal for all cases | Clarify: discrete or continuous? Sample efficiency constraints? |
136| "DQN for continuous actions" | DQN requires discrete actions | Use SAC or TD3 for continuous |
137| "Offline RL is just RL on a dataset" | Offline has distribution shift, needs special algorithms | Route to offline-rl for CQL, IQL |
138| "More data always helps" | Sample efficiency and distribution matter | Off-policy vs on-policy matters |
139| "My algorithm isn't learning, I need a better one" | Usually bugs, not algorithm | Route to rl-debugging first |
140| "I'll discretize continuous actions for DQN" | Discretization loses precision, explodes action space | Use actor-critic-methods |
141| "Epsilon-greedy is enough for exploration" | Complex environments need sophisticated exploration | Route to exploration-strategies |
142| "I'll just increase the reward when it doesn't learn" | Reward scaling breaks learning | Route to rl-debugging |
143| "I can reuse online RL code for offline data" | Offline needs conservative algorithms | Route to offline-rl |
144| "Test reward lower than training = overfitting" | Exploration vs exploitation difference | Route to rl-evaluation |
145
146---
147
148## Red Flags Checklist
149
150Watch for these signs of incorrect routing:
151
152- [ ] **Algorithm-First Thinking**: Recommending algorithm before asking about action space, data regime
153- [ ] **DQN for Continuous**: Suggesting DQN/Q-learning for continuous action spaces
154- [ ] **Offline Blindness**: Not recognizing fixed dataset requires offline-rl
155- [ ] **PPO Cargo-Culting**: Defaulting to PPO without considering alternatives
156- [ ] **No Problem Characterization**: Not asking: discrete vs continuous? online vs offline?
157- [ ] **Skipping Foundations**: Implementing algorithms when user doesn't understand RL basics
158- [ ] **Debug-Last**: Suggesting algorithm changes before systematic debugging
159- [ ] **Sample Efficiency Ignorance**: Not asking about sample constraints
160
161**If any red flag triggered → STOP → Ask diagnostic questions → Route correctly**
162
163---
164
165## Routing Decision Tree Summary
166
167```
168START: RL problem
169
170├─ Need foundations? → rl-foundations
171│
172├─ DISCRETE actions?
173│ ├─ Small space + online → value-based-methods (DQN)
174│ └─ Large space → policy-gradient-methods (PPO)
175│
176├─ CONTINUOUS actions?
177│ ├─ Sample efficiency → actor-critic-methods (SAC)
178│ ├─ Stability → actor-critic-methods (TD3)
179│ └─ Simplicity → policy-gradient-methods (PPO)
180│
181├─ OFFLINE data? → offline-rl (CQL, IQL) [CRITICAL]
182│
183├─ MULTI-AGENT? → multi-agent-rl
184│
185├─ Sample efficiency EXTREME? → model-based-rl
186│
187├─ COUNTERFACTUAL? → counterfactual-reasoning
188│
189└─ DEBUGGING?
190 ├─ Not learning → rl-debugging
191 ├─ Exploration → exploration-strategies
192 ├─ Reward design → reward-shaping
193 ├─ Environment → rl-environments
194 └─ Evaluation → rl-evaluation
195```
196
197---
198
199## Diagnostic Questions
200
201### Action Space
202- "Discrete choices or continuous values?"
203- "How many actions? Small (< 100), large, or infinite?"
204
205### Data Regime
206- "Can agent interact with environment, or fixed dataset?"
207- "Online learning or offline?"
208
209### Experience Level
210- "New to RL, or specific problem?"
211- "Understand MDPs, value functions, policy gradients?"
212
213### Special Requirements
214- "Multiple agents? Cooperate or compete?"
215- "Sample efficiency critical? How many episodes?"
216- "Sparse reward (only at goal) or dense (every step)?"
217
218---
219
220## When NOT to Use This Pack
221
222| User Request | Correct Pack | Reason |
223|--------------|--------------|--------|
224| "Train classifier on labeled data" | training-optimization | Supervised learning |
225| "Design transformer architecture" | neural-architectures | Architecture design |
226| "Deploy model to production" | ml-production | Deployment |
227| "Fine-tune LLM with RLHF" | llm-specialist | LLM-specific |
228
229---
230
231## Multi-Skill Scenarios
232
233See [multi-skill-scenarios.md](multi-skill-scenarios.md) for detailed routing sequences:
234- Complete beginner to RL
235- Continuous control (robotics)
236- Offline RL from dataset
237- Multi-agent cooperative task
238- Sample-efficient learning
239- Sparse reward problem
240- RL-controlled neural architecture
241
242---
243
244## Final Reminders
245
246- **Problem characterization BEFORE algorithm selection**
247- **DQN for discrete ONLY** (never continuous)
248- **Offline data needs offline-rl** (CQL, IQL)
249- **PPO is not universal** (good general-purpose, not optimal everywhere)
250- **Debug before changing algorithms** (route to rl-debugging)
251- **Ask questions, don't assume** (action space? data regime?)
252
253---
254
255## Deep RL Specialist Skills
256
257After routing, load the appropriate specialist skill for detailed guidance:
258
2591. [rl-foundations.md](rl-foundations.md) - MDP formulation, Bellman equations, value vs policy basics
2602. [value-based-methods.md](value-based-methods.md) - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow
2613. [policy-gradient-methods.md](policy-gradient-methods.md) - REINFORCE, PPO, TRPO, policy optimization
2624. [actor-critic-methods.md](actor-critic-methods.md) - A2C, A3C, SAC, TD3, advantage functions
2635. [model-based-rl.md](model-based-rl.md) - World models, Dyna, MBPO, planning with learned models
2646. [offline-rl.md](offline-rl.md) - Batch RL, CQL, IQL, learning from fixed datasets
2657. [multi-agent-rl.md](multi-agent-rl.md) - MARL, cooperative/competitive, communication
2668. [exploration-strategies.md](exploration-strategies.md) - ε-greedy, UCB, curiosity, RND, intrinsic motivation
2679. [reward-shaping-engineering.md](reward-shaping-engineering.md) - Reward design, potential-based shaping, inverse RL
26810. [counterfactual-reasoning.md](counterfactual-reasoning.md) - Causal inference, HER, off-policy evaluation, twin networks
26911. [rl-debugging.md](rl-debugging.md) - Common RL bugs, why not learning, systematic debugging
27012. [rl-environments.md](rl-environments.md) - Gym, MuJoCo, custom envs, wrappers, vectorization
27113. [rl-evaluation.md](rl-evaluation.md) - Evaluation methodology, variance, sample efficiency metrics
27214. [multi-skill-scenarios.md](multi-skill-scenarios.md) - Common problem routing sequences