界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

eval-guide

eval-guide

【数据与研究】Use when writing eval code, configuring eval infrastructure, creating golden datasets, setting up PromptRegistry, authoring CI eval gates, or working with any eval tool: DeepEval, Ragas, Giskard OSS v3, Promptfoo, Langfuse, Arize Phoenix, adk eval, ADK User Simulation, Vertex GenAI Eval. Covers per-agent accuracy thresholds, CI tier structure (R1-R4)…

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: eval-guide description: "Use when writing eval code, configuring eval infrastructure, creating golden datasets, setting up PromptRegistry, authoring CI eval gates, or working with any eval tool: DeepEval, Ragas, Giskard OSS v3, Promptfoo, Langfuse, Arize Phoenix, adk eval, ADK User Simulation, Vertex GenAI Eval. Covers per-agent accuracy thresholds, CI tier structure (R1-R4), MCP eval suites, golden dataset structure, and PromptRegistry architecture. Also covers pytest harness configuration (asyncio_mode, InMemoryRunner, parametrize-over-golden)." allowed-tools: Bash, Read, Write, Edit metadata: triggers: deepeval, ragas, giskard, promptfoo, langfuse, phoenix, PromptRegistry, golden dataset, evalset, eval-smoke, eval-adk, redteam, MCPUseMetric, Faithfulness, ToolCallAccuracy, HallucinationsV1, tests/golden, dataset_manifest, seed-prompts, R1 gate, R2 nightly, R3 pre-release, R4 canary, ci tier, eval threshold, ArenaGEval, GeminiModel judge, set_default_generator, promptfooconfig.yaml, Scenario, Suite, make eval-all-local, make redteam-promptfoo, make giskard-scan, make mcp-eval-all, make seed-prompts-local, eval-reviewer, per-agent threshold, golden case, asyncio_mode, InMemoryRunner, pytest-asyncio, dataset_manifest.yaml, diff_langfuse_prompts, emergency pack, prompt registry, prompt lifecycle related-skills: google-adk, adk-eval-guide, python-dev, adk-observability-guide domain: agentic-ai role: specialist scope: evaluation output-format: code last-reviewed: "2026-04-28"

Eval Guide

Iron Law

NEVER generate eval tool code from memory. ALWAYS query Context7 MCP for the official API before writing any eval code. Every metric class name, constructor signature, and YAML provider ID must be verified against current official docs — these APIs change between minor versions.

Prefer LangChain-free eval paths. Ragas, Giskard, and Promptfoo all have LangChain-free paths — prefer them to reduce dependency surface and avoid version conflicts.

Consistent LLM judge. Best practice: use the same LLM provider as your main stack for LLM-as-judge to reduce vendor sprawl. For Gemini-based stacks: GeminiModel("gemini-2.5-flash") for DeepEval, Generator(model="google/gemini-3.1-flash") for Giskard, google:gemini-2.5-pro for Promptfoo.

Dispatch eval-reviewer agent after writing any eval code — same mandate as dispatching adk-reviewer after ADK agent code.

Documentation Sources — Query Context7 BEFORE Writing Any Tool Code

ToolContext7 queryFallback
DeepEvaldeepevalhttps://docs.confident-ai.com/docs
Ragasragashttps://docs.ragas.io/en/latest
Giskard OSS v3giskardhttps://docs.giskard.ai/en/latest
Promptfoopromptfoohttps://www.promptfoo.dev/docs
Langfuselangfusehttps://langfuse.com/docs
Arize Phoenixarize-phoenixhttps://docs.arize.com/phoenix
ADK Evalgoogle-adk (adk-docs MCP)https://google.github.io/adk-docs/evaluate
Vertex GenAI Evalgoogle-cloud-aiplatformhttps://cloud.google.com/vertex-ai/generative-ai/docs/evaluate
pytest-asynciopytest-asynciohttps://pytest-asyncio.readthedocs.io

Reference Files

FileWhen to use
reference/deepeval-patterns.mdMCPUseMetric, GeminiModel, 15 confirmed metric classes, ArenaGEval A/B testing
reference/ragas-patterns.mdToolCallAccuracy, Faithfulness, ContextPrecision — LangChain-free path only
reference/promptfoo-patterns.mdYAML config, google:gemini-2.5-pro provider, 70+ red-team plugins, MCP security suite
reference/giskard-patterns.mdv3 Scenario/Suite API, LiteLLM Gemini setup, FHA check, RAGET v2-only warning
reference/langfuse-prompts.mdPromptRegistry abstraction, prompt lifecycle, .compile(), emergency pack, drift detection
reference/golden-dataset.md8-folder structure, dataset_manifest.yaml schema, per-agent case minimums
reference/ci-tiers.mdR1-R4 tier config, pytest marks (@r1/@r2), path-routing rules, 9 CI blockers reference
reference/per-agent-thresholds.mdPer-agent accuracy thresholds for all 14 agents, habitability 100% sub-threshold
reference/mcp-eval-patterns.mdMCP contract suite, tenant isolation test pattern, audit-log verification
reference/pytest-harness.mdasyncio_mode = "auto", conftest.py template, InMemoryRunner, parametrize-over-golden
reference/failure-mode-taxonomy.md6 failure modes with symptom → eval tool routing table; fix patterns per mode

Process — Before Writing Any Eval Code

  1. Identify which tool(s) are needed
  2. Query Context7 for that tool's current API — the reference files are starting points, NOT the final authority on API signatures
  3. Read the relevant reference file for patterns and gotchas
  4. Check reference/per-agent-thresholds.md for the target agent's required thresholds
  5. Check reference/golden-dataset.md for dataset structure and minimum case counts
  6. Mark every test with @pytest.mark.r1 (PR gate) or @pytest.mark.r2 (nightly) — never unmarked
  7. After implementation: dispatch eval-reviewer agent

Make Targets Quick Reference

TargetWhat it runsWhen to use
make eval-smokeLint + types + 1-2 eval cases for changed agent + prompt schema checkEvery PR (< 30s)
make eval-adkadk eval against all tests/golden/agents/*/golden.evalset.jsonFull ADK eval
make eval-deepevaluv run pytest -m eval -k deepevalDeepEval metric runs
make eval-ragasuv run pytest -m eval -k ragasRAG metric runs
make redteam-promptfoonpx promptfoo eval -c tests/eval/promptfoo/Red-team + regression
make giskard-scan AGENT=<name>Targeted Giskard scan → reports/giskard/<agent>.htmlSecurity scan
make mcp-eval-allContract + auth + behavior + security suites for MCP serverMCP eval
make eval-all-localAll of the above in sequenceFull local validation
make seed-prompts-localSeeds prompts into local Langfuse with label="development"Prompt registry setup
make diff-prompts-stagingDetects Git ↔ Langfuse prompt driftPre-release check
make phoenix-experiment AGENT=<name>Phoenix run_experiment() against golden datasetTrace replay eval
make mcp-inspectLaunches @modelcontextprotocol/inspector against local MCPInteractive MCP debug
make eval-multiturn AGENT=<name>ADK User Simulation multi-turn flowsMulti-turn eval
make update-mcp-hashesRegenerates mcp/.tool-surface-hashes.jsonAfter MCP tool changes

Golden Dataset Minimum Requirements (Day-1)

Agent/SuiteMinimum casesLocation
Primary agent (highest-risk)≥ 8 Day-1 → ≥ 100 full targettests/golden/agents/<agent>/
Secondary agents≥ 8 Day-1 → ≥ 20 full targettests/golden/agents/<agent>/
Security suite≥ 1 each: prompt_injection, tenant_isolation, policy_bypasstests/golden/security/
All other agents≥ 20 before agent PR mergestests/golden/agents/<agent>/
RAG agents≥ 10 faithfulness casestests/golden/rag/
MCP contract≥ 1 per tooltests/golden/mcp/

Related Skills

  • adk-eval-guide — ADK-native eval only (8 ADK criteria, evalset schema, user simulation)
  • google-adk — ADK agent construction patterns
  • adk-observability-guide — Phoenix OTel integration, span inspection
我的收藏