Writing a dataset

A dataset is the pinned cases in evals/cases.yaml, the inputs under evals/fixtures/, and the expected files under evals/goldens/. The examples from skillgate examples install are the same shape. Read one folder next to this page, or open Examples.

File layout

The folder name, the name in SKILL.md, and skill in evals/cases.yaml are the same string.

shell
json-response/
  SKILL.md
  scripts/agent_entry.py
  evals/
    cases.yaml
    fixtures/
      orders.json
      empty-orders.json
    goldens/
      flatten-orders.json
      edge-empty.json
    history/

Copy this pack

Copy these four files into skills/json-response/. This is the empty-input case from that example. The pack on disk adds two more cases. Then run skillgate ingest skills/json-response.

SKILL.md

markdown
---
name: json-response
description: Reshape a JSON API response. Flatten nested fields to id, status, and total, and drop empty values. Use when the user has a JSON response.
---

# JSON response

Flatten each object under `data` to `id`, `status`, and `total`. An empty `data` array becomes `[]`.

evals/fixtures/empty-orders.json

json
{
  "data": []
}

evals/goldens/edge-empty.json

json
[]

evals/cases.yaml

yaml
schema: 1
skill: json-response
cases:
  - id: edge-empty
    status: pinned
    prompt: Flatten the JSON API response in empty-orders.json. Save output/orders.json.
    should_trigger: true
    input:
      files:
        - src: evals/fixtures/empty-orders.json
          dest: empty-orders.json
    golden:
      output_path: output/orders.json
      path: evals/goldens/edge-empty.json
      kind: json
    contains:
      - "[]"

status: pinned is what runs. dest is the name the agent sees.golden.output_path is the file the agent must write. golden.path is the expected file in the pack. kind is text, json, or bytes. contains lists substrings that must appear. should_trigger: false is an unrelated prompt: leave input.files empty and set golden: null.

What each example tests

json-response-sabotaged copies the JSON cases. Its instructions ignore JSON and write a snack list, so a live check fails the trigger cases. The unrelated case can still pass.

How to write a case

Start with 3 to 6 pinned cases. Each example ships three: one main behavior, one edge, and one unrelated prompt.

Check it locally

shell
skillgate ingest skills/json-response
skillgate case list skills/json-response
skillgate check skills/json-response
skillgate check skills/json-response --case flatten-orders
skillgate check skills/json-response-sabotaged
skillgate check skills/json-response-sabotaged --expect-fail

skillgate ingest prints OK json-response when SKILL.md loads. skillgate case list prints each id, pinned, and the prompt. skillgate check exits 0 when the live run is green, 1 when it is red, and 2 when no agent is available, you are not signed in, or no decision model is selected. Sign in with skillgate login, then pick a decision model. Without those, the check exits 2. That is not a pass.

shell
skillgate ui
  1. Click Skills. The page title is Skill Repository.
  2. Click Examples, then Install.
  3. Open json-response. Click Evaluate this skill.
  4. Click Run. The label is Run 3 cases when three checks are loaded. Until you sign in or add a key, the line above the button is Next: sign in or add a key in Settings, then press Run.
  5. For the red path, open json-response-sabotaged and press Run. The JSON checks fail. The unrelated check can pass.

Common mistakes