Eval run

From Fr-e-d/GAAI-framework · View interactive version

Eval run is an AI agent skill from the GitHub repository Fr-e-d/GAAI-framework. Evaluate any output file against a structured evals.yaml assertions file and produce a score report with per-assertion pass/fail results. Activate when the Discovery Agent runs the Skill Optimize protocol to measure output quality or detect regressions after skill instruction changes.

How to use this skill

Skill file

Eval Run

Purpose / When to Activate

Activate when:

This skill is generic: it accepts any output file and any evals.yaml, regardless of skill domain.

It follows the GAAI principle "skills never chain" — it evaluates the output it receives; it does not invoke the skill that produced the output.


Process

Step 1 — Load inputs

  1. Read the output_file path. Confirm the file exists and is non-empty. If missing: FAIL immediately with error "output_file not found: {path}".
  2. Read the evals_file path. Confirm the file exists and is valid YAML. If missing: FAIL immediately with error "evals_file not found: {path}".
  3. Parse the evals.yaml structure. Validate:

For the full evals.yaml format spec, see references/evals-format.md.

Step 2 — Run `code` assertions

For each assertion where type: code:

  1. Read the check field. Execute the corresponding mechanical verification:

| check | Verification method |

|---|---|

| word_count | Count whitespace-separated tokens in the output file. Compare against params.min and params.max. |

| char_count | Count all characters in the output file. Compare against params.min and params.max. |

| regex_match | Apply params.pattern as a regex to the full output text. PASS if at least one match found. |

| regex_not_match | Apply params.pattern as a regex to the full output text. PASS if zero matches found. |

| structure_present | Search the output text for the literal string params.marker. PASS if found. |

| structure_absent | Search the output text for the literal string params.marker. PASS if NOT found. |

  1. Record the result:

Step 3 — Run `llm-judge` assertions

For each assertion where type: llm-judge:

  1. Construct the evaluation prompt:

```

{assertion.prompt}


OUTPUT TO EVALUATE:

{full content of output_file}

```

  1. Submit the prompt. Parse the response for a binary verdict: PASS or FAIL.
  2. Extract the one-sentence explanation from the response.
  3. Record the result:

Step 4 — Compile score report

After all assertions are evaluated, compile the score report:

  1. Count total assertions run and total assertions passed.
  2. List all failed assertions with their IDs, descriptions, and failure details.
  3. Produce the structured output (see Outputs section).

Quality Checks


Outputs

The skill produces a score report in the following structured Markdown format:

# Eval Report: {skill name} — {evals.yaml version}

**Output file:** {output_file path}
**Evals file:** {evals_file path}
**Run date:** {ISO 8601 date}
**Score:** {N}/{total} assertions passed

---

## Results

| ID | Type | Description | Result | Details |
|----|------|-------------|--------|---------|
| A01 | code | Word count within ±15% of target | PASS | 1247 words (range: 1020–1380) |
| A02 | code | Kill list word 'leverage' absent | FAIL | 2 matches found |
| A03 | llm-judge | Post stands alone without prior context | PASS | "The post opens with a clear hook and requires no prior context to understand." |

---

## Failed Assertions

### A02 — Kill list word 'leverage' absent
- **Type:** code
- **Check:** regex_not_match
- **Pattern:** `\bleverag(e|ing|ed)\b`
- **Result:** FAIL — 2 matches found at positions [line 4, line 11]

The score report may also be emitted as structured YAML if the invoking agent requires machine-readable output:

eval_report:
  skill: content-draft
  evals_version: "1.0"
  output_file: {path}
  evals_file: {path}
  run_date: {ISO 8601}
  score:
    passed: 4
    total: 5
    ratio: "4/5"
  results:
    - id: A01
      type: code
      description: "Word count within ±15% of target"
      result: PASS
      details: "1247 words (range: 1020–1380)"
    - id: A02
      type: code
      description: "Kill list word 'leverage' absent"
      result: FAIL
      details: "2 matches found"
  failed_assertions:
    - id: A02
      description: "Kill list word 'leverage' absent"
      type: code
      check: regex_not_match
      pattern: "\\bleverag(e|ing|ed)\\b"
      details: "2 matches found at positions [line 4, line 11]"

Non-Goals

This skill must NOT:

No silent skips. Every assertion produces an explicit PASS, FAIL, or ERROR result.

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.