AGENT SKILL

spaces-data

Design Gymnasium action and observation spaces, validate samples, flatten/unflatten data, serialize JSONable batches, and debug dtype/shape mismatches.

License 许可
MIT
最近更新
2026-10-08
Stars
★ 11
Forks
3

01 前言 Front Matter

name
spaces-data
license
MIT
metadata
{ "disco-role": "operating" }
description
Design Gymnasium action and observation spaces, validate samples, flatten/unflatten data, serialize JSONable batches, and debug dtype/shape mismatches.
disable-model-invocation
true

02 资源文件 3

03 SKILL.md 正文

Gymnasium Spaces and Data Contracts

Use this sub-skill when a task involves choosing Gymnasium action or observation spaces, validating samples with contains, seeding or sampling spaces, flattening nested data for model inputs, unflattening model vectors back to structured observations/actions, or serializing space samples.

Start Here

  • For constructor choices and data contracts, use references/space-design.md before modifying an environment's action_space or observation_space.
  • For flatdim, flatten_space, flatten, unflatten, to_jsonable, and from_jsonable, use references/flattening-and-json.md.
  • For Box.contains surprises, integer starts, nested flatten shape mismatches, dynamic spaces, and wrapper space updates, use references/troubleshooting.md.
  • To smoke-test the local Gymnasium install and demonstrate the core contract, run python sub-skills/spaces-data/scripts/space_contract_smoke.py --help and then python sub-skills/spaces-data/scripts/space_contract_smoke.py from the root Gymnasium skill directory.

Scope Boundaries

  • Use ../environment-api/SKILL.md for custom Env lifecycle, reset/step, registration, check_env, and seeding an environment through reset(seed=...).
  • Use ../wrappers-recording/SKILL.md when a wrapper changes observation_space, action_space, observations, actions, rewards, rendering, or recording behavior.
  • Use ../vectorization/SKILL.md for batched/vector spaces, gym.vector utilities, single_observation_space, single_action_space, and vector wrapper space transforms.

Minimum Correct Patterns

import numpy as np
from gymnasium import spaces

observation_space = spaces.Dict({
    "position": spaces.Box(low=-1.0, high=1.0, shape=(2,), dtype=np.float32),
    "inventory": spaces.Tuple((spaces.Discrete(5), spaces.MultiBinary(3))),
})

observation = observation_space.sample()
assert observation_space.contains(observation)
from gymnasium.spaces import utils as space_utils

flat = space_utils.flatten(observation_space, observation)
restored = space_utils.unflatten(observation_space, flat)
assert observation_space.contains(restored)

Keep runtime guidance self-contained. Do not depend on Gymnasium source, tests, examples, or documentation paths at runtime.

04 同仓库更多 Skills

lza6
lza6/Armor-piercing-system-prompts

ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

★ 11
lza6
lza6/Armor-piercing-system-prompts

chrome-devtools

Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).

★ 11
lza6
lza6/Armor-piercing-system-prompts

chrome-cdp

Drive a real Chrome via the Chrome DevTools Protocol (CDP). Ensures a debuggable Chrome is running (launching it if needed) so the agent can navigate, read page content, inspect the DOM, run JavaScript, and take screenshots — without the user typing any launch command. Includes a first-class "review a live running app" flow: point Chrome at the app under development and inspect/screenshot the REAL page (what a static-artifact tool cannot do). Backed by Glimpse and the chrome-devtools MCP server. Use when asked to "use chrome", "open chrome", "drive my browser", "read the page in chrome", "review the running app", "screenshot the app", or "/chrome-cdp".

★ 11
lza6
lza6/Armor-piercing-system-prompts

check-identity-pack

Run an AFP 100-point or AUSTRAC safe-harbour identity check over a set of documents, and report exactly what's missing. Use when the user asks to check identity documents, verify someone's ID for onboarding, or assess whether a document pack satisfies Australian identity requirements.

★ 11
lza6
lza6/Armor-piercing-system-prompts

changelog

Auto-generates a changelog from git commits, sprint data, and design documents. Produces both internal and player-facing versions.

★ 11
lza6
lza6/Armor-piercing-system-prompts

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

★ 11