一键导入
apastra-eval
Run prompt evaluations using your IDE agent as the harness. Load suites, execute test cases, score results, and compare against baselines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run prompt evaluations using your IDE agent as the harness. Load suites, execute test cases, score results, and compare against baselines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
PromptOps skills for versioning, evaluating, tracing, and shipping AI prompts as disciplined software assets. Agent-as-harness — your IDE agent runs evals, compares baselines, surfaces trace evidence, and gates quality.
Upgrade from local-first evaluation to automated GitHub Actions CI. Installs workflows for PR gating, release promotion, and auto-merge.
Quick setup guide for apastra PromptOps. Create your first prompt spec, dataset, evaluator, and suite in 5 minutes.
Generate new prompt specs, datasets, evaluators, and suites from templates. Creates correctly-formatted files that pass schema validation.
Inspect agent traces, hook events, tool-call transcripts, and run artifacts; turn them into PromptOps evidence, eval cases, and artifact references.
Interactive PromptOps eval design — what behavior to pin down, cases, scoring, thresholds, and outcome/step/trace evidence. Deep link to Writing evals once per session; pair with scaffold + apastra-eval.
| name | apastra-eval |
| description | Run prompt evaluations using your IDE agent as the harness. Load suites, execute test cases, score results, and compare against baselines. |
Run prompt evaluations locally. Your IDE agent is the harness — no external tools, APIs, or CI needed.
Deterministic steps (rendering, scoring, normalization, comparison) are handled by Python scripts in promptops/. You handle the LLM-dependent parts: calling the model and grading with judge evaluators.
Use this skill when you want to:
promptops/evals/When asked to "run an eval," check whether the user is referencing a suite ID or a quick eval file. If ambiguous, check promptops/evals/ first, then promptops/suites/.
Read promptops/suites/<suite-id>.yaml. Extract datasets, evaluators, model_matrix, trials, thresholds.
promptops/datasets/<dataset-id>.jsonlpromptops/evaluators/<evaluator-id>.yamlpromptops/prompts/<prompt-id>.yamlRun the digest script to fingerprint all inputs:
python .agent/scripts/apastra/runtime/digest.py promptops/prompts/<prompt-id>.yaml
python .agent/scripts/apastra/runtime/digest.py promptops/datasets/<dataset-id>.jsonl
python .agent/scripts/apastra/runtime/digest.py promptops/suites/<suite-id>.yaml
Record these in the run manifest for traceability.
For each case in the dataset:
Render the template: The agent substitutes {{variable}} placeholders with values from the case's inputs. (For reference, this follows the same logic as .agent/scripts/apastra/runtime/render.py.)
Call the model: Send the rendered prompt to the model and capture the response. If trials > 1, run multiple times. When the harness or agent hooks expose trace data, also capture tool calls, tool arguments, retries, duration, cost/tokens, validation feedback, stopping decisions, and raw intermediate outputs.
Score the output using two sources:
a) Suite evaluators (from promptops/evaluators/):
keyword_recall: fraction of expected_outputs.should_contain keywords found in outputexact_match: output exactly matches expected. Score is 0 or 1.config.schema. Score is 0 or 1.config.rubric on a 0-1 scale.b) Inline assertions (if the case has an assert array): Write the model output to a temp file and run:
python .agent/scripts/apastra/runs/evaluate_assertions.py <output.txt> <assertions.json>
This returns a JSON array of {"assert_<type>": 1.0 or 0.0} results.
Record the result as one JSONL line in cases.jsonl. Include trace or artifact references when available so failures can be debugged without relying only on final prose. Do not store raw secrets or private transcripts in Git; store sanitized evidence or references with digests:
{"case_id": "<id>", "inputs": {}, "output": "<response>", "evaluator_outputs": [{"<metric>": <score>}], "artifact_refs": []}
Run the normalization script to aggregate per-case results into a scorecard:
python .agent/scripts/apastra/runs/normalize.py <cases.jsonl> <scorecard.json>
This computes mean metrics, variance, and flake rates automatically.
Compare each metric in scorecard.json against the suite's thresholds. If any metric falls below its threshold, the suite fails.
Report results:
Suite: summarize-smoke
Status: PASS ✅ (or FAIL ❌)
Metrics:
keyword_recall: 0.85 (threshold: 0.60) ✅
Per-case results:
short-article: keyword_recall=1.00 ✅
multi-topic: keyword_recall=0.50 ⚠️
If a baseline exists at derived-index/baselines/<suite-id>.json:
promptops/policies/regression.yamlhigher_is_better: fail if candidate < (baseline - allowed_delta) or candidate < floorlower_is_better: fail if candidate > (baseline + allowed_delta) or candidate > floorIf no baseline exists, suggest running the baseline skill.
Write to promptops/runs/<suite-id>-<YYYY-MM-DD-HHmmss>/:
scorecard.json — aggregated metrics (output of normalize.py)cases.jsonl — per-case resultsrun_manifest.json — metadata: timestamp, model, harness, suite ID, prompt digestartifact_refs.json — optional references/digests for raw outputs, logs, or traces when the harness can provide themRead promptops/evals/<eval-id>.yaml. It contains id, prompt, cases, and thresholds.
For each case:
inputspython .agent/scripts/apastra/runs/evaluate_assertions.py <output.txt> <assertions.json>
Quick Eval: summarize-quick
Status: PASS ✅
Cases:
short: 2/2 assertions passed ✅
empty-input: 1/1 assertions passed ✅
Pass rate: 1.00 (threshold: 1.00) ✅
Write results to promptops/runs/<eval-id>-<timestamp>/ using the same format as suite runs.
| Script | Purpose | CLI Usage |
|---|---|---|
promptops/runtime/digest.py | Compute content digest | python .agent/scripts/apastra/runtime/digest.py <file> |
promptops/runs/evaluate_assertions.py | Evaluate inline assertions | python .agent/scripts/apastra/runs/evaluate_assertions.py <output.txt> <assertions.json> |
promptops/runs/normalize.py | Aggregate cases into scorecard | python .agent/scripts/apastra/runs/normalize.py <cases.jsonl> <scorecard.json> |
.agent/scripts/apastra/runtime/runner.py | Full harness runner (adapter mode) | python .agent/scripts/apastra/runtime/runner.py <request.json> <adapter.yaml> <outdir> |
.agent/scripts/apastra/runs/compare.py | Cross-model comparison | python .agent/scripts/apastra/runs/compare.py <suite-id> [models...] |
.agent/scripts/apastra/runtime/render.py | Template rendering (importable) | Used as reference for {{var}} substitution |
Use a short identifier for the execution environment in run_manifest.json:
claude-code, cursor, copilot, antigravity, jules, api, github-actionsThe harness matters because the same model can produce different results in different environments.
For interactive eval design, follow apastra-writing-evals (paired workflow with disciplined link-sharing to external docs).
The reference material below summarizes execution-time reminders; authoritative patterns for design sessions belong in apastra-writing-evals + https://bintzgavin-apastra-14.mintlify.app/guides/writing-evals.
| Level | What | When | Apastra tools |
|---|---|---|---|
| 1. Deterministic checks | contains, is-json, regex, required artifact | Default | Inline assertions, quick eval |
| 2. Executable checks | test passes, command succeeds, file exists | When output has observable state | Harness + run artifacts |
| 3. AI-graded checks | llm-rubric, similar, factuality | When deterministic checks cannot capture quality | Judge evaluators |
| 4. Baseline comparison | Compare scorecards | When you need regression detection | Baseline skill, policies |
| 5. Human review | Spot-check traces and labels | To calibrate judges and catch bad graders | Manual review |
Deterministic: equals, contains, icontains, contains-any, contains-all, regex, starts-with, is-json, contains-json, is-valid-json-schema
Model-assisted: similar, llm-rubric, factuality, answer-relevance
Performance: latency, cost
Negate any type with not- prefix (e.g., not-contains).
All assertion evaluation is handled by promptops/runs/evaluate_assertions.py — do not reimplement assertion logic yourself.