-
Notifications
You must be signed in to change notification settings - Fork 159
Add run-evals orchestration skill and evals for published skills #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9bab00a
2d36209
989e571
69464d9
df8caf0
2ef691f
9378e8f
3e5d8ce
c05fb05
582449c
4c416c8
38ef90e
909de2e
d3d8ee2
9f6a8e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,22 @@ | ||
| { | ||
| "skill_name": "definition-of-done", | ||
| "repo_criteria": [ | ||
| "evals/code_quality_rubric.json" | ||
| ], | ||
| "evals": [ | ||
| { | ||
| "id": 1, | ||
| "prompt": "Modify tool/dart_skills_lint/lib/src/levenshtein.dart to add a comment explaining how the algorithm calculates distance (e.g. tracking deletion, insertion, substitution cost), and make sure you finish the task completely.", | ||
| "expected_output": "The file tool/dart_skills_lint/lib/src/levenshtein.dart has a new explanatory comment, code is formatted, analyzed cleanly, and contains no forbidden temporal terms.", | ||
| "expectations": [ | ||
| "expected_chat_output": [ | ||
| "The agent confirms it added an explanatory comment about how edit distance is calculated to levenshtein.dart.", | ||
| "The agent outputs a text list of all definition-of-done rules in the format '[x] Identifier: Explanation' (if done) or '[ ] Identifier: Skipped explanation' (if skipped)." | ||
| ], | ||
| "expected_repo_state": [ | ||
| "The levenshtein.dart file contains a new comment explaining how edit distance is calculated.", | ||
| "The new comment does not contain any relative temporal words such as 'now', 'currently', 'new', 'old', or 'existing'.", | ||
| "The levenshtein.dart file is formatted cleanly according to dart format.", | ||
| "The project has no dart analyze errors or warnings." | ||
| ] | ||
| ], | ||
| "agent_config": "reidbaker-agent" | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| name: run-evals | ||
| description: Run evaluations for one, multiple, or all skills using the agent orchestration framework. Make sure to use this skill whenever the user asks to run evals, test a skill's performance, run benchmarks, or compare baseline versus with-skill execution. | ||
| metadata: | ||
| internal: true | ||
| --- | ||
|
|
||
| # Run Skill Evals | ||
|
|
||
| 1. **Read Framework**: Read `tool/dart_skills_lint/evals/README.md` for understanding the difference between per-skill evals and cross-skill evals. | ||
| 2. **Locate Targets**: Find target `evals/evals.json` files inside `.agents/skills/` and/or `skills/`. | ||
| 3. **Determine Agent Configuration**: Check the `agent_config` field in the target `evals.json` to determine the environment/harness to spawn. If `agent_config` is `"bare-agent"`, spawn a subagent with the `bare-agent` profile. If it is a specific contributor profile (e.g. `"reidbaker-agent"`), use that profile to provide the necessary contributor context. | ||
| 4. **Orchestrate**: By default, run an Integration Test by spawning a single **With-Skill** subagent using `Workspace: branch` and the identified `agent_config`. | ||
| - Provide the task prompt. See `resources/with_skill_execution_prompt.md` for the template. When filling in `<path-to-skill>`, you MUST use a relative path from the repository root, not an absolute path, to prevent the subagent from accidentally anchoring to and modifying the parent workspace. | ||
| - **Only if the user explicitly requests a comparison or benchmark**, also spawn a **Baseline** subagent. See `resources/baseline_execution_prompt.md` for the template. | ||
| Instruct the subagent(s) to return their `git diff` and verification outputs (`dart format`, `dart analyze`, `dart test`) without committing. | ||
| **CRITICAL**: You must explicitly warn the subagent(s) to confine all file edits strictly to their current working directory and avoid using absolute paths to modify the parent workspace. | ||
| 5. **Grade**: Parse the combined rubric (resolving `repo_criteria` + `evals.json` expectations). Use the grading instructions in `resources/agent_judge_prompt.md`. When an expectation fails, you MUST explicitly list both the expectation and what was actually found that caused the failure. | ||
| 6. **Artifact**: Grade the outputs and generate a Markdown artifact (e.g., `<skill>_eval_results.md`) containing the metadata, pass/fail rationale, and raw diffs/stdout. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| "repo_criteria": [ | ||
| "evals/code_quality_rubric.json" | ||
| ], | ||
| "evals": [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the evals structure might need the ability to have a starting configuration state and to specify what that state is. Think skills that warn on dirty git starting state, evaluated skills with particular classes of errors. Different repo formats etc. |
||
| { | ||
| "id": 1, | ||
| "prompt": "Run the evals for the definition-of-done skill.", | ||
| "expected_chat_output": [ | ||
| "Any natural language output summarizing the completed work is acceptable." | ||
| ], | ||
| "expected_repo_state": [ | ||
| "The agent successfully triggered subagents to run the test cases.", | ||
| "There is an artifact with the results.", | ||
| "No files are modified in the parent workspace after the eval is done running (all modifications must be confined to the isolated subagent worktree).", | ||
| "The evaluation artifact includes evals sourced from code_quality_rubric.json for a skill that produces code." | ||
| ], | ||
| "agent_config": "reidbaker-agent" | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "prompt": "Can you test the definition-of-done skill and see if it passes its rubric?", | ||
| "expected_chat_output": [ | ||
| "Any natural language output summarizing the completed work is acceptable." | ||
| ], | ||
| "expected_repo_state": [ | ||
| "There is an artifact with the results.", | ||
| "No files are modified in the parent workspace after the eval is done running (all modifications must be confined to the isolated subagent worktree).", | ||
| "The evaluation artifact includes evals sourced from code_quality_rubric.json for a skill that produces code." | ||
| ], | ||
| "agent_config": "reidbaker-agent" | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "prompt": "Run an A/B benchmark evaluation for the definition-of-done skill, comparing it explicitly against a baseline without the skill.", | ||
| "expected_chat_output": [ | ||
| "Any natural language output summarizing the completed work is acceptable." | ||
| ], | ||
| "expected_repo_state": [ | ||
| "The agent successfully triggered both baseline and with-skill subagents.", | ||
| "There is an artifact with the results.", | ||
| "The evaluation artifact contains explicit sections for both the 'With-Skill Agent' and the 'Baseline Agent'.", | ||
| "No files are modified in the parent workspace after the eval is done running (all modifications must be confined to the isolated subagent worktree)." | ||
| ], | ||
| "agent_config": "reidbaker-agent" | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| You are an expert evaluator. Review the following execution outputs from an AI agent against the provided combined rubric. | ||
|
|
||
| Execution Outputs: | ||
| - Git Diff: <diff> | ||
| - Command Stdout: <test/analyze output> | ||
|
|
||
| Combined Rubric Expectations: | ||
| <combined expectations list> | ||
|
|
||
| For every single expectation, explicitly state whether it PASSED or FAILED and provide a 1-sentence justification. | ||
| IMPORTANT: When an expectation fails, explicitly list the expectation and explain exactly what you found that caused the failure. | ||
|
|
||
| Finally, provide an overall PASS/FAIL grade. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Execute this task: | ||
| - Task: <eval prompt> | ||
| - Input files: <eval files if any, or "none"> | ||
|
|
||
| WARNING: You are executing in an isolated branch workspace. Confine all file modifications strictly to your current working directory. Do NOT use absolute paths to modify files in the parent workspace. | ||
|
|
||
| Once you are done, do not commit. Just send me a message with the `git diff` of your changes, and the output of running verification commands (e.g., `dart format`, `dart analyze`, `dart test`). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Execute this task: | ||
| - Skill path: <path-to-skill> (Please read and STRICTLY FOLLOW the instructions in this skill file before finishing) | ||
| - Task: <eval prompt> | ||
| - Input files: <eval files if any, or "none"> | ||
|
|
||
| WARNING: You are executing in an isolated branch workspace. Confine all file modifications strictly to your current working directory. Do NOT use absolute paths to modify files in the parent workspace. | ||
|
|
||
| Once you are done, do not commit. Just send me a message with the `git diff` of your changes, and the output of running verification commands (e.g., `dart format`, `dart analyze`, `dart test`). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Skill Evaluations | ||
|
|
||
| Architecture, rubrics, and instructions for evaluating AI agent skills authored and maintained in this repository. | ||
| **Note:** These evaluations are essentially unit tests for the skills within the `dart_skills_lint` package and its internal ecosystem. They are *not* intended to be a generic evaluation framework for other agent client plugins or tools outside of this specific domain. | ||
|
|
||
| ## What Should (and Shouldn't) Be Evaluated | ||
|
|
||
| **DO Evaluate:** | ||
| - Core workflows of a skill (e.g., adding a dependency, running validation checks). | ||
| - Specific edge cases that a skill claims to handle (e.g., legacy integration paths without `--fix`). | ||
| - Whether a skill correctly leaves the repository in a compilable, passing state. | ||
|
|
||
| **DO NOT Evaluate:** | ||
| - Trivial syntax formatting that `dart format` already fixes perfectly. | ||
| - Complete system architectures that take longer than a few minutes to generate and verify. | ||
| - Skills that are outside the scope of `dart_skills_lint` (e.g. general flutter app creation). | ||
|
|
||
| ## Core Principles & Architecture | ||
|
|
||
| Evaluations in this repository use a **Two-Tiered Architecture** to separate domain-specific skill requirements from universal skill quality standards. | ||
|
|
||
| ### 1. Per-Skill Evals (`<skill_dir>/evals/evals.json`) | ||
| Each skill maintains an `evals/evals.json` file containing target task prompts and expectations: | ||
| - **`prompt`**: Realistic user prompt testing primary or edge-case workflows. | ||
| - **`expected_chat_output`**: High-level narrative summary of what the LLM should say/give to the user. | ||
| - **`expected_repo_state`**: Array of discrete, testable assertions regarding the end state of the repository and tracked files. | ||
| - **`repo_criteria`**: Array of relative file paths to shared universal quality rubrics (e.g., `["evals/code_quality_rubric.json"]`). | ||
| - **`agent_config`**: The model configuration/harness used when executing the eval against the skill. For published skills, use `"bare-agent"`. For internal contributor skills, use the internal agent profile (e.g., `"reidbaker-agent"`). | ||
|
|
||
| ### 2. Cross-Skill Evals (`evals/*_rubric.json`) | ||
| Universal skill quality expectations are structured into modular rubric classes that apply broadly across skills. | ||
|
|
||
| ## Cross-Cutting Rules | ||
| Skills that author or modify code MUST adhere to the universal code quality expectations defined in `code_quality_rubric.json`. This ensures that generated code compiles cleanly, adheres to Effective Dart, works across platforms, and is placed in standard canonical directories. | ||
|
|
||
|
reidbaker marked this conversation as resolved.
|
||
| ## 🚀 Running & Validating Evals Locally | ||
|
reidbaker marked this conversation as resolved.
|
||
|
|
||
| ### 1. Validate Evals Structural Consistency | ||
| Run the unit test that checks all `evals.json` files for structural consistency across the repository: | ||
|
|
||
| ```bash | ||
| dart test test/skills_evals_test.dart | ||
| ``` | ||
|
|
||
| ### 2. Running Evals via Agent Orchestration | ||
| You should use the `/run-evals` skill to run evaluations. The bulk of the execution logic and prompts are located within the `run-evals` skill itself (`.agents/skills/run-evals/SKILL.md`). The environment, model, and harness are determined by the `agent_config` specified in the corresponding `evals.json` file. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This concept is important but I dont think as authored this eval adds much value. Consider authoring a prompt that should cause this code quality eval to fail. For example a prompt asking to write dart 2 style code or to add a specific line to a file that will cause a lint error then ensure this eval actually catches it. Or maybe we need a data set of examples to run the code quality checks on to make sure they catch examples we have in mind. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "evals": [ | ||
| { | ||
| "id": "compilation_and_health", | ||
| "expected_repo_state": [ | ||
| "The generated code compiles with zero syntax errors.", | ||
|
reidbaker marked this conversation as resolved.
|
||
| "Static analysis passes cleanly ('dart analyze --fatal-infos' returns zero errors or warnings).", | ||
| "Existing and newly added unit, widget, or integration tests execute and pass successfully." | ||
| ] | ||
| }, | ||
| { | ||
| "id": "effective_dart_and_idioms", | ||
| "expected_repo_state": [ | ||
| "Follows Effective Dart style guidelines as enforced by standard 'core' and 'recommended' linter rules.", | ||
| "Leverages Dart 3 idioms such as switch expressions and exhaustive pattern matching when conditional logic branches on algebraic types.", | ||
| "Avoids anti-patterns such as unnecessary dynamic types, raw Strings instead of string interpolation, or unhandled Futures." | ||
| ] | ||
| }, | ||
| { | ||
| "id": "cross_platform_compatibility", | ||
| "expected_repo_state": [ | ||
| "File paths and CLI path parameters use platform-agnostic formatters (package:path or forward slashes '/').", | ||
| "CLI commands and shell invocation scripts use cross-platform compatible syntax.", | ||
| "Avoids hardcoded platform-specific environment paths (such as C:\\ or /usr/local/bin directly)." | ||
| ] | ||
| }, | ||
| { | ||
| "id": "directory_and_placement_hygiene", | ||
| "expected_repo_state": [ | ||
| "Source code must be placed in 'lib/', tests in 'test/', and executable scripts in 'bin/' or 'tool/'.", | ||
| "No temporary scratch files or orphaned directories are left behind after execution." | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bunch of the run specific logic from tool/dart_skills_lint/evals/README.md should instead be in this skill. The readme is for humans and the skill is for agents.
Consider extracting prompts into their own md files under resources in this skill.