Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

writing-evals

БесплатноБез исполняемых скриптовНе проверен

Teaches how to write and run evals on the `products/posthog_ai/eval_harness/` harness — sandboxed agent suites that execute the real coding agent in a Docker…

PostHogот PostHog★ 41 278 звёзд на GitHub

Об этом скилле

Writing and running evals

The harness under products/posthog_ai/eval_harness/ runs two kinds of suites: sandboxed suites execute the real coding agent inside a real sandbox against a seeded Hedgebox project and score what it did, and one-shot suites score a single in-process model invocation per case. Neither runs under pytest — the standalone harness boots the shared infrastructure the selected suites need (for sandboxed suites: test DB, Django live server, AI gateway, MCP server, Temporal, personhog; for one-shot suites: just the test DB, personhog, and demo data) and runs every selected suite concurrently, with Braintrust as the eval engine.

Read before writing anything:

Field-level API detail (case fields, the output dict, LogParser, seeder inventory) lives in references/authoring-reference.md.

Writing a suite

Suites are discovered by convention, not registered: any coroutine named eval_* in a file named eval_*.py, taking a single ctx: EvalContext and returning None. The harness discovers suites from two root sets:

  • products/posthog_ai/evals/<domain>/ — the built-in tree, reserved for Max and other agent suites. The directory is the domain; the suite id is <domain>/<module>::<fn> (import path products.posthog_ai.evals.<domain>.<module>).
  • products/<product>/evals/ — where a product ships eval suites next to its own code. Note the plural evals/: the singular products/signals/eval/ is an existing pytest tree and is not collected by the harness. The product is the domain; the suite id is <product>/<module>::<fn> (import path products.<product>.evals.<module>).

New product-owned evals belong under products/<product>/evals/. Both root sets use the same conventions (the eval_*-coroutine-in-eval_*.py rule, the SUITE_KIND marker, and substring selectors). No evals/ tree needs a pytest-collection exclusion: pytest's default python_files matches test_*.py, so eval_*.py files there are never collected as tests. Do not add a conftest.py under an evals/ tree.

from products.posthog_ai.eval_harness.base import SandboxedEval
from products.posthog_ai.eval_harness.config import SandboxedEvalCase
from products.posthog_ai.eval_harness.harness.context import EvalContext


async def eval_my_thing(ctx: EvalContext) -> None:
    await SandboxedEval(
        experiment_name="sandboxed-my-thing-cli",
        cases=[SandboxedEvalCase(name="my_case", prompt="...")],
        scorers=[],
        ctx=ctx,
    )
  • One suite = one experiment. Bundle related cases into one suite; split only when the scorecard would be heterogeneous (self-skipping scorers stretch a shared scorer list across mildly different cases, but a scorecard where half the scorers skip half the cases is a sign to split).
  • experiment_name identifies local and PostHog runs — keep it stable for cross-run comparison. Existing sandboxed suites end in -cli because the MCP server serves the cli surface.
  • SandboxedEval and OneShotEval always run Braintrust locally without uploading to it. With offline_suite and a publishing credential, results publish to PostHog by default. Set send_to_posthog=False for local-only results; local logs are always written. Ordinary SDK and trace clients still honor OPT_OUT_CAPTURE. See evaluation result reporting.
  • To enroll a suite in PostHog reporting, register its scorer kinds and immutable version UUIDs in the owning offline_config.py catalog, then pass offline_suite=offline_suite("<domain>/<module>::<function>", metrics=[...]) to the runner. Use the PostHog AI catalog for built-in suites and the Slack app catalog for Slack suites. List every explicit scorer's _name() in metrics; the catalog adds exit_code_zero only for sandboxed suites. For one-shot suites, pass suite_kind=SUITE_KIND. The enrollment test discovers catalog-using modules and checks every suite function against its scorer list.
  • Uploading and tagging require POSTHOG_OFFLINE_EVAL_API_KEY to be a personal key with offline_evaluation_ingestion:write and evaluation:write. Ingestion-only personal or project secret keys can upload without tags. Upload success is recorded before the separate, bounded tag update, so a tagging failure or interruption keeps the results link.

One-shot suites

A module-level SUITE_KIND declares how a module's s

Полный SKILL.md на GitHub

Установить writing-evals в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/authoring-reference.mdreferences/running-evals.md

FAQ

Что делает скилл writing-evals?

Teaches how to write and run evals on the `products/posthog_ai/eval_harness/` harness — sandboxed agent suites that execute the real coding agent in a Docker or Modal sandbox against a seeded Hedgebox project, and one-shot suites that score a single in-process model invocation per case. Use when adding or changing eval suites, cases, scorers, seeders, or synthesizers under `products/posthog_ai/evals/` or `products/*/evals/`, when touching the harness under `products/posthog_ai/eval_harness/`, or when running or debugging those evals (`hogli evals`). Covers suite kinds and discovery, case anatomy, the seeder/synthesizer split, the one-branch scorer patterns, and how to read results. Not for the LLM Analytics product's evaluation features.

Как установить скилл writing-evals?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл writing-evals запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить writing-evals с