Agent skill

Generate Openenv Env

by adithya-s-k in adithya-s-k/FineEnvs

Builds an OpenEnv (Hugging Face) variant of an RL environment.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Generate Openenv Env

skills CLI
$ npx skills add adithya-s-k/FineEnvs --skill generate-openenv-env -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install adithya-s-k/FineEnvs generate-openenv-env --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/adithya-s-k/FineEnvs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/generate-openenv-env .claude/skills/generate-openenv-env && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
generate-openenv-env
GitHub stars
456
Token cost
~2.4k tokens
SKILL.md length
691 words
Files
2 (incl. references)
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

Builds an OpenEnv (Hugging Face) variant of an RL environment.

  • Works in 7 steps: Pydantic state model — models.py → The MCPEnvironment —… → The FastAPI app — server/app.py → …
  • Someone asks to scaffold an OpenEnv server
  • SKILL.md covers Concept, Archetypes (pick the one…, Recommended file layout and Implementation order (one…, plus 4 more sections
  • Calls uv and curl

What it does

Generate Openenv Env is an agent skill from adithya-s-k/FineEnvs. Builds an OpenEnv (Hugging Face) variant of an RL environment. Use whenever someone asks to scaffold an OpenEnv server, port an existing env to OpenEnv, add MCP tools to an env, or deploy an OpenEnv to HF Spaces. OpenEnv is the right framework when the user wants HTTP+MCP, structured tool calls discovered via listtools(), an optional Gradio UI, sandbox-backed sessions, or deployment as a Docker container / HF Space. Output is a runnable <envdir/openenv/ folder with server/app.py, server/<envenvironment.py…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/architecture.md`).

It sits in AI & LLM Engineering, covering Model hubs and datasets, Containers and Reinforcement learning. It works with Docker, Model Context Protocol, Gradio and Hugging Face. The repository describes itself as: FineEnvs — RL Environments 101: building and scaling RL environments in the age of LLMs. The licence is Apache-2.0.

When your agent uses it

  • Someone asks to scaffold an OpenEnv server
  • Port an existing env to OpenEnv
  • Add MCP tools to an env
  • Deploy an OpenEnv to HF Spaces

Example prompts

  • “wrap my game in OpenEnv”
  • “make an MCP env for X”
  • “add the openenv variant”
  • “/generate-openenv-env”

Requirements

  • Python 3
  • Docker

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Pydantic state model — models.py
  2. The MCPEnvironment — server/_environment.py
  3. The FastAPI app — server/app.py
  4. Custom Gradio UI (optional, computer-use-style envs benefit)
  5. The rollout — rollout.py
  6. The Dockerfile
  7. The HF Space README frontmatter

What it can do on your machine

Read from SKILL.md and the folder at commit 5e0b46e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • huggingface.co
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Generate Openenv Env loads about 2.4k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 175 tokens; SKILL.md has 691 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~175
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from adithya-s-k/FineEnvs at commit 5e0b46e, republished under its Apache-2.0 licence (© adithya-s-k). 691 words, ~2,351 tokens.

Download SKILL.mdSave it as .claude/skills/generate-openenv-env/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
generate-openenv-env
description
Builds an OpenEnv (Hugging Face) variant of an RL environment. Use whenever someone asks to scaffold an OpenEnv server, port an existing env to OpenEnv, add MCP tools to an env, or deploy an OpenEnv to HF Spaces. OpenEnv is the right framework when the user wants HTTP+MCP, structured tool calls discovered via `list_tools()`, an optional Gradio UI, sandbox-backed sessions, or deployment as a Docker container / HF Space. Output is a runnable `<env_dir>/openenv/` folder with `server/app.py`, `server/<env>_environment.py`, `pyproject.toml`, `Dockerfile`, and `rollout.py`. Use for prompts like "wrap my game in OpenEnv", "make an MCP env for X", or "add the openenv variant".

generate-openenv-env

Build the OpenEnv variant of an env. Targets OpenEnv >= 0.4.1 (the openenv package — formerly openenv-core[core]).

Concept

OpenEnv is an HTTP server exposing tools via the MCP (Model Context Protocol) shape. The runtime is FastAPI; tools are FastMCP-decorated functions. Clients discover tools via list_tools() (under the hood: a list-tools action on /step) and call them via call_tool(name, **args).

When the user has a shared domain module (<domain>.py) and wants an OpenEnv variant, never duplicate domain logic into the framework folder — wrap it.

Archetypes (pick the one matching the task)

ArchetypeHallmarks
Pure-Python gameDeterministic, single @mcp.tool, text-only observations. Reward computed externally from the trajectory.
Stateful sandboxE2B / browser / DB, multiple tools mutating session state, MCPEnvironment per session.
Vision / computer-useScreenshots returned as MCP image content blocks (fastmcp.utilities.types.Image), 19-tool action surface modelled on Anthropic's computer_20251124, optional custom Gradio UI mounted at /web.

The user picks the actual paths. The canonical shape:

<env_dir>/openenv/
├── pyproject.toml      # openenv + e2b-* + fastmcp + uvicorn + gradio
├── __init__.py
├── models.py           # Pydantic State / typed action / observation models
├── Dockerfile          # multi-stage from ghcr.io/huggingface/openenv-base
├── openenv.yaml        # spec_version 1, name, runtime, app, port
├── server/
│   ├── __init__.py
│   ├── app.py          # create_app(EnvCls, CallToolAction, CallToolObservation, env_name=...)
│   └── <env>_environment.py    # MCPEnvironment subclass with @mcp.tool methods
├── rollout.py          # MCPToolClient drives the server; auto-discovers tools
└── README.md           # one-page; with HF frontmatter if deploying to Spaces

Implementation order (one continuous pass)

1. Pydantic state model — models.py

Subclass openenv.core.env_server.types.State. Add per-episode fields you'll mutate (step_count, last_output, sandbox/session ids, anything you want to inspect later).

For visual envs, add last_screenshot_b64. Don't store huge blobs unless you need them in state — use metadata on observations instead.

2. The MCPEnvironment — server/<name>_environment.py
python
class MyEnv(MCPEnvironment):
    SUPPORTS_CONCURRENT_SESSIONS = True   # only if real session isolation
    def __init__(self):
        # ... env-side state init
        mcp = FastMCP("my_env")
        @mcp.tool
        def my_tool(arg: int) -> str: ...
        super().__init__(mcp)

Key contracts:

  • Dual-import pattern. Inside server/, write try: from ..models import X; except ImportError: from models import X. Relative imports work inside the repo (PYTHONPATH=src:envs); flat imports work in Docker (/app/env). Same applies to sibling modules like e2b_sandbox.py.
  • Tool methods are @mcp.tool decorated functions inside __init__. They close over self and read/write env state. Don't try to put @mcp.tool on instance methods — FastMCP introspects free functions.
  • For images, use fastmcp.utilities.types.Image: return Image(data=png_bytes, format="png"). The model receives an MCP image content block. Returning a base64 string in text means the model is blind.
  • Lifecycle hooks: reset(seed=None, episode_id=None, **kwargs) returns an Observation; step(action, timeout_s=None, **kwargs) is inherited from MCPEnvironment for tool dispatch — only override if you need pre/post hooks (e.g. step-counter increment, terminate signal handling).
3. The FastAPI app — server/app.py
python
import os
from openenv.core.env_server.http_server import create_app
from openenv.core.env_server.mcp_types import CallToolAction, CallToolObservation
try:
    from .my_environment import MyEnv
    from .gradio_ui import my_ui_builder      # only if you have a custom UI
except ImportError:
    from server.my_environment import MyEnv
    from server.gradio_ui import my_ui_builder

def _custom_gradio_builder(*args, **kwargs):
    return my_ui_builder(env_factory=MyEnv)

os.environ["ENABLE_WEB_INTERFACE"] = "true"
app = create_app(
    MyEnv, CallToolAction, CallToolObservation,
    env_name="my_env",
    max_concurrent_envs=int(os.getenv("MAX_CONCURRENT_ENVS", "4")),
    gradio_builder=_custom_gradio_builder,   # omit if no custom UI
)

Pass the class to create_app, not an instantiated env.

4. Custom Gradio UI (optional, computer-use-style envs benefit)

server/gradio_ui.py defines my_ui_builder(env_factory) that returns a gr.Blocks. Mounted at /web (set base_path: /web in the HF Space frontmatter). For computer-use envs, the canonical pattern includes an iframe panel showing the E2B stream URL alongside text controls — but any gr.Blocks layout works.

Show full SKILL.md (301 more words)Show less
5. The rollout — rollout.py

Use openenv.core.mcp_client.MCPToolClient. Discover tools, don't hardcode:

python
from openenv.core.mcp_client import MCPToolClient
with MCPToolClient(base_url=ENV_URL).sync() as env:
    env.reset()
    tools = env.list_tools()                 # list of ToolSpec
    # convert to OpenAI tool schemas, drive the LLM, call env.call_tool(name, **args)

Note: for image-returning tools, env.call_tool strips to result.data (which is None for image returns). Use env.step(CallToolAction(tool_name="screenshot", arguments={})) to get the full result dict, then read obs.result["content"][0]["data"] for the b64 image. Pattern:

python
def _call(env, name, **kwargs):
    out = env.step(CallToolAction(tool_name=name, arguments=kwargs))
    return out.observation.result or {}

def _b64_screenshot(env):
    res = _call(env, "screenshot")
    for c in res.get("content", []) or []:
        if c.get("type") == "image" and c.get("data"):
            return c["data"]
    raise RuntimeError(f"screenshot returned no image: {res}")

For multimodal models (Qwen3-VL, GPT-4o), feed the latest screenshot as an image block in the user message every turn.

6. The Dockerfile

Use a multi-stage build:

  • FROM ghcr.io/huggingface/openenv-base:latest (the official base — already has FastAPI, MCP, Gradio).
  • uv sync twice (no-install-project, then with project) for cache friendliness.
  • Healthcheck via /health.
  • Expose port 8000.

For HF Spaces, the canonical app_port is 8000 (not 7860 — OpenEnv's pattern uses 8000). Set base_path: /web in the README frontmatter so Gradio mounts under that prefix.

7. The HF Space README frontmatter
yaml
---
title: My Env Server
emoji: 🤖
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
app_port: 8000
base_path: /web
tags: [openenv, your-domain]
short_description: One-line summary
---

Validation gates

Before declaring done, all four must pass:

  1. In-repo import — PYTHONPATH=envs uv run python -c "from envs.<name>.openenv.server.<name>_environment import <Cls>"
  2. Local server — uv run uvicorn server.app:app --port 8000 then curl /health returns {"status":"healthy"} and /list_environments returns the env name.
  3. Tool discovery — MCPToolClient.list_tools() returns the expected list.
  4. Rollout — MAX_TURNS=3 uv run python rollout.py runs without errors.

Common gotchas (from real-world OpenEnv work)

  • KeyError: 'tools' from POST /list_tools — OpenEnv doesn't expose /list_tools directly; MCPToolClient uses /step with a list-tools action under the hood. Always discover via the client.
  • Screenshot returns None — env.call_tool("screenshot") returns only the structured data field. Use env.step(CallToolAction(...)) and read obs.result["content"].
  • address already in use — common during local-dev iteration. Just pick a different --port.
  • ModuleNotFoundError in Docker but works locally — missing dual-import pattern in server/app.py or server/<name>_environment.py.

Reference

  • references/architecture.md — full architecture deep-dive (when needed)

Official documentation

© adithya-s-k, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .claude/skills/generate-openenv-env of adithya-s-k/FineEnvs.

  • SKILL.md
  • references/architecture.md

Open the folder on GitHubat commit 5e0b46e

Compare with similar skills

Generate Openenv Env next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Generate Openenv Env compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Generate Openenv Env this skilladithya-s-k/FineEnvs456—~2.4kAutomated safety check: PassApache-2.0
Hugging Face Spaces DeployVincentqyw/image-matching-webui1.3k—~721Automated safety check: PassApache-2.0
Hf MCPhuggingface/skills11k2 repos~1.2kAutomated safety check: PassApache-2.0
Task Orchestrator Server Setupjpicklyk/task-orchestrator207—~3.1kAutomated safety check: PassMIT
Frontmcp Deploymentagentfront/frontmcp146—~9.2kAutomated safety check: NotesApache-2.0
Convergence TestAMD-AGI/Primus131—~2.1kAutomated safety check: PassCustom licence

Similar skills

  • Hugging Face Spaces Deploy

    Vincentqyw/image-matching-webui

    Releases a new imcui version on GitHub, then deploys it to a test and a production Hugging Face Space from a dedicated huggingface branch.

    1.3k GitHub stars~721 tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Hf MCP

    huggingface/skills

    Official

    Use Hugging Face Hub via MCP server tools. An agent skill from huggingface/skills.

    11k GitHub starsUsed in 2 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Task Orchestrator Server Setup

    jpicklyk/task-orchestrator

    Walks through how to launch and reach the MCP Task Orchestrator server container: transport, REST API, port publishing, config mounts and config-sync.

    207 GitHub stars~3.1k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Frontmcp Deployment

    agentfront/frontmcp

    A skill your agent uses when deploying, building for production, packaging, or shipping a FrontMCP server.

    146 GitHub stars~9.2k tokensUpdated 2 days ago
    DevOps & CloudAuto-check: notes
  • Convergence Test

    AMD-AGI/Primus

    Run, monitor, stop and report Primus convergence tests -- training a model on a real corpus and checking that the loss curve is healthy -- from a plain-language request such as "run convergence test…

    131 GitHub stars~2.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Hugging Face LLM Trainer

    huggingface/skills

    Official

    Trains or fine-tunes language and vision models with TRL or Unsloth on Hugging Face Jobs cloud GPUs, then converts the results to GGUF.

    11k GitHub starsUsed in 1 repo~7.2k tokens
    AI & LLM EngineeringAuto-check passed

More from adithya-s-k/FineEnvs

All 8 skills in this repo
  • Generate Verifiers Env

    adithya-s-k/FineEnvs

    Builds a Verifiers (PrimeIntellect) variant of an RL environment.

    456 GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Generate Nemo Gym Env

    adithya-s-k/FineEnvs

    Builds a NeMo Gym (NVIDIA) variant of an RL environment. An agent skill from adithya-s-k/FineEnvs.

    456 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Generate Ors Env

    adithya-s-k/FineEnvs

    Builds an Open Reward Standard (ORS) variant of an RL environment using the official openreward Python package.

    456 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check: notes
  • Rl Env From Description

    adithya-s-k/FineEnvs

    Turns a user's plain-English description of an RL training environment into runnable code across the four target frameworks — OpenEnv, OpenReward (ORS), Verifiers, and NeMo Gym.

    456 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check: notes
  • Article Frontmatter

    adithya-s-k/FineEnvs

    Configure article metadata via MDX frontmatter. An agent skill from adithya-s-k/FineEnvs.

    456 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Create HTML Embed

    adithya-s-k/FineEnvs

    Create self-contained D3 HTML embed charts for the research article template.

    456 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Questions about Generate Openenv Env

What does Generate Openenv Env do?

Builds an OpenEnv (Hugging Face) variant of an RL environment. Generate Openenv Env is an agent skill from adithya-s-k/FineEnvs. Builds an OpenEnv (Hugging Face) variant of an RL environment.

When should I use Generate Openenv Env?

Generate Openenv Env fits situations like: someone asks to scaffold an OpenEnv server; port an existing env to OpenEnv; add MCP tools to an env; deploy an OpenEnv to HF Spaces.

How do I install Generate Openenv Env in Claude Code?

Run `npx skills add adithya-s-k/FineEnvs --skill generate-openenv-env -a claude-code`. Or copy the skill folder (.claude/skills/generate-openenv-env in adithya-s-k/FineEnvs) into .claude/skills/generate-openenv-env in your project. Claude Code loads it when a task matches its description.

How do I install Generate Openenv Env in Codex?

Run `npx skills add adithya-s-k/FineEnvs --skill generate-openenv-env -a codex`. Or copy the skill folder (.claude/skills/generate-openenv-env in adithya-s-k/FineEnvs) into .agents/skills/generate-openenv-env in your project. Codex loads it when a task matches its description.

Can I use Generate Openenv Env in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add adithya-s-k/FineEnvs --skill generate-openenv-env -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/generate-openenv-env, .gemini/skills/generate-openenv-env, .github/skills/generate-openenv-env and .opencode/skills/generate-openenv-env in your project.

What does Generate Openenv Env need to run?

Going by SKILL.md and its folder, Generate Openenv Env needs the command-line tools its instructions call (uv and curl). Our summary lists: Python 3; Docker.

Does Generate Openenv Env access the network?

SKILL.md names 2 domains. As links in the text: huggingface.co and github.com. This is read from the text; nothing was executed.

Is Generate Openenv Env safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Generate Openenv Env use?

Generate Openenv Env is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Generate Openenv Env use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Generate Openenv Env?

Skills that share tags, products or a category with Generate Openenv Env: Hugging Face Spaces Deploy (Vincentqyw/image-matching-webui, 1.3k stars), Hf MCP (huggingface/skills, 11k stars), Task Orchestrator Server Setup (jpicklyk/task-orchestrator, 207 stars) and Frontmcp Deployment (agentfront/frontmcp, 146 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Generate Openenv Env?

adithya-s-k (a GitHub user) maintains it in adithya-s-k/FineEnvs, which has 456 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 8, 2026.

Source: adithya-s-k/FineEnvs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.