Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
Contributors/Hamel Husain/Write code eval
AI evals

Write code eval

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.

ByHamel HusainHamel Husain + 1Automation builder @ AI Evals Course
name:
write-code-eval
description:
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.

Write a code evaluator

Start 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.

  1. State the rule and identify the trace fields or reference data the check needs. If the rule requires interpretation, use write-judge-prompt.
  2. Implement the check in the project's language and eval framework. Return a result and a reason in the format that framework expects.
  3. 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.

Examples

Failure mode Possible check
Invalid output structure Parse the output and check required fields
Missing or forbidden text Match a string or pattern
Citation not in retrieved documents Compare cited IDs with retrieved IDs
Bad tool call Check arguments against the tool schema or run the call in a safe test environment
Wrong value Compare the output with a reference value

Choose 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.

More in this playbook

QA Itay GuttmanItay Guttman + 1CEO @ engini.ai

Prove it ran

Use this skill when an automation, workflow, scheduled job, webhook handler or integration step has been built or changed and someone needs to know it really works: "test this automation", "did it run", "verify the workflow", "is it working", "QA this integration", "sign off before we turn it on". Produces a verdict per step and per trigger (pass, fail, blocked, not verified), each backed by one specific run record with the evidence quoted and an owner named for every failure.

QA Itay GuttmanItay Guttman + 1CEO @ engini.ai

Review an automation

Use this skill when reviewing a change to an automation, workflow, integration or the code behind one: "review this workflow", "review this PR", "is this safe to ship", "sanity-check my automation". Produces a severity-ranked list of findings, each reproduced against the real thing, with a verdict and a named next owner for every fix.

AI evalsMIT Hamel HusainHamel HusainAutomation builder @ AI Evals Course

Build review interface

Build a custom browser-based annotation interface tailored to your data for reviewing LLM traces and collecting structured feedback. Use when you need to build an annotation tool, review traces, or collect human labels.

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.