Skip to content
cccskills
FreePublished on GitHub

promptfoo-evaluation

Authors and runs Promptfoo evals for LLM prompts and RAG pipelines - wires `promptfooconfig.yaml` providers + prompts + tests + assertions (deterministic `equals` / `contains` / `is-json` / `regex`, semantic `similar`, model-graded `llm-rubric` / `factuality` / `g-eval`, performance `latency` / `cost`, custom `javascript` / `python`), runs `npx promptfoo eval`, views HTML report via `promptfoo view`, and integrates CI for regression gating. Use when the user runs Promptfoo, asks about prompt regression suites, or needs an eval-driven workflow for LLM-backed features.

The English summary is being prepared. Showing the original description.

testland/qa13 stars(GitHub 13 + cccskills 0)
Works withOpenAI

Run score Not tested

See how to install

Files included (12)

  • SKILL.md7.8 KB
  • .tessl-plugin/plugin.json709 B
  • evals/forty-row-answer-sheet-as-a-launch-gate/criteria.json6.6 KB
  • evals/forty-row-answer-sheet-as-a-launch-gate/task.md11.3 KB
  • evals/june-board-number-cannot-be-reproduced-in-september/criteria.json6.2 KB
  • evals/june-board-number-cannot-be-reproduced-in-september/task.md5.6 KB
  • evals/pr-eval-bill-went-from-nine-dollars-to-four-hundred/criteria.json6.0 KB
  • evals/pr-eval-bill-went-from-nine-dollars-to-four-hundred/task.md9.8 KB
  • evals/safety-gate-has-not-gone-red-since-march/criteria.json5.3 KB
  • evals/safety-gate-has-not-gone-red-since-march/task.md9.5 KB
  • evals/subject-line-suite-red-three-mornings-a-week/criteria.json6.0 KB
  • evals/subject-line-suite-red-three-mornings-a-week/task.md10.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

promptfoo-evaluation

A promptfooconfig.yaml declares providers (LLMs under test), prompts (templates with {{var}} placeholders), tests (input variables + assertions); promptfoo eval runs the cross-product (per pf-config).

When to use

  • The repo has a promptfooconfig.yaml or the user wants to author one.
  • The user needs prompt regression suites - same inputs, multiple providers, fail-on-diff.
  • A CI workflow needs an eval gate on prompt or model changes.
  • The team prefers vendor-neutral eval (vs OpenAI Evals' OpenAI-first posture).

Step 1 - Install

Per github.com/promptfoo/promptfoo:

npm install -g promptfoo
# or
brew install promptfoo
# or one-off
npx promptfoo@latest

Per pf-gh: "Node.js 20.20+ or 22.22+ is required for npm and npx usage."

Step 2 - First eval

Initialize from a built-in example, then run:

promptfoo init --example getting-started
cd getting-started
promptfoo eval
promptfoo view  # opens HTML report

(Commands per pf-gh.)

A minimal promptfooconfig.yaml per pf-config:

prompts:
  - file://prompt1.txt

providers:
  - openai:gpt-5-mini
  - anthropic:claude-haiku-4-5

tests:
  - vars:
      language: French
      input: Hello world
    assert:
      - type: contains-json

Provider syntax <vendor>:<model> works for OpenAI, Anthropic, Vertex (vertex:gemini-2.0-flash-exp), Ollama (ollama:llama2), and 30+ others (per pf-config).

Step 3 - Variable interpolation

Vars interpolate into prompts using {{variable}}. Arrays create combinations (per pf-config):

tests:
  - vars:
      language: [French, German, Spanish]
      input: [Hello world, Good morning]

This generates 6 test rows (3 languages × 2 inputs). Vars can also load from files:

tests:
  - vars:
      var3: file://path/to/var3.txt
      context: file://fetch_from_vector_database.py

Step 4 - Assertion catalog

Per promptfoo.dev/docs/configuration/expected-outputs/:

Deterministic (string + structure):

TypeExample
equalsvalue: 'expected string'
contains / icontainsvalue: 'substring' (case-sensitive / insensitive)
starts-withvalue: 'prefix'
contains-any / contains-allvalue: ['a', 'b']
regexvalue: '^pattern$'
is-json / contains-json(validates / locates JSON)
is-sql / contains-sql(SQL syntax)
is-xml / is-html / contains-xml / contains-html(markup)
is-valid-openai-tools-call / is-valid-openai-function-call(tool calls)

Custom logic:

- type: javascript
  value: 'output.length > 10'
- type: python
  value: 'file://script.py'

Text-quality metrics (default thresholds per pf-asserts):

TypeDefault threshold
rouge-n0.75
bleu0.5
gleu0.5
meteor0.5
levenshtein5 (edit distance max)

Performance + cost:

- type: latency
  threshold: 200    # milliseconds
- type: cost
  threshold: 0.001  # dollars per response

Model-graded (LLM-as-judge):

TypeUse
llm-rubricFree-form rubric: value: 'Is helpful and accurate'
model-graded-closedqaClosed-QA evaluation method
factualityCompares against reference facts
g-evalChain-of-thought scoring
answer-relevanceChecks output relates to query
context-faithfulness / context-recall / context-relevanceRAG-specific

Semantic similarity:

- type: similar
  value: 'reference text'
  threshold: 0.8   # cosine similarity via embeddings

Negation: all deterministic assertions support a not- prefix (not-equals, not-contains, not-regex, etc.) per pf-asserts.

Step 5 - defaultTest pattern

Shared assertions/vars across all tests:

defaultTest:
  vars:
    shared_var: 'shared content'
  assert:
    - type: llm-rubric
      value: does not describe self as AI
  options:
    provider: openai:gpt-5-mini-0613

tests:
  - vars:
      unique_var: value1

(Per pf-config.)

Step 6 - Output transforms

Modify LLM output before assertions execute (per pf-config):

tests:
  - vars:
      body: Hello world
    options:
      transform: output.toUpperCase()

Or load from a file:

options:
  transform: file://transform.js:customTransform

Step 7 - assert-set grouping

Group assertions and require a threshold percentage to pass (per pf-asserts):

assert:
  - type: assert-set
    threshold: 0.5   # 50% of grouped asserts must pass
    assert:
      - type: cost
        threshold: 0.001
      - type: latency
        threshold: 200

Step 8 - CI integration

Provider API keys via env vars (per pf-gh: export OPENAI_API_KEY=sk-abc123).

GitHub Actions pattern (per promptfoo.dev/docs/integrations/github-action):

- uses: promptfoo/promptfoo-action@v2
  with:
    openai-api-key: ${{ secrets.OPENAI_API_KEY }}
    config: 'promptfooconfig.yaml'
    cache-path: '~/.cache/promptfoo'
    use-config-prompts: false
    no-share: true
    promptfoo-version: 'latest'

The action posts a PR comment with regression diff vs the base branch. Caching reuses LLM responses for unchanged tests (per promptfoo.dev/docs/configuration/caching/).

Anti-patterns

Anti-patternWhy it failsFix
Only deterministic assertions on creative outputsLLM responses vary; rigid asserts produce flakeUse llm-rubric or similar (Step 4)
Single provider in configMisses cross-provider regressionAt least 2 providers per eval (Step 2)
No cost / latency capsEval cost balloons per PRcost + latency asserts (Step 4)
assert-set with threshold: 0Effectively disables groupingPick a real threshold (Step 7)
Fresh provider model on every run without pinningOutput drifts when vendor updates modelPin specific snapshot (e.g., openai:gpt-5-mini-0613)
Skip caching in CIRe-runs every test on every PRcache-path in GHA action (Step 8)

Limitations

  • Model-graded assertions invoke a judge LLM per test row → cost per test ≈ 2× a deterministic-only eval.
  • Even seeded LLMs drift between provider model updates; pin model versions in CI to bound the regression surface.
  • Promptfoo ships HTML + JSON + JUnit reporters; no native Markdown PR-comment formatter (use the GHA action for that).

References

  • pf-intro - overview
  • pf-config - full configuration guide
  • pf-asserts - assertion catalog
  • pf-gha - GitHub Action
  • pf-cache - caching mechanics
  • pf-gh - install commands
  • openai-evals, deepeval-evaluation, ragas-evaluation - sister tools (different framework styles)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Builds a CI gate that fails the build on **new** WCAG / a11y violations introduced by a PR while grandfathering pre-existing violations on a per-rule / per-page baseline. Aggregates verdicts from axe-core / pa11y / Lighthouse a11y / WAVE / IBM Equal Access scans. Use when a project has accumulated a11y debt and a strict "zero violations" gate would block every PR - the ratchet pattern lets the team ship while preventing regressions.

The English summary is being prepared. Showing the original description.

testland/qa13Updated Oct 20, 2026

Workflow skill that builds an A/B-test validity checklist from an experiment proposal, walking the canonical design-correctness gates - pre-registered OEC/power/guardrails, randomization unit + SRM check, assignment integrity, telemetry, peeking discipline, novelty/primacy, post-experiment SRM re-check - into a per-experiment checklist + sign-off form. Use when launching, auditing, or governing an experiment. For pitfall mechanics (guardrails, peeking) see experiment-results-interpreter's references; to read an already-valid result use experiment-results-interpreter; for per-SDK harness tests use experiment-sdk-testing - this gates DESIGN, not SDK code.

The English summary is being prepared. Showing the original description.

testland/qa13Updated Oct 20, 2026

The single install-flow skill: the reference contract for the PWA install flow (installability gate fields, `beforeinstallprompt` handshake, per-platform paths - Android WebAPK / iOS Share menu / Firefox no-op - and the `display-mode` post-install signal, in references/install-flow-reference.md) plus the build-an-X workflow that emits the Add-to-Home-Screen suite. Walks the four-stage timeline, emitting one test per gate cell per [web.dev/articles/install-criteria][install-criteria], the deferred-prompt → `prompt()` → `userChoice` chain per [web.dev/articles/customize-install][customize-install], the iOS Safari manual-metadata branch (`apple-touch-icon`) per [web.dev/learn/pwa/installation][learn-pwa], and the post-install `(display-mode: standalone)` MQ assertion. Output: a Playwright spec with per-stage cells plus a coverage matrix. Use when a PWA's manifest, icons, or install handler change, when install conversion drops at an unknown stage, or when triaging a flaky install assertion.

The English summary is being prepared. Showing the original description.

testland/qa13Updated Oct 20, 2026

Build-an-X workflow that uses an LLM to map existing tests to spec sections - given a spec doc + the test suite, the LLM identifies which tests cover which sections, surfaces uncovered sections (gap), and recommends specific tests to add. Output is a coverage matrix per spec ID. Scope is mapping tests that already exist and naming the gaps, not authoring tests for new acceptance criteria. Use when a spec doc and a test suite both exist but nobody can say which requirements are actually covered - before a release sign-off, an audit, or a decision about where to spend the next round of test effort.

The English summary is being prepared. Showing the original description.

testland/qa13Updated Oct 20, 2026

Generates tests from natural-language specs (acceptance criteria, user stories, requirements) using an LLM, with confidence scoring per test case (LLM self-assessment plus heuristics: assertion quality, naming, completeness), batching uncertain cases for human review, and integration with the team's existing test framework. Use when the user asks to generate unit tests from acceptance criteria, convert user stories to test cases, automate test creation from requirements, or augment a spec-driven test suite with AI-generated stubs that are then curated before merge.

The English summary is being prepared. Showing the original description.

testland/qa13Updated Oct 20, 2026

Configures Allure Report (test-runner adapter install, `allure-results` directory wiring, `categories.json` for failure classification, `history-trend.json` retention via the copy-history-between-runs pattern), runs the Allure CLI to convert `allure-results` to a static HTML site, and uploads the report as a CI artifact. Use when the team needs richer test reporting than JUnit XML - step-level attachments, per-test history, retry tracking, and severity / epic / feature labeling across framework-agnostic adapters (pytest, Jest, JUnit, TestNG, NUnit, Mocha). As a rich static HTML report generator, it is the open-source alternative to the sunset ExtentReports (JVM/.NET per-test HTML narrative); for hosted cross-run flakiness analytics rather than a static per-run report use currents-integration.

The English summary is being prepared. Showing the original description.

testland/qa13Updated Oct 20, 2026

See all skills by testland

Report a problem with this skill