Skill Tracer
Skills › Evals Skills › write-code-eval

write-code-eval

skill · 27 lines · Apache-2.0 · skills/write-code-eval/SKILL.md

The facts

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

The description the agent reads to decide when to use it.

From its settingsline 3

When it starts

The agent picks this skill when someone wants to write a code-based evaluator for a failure mode whose rule is objective and checkable from a trace, such as output structure, string matching, or comparison against a reference. It is chosen over the judge-prompt skill when the rule does not need interpretation.

Things a person might say (the model's guesses)

  • “I found a failure mode where the model returns JSON with missing fields — can you write a check for that?”
  • “Help me write a code evaluator for bad tool calls.”
  • “Can I check with code whether the cited documents were actually retrieved?”

A model's summary of when it is used.

A model's reading

What it leads to

Other skills this one hands off to, calls, requires or offers instead, as a model read them.

A model's reading

What leads to it

Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.

A model's reading

Licence

Apache-2.0, from LICENSE

The terms its author shares it under, which let it be shown here.

From the repositorylicence text
Other files in this skill (1) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: write-code-eval
3description: >
4 Write code evaluators for known failure modes with objective rules. Use when
5 code can check the rule from a trace, with or without a reference answer.
6 Use `write-judge-prompt` when the rule requires interpretation.
7---
8
9# Write a code evaluator
11Start 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.
131. State the rule and identify the trace fields or reference data the check needs. If the rule requires interpretation, use `write-judge-prompt`.
142. Implement the check in the project's language and eval framework. Return a result and a reason in the format that framework expects.
153. 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.

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.
Raw lines 1 to 16
Names a skill error-discovery :11
Names a skill write-judge-prompt :13
Names a skill validate-evaluator :15
17## Examples
19| Failure mode | Possible check |
20|---|---|
21| Invalid output structure | Parse the output and check required fields |
22| Missing or forbidden text | Match a string or pattern |
23| Citation not in retrieved documents | Compare cited IDs with retrieved IDs |
24| Bad tool call | Check arguments against the tool schema or run the call in a safe test environment |
25| Wrong value | Compare the output with a reference value |
27Choose 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.

Examples

Failure modePossible check
Invalid output structureParse the output and check required fields
Missing or forbidden textMatch a string or pattern
Citation not in retrieved documentsCompare cited IDs with retrieved IDs
Bad tool callCheck arguments against the tool schema or run the call in a safe test environment
Wrong valueCompare 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.

Raw lines 17 to 27

From ai-evals-course/evals-skills at 80d5f7b, 2026-09-24. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.