一键导入
apastra-scaffold
Generate new prompt specs, datasets, evaluators, and suites from templates. Creates correctly-formatted files that pass schema validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate new prompt specs, datasets, evaluators, and suites from templates. Creates correctly-formatted files that pass schema validation.
用 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.
Run prompt evaluations using your IDE agent as the harness. Load suites, execute test cases, score results, and compare against baselines.
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-scaffold |
| description | Generate new prompt specs, datasets, evaluators, and suites from templates. Creates correctly-formatted files that pass schema validation. |
Quickly generate new PromptOps files. All generated files follow the apastra schemas and will pass validation.
Use this skill when you want to:
If the user has not already agreed on an eval design, pause and invoke apastra-writing-evals or ask for the missing design brief. Do not silently choose behavior, cases, and thresholds from a vague request.
Minimum design brief before creating eval files:
When you scaffold from a completed design:
metadata.source_relpath when cases map to instruction filesWhen asked to create a new prompt (e.g., "scaffold a prompt for email classification"):
Create promptops/prompts/<id>.yaml:
id: <kebab-case-id>
variables:
<var_name>:
type: string
template: |
<The actual prompt text with {{var_name}} placeholders>
output_contract:
type: object
properties:
<output_field>:
type: string
metadata:
author: <user or team name>
intent: <what this prompt does>
tags:
- <relevant-tags>
id is required and must be unique across all prompt specsid should be kebab-case and include a version suffix (e.g., classify-email-v1)variables is required — defines the input schema as a map of variable names to JSON Schema type objectstemplate is required — the prompt text with {{variable}} placeholdersoutput_contract is optional but recommended — defines expected output structuremetadata is optional — use for organization and discoveryWhen asked to create test cases (e.g., "create test cases for the email classifier"):
Create promptops/datasets/<id>.jsonl — one JSON object per line:
{"case_id": "<unique-case-id>", "inputs": {"<var>": "<value>"}, "expected_outputs": {"<field>": "<expected>"}, "metadata": {"tags": ["<tag>"]}}
.jsonl format (one JSON object per line, NOT a JSON array)case_id is required and must be unique within the datasetinputs is required — keys must match the prompt spec's variablesexpected_outputs is optional — used by evaluators for checkingmetadata is optional — useful for tagging difficulty, domain, etc.When asked to create a scoring rule (e.g., "create an evaluator that checks for JSON output"):
Create promptops/evaluators/<id>.yaml:
id: <evaluator-id>
type: <deterministic | schema | judge>
metrics:
- <metric-name>
description: <what this evaluator checks>
config:
<evaluator-specific configuration>
deterministic — rule-based checks:
id: keyword-check
type: deterministic
metrics:
- keyword_recall
description: Checks if output contains expected keywords.
config:
match_field: should_contain
case_sensitive: false
schema — validates output structure:
id: json-output-valid
type: schema
metrics:
- schema_valid
description: Validates that model output is valid JSON matching the output contract.
config:
schema:
type: object
required: ["category", "confidence"]
properties:
category:
type: string
confidence:
type: number
judge — AI-graded evaluation:
id: quality-judge
type: judge
metrics:
- coherence
- relevance
description: Uses AI judgment to score output quality.
config:
rubric: |
Score the output on two dimensions (0-1 each):
- coherence: Is the text well-structured and readable?
- relevance: Does the output address the input query?
model: default
id is required and must be uniquetype is required — must be one of: deterministic, schema, judgemetrics is required — array of metric names this evaluator produces (minimum 1)judge evaluators: always version the rubric — changing it changes what the metric meansWhen asked to create a test suite (e.g., "create a smoke suite for the email classifier"):
Create promptops/suites/<id>.yaml:
id: <suite-id>
name: <Human Readable Name>
description: <what this suite tests>
datasets:
- <dataset-id>
evaluators:
- <evaluator-id>
model_matrix:
- default
trials: 1
thresholds:
<metric>: <minimum-score>
| Tier | When to Run | Cases | Trials |
|---|---|---|---|
| Smoke | Every prompt edit | 5-10 | 1 |
| Regression | Before merging | 20-50 | 3 |
| Full | Nightly / on-demand | 50+ | 5 |
| Release | Before shipping | 100+ | 5 |
id is required and must be uniquename is required — human-readabledatasets is required — at least one dataset referenceevaluators is required — at least one evaluator referencemodel_matrix is required — at least one model identifier"default" in model_matrix to test against the current IDE agent's modelWhen asked something like "scaffold a complete PromptOps setup for sentiment analysis," create all four files:
promptops/prompts/sentiment-v1.yamlpromptops/datasets/sentiment-smoke.jsonlpromptops/evaluators/sentiment-accuracy.yamlpromptops/suites/sentiment-smoke.yamlFor rapid iteration, scaffold a single quick eval file instead of four separate files.
When asked to create a quick eval (e.g., "scaffold a quick eval for email classification"):
Create promptops/evals/<id>.yaml:
id: classify-email-quick
prompt: |
Classify the following email into one of these categories: spam, support, sales, personal.
Respond with JSON: {"category": "<category>", "confidence": <0-1>}
Email: {{email}}
cases:
- id: obvious-spam
inputs:
email: "CONGRATULATIONS! You've won $1,000,000! Click here NOW!"
assert:
- type: is-json
- type: contains
value: "spam"
- id: support-request
inputs:
email: "Hi, I'm having trouble logging in. My password reset isn't working."
assert:
- type: is-json
- type: contains-any
value: ["support", "help"]
- id: personal-email
inputs:
email: "Hey! Want to grab lunch on Friday?"
assert:
- type: is-json
- type: contains
value: "personal"
thresholds:
pass_rate: 1.0
When the user wants inline assertions on their test cases (skipping the evaluator file), include assert arrays directly in the JSONL:
{"case_id": "case-1", "inputs": {"text": "Hello"}, "assert": [{"type": "contains", "value": "Bonjour"}, {"type": "not-contains", "value": "error"}]}
{"case_id": "case-2", "inputs": {"text": ""}, "assert": [{"type": "regex", "value": ".*"}]}
Inline assertions work alongside separate evaluator files — they complement each other. Use inline assertions for per-case checks and evaluator files for suite-wide scoring rules.
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, not-is-json).