From c7d70485977f29c7b6d44b1136a35c940d8d3082 Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 3 Jul 2026 18:28:28 +1000 Subject: [PATCH] test(cli): cover agent skills expectations criteria --- .../convert/convert-evals-json.test.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/apps/cli/test/commands/convert/convert-evals-json.test.ts b/apps/cli/test/commands/convert/convert-evals-json.test.ts index f19084377..f837f5f5d 100644 --- a/apps/cli/test/commands/convert/convert-evals-json.test.ts +++ b/apps/cli/test/commands/convert/convert-evals-json.test.ts @@ -104,6 +104,38 @@ describe('convertEvalsJsonToYaml', () => { }); }); + it('accepts expectations as Agent Skills criteria without assertions', () => { + const filePath = writeTempJson({ + skill_name: 'test-skill', + evals: [ + { + id: 1, + prompt: 'Check this paragraph for style issues', + expectations: ['Flags "please" as unnecessary', 'Flags "below" as positional'], + }, + ], + }); + + const yamlObject = agentSkillsToAgentVYamlObject(readAgentSkillsEvalsFile(filePath)); + + expect(yamlObject.tests?.[0]?.assert?.[0]).toMatchObject({ + metric: 'agent-skills-criteria', + type: 'llm-rubric', + value: [ + { + id: 'expectation-1', + outcome: 'Flags "please" as unnecessary', + required: true, + }, + { + id: 'expectation-2', + outcome: 'Flags "below" as positional', + required: true, + }, + ], + }); + }); + it('throws on invalid format', () => { const filePath = writeTempJson({ not_evals: true }); expect(() => convertEvalsJsonToYaml(filePath)).toThrow(