Skill: RAG answer faithfulness checks
Evaluate RAG answers for citation presence and contradictions so retrieval systems stay trustworthy.
What to do first
- Capture the triad for every case: question, retrieved chunks, final answer - or the eval is unreproducible.
- Require every non-trivial claim to map to a citation, or be labeled as general knowledge outside the corpus.
- Treat the run as unfinished until there is a faithfulness verdict, a failure-mode label (retrieval / ranking / generation), and the case is archived.
Fluency is cheap. RAG products fail when answers contradict sources, cite decoratively, or hallucinate when retrieval returned nothing. Agents that only score BLEU or “sounds good” miss the product risk.
This skill encodes faithfulness checks agents must run on RAG outputs or eval sets when tuning retrievers, chunking, or answer prompts.
Part 1: Claim-to-citation check

Claim Cite
Evaluate this RAG answer for faithfulness. Do not rewrite the answer yet.
1. List non-trivial claims in the answer.
2. For each: supporting quote from retrieved chunks, or OUTSIDE_CORPUS, or UNSUPPORTED.
3. Flag contradictions between answer and sources.
4. Note decorative citations (cite present, support absent).
QUESTION: [paste]
RETRIEVED CHUNKS: [paste]
ANSWER: [paste]
Part 2: Label the failure mode, then smallest fix

Failure Label
Separate:
| Label | Meaning |
|---|---|
| retrieval | Wrong/empty chunks; answer cannot be faithful to the right docs |
| ranking | Right docs exist but were not top-ranked |
| generation | Chunks were adequate; model invented or contradicted |
Then propose the smallest fix (prompt, chunking, filters, refusal on empty retrieval) and log the case into the suite.
Hard rules:
1. Claims need support or an honest outside-corpus label.
2. Contradiction hunt required.
3. Separate retrieval vs generation fails - do not blame the model for empty retrieval.
4. Empty retrieval → expect refusal or clarify-outside-corpus behavior.
Part 3: Traps this skill must catch

Failure modes to catch early
Read the board. Each card is a stop rule the skill must encode.
A worked example
Invented situation: answer cites Doc A for a refund window but states Doc B’s opposite (14 days vs 30 days). Retrieval included both.
Without the skill: “Answer is clear and well written - pass.”
With the skill: contradiction flag; generation failure (chunks adequate); require prompt rule to prefer explicit policy quotes and surface conflicts; case archived with both chunk ids.
Save it as a skill file
# Skill: rag-faithfulness
## When
- Evaluating RAG answers / tuning retrieval or answer prompts
## Hard rules
1. Claims need support.
2. Contradiction hunt required.
3. Separate retrieval vs generation fails.
## Steps
1. Capture triad (Q, docs, A).
2. Claim→citation + contradiction check.
3. Label failure mode; smallest fix; archive.
## Done when
- Verdict + labeled failure mode + case logged.
Test the skill before you trust it
- Contradictory cite. Answer cites A, states B’s opposite. Pass: fail with evidence.
- Empty retrieval. Pass: requires refusal / outside-corpus behavior.
- Faithful short answer. Pass even if not eloquent.
Related: prompt eval harness skill and vector DB choices.
Common mistakes
- Rewarding verbosity. Longer answers that ignore chunks should score worse.
- One-off fixes. If it is not in the suite, it will regress.
- Missing retrieval logs. Faithfulness without chunks is theater.
You are done when every claim is supported or labeled, the failure mode is named, and the case can be replayed from the archive.
Share