Skill Tracer
Skills › Evals Skills › write-judge-prompt

write-judge-prompt

skill · 144 lines · Apache-2.0 · skills/write-judge-prompt/SKILL.md

The facts

Its description

Design LLM-as-Judge evaluators for subjective criteria that code-based checks cannot handle. Use when a failure mode requires interpretation (tone, faithfulness, relevance, completeness). Do NOT use when the failure mode can be checked with code (regex, schema validation, execution tests); use `write-code-eval`. To validate an existing judge, use `validate-evaluator`.

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

From its settingsline 3

When it starts

The agent picks this skill when the user needs an LLM-as-Judge evaluator for a subjective failure mode that code-based checks cannot cover, such as tone, faithfulness, relevance or completeness. It is not for failure modes that regex, schema validation or execution tests can catch, and not for validating a judge that already exists.

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

  • “I need a judge that decides whether our support replies match the customer's tone”
  • “How do I write an LLM-as-judge prompt for answer faithfulness?”
  • “Our completeness failure mode can't be caught with regex — help me build a judge for it”

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-judge-prompt
3description: >
4 Design LLM-as-Judge evaluators for subjective criteria that code-based checks
5 cannot handle. Use when a failure mode requires interpretation (tone,
6 faithfulness, relevance, completeness). Do NOT use when the failure mode can be
7 checked with code (regex, schema validation, execution tests); use
8 `write-code-eval`. To validate an existing judge, use `validate-evaluator`.
9---
11# Write LLM-as-Judge Prompt
13Design a binary Pass/Fail LLM-as-Judge evaluator for one specific failure mode. Each judge checks exactly one thing.

Write LLM-as-Judge Prompt

Design a binary Pass/Fail LLM-as-Judge evaluator for one specific failure mode. Each judge checks exactly one thing.

Raw lines 1 to 14
Names a skill write-code-eval :8
15## Prerequisites
18- You have human-labeled traces for this failure mode (at least 20 Pass and 20 Fail examples).
19- A code-based evaluator cannot check this failure mode. Exhaust code-based options before reaching for a judge — many failure modes that seem subjective reduce to keyword checks, regex, or API calls when you understand the domain. Example: detecting whether an AI interviewing coach suggests "general" questions (asking about typical behavior instead of a specific past event) seems to require semantic understanding, but in practice a keyword check for words like "usually," "typical," and "normally" could work quite well.

Prerequisites

  • Error analysis is complete. The failure mode is identified.
  • You have human-labeled traces for this failure mode (at least 20 Pass and 20 Fail examples).
  • A code-based evaluator cannot check this failure mode. Exhaust code-based options before reaching for a judge — many failure modes that seem subjective reduce to keyword checks, regex, or API calls when you understand the domain. Example: detecting whether an AI interviewing coach suggests "general" questions (asking about typical behavior instead of a specific past event) seems to require semantic understanding, but in practice a keyword check for words like "usually," "typical," and "normally" could work quite well.
Raw lines 15 to 20
Names a skill error-discovery :17
21## The Four Components
23Every judge prompt requires exactly four components:

The Four Components

Every judge prompt requires exactly four components:

Raw lines 21 to 24
25### 1. Task and Evaluation Criterion
27State what the judge evaluates. One failure mode per judge.
29```
30You are an evaluator assessing whether a real estate assistant's email
31uses the appropriate tone for the client's persona.
32```
34Not: "Evaluate whether the email is good" or "Rate the email quality from 1-5."

1. Task and Evaluation Criterion

State what the judge evaluates. One failure mode per judge.

You are an evaluator assessing whether a real estate assistant's email
uses the appropriate tone for the client's persona.

Not: "Evaluate whether the email is good" or "Rate the email quality from 1-5."

Raw lines 25 to 35
36### 2. Pass/Fail Definitions
38Outcomes are strictly binary: Pass or Fail. No Likert scales, no letter grades, no partial credit. Define exactly what constitutes Pass and Fail. These definitions come from your error analysis failure mode descriptions.
40```
41## Definitions
43PASS: The email matches the expected communication style for the client persona:
44- Luxury Buyers: formal language, emphasis on exclusive features, premium
45 market positioning, no casual slang
46- First-Time Homebuyers: warm and encouraging tone, educational explanations,
47 avoids jargon, patient and supportive
48- Investors: data-driven language, ROI-focused, market analytics, concise
49 and professional
51FAIL: The email uses a tone mismatched to the client persona. Examples:
52- Using casual slang ("hey, check out this pad!") for a luxury buyer
53- Using heavy financial jargon for a first-time homebuyer
54- Using overly emotional language for an investor
55```

2. Pass/Fail Definitions

Outcomes are strictly binary: Pass or Fail. No Likert scales, no letter grades, no partial credit. Define exactly what constitutes Pass and Fail. These definitions come from your error analysis failure mode descriptions.

## Definitions

PASS: The email matches the expected communication style for the client persona:
- Luxury Buyers: formal language, emphasis on exclusive features, premium
  market positioning, no casual slang
- First-Time Homebuyers: warm and encouraging tone, educational explanations,
  avoids jargon, patient and supportive
- Investors: data-driven language, ROI-focused, market analytics, concise
  and professional

FAIL: The email uses a tone mismatched to the client persona. Examples:
- Using casual slang ("hey, check out this pad!") for a luxury buyer
- Using heavy financial jargon for a first-time homebuyer
- Using overly emotional language for an investor
Raw lines 36 to 56
57### 3. Few-Shot Examples
59Include labeled Pass and Fail examples from your human-labeled data.
61```
62## Examples
64### Example 1: PASS
65Client Persona: Luxury Buyer
66Email: "Dear Mr. Harrington, I am pleased to present an exclusive listing
67at 1200 Pacific Heights Drive. This distinguished property features..."
68Critique: The email opens with a formal salutation and uses language
69consistent with luxury positioning — "exclusive listing," "distinguished
70property." No casual slang or informal phrasing. The tone matches the
71luxury buyer persona throughout.
72Result: Pass
74### Example 2: FAIL
75Client Persona: Luxury Buyer
76Email: "Hey! Just found this awesome place you might like. It's got a
77pool and stuff, super cool neighborhood..."
78Critique: The greeting "Hey!" is informal. Phrases like "awesome place,"
79"got a pool and stuff," and "super cool" are casual slang inappropriate
80for a luxury buyer. The email reads like a text message, not a
81professional communication for a high-end client.
82Result: Fail
84### Example 3: PASS (borderline)
85Client Persona: First-Time Homebuyer
86Email: "Hi Sarah, I found a property that might be a great fit for your
87first home. The neighborhood has good schools nearby, and the monthly
88payment would be similar to what you're currently paying in rent..."
89Critique: The greeting is warm but not overly casual. The email explains
90the property in relatable terms — comparing mortgage to rent, mentioning
91schools — which is educational without being condescending. It avoids
92jargon like "amortization" or "LTV ratio." While not deeply technical,
93this matches the supportive tone expected for a first-time buyer.
94Result: Pass
95```
97**Rules for selecting examples:**
98- Include at least one clear Pass, one clear Fail, and one borderline case. Borderline examples are the most valuable — they teach nuance.
99- Draw examples from the training split (10-20% of labeled data set aside for this purpose).
100- Any example used in the judge prompt must be excluded from dev and test sets. Using dev/test examples is data leakage.
101- 2-4 examples is typical. Performance plateaus after 4-8.

3. Few-Shot Examples

Include labeled Pass and Fail examples from your human-labeled data.

## Examples

### Example 1: PASS
Client Persona: Luxury Buyer
Email: "Dear Mr. Harrington, I am pleased to present an exclusive listing
at 1200 Pacific Heights Drive. This distinguished property features..."
Critique: The email opens with a formal salutation and uses language
consistent with luxury positioning — "exclusive listing," "distinguished
property." No casual slang or informal phrasing. The tone matches the
luxury buyer persona throughout.
Result: Pass

### Example 2: FAIL
Client Persona: Luxury Buyer
Email: "Hey! Just found this awesome place you might like. It's got a
pool and stuff, super cool neighborhood..."
Critique: The greeting "Hey!" is informal. Phrases like "awesome place,"
"got a pool and stuff," and "super cool" are casual slang inappropriate
for a luxury buyer. The email reads like a text message, not a
professional communication for a high-end client.
Result: Fail

### Example 3: PASS (borderline)
Client Persona: First-Time Homebuyer
Email: "Hi Sarah, I found a property that might be a great fit for your
first home. The neighborhood has good schools nearby, and the monthly
payment would be similar to what you're currently paying in rent..."
Critique: The greeting is warm but not overly casual. The email explains
the property in relatable terms — comparing mortgage to rent, mentioning
schools — which is educational without being condescending. It avoids
jargon like "amortization" or "LTV ratio." While not deeply technical,
this matches the supportive tone expected for a first-time buyer.
Result: Pass

Rules for selecting examples:

  • Include at least one clear Pass, one clear Fail, and one borderline case. Borderline examples are the most valuable — they teach nuance.
  • Draw examples from the training split (10-20% of labeled data set aside for this purpose).
  • Any example used in the judge prompt must be excluded from dev and test sets. Using dev/test examples is data leakage.
  • 2-4 examples is typical. Performance plateaus after 4-8.
Raw lines 57 to 102
103### 4. Structured Output Format
105Enforce structured output using your LLM provider's schema enforcement (e.g., `response_format` in OpenAI, tool definitions in Anthropic) or a library like Instructor or Outlines. If the provider doesn't support schema enforcement, specify the JSON schema in the prompt.
107The output must include a critique before the verdict. Placing the critique first forces the judge to articulate its assessment before committing to a decision.
109```json
111 "critique": "string — detailed assessment of the output against the criterion",
112 "result": "Pass or Fail"
114```
116Critiques must be detailed, not terse. A good critique explains what specifically was correct or incorrect and references concrete evidence from the output. The critiques in your few-shot examples set the bar for the level of detail the judge will produce.

4. Structured Output Format

Enforce structured output using your LLM provider's schema enforcement (e.g., response_format in OpenAI, tool definitions in Anthropic) or a library like Instructor or Outlines. If the provider doesn't support schema enforcement, specify the JSON schema in the prompt.

The output must include a critique before the verdict. Placing the critique first forces the judge to articulate its assessment before committing to a decision.

{
  "critique": "string — detailed assessment of the output against the criterion",
  "result": "Pass or Fail"
}

Critiques must be detailed, not terse. A good critique explains what specifically was correct or incorrect and references concrete evidence from the output. The critiques in your few-shot examples set the bar for the level of detail the judge will produce.

Raw lines 103 to 117
118## Choosing What to Pass to the Judge
120Feed only what the judge needs for an accurate decision:
122| Failure Mode | What the Judge Needs |
123|-------------|---------------------|
124| Tone mismatch | Client persona + generated email |
125| Answer faithfulness | Retrieved context + generated answer |
126| SQL correctness | User query + generated SQL + schema |
127| Instruction following | System prompt rules + generated response |
128| Tool call justification | Conversation history + tool call + tool result |
130For long documents, feed only the relevant snippet, not the entire document.

Choosing What to Pass to the Judge

Feed only what the judge needs for an accurate decision:

Failure ModeWhat the Judge Needs
Tone mismatchClient persona + generated email
Answer faithfulnessRetrieved context + generated answer
SQL correctnessUser query + generated SQL + schema
Instruction followingSystem prompt rules + generated response
Tool call justificationConversation history + tool call + tool result

For long documents, feed only the relevant snippet, not the entire document.

Raw lines 118 to 131
132## Model Selection
134Start with the most capable model available. The same model used for the main task works as judge (the judge performs a different, narrower task). Optimize for cost later once alignment is confirmed.

Model Selection

Start with the most capable model available. The same model used for the main task works as judge (the judge performs a different, narrower task). Optimize for cost later once alignment is confirmed.

Raw lines 132 to 135
136## Anti-Patterns
138- **Vague criteria like "is this helpful?"** Target a specific, observable failure mode from error analysis.
139- **Holistic judge for the entire trace.** A single judge covering multiple dimensions produces unactionable verdicts.
140- **No few-shot examples.** Without examples, the model won't know what counts as a failure in your application.
141- **Dev/test examples used as few-shot.** This is data leakage. Use only the training split.
142- **Likert scales (1-5, letter grades, etc.).** Binary pass/fail only. Likert scales produce scores that sound precise but can't be calibrated: annotators disagree on the difference between a 3 and a 4, and the judge inherits that noise. Binary forces you to define a clear decision boundary upfront, which makes inter-annotator agreement measurable and the judge's errors actionable. If you need to capture severity, use multiple binary judges (e.g., "factually wrong" and "dangerously wrong") rather than one ordinal scale.
143- **Skipping validation.** Measure alignment with human labels using validate-evaluator before trusting the judge.
144- **Judges for specification failures without fixing the prompt first.** If the prompt never asked for the behavior, add the instruction before building an evaluator. For critical requirements, a judge can still serve as a regression guard.

Anti-Patterns

  • Vague criteria like "is this helpful?" Target a specific, observable failure mode from error analysis.
  • Holistic judge for the entire trace. A single judge covering multiple dimensions produces unactionable verdicts.
  • No few-shot examples. Without examples, the model won't know what counts as a failure in your application.
  • Dev/test examples used as few-shot. This is data leakage. Use only the training split.
  • Likert scales (1-5, letter grades, etc.). Binary pass/fail only. Likert scales produce scores that sound precise but can't be calibrated: annotators disagree on the difference between a 3 and a 4, and the judge inherits that noise. Binary forces you to define a clear decision boundary upfront, which makes inter-annotator agreement measurable and the judge's errors actionable. If you need to capture severity, use multiple binary judges (e.g., "factually wrong" and "dangerously wrong") rather than one ordinal scale.
  • Skipping validation. Measure alignment with human labels using validate-evaluator before trusting the judge.
  • Judges for specification failures without fixing the prompt first. If the prompt never asked for the behavior, add the instruction before building an evaluator. For critical requirements, a judge can still serve as a regression guard.
Raw lines 136 to 144
Names a skill validate-evaluator :143

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.