Tooluck logoTooluck
SKILL.md

write-code-eval

Agent skill fromai-evals-course/evals-skills

Write code evaluators for known failure modes with objective rules. Use when code can check the rule from a trace, with or without a reference answer. Use `write-judge-prompt` when the rule requires interpretation.

How to install write-code-eval

install write-code-eval
# install the evals-skills pack with the skills CLI
npx skills add ai-evals-course/evals-skills

# or add only this skill to Claude Code: copy the folder

skills/write-code-eval/

# into

~/.claude/skills/write-code-eval/ (all projects)

.claude/skills/write-code-eval/ (one project)

skills/write-code-eval/SKILL.md

Apache-2.0Full file
1# Write a code evaluator
2
3Start with a failure mode found through error analysis. Write one check for that failure mode, much like a unit test that asserts what should hold for each trace.
4
51. State the rule and identify the trace fields or reference data the check needs. If the rule requires interpretation, use `write-judge-prompt`.
62. Implement the check in the project's language and eval framework. Return a result and a reason in the format that framework expects.
73. Test known passes and failures, including borderline cases. Run the check on available traces and inspect mistakes. If the rule uses a proxy for human judgment, compare its results with human labels.
8
9## Examples
10
11| Failure mode | Possible check |
12|---|---|
13| Invalid output structure | Parse the output and check required fields |
14| Missing or forbidden text | Match a string or pattern |
15| Citation not in retrieved documents | Compare cited IDs with retrieved IDs |
16| Bad tool call | Check arguments against the tool schema or run the call in a safe test environment |
17| Wrong value | Compare the output with a reference value |
18
19Choose the check from the failure rule. For a failure with both objective and interpretive parts, check the objective part with code and use a judge for the rest.

Excerpt shown under the repository's Apache-2.0 license.

More skills in evals-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates