nemo_gym.skills
nemo_gym.skills
Agent skills: a directory of skills made available to an agent at rollout time.
Skills follow the open Agent Skills standard <https://agentskills.io/specification>_
used by Codex CLI and Claude Code. A skill is a directory containing a SKILL.md
file (YAML frontmatter + markdown body) plus optional supporting files. The skills.path
config points at a directory of such skill directories.
Skills are a run-level knob (specified on gym eval run), applied to a fixed,
skill-agnostic dataset — mirroring how prompt.py applies a prompt template. They are
not a dataset-row field, so the same dataset is reusable across skill variants. Each
rollout result is stamped with a skills_ref for provenance/grouping in reward profiling.
The skills_ref carries a content hash (a short sha256 over the skill directory’s
sorted relative paths + file bytes) so that variants that mutate a skill in place at the
same path — as optimizer loops like ACE, GEPA, and EvoSkill commonly do — remain
distinguishable when comparing rollouts. Identity is derived from bytes on disk, so it
requires no cooperation from the optimizer.
Module Contents
Classes
Functions
Data
API
Bases: BaseModel
Metadata parsed from a single skill’s SKILL.md YAML frontmatter.
Bases: BaseModel
Run-level skills config: skills.path points at a directory of skill directories.
Bases: BaseModel
Provenance stamp describing the skills made available for a run.
Stamped onto rollout result rows (not source datasets). hash is a content
digest so two skill versions at the same path do not collide in profiling.
Resolve a skills path. Relative paths check cwd first, then the Gym root (PARENT_DIR).
This matches how input_jsonl_fpath and config_paths are resolved.
Compute a stable short sha256 over a skill directory’s contents.
Walks files in sorted relative-path order, folding each file’s relative path and bytes
into the digest. Including the relative path means renaming or adding/removing files also
changes the hash — a skill is its file layout, not just SKILL.md’s bytes.
Load a directory of skills, returning a SkillsRef (path, content hash, metadata).
The directory at path contains one subdirectory per skill, each with a SKILL.md.
Raises ValueError with an actionable message if the path is missing, is not a
directory, contains no skills, or contains a malformed skill.
Parse a SKILL.md file’s YAML frontmatter into SkillMetadata.
Frontmatter is delimited by lines containing only ---. Raises ValueError with a
clear message if the frontmatter is missing, malformed, or lacks a name.
Copy the directory of skills at path into dest_skills_dir.
Used by agent runtimes to materialize skills into a location their native discovery
mechanism scans (e.g. <CLAUDE_CONFIG_DIR>/skills/ for Claude Code). dest_skills_dir
must not already exist. Raises ValueError if the source path is missing or not a directory.