rl-env-integrator

Integrate RL environments behind a Gymnasium adapter contract with extracted specs and smoke tests.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/Lingjie-wang/autoRL --skill rl-env-integrator-lingjie-wang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rl-env-integrator
Source: https://github.com/Lingjie-wang/autoRL/tree/main/skills/rl-env-integrator
Command: npx skills add https://github.com/Lingjie-wang/autoRL --skill rl-env-integrator-lingjie-wang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Getting a concrete RL environment (official benchmark, custom code, or external simulator) into a constructible, spec-documented, smoke-tested state is error-prone: documentation disagrees with runtime behavior, dependency versions break, and specs get hand-written instead of measured. This Skill standardizes that integration behind a single adapter contract and reuses prior verified integrations when possible. ## Core Features & Use Cases - Verified Integration Reuse: Runs a deterministic reuse gate (scripts/find_reusable_integration.py) that links a previously verified integration into a new run only when artifacts, verification reports, metadata, and source hashes all match. - Adapter Contract Deliverables: Produces adapter.py (single make_env entrypoint), env_config.json with pinned dependencies, extract_spec.py that derives env_spec.json from the live environment, and smoke_rollout.py for random-policy checks. - Route Classification: Handles official_benchmark, custom_env, external_simulator, PettingZoo multi-agent, and EPyMARL channels, with a known-pitfalls knowledge base covering Python version pins, lazy registration, and reward-bound measurement. - Use Case: Given a custom thermal-control environment file plus a natural-language description, wrap it in the Gymnasium API, extract an honest spec from the live object, run a smoke rollout, and hand off a complete integration report for independent verification. ## Quick Start Use the rl-env-integrator skill to integrate the environment described in my task card into runs/<task-id>/, reusing a verified integration if one exists.

Frequently Asked Questions about rl-env-integrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate a custom RL environment with Gymnasium?

Subclass gymnasium.Env, declare observation_space and action_space from real data samples, and map the native lifecycle to reset returning (obs, info) and step returning the 5-tuple with terminated and truncated split. Expose everything through a single make_env(config) adapter entrypoint.

How to extract an environment spec from a Gymnasium environment?

Build the environment through the adapter and read spaces, reward bounds, and termination limits from the live object, never from documentation. Measure observed_reward_bounds over at least 10 full episodes and record fields like observation_modality, action_type, and randomness_sources.

Why does gym.make fail with NameNotFound for an installed package?

Packages like ale-py, minigrid, and gymnasium-robotics only register their environment ids after gymnasium.register_envs(<pkg>) runs. Call it lazily inside make_env behind a module-level flag, never at import time, so multiple adapters stay importable in one process.

Can I reuse a previously verified RL environment integration?

Yes, run the find_reusable_integration.py finder, which requires complete artifacts, a passing non-stale verification report, matching metadata and config constraints, and matching source hashes for custom environments. Eligible runs are linked read-only via symlink with an environment_reuse.json receipt.

Why is env.spec.max_episode_steps None for Atari or MiniGrid?

These environments truncate internally rather than via a TimeLimit wrapper: ALE uses max_num_frames_per_episode divided by frameskip, and MiniGrid uses env.unwrapped.max_steps. Spec extraction and smoke scripts must carry their own explicit step cap instead of looping unboundedly.

What are the limitations of environment integration before training?

Integration only makes the environment constructible, spec-documented, and smoke-tested; it does not choose algorithms, write training loops, or claim performance. A passing smoke rollout is not verification, and integration is not complete until an independent verifier passes.