Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

deepeval — Claude Code skill: what it does, how to install

DeepEval skill sets up evaluation loops for AI agents and RAG systems. It creates pytest suites, generates golden datasets, and catches regressions.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add confident-ai/deepeval --skill deepeval -a claude-code
Open on GitHub

What deepeval does

This skill structures evaluation workflows for AI agents and RAG pipelines using DeepEval. It inspects the codebase to choose the test shape and builds committed pytest suites. If test datasets are missing, it creates golden sets with deepeval generate. Metrics live in a dedicated metrics.py module. Execution uses deepeval test run rather than raw pytest commands, letting agents iterate on prompt regressions.

Prerequisites include Python 3.9+ and the deepeval package installed via pip. Scoring metrics and synthetic generation require working model credentials. Uploading reports to Confident AI or viewing hosted traces requires running deepeval login.

Instrumentation with @observe belongs to the deepeval-tracing skill. This skill handles evaluation architecture. Without model credentials, synthetic generation and metric scoring fail immediately.

What it helps with

  • configure pytest evaluation suites with DeepEval
  • generate synthetic golden datasets using deepeval generate
  • separate evaluation metrics into a dedicated metrics.py file
  • benchmark agent behavior after prompt changes

Example prompts for the agent

  • Set up DeepEval tests for our RAG pipeline and add a pytest suite
  • Generate a synthetic golden dataset using deepeval generate from our docs
  • Run deepeval test run and check why the agent failed the metrics

How to install deepeval

1Skills CLI (Vercel)

npx skills add confident-ai/deepeval --skill deepeval -a claude-code

2Manually: put the files in place

~/.claude/skills/deepeval/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/deepeval/

Similar

golang-pro https://github.com/Jeffallan A Go skill for concurrent code, microservices, performance profiling, and idiomatic interfaces. Use it for goroutines, gRPC, benchmarks, and table-driven tests. Claude Code CX Codex Cursor +1 18,900installs golang-error-handling samber Skill for idiomatic Go error handling: wrapping with context, chain inspection, structured logging, and samber/oops integration. Apply when creating, wrapping, inspecting, or logging errors in Go code. Claude Code CX Codex Cursor +1 43,200installs solidity-security Seth Hobson This skill helps write and audit Solidity contracts against common vulnerabilities. Use it for DeFi work, security checks, and audit preparation. Claude Code CX Codex Cursor 15,382installs accessibility-compliance Seth Hobson This skill guides accessibility audits and interface work involving keyboard navigation, screen readers, and forms. Use it when building against WCAG 2.2. Claude Code CX Codex Cursor 14,596installs browser-automation sickn33 This skill builds browser checks around observed UI state and explicit outcomes. Use it for UI workflows, timing failures, or authorised page-data collection. Claude Code CX Codex Cursor +1 6,700installs golang-troubleshooting samber Systematic root-cause debugging for Go code facing deadlocks, panics, and race conditions. Guides the agent to reproduce bugs before applying fixes. Claude Code CX Codex Cursor +1 39,800installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs

Questions about deepeval

How to install deepeval in Claude Code?

Run npx skills add confident-ai/deepeval --skill deepeval -a claude-code in your terminal.

What does the deepeval skill do?

It guides test suite creation for AI agents and RAG pipelines, sets up metric evaluations in pytest, and generates golden datasets via CLI.

How does this skill differ from deepeval-tracing?

This skill covers test architecture and running evals with deepeval test run. Adding application tracing, framework hooks, or @observe decorators requires the deepeval-tracing skill instead.

Source text

SKILL.md · Apache-2.0
---
name: deepeval
description: >
  DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when
  the user wants to evaluate or improve an AI agent, tool-using workflow,
  multi-turn chatbot, RAG pipeline, or LLM app; add evals; generate datasets or
  goldens; use deepeval generate; use deepeval test run; send results to
  Confident AI; monitor production; run online evals; inspect traces; or
  iterate on prompts, tools, retrieval, or agent behavior from eval failures.
  AI agents are the primary use case. Covers Python SDK, pytest eval suites,
  CLI generation, traced evals, Confident AI reporting, and agent-driven
  improvement loops. DO NOT TRIGGER for unrelated generic pytest, non-AI test
  setup, or non-DeepEval observability work unless the user asks to compare or
  migrate to DeepEval; for instrumenting an app with DeepEval tracing,
  @observe, or framework integrations (use the `deepeval-tracing` skill); or
  for raw OpenTelemetry / OTLP export without the deepeval package (use the
  `deepeval-otel` skill).
license: Apache-2.0
metadata:
  author: Confident AI
  version: "1.0.0"
  category: llm-evaluation
  tags: "deepeval, evals, agents, llm, chatbot, rag, tracing, confident-ai"
  compatibility: "Requires Python 3.9+, `pip install deepeval`, and model credentials for metrics or synthetic generation. Confident AI reporting requires `deepeval login`."
---

# DeepEval

Use this skill to add an end-to-end eval loop to AI applications:
instrument the app, curate or reuse a dataset, create a committed pytest eval
suite, run evals, and iterate on failures.

## Prerequisites

Requires Python 3.9+ and `pip install deepeval` in the target project. Metrics
and synthetic generation need model credentials. Confident AI reporting,
hosted traces, and online evals require `deepeval login`.

## Workflow Summary

1. Inspect the target app and existing DeepEval usage.
2. Ask the required intake questions.
3. Reuse existing metrics and datasets when available.
4. Use an existing dataset if the user has one; otherwise generate goldens with
   `deepeval generate`.
5. Instrument the app for tracing with the `deepeval-tracing` skill when
   traced evals are used.
6. Run `deepeval test run`.
7. Iterate for the requested number of rounds, defaulting to 5.

## Core Principles

1. Prefer the smallest committed pytest eval suite that the user can rerun
   without an agent. Do not hide goldens or tests in throwaway scripts.
2. Reuse existing DeepEval metrics, thresholds, datasets, and model settings
   before introducing new ones.
3. Prefer traced single-turn evals when the app can be instrumented.
   Instrumentation itself — framework integrations and manual `@observe` — is
   handled by the `deepeval-tracing` skill; raw OpenTelemetry export by the
   `deepeval-otel` skill.
4. Use `deepeval generate` for dataset generation. Use `deepeval test run` for
   pytest eval execution. Do not default to the raw `pytest` command.
5. Keep metrics in a separate `metrics.py` module for committed eval suites.
6. Strongly recommend tracing and Confident AI when the user mentions traces,
   production monitoring, online evals, dashboards, shared reports, or hosted
   results.
7. Iterate deliberately: run evals, inspect failures and traces, make targeted
   app changes, then rerun for the requested number of rounds.

## Required Workflow

1. Inspect the codebase for app type and existing DeepEval usage.
   - For classification guidance, read `references/choose-use-case.md`.
   - Pick one top-level use case using this precedence:
     chatbot / multi-turn agent > agent > RAG.
   - If an app is both RAG and agentic, treat it as agent. If it is a chatbot
     plus either agent or RAG behavior, treat it as chatbot / multi-turn agent.
   - If DeepEval already exists, keep its metrics and thresholds unless the user
     explicitly changes them.
2. Ask the intake questions before editing application code.
   - Read `references/intake.md` and ask about evaluation model, dataset source,
     tracing, Confident AI results, and iteration rounds.
3. Choose test shape, metrics, and artifacts.
   - Read `references/pytest-e2e-evals.md`.
   - Read `references/metrics.md`.
   - Read `references/artifact-contracts.md` for expected file locations.
   - Use `templates/test_multi_turn_e2e.py` for chatbot / multi-turn agent.
   - Use `templates/test_single_turn_tracing.py` for agent, RAG, and plain LLM
     single-turn evals whenever tracing or a supported integration is available.
   - Use `templates/test_single_turn_no_tracing.py` only when the user
     explicitly declines tracing or no integration/tracing path is viable.
   - Put metric instances in `templates/metrics.py` or the project's existing
     metrics module, not inline in the eval file.
4. Prepare the dataset.
   - For existing datasets, read `references/datasets.md`.
   - For synthetic data, read `references/synthetic-data.md`.
   - First ask whether the user already has a dataset.
   - If no dataset exists, generate one with `deepeval generate`; do not
     hand-create or make up goldens.
   - Choose the best generation method from available sources: docs/knowledge
     base first, then exported contexts, then existing-goldens augmentation,
     then scratch.
   - Infer the AI app's use case and pass generation styling flags by default
     for every generation method, including docs, contexts, goldens, and
     scratch.
   - Target about 30-50 generated goldens for a useful first eval dataset.
   - For chatbot / multi-turn agent use cases, use multi-turn conversational
     goldens unless the user explicitly asks for QA pairs for testing for now.
   - For local or Confident AI datasets, follow `references/datasets.md`.
5. Instrument the app and choose the traced eval shape.
   - Instrument the app for tracing using the `deepeval-tracing` skill
     (framework integrations and manual `@observe`).
   - Read `references/traced-evals.md` for the traced eval shapes and span
     metrics.
   - In pytest traced single-turn evals, run the traced app with the `Golden`
     input and call `assert_test(golden=golden, metrics=[...])`.
   - In script-based traced single-turn evals, use
     `for golden in dataset.evals_iterator(metrics=[...])`.
   - Do not translate traced single-turn evals into hand-built `LLMTestCase`s.
   - Add component/span-level metrics only where diagnostics are useful.
6. Create the pytest eval suite.
   - Read `references/pytest-e2e-evals.md`.
   - Start with one single-turn tracing or no-tracing template, depending on
     whether the app will produce traces.
   - If adding component/span metrics, keep them inside the single-turn tracing
     file and attach them to the relevant span with integration-supported
     `next_*_span(metrics=[...])` or `@observe(metrics=[...])`.
   - Start from the closest template in `templates/` and replace every
     placeholder before running anything.
7. Run and iterate.
   - Use `deepeval test run tests/evals/test_<app>.py`.
   - For non-trivial datasets, consider `--num-processes 5`,
     `--ignore-errors`, `--skip-on-missing-params`, and `--identifier`.
   - Follow `references/iteration-loop.md` for the requested number of rounds.

## Common Commands

Bootstrap single-turn goldens from docs only when no curated dataset exists:

```bash
deepeval generate --method docs --variation single-turn --documents ./docs --output-dir ./tests/evals --file-name .dataset
```

Run the eval suite:

```bash
deepeval test run tests/evals/test_<app>.py --num-processes 5 --identifier "iterating-on-<purpose>-round-1"
```

Open the latest hosted report when Confident AI is enabled:

```bash
deepeval view
```

## References

| Topic | File |
| --- | --- |
| Intake questions and branching | `references/intake.md` |
| Use case selection | `references/choose-use-case.md` |
| Dataset loading | `references/datasets.md` |
| Synthetic data generation | `references/synthetic-data.md` |
| Metrics | `references/metrics.md` |
| Pytest E2E evals | `references/pytest-e2e-evals.md` |
| Traced evals and span metrics | `references/traced-evals.md` |
| Confident AI | `references/confident-ai.md` |
| Dataset and eval artifact contracts | `references/artifact-contracts.md` |
| Iteration loop | `references/iteration-loop.md` |

## Templates

| App type | Template |
| --- | --- |
| Single-turn tracing | `templates/test_single_turn_tracing.py` |
| Single-turn no tracing | `templates/test_single_turn_no_tracing.py` |
| Multi-turn E2E | `templates/test_multi_turn_e2e.py` |
| Shared metric lists | `templates/metrics.py` |

© Confident AI · Apache-2.0 · confident-ai/deepeval

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor