Environment api

From lza6/Armor-piercing-system-prompts · View interactive version

Environment api is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Use Gymnasium's single-environment API: make/reset/step/render/close loops, custom Env classes, registration/specs, checker validation, seeding, and old Gym migration.

How to use this skill

Skill file

Gymnasium Environment API

Use this sub-skill when a task involves creating or interacting with a single Gymnasium Env, migrating old Gym code, registering a custom environment, inspecting EnvSpec, or fixing reset/step/check_env failures.

Start Here

Scope Boundaries

Minimum Correct Patterns

import gymnasium as gym

env = gym.make("CartPole-v1")
obs, info = env.reset(seed=123)
terminated = truncated = False
while not (terminated or truncated):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)
env.close()
from gymnasium.utils.env_checker import check_env

check_env(raw_env, skip_render_check=True)

Keep public runtime guidance self-contained. Do not depend on the Gymnasium source tree, test tree, or documentation paths at runtime.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.