Skip to content

feat: agent skill evaluation infrastructure #1256

Description

@cwing-nvidia

Background

As part of agent evaluation and training, users want to compare the impact on agent performance with iterations on agent skills. They want to enable modifying skills without modifying the rest of the environment or agent. They are interested to evaluate the impact of skills on accuracy, cost, task completion time, and the ability for skills to generalize across different sets of tasks.

Description

Evaluate skills as a first class variable with support for runtime skills loading. Skills often encode operational knowledge that influences agent success in workflows.

Design

Core Concept

Skills are treated as an environment-level concern in NeMo Gym. The framework manages which skills are available to the agent's runtime, without modifying the agent itself. The agent uses its own native skill-loading mechanism (filesystem scanning, MCP, tool calls, etc.) to discover and use skills as it normally would. NeMo Gym's role is to set up the skill environment, vary it between runs, and measure the outcome.

Skills follow the open Agent Skills standard 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 (scripts, references, assets). The directory is the unit of variation, not just the SKILL.md file.

Config

A single skills.path field specifies the directory of skills to make available for a given run:

skills:
  path: skills/variant_a/   # directory of skill directories, Agent Skills standard layout

The directory at path follows the standard layout:

skills/variant_a/
├── cot_enhanced/
│   └── SKILL.md
├── tool_focused/
│   ├── SKILL.md
│   └── references/
│       └── api_spec.md
└── baseline/
    └── SKILL.md

To compare variants, run with different path values:

# Variant A
ng_collect_rollouts +agent_name=my_agent \
  +input_jsonl_fpath=data/tasks.jsonl \
  +output_jsonl_fpath=results/rollouts_variant_a.jsonl \
  +skills.path=skills/variant_a/ \
  +num_repeats=10

# Variant B (different skill content, or different set of skills)
ng_collect_rollouts +agent_name=my_agent \
  +input_jsonl_fpath=data/tasks.jsonl \
  +output_jsonl_fpath=results/rollouts_variant_b.jsonl \
  +skills.path=skills/variant_b/ \
  +num_repeats=10

How Skills Are Made Available

The framework resolves skills.path and makes the skills accessible to the agent's runtime environment. How the agent discovers and loads them depends on the agent:

  • Agents with filesystem-based skill loading (Codex CLI, Claude Code, or agents with Read/Glob tools): Skills are files on disk. The agent's skill-loading config points at the resolved path, and its native discovery mechanism picks them up.
  • Agents with a skill-serving backend (e.g., MCP skill server, custom search_skills tool): The existing backend is configured to serve from the specified skill directories.
  • Agents without any skill mechanism: Future enhancement — inject skill content into responses_create_params.input as a system message at _preprocess_rows_from_config time. Not in initial scope.

The skills directory is a filesystem path (absolute or relative, resolved like input_jsonl_fpath). It does not need to live inside Gym or inside a resources server. For distributed runs, it needs to be on shared storage accessible to the agent process.

What Gets Evaluated

The framework supports evaluating skills at multiple levels depending on the agent's capabilities:

Level What it tests Requires
Content quality Given that a skill activates, does its content help the model complete the task? Agent with skill loading
Selection quality Does the model activate the right skill for a given task? Is the skill description effective? Agent with skill discovery tools; optional verifier_metadata.expected_skill labels in task data
Library composition Does adding/removing skills from the library help or hurt overall performance? Multiple runs with different skills.path values
Generalization Does a skill improve performance across diverse task types, or only narrow ones? Per-task-group analysis of rollout results

Output Tagging

Each rollout result is tagged with a skills_ref listing the skills that were available:

{
  "reward": 1.0,
  "task_index": 0,
  "rollout_index": 0,
  "agent_ref": {"name": "my_agent"},
  "skills_ref": {
    "path": "skills/variant_a/",
    "skills": [
      {"name": "cot_enhanced", "description": "..."},
      {"name": "tool_focused", "description": "..."},
      {"name": "baseline", "description": "..."}
    ]
  }
}

Skill metadata (name, description, version) is read from each skill's SKILL.md frontmatter.

For agents with tool-based skill loading, which skills were actually activated can be determined from the tool call logs in the response output (e.g., calls to activate_skill, read_skill, etc.).

Metrics

Uses existing NeMo Gym metrics infrastructure. No new metrics primitives are needed — users compare skill variants by diffing rollout outputs:

  • Accuracy: Reward from verify(), aggregated into pass@1/pass@k by ng_reward_profile
  • Cost: Token usage from response.usage.{input_tokens, output_tokens}, already present in rollout output

Implementation

Files to touch:

  1. nemo_gym/skills.py (new) — load_skill_directory(path) utility function to walk a skills directory, parse SKILL.md frontmatter from each subdirectory, and return skill metadata (name, description, version).
  2. nemo_gym/rollout_collection.py — Add optional skills field to RolloutCollectionConfig. In _preprocess_rows_from_config, load skills metadata via load_skill_directory and tag each row with skills_ref. In run_from_config, propagate skills_ref to rollout results.
  3. Config schema — Add skills as an optional top-level config section with a path field.

Agent Skills Standard Compatibility

The design is compatible with the Agent Skills open standard used by Codex CLI and Claude Code. NeMo Gym provides skill files faithfully following the standard — the agent's native skill runtime handles all skill-specific features (context: fork, disable-model-invocation, allowed-tools, dynamic context injection, etc.). NeMo Gym is not a skill runtime; it manages the skill environment and lets the agent load and interpret skills as it normally would.

Out of Scope

  • Modifying existing agent code to add skill-loading capabilities. The agent is held constant; skills are an environment concern.
  • A dedicated "skill library resources server" that serves skills via tool endpoints. If needed, this would be a separate issue.
  • Direct injection of skill content into responses_create_params for agents without native skill loading. This is a future enhancement.
  • Skill authoring, editing, or management tools. This issue covers evaluation/training, not skill creation.
  • Multi-variant orchestration CLI (ng_eval_skills). Users can compare variants by running ng_collect_rollouts multiple times with different skills.path values. A convenience wrapper can be added later.

Acceptance Criteria

  • I can specify a skills.path in my ng_collect_rollouts config pointing at a directory of Agent Skills standard skill directories
  • My agent can discover and load the skills at that path using its native skill-loading mechanism
  • Each rollout result in the output JSONL includes a skills_ref with metadata (name, description) for the skills that were available
  • I can compare two skill variants by running ng_collect_rollouts twice with different skills.path values and diffing the output
  • Invalid or malformed skill directories produce clear error messages telling me what's wrong
  • Documentation covers the skills config, expected directory layout, and the workflow for comparing skill variants

Activity

  1. changed the title [-]feat: agent skill evaluation[/-] [+]epic: agent skill evaluation[/+] on May 29, 2026
  2. changed the title [-]epic: agent skill evaluation[/-] [+]feat: agent skill evaluation infrastructure[/+] on Jun 2, 2026
  3. 5 remaining items

  4. ffrujeri commented on Jun 24, 2026

    @ffrujeri
    Contributor

    As a general feedback here, we should be careful with "Skills are treated as an environment-level concern in NeMo Gym", because the skills are actually part of the Agent :). I understand what you mean by "skills environment" but maybe we need to find a better term later, like "skills bag/store", "skills runtime".

    An associated example to illustrate the point: can the same skill be used in two different environments?

  5. self-assigned this
    on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions