skills/llm-evaluation-harness/SKILL.md
Build automated LLM evaluation pipelines with benchmarks, regression tests, RAGAS, and human eval workflows. Activate on: LLM evaluation, benchmark testing, eval pipeline, RAGAS, model regression tests. NOT for: traditional software testing (testing-expert), model training (ai-engineer).
npx skillsauth add curiositech/windags-skills llm-evaluation-harnessInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build automated evaluation pipelines for LLM applications with benchmarks, regression tests, RAG evaluation (RAGAS), and human eval workflows.
Activate on: "evaluate LLM", "benchmark model", "regression test AI", "RAGAS evaluation", "eval pipeline", "LLM quality metrics", "compare model versions", "human evaluation workflow", "test AI responses"
NOT for: Traditional unit/integration testing (testing-expert), model training loops (ai-engineer), or prompt writing (prompt-engineer)
| Domain | Technologies | Notes | |--------|-------------|-------| | RAG Evaluation | RAGAS, DeepEval, custom | Faithfulness, answer relevance, context precision | | LLM-as-Judge | Claude, GPT-4o, Llama 3.1 as evaluators | Rubric-based scoring with calibration | | Exact Match | Regex, JSON schema validation, string match | For structured outputs: classification, extraction | | Human Eval | Argilla, Label Studio, custom UI | Gold-standard quality, expensive, slow | | Benchmarks | MMLU, HumanEval, custom domain benchmarks | Standardized comparison across models | | CI Integration | GitHub Actions, pytest, Vitest | Eval-as-tests with pass/fail thresholds |
Eval Dataset (N test cases)
│
├──→ [Exact Match] ──→ Precision/Recall/F1 (for structured outputs)
│
├──→ [LLM-as-Judge] ──→ Rubric scores 1-5 per dimension
│ │
│ └── Calibrate: run judge on 20 pre-scored examples first
│
├──→ [RAGAS] ──→ Faithfulness, Answer Relevance, Context Precision
│ │
│ └── For RAG systems only; measures retrieval + generation quality
│
└──→ [Human Eval] ──→ Gold-standard labels (sample 10-20%)
│
└── Use for calibrating LLM-as-judge, not as primary method
All results ──→ [Score Aggregation] ──→ [Trend Tracker] ──→ [CI Gate]
# LLM-as-judge evaluation
import json
JUDGE_RUBRIC = """
Score the following response on a scale of 1-5 for each dimension:
- **Correctness** (1-5): Is the information factually accurate?
- **Completeness** (1-5): Does it address all parts of the question?
- **Clarity** (1-5): Is it well-organized and easy to understand?
Question: {question}
Expected: {expected}
Response: {response}
Return JSON: {{"correctness": N, "completeness": N, "clarity": N, "reasoning": "..."}}
"""
async def evaluate_with_judge(test_cases: list[dict], model_output_fn) -> dict:
results = []
for case in test_cases:
response = await model_output_fn(case["question"])
judge_prompt = JUDGE_RUBRIC.format(
question=case["question"],
expected=case["expected"],
response=response
)
scores = await llm_call(judge_prompt, model="claude-sonnet-4-20250514", temperature=0)
results.append(json.loads(scores))
# Aggregate
return {
dim: sum(r[dim] for r in results) / len(results)
for dim in ["correctness", "completeness", "clarity"]
}
Test Case: (question, ground_truth, retrieved_contexts)
│
├──→ Faithfulness: Is the answer supported by retrieved contexts?
│ Score = (claims supported by context) / (total claims in answer)
│
├──→ Answer Relevance: Does the answer address the question?
│ Score = cosine_sim(question, generated_questions_from_answer)
│
├──→ Context Precision: Are relevant contexts ranked higher?
│ Score = weighted precision of relevant contexts in top-k
│
└──→ Context Recall: Were all ground-truth facts retrievable?
Score = (ground_truth_claims in contexts) / (total ground_truth_claims)
# RAGAS evaluation
from ragas import evaluate
from ragas.metrics import faithfulness, answer_relevancy, context_precision
from datasets import Dataset
eval_dataset = Dataset.from_dict({
"question": questions,
"answer": generated_answers,
"contexts": retrieved_contexts,
"ground_truth": expected_answers,
})
result = evaluate(eval_dataset, metrics=[
faithfulness, answer_relevancy, context_precision
])
print(result) # {'faithfulness': 0.87, 'answer_relevancy': 0.92, ...}
On PR / prompt change:
│
▼
[Run eval suite] ──→ scores
│
▼
[Compare to baseline]
├── Score >= baseline - tolerance (2%) ──→ PASS (merge allowed)
└── Score < baseline - tolerance ──→ FAIL (block merge)
│
└── Report: which test cases regressed, by how much
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.