Skip to content
Back to skills

On Policy Discrete

ASecurity

"Guides minimalRL single-process discrete CartPole policy-gradient,

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
toolspythongobashdebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill on-policy-discrete --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of On Policy Discrete?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for On Policy Discrete
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-on-policy-discrete/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-on-policy-discrete)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: on-policy-discrete
description: "Guides minimalRL single-process discrete CartPole policy-gradient,
  actor-critic, PPO, PPO-LSTM, and V-trace policy/value workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# On-Policy Discrete Workflows

Use this sub-skill when a task asks about minimalRL's single-process discrete-action CartPole algorithms: REINFORCE, vanilla actor-critic, discrete PPO, PPO-LSTM, or the policy/value side of V-trace.

## Route by task

- **REINFORCE or Monte-Carlo policy gradient**: read [references/api-reference.md](references/api-reference.md) for the `Policy` contract and [references/workflows.md](references/workflows.md) for the return/backprop loop.
- **Vanilla actor-critic**: use [references/workflows.md](references/workflows.md) for rollout batches and TD advantage, then [references/api-reference.md](references/api-reference.md) for `ActorCritic.pi`, `v`, `make_batch`, and `train_net`.
- **Discrete PPO / GAE**: use [references/workflows.md](references/workflows.md) for clipped surrogate and GAE decisions. Check [references/troubleshooting.md](references/troubleshooting.md) when ratios, `prob_a`, or advantage tensors misbehave.
- **Recurrent PPO**: use the PPO-LSTM sections in [references/api-reference.md](references/api-reference.md) and [references/troubleshooting.md](references/troubleshooting.md) for hidden-state shape and detach issues.
- **V-trace policy/value mechanics**: use this sub-skill for policy/value network shapes; route replay and off-policy correction depth to [../off-policy-value/SKILL.md](../off-policy-value/SKILL.md).

## Do not use this sub-skill for

- DQN, ACER replay buffers, target networks, or off-policy correction debugging; use [../off-policy-value/SKILL.md](../off-policy-value/SKILL.md).
- DDPG, SAC, or continuous PPO for Pendulum; use [../continuous-control/SKILL.md](../continuous-control/SKILL.md).
- A2C/A3C multiprocessing, worker processes, or Gym API modernization for parallel scripts; use [../parallel-actor-critic/SKILL.md](../parallel-actor-critic/SKILL.md).

## Quick operating workflow

1. Identify the algorithm and action space. All workflows here assume CartPole-style observations of length 4 and 2 discrete actions unless you are intentionally porting.
2. Read the relevant API contract in [references/api-reference.md](references/api-reference.md) before changing shapes, tuple fields, or update loops.
3. When porting to another discrete environment, update input dimension, output action count, `softmax_dim`, reward scaling, and termination handling together; see [references/workflows.md](references/workflows.md).
4. Run the bundled shape smoke helper before attempting long training:

   ```bash
   python sub-skills/on-policy-discrete/scripts/smoke_on_policy_discrete.py --algorithm all
   ```

5. If the failure involves Gym reset/step arity, PyTorch graph reuse, probability zeros, or hidden-state shapes, read [references/troubleshooting.md](references/troubleshooting.md) before editing the algorithm.

## Bundled runtime files

- [references/api-reference.md](references/api-reference.md) records source-faithful classes, methods, hyperparameters, tensor shapes, and data tuple contracts.
- [references/workflows.md](references/workflows.md) explains how to choose and adapt REINFORCE, actor-critic, PPO, PPO-LSTM, and V-trace policy/value logic.
- [references/troubleshooting.md](references/troubleshooting.md) maps common symptoms to concrete fixes.
- [scripts/smoke_on_policy_discrete.py](scripts/smoke_on_policy_discrete.py) is a safe CPU-only helper that validates representative model, data, and tensor-shape contracts without importing the original repository or running training.

Files in this skill

  • SKILL.md3.7 KB
  • references/api-reference.md4.9 KB
  • references/troubleshooting.md3.1 KB
  • references/workflows.md4 KB
  • scripts/smoke_on_policy_discrete.py5.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.