Skip to content
Back to skills

Custom Components

ASecurity

"Use RL Baselines3 Zoo custom Gymnasium registrations, wrappers,

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
developmentpythongobashawsapi

Works with

  • cli
  • api

Security analysis

A100/100

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

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill custom-components --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Custom Components?

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

Security grade badge for Custom Components
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-custom-components-da40ebac/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-custom-components-da40ebac)

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: custom-components
description: "Use RL Baselines3 Zoo custom Gymnasium registrations, wrappers,
  callbacks, schedules, and algorithm registry patches safely."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# custom-components

Use this sub-skill when a future Researcher needs to register custom Gymnasium environments, validate wrapper/callback/policy import strings, use RL Zoo's bundled wrappers and callbacks, configure linear schedules, or patch the in-process algorithm registry for SBX or another Stable-Baselines3-compatible algorithm class.

## Start here

1. Decide what kind of component is involved:
   - Custom environment package or env id: read [custom envs, wrappers, and callbacks](references/custom-envs-wrappers-callbacks.md#custom-gymnasium-environment-registration).
   - `env_wrapper`, `vec_env_wrapper`, `callback`, `policy`, or schedule entries: read [custom envs, wrappers, and callbacks](references/custom-envs-wrappers-callbacks.md#component-configuration-flow).
   - API signatures and constraints: read [API reference](references/api-reference.md).
   - Failure diagnosis: read [troubleshooting](references/troubleshooting.md).
2. Validate import strings before launching training:

   ```bash
   python scripts/component_import_checker.py \
     --wrapper rl_zoo3.wrappers.HistoryWrapper \
     --callback rl_zoo3.callbacks.RawStatisticsCallback \
     --policy stable_baselines3.ppo.MlpPolicy
   ```

3. If components are declared in a YAML hyperparameter file, list and validate them without creating an environment:

   ```bash
   python scripts/component_import_checker.py \
     --config ./my_hyperparams.yml --env CartPole-v1
   ```

## Operating checklist

- Import custom Gymnasium registration modules before RL Zoo checks `gym.envs.registry`; for installed-package training this is normally `python -m rl_zoo3.train --gym-packages my_env_package ...` or `rl_zoo3 train --gym-packages my_env_package ...`.
- Keep custom registration modules import-only: their top-level code should call Gymnasium `register(...)` and avoid training, network calls, credentials, or heavy initialization.
- Validate every dotted import string as `module.submodule.ClassName`. Exact case matters, and the module must be importable in the same Python environment that runs RL Zoo.
- For wrappers, verify constructor kwargs and environment-space requirements before training. `HistoryWrapper`, action wrappers, and `MaskVelocityWrapper` assert on observation/action-space shape or supported env ids.
- For callbacks, verify constructor kwargs and runtime prerequisites. `RawStatisticsCallback` needs TensorBoard logging; `ParallelTrainCallback` is limited to SAC/TQC models.
- Treat SBX/JAX and external simulator packages as optional dependency surfaces; confirm they are installed before proposing commands that depend on them.

## Boundaries and routes

- Full YAML/Python hyperparameter-file grammar, indentation rules beyond wrapper/callback examples, `--conf-file`, and `--hyperparams`: route to `../config-hyperparams/SKILL.md`.
- Actual training/resume/evaluation command execution after components are validated: route to `../training-cli/SKILL.md`.
- Hyperparameter-optimization callbacks and Optuna trial behavior: route to `../tuning-optimization/SKILL.md`.
- Package install, console-entry optional plotting import behavior, and optional simulator dependencies: route to `../../references/install-and-environment.md`.

## Minimal safe workflow

```bash
# 1) Validate component imports and constructor kwargs only.
python scripts/component_import_checker.py \
  --config ./my_hyperparams.yml --env MyEnv-v0 --gym-package my_envs

# 2) If validation passes, hand off the actual run to training-cli.
python -m rl_zoo3.train --algo ppo --env MyEnv-v0 \
  --gym-packages my_envs --conf-file ./my_hyperparams.yml \
  --n-timesteps 1000 --log-folder ./runs/rl-zoo --device cpu
```

Do not train from this sub-skill unless the caller explicitly asks to execute the validated training workflow; otherwise hand off to `../training-cli/SKILL.md`.

Files in this skill

  • SKILL.md4 KB
  • references/api-reference.md9.5 KB
  • references/custom-envs-wrappers-callbacks.md10.7 KB
  • references/troubleshooting.md7.5 KB
  • scripts/component_import_checker.py14.4 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.