Promptfoo - LLM Evaluation Framework

VerifiedSafe

CLI tool for testing and comparing LLM outputs. Create evaluation configs, test cases, and custom assertions for validating model behavior.

Sby Skills Guide Bot
TestingIntermediate
3/8/2026
Claude CodeCursorCodex
#llm-evaluation#promptfoo#assertions#yaml-config#llm-testing

Recommended for

Automated summary

Guides the authoring of Promptfoo configurations (promptfooconfig.yaml), test cases, and assertions to evaluate and compare LLM outputs from the command line.

Strengths

  • Reference table of assertion types (contains, regex, is-json, llm-rubric, javascript, similar, cost, latency) with negation through the not- prefix
  • Concrete config examples: inline or file:// prompts, variables, defaultTest with temperature and max_tokens, outputPath and maxConcurrency
  • Modular test organization through referenced case files plus the essential CLI commands (eval, view, cache clear, metadata filtering)

Limitations

  • The provider table only lists Anthropic models, with no OpenAI, Google, or local examples
  • The References section is cut off, leaving the configuration reference link incomplete
  • Does not cover advanced features such as red teaming, CI integration, or detailed multi-provider comparison
When to use it

Use it when writing or debugging a promptfooconfig.yaml, defining test cases and assertions, or running a Promptfoo evaluation from the CLI.

When not to use it

Avoid it if you need thorough cross-provider comparison, security/red-team testing, or a full CI pipeline, which this skill does not document.

Security analysis

Safe
Quality score86/100

The skill is documentation for the promptfoo eval framework and does not instruct destructive, exfiltrating, or obfuscated actions. Allowed tools are narrowly scoped to promptfoo CLI commands, npm eval scripts, and the official promptfoo docs domain.

No concerns found

How this analysis is made

Examples

Write an eval config
Create a promptfooconfig.yaml that tests my summarization prompt against claude-sonnet-4-5 with three test cases, asserting the output is valid JSON and contains key phrases.
Debug a failing assertion
My llm-rubric assertion keeps failing with a threshold of 0.7 — help me rewrite the rubric and verify the assertion config in promptfooconfig.yaml.
Split test cases into files
Refactor my promptfooconfig.yaml so the basic and edge-case tests live in separate files under cases/ and are referenced with file:// paths, then run npx promptfoo eval.

name: promptfoo description: | Promptfoo evaluation framework for testing and comparing LLM outputs. Use when writing eval configs, creating test cases, debugging eval runs, or working with assertions. allowed-tools:

  • Bash(npx promptfoo:*)
  • Bash(npm run evals:*)
  • WebFetch(domain:www.promptfoo.dev)

Promptfoo

Promptfoo is a CLI tool for testing and comparing LLM outputs.

Config File

The CLI auto-discovers promptfooconfig.yaml in the current directory. Use -c path for other locations.

Supported extensions: .yaml, .json, .js

Configuration

# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: "What this eval tests"

prompts:
  - file://prompt.txt
  - |
    Inline prompt with {{variable}} substitution

providers:
  - anthropic:messages:claude-sonnet-4-5-20250929

defaultTest:
  options:
    provider:
      config:
        temperature: 0.0
        max_tokens: 4096

tests:
  - description: "What this case tests"
    vars:
      variable: "value"
      from_file: file://data/input.txt
    assert:
      - type: contains
        value: "expected substring"

# Or load tests from files
tests: file://cases/all.yaml

outputPath: ./results.json

evaluateOptions:
  maxConcurrency: 4

Provider IDs

| Model | ID | |-------|----| | Opus 4.5 | anthropic:messages:claude-opus-4-5-20251101 | | Sonnet 4.5 | anthropic:messages:claude-sonnet-4-5-20250929 | | Haiku 4.5 | anthropic:messages:claude-haiku-4-5-20251001 |

Provider config: temperature, max_tokens, top_p, top_k, tools, tool_choice

Prompts

  • file://path.txt — load from file (path relative to config)
  • Inline string with {{variable}} Nunjucks substitution
  • Chat format via JSON: [{"role": "system", "content": "..."}, {"role": "user", "content": "{{input}}"}]

Assertion Types

| Type | Use | Value | |------|-----|-------| | contains | Substring match | "expected text" | | icontains | Case-insensitive substring | "expected text" | | equals | Exact match | "exact value" | | regex | Pattern match | "\\d{4}-\\d{2}-\\d{2}" | | is-json | Valid JSON output | — | | contains-json | Output contains JSON | — | | starts-with | Prefix match | "prefix" | | cost | Max cost | threshold: 0.01 | | latency | Max response time (ms) | threshold: 5000 | | javascript | Custom JS expression | output.includes('x') | | python | Custom Python | file://check.py:fn_name | | llm-rubric | LLM-as-judge | rubric text | | similar | Semantic similarity | value: "text", threshold: 0.8 | | model-graded-factuality | Fact checking | — |

Prefix any assertion with not- to negate (e.g., not-contains).

llm-rubric

Uses an LLM to grade output against a rubric:

assert:
  - type: llm-rubric
    value: |
      The response should:
      - Mention at least 3 factors
      - Include specific examples
    threshold: 0.7
    provider: anthropic:messages:claude-sonnet-4-5-20250929

javascript

Inline expressions or functions. Access output (string) and context (with vars, prompt):

assert:
  - type: javascript
    value: output.length > 100 && output.includes('route')
  - type: javascript
    value: |
      const data = JSON.parse(output);
      return data.calories >= 200 && data.calories <= 300;

Test Organization

Split cases into separate files and reference them:

tests:
  - file://cases/basic.yaml
  - file://cases/edge-cases.yaml

Each case file contains a YAML array of test objects.

CLI

npx promptfoo eval                         # Run with auto-discovered config
npx promptfoo eval -c path/to/config.yaml  # Specific config
npx promptfoo eval --filter-metadata key=v # Filter tests
npx promptfoo view                         # Web UI for results
npx promptfoo cache clear                  # Clear result cache

References

Consult the configuration reference and Anthropic provider docs for full details.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/promptfoo-llm-evaluation-framework-mmh8qqy4/download' --output '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md.part' && mv '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md.part' '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md' && test -s '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/promptfoo' && cp -R '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4' '.claude/skills/promptfoo'

Cursor
test -f '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md' && test -s '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/promptfoo' && cp -R '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4' '.cursor/skills/promptfoo'

Codex
test -f '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md' && test -s '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/promptfoo' && cp -R '.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4' '.agents/skills/promptfoo'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4'

openskills read 'promptfoo-llm-evaluation-framework-mmh8qqy4'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/promptfoo-llm-evaluation-framework-mmh8qqy4/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills