A prompt spec is the source of truth for a single prompt in your project. It defines a stable identifier, the inputs the prompt accepts, the template text, and optionally an output contract and metadata. Prompt specs are YAML files stored inDocumentation Index
Fetch the complete documentation index at: https://bintzgavin-apastra-14.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
promptops/prompts/.
Directory structure
All prompt-related files live underpromptops/:
id — for example, prompts/summarize-v1.yaml for a prompt with id: summarize-v1.
The prompt spec format
Every prompt spec is validated against the prompt spec schema. The required fields areid, variables, and template. Optional fields are output_contract, metadata, and tool_contract.
Required fields
| Field | Type | Purpose |
|---|---|---|
id | string | Stable identifier for the prompt |
variables | object | Input variable definitions (JSON Schema) |
template | string, object, or array | The prompt template content |
Optional fields
| Field | Type | Purpose |
|---|---|---|
output_contract | object | JSON Schema describing the expected output structure |
metadata | object | Arbitrary key-value pairs (author, intent, tags, etc.) |
tool_contract | object | JSON Schema for tool calling structure and available tools |
A real example: summarize-v1.yaml
Here is the complete promptops/prompts/summarize-v1.yaml from the apastra repo:
- A stable ID (
summarize-v1) - One input variable (
text, typed as a string) - A template that uses
{{text}}as a placeholder
output_contract and metadata.
Stable IDs and naming conventions
Theid field is the canonical identifier for your prompt. Treat it like a function name — once you publish or consume a prompt, renaming the ID is a breaking change.
Guidelines:
- Use lowercase letters, hyphens, and slashes only.
- Include a version suffix (
-v1,-v2) so you can publish a new major version alongside the old one without breaking consumers. - Never rename a published ID — create a new versioned ID instead.
- The file name should match the ID (e.g.,
id: summarize-v1→ filesummarize-v1.yaml).
Variable schema
Thevariables field is a map of variable names to JSON Schema definitions. At minimum, provide the type:
- Declare every variable the template uses — undeclared variables are implicit coupling that breaks consumers.
- Use
descriptionfields so consumers and evaluators understand what each variable means. - Prefer
stringtypes for LLM inputs. Usenumberorbooleanonly when the consuming code is doing the type conversion. - Avoid leaking implementation details (internal IDs, session tokens) into variables.
Template syntax
Templates use{{variable}} double-brace placeholders. The agent or runtime substitutes each placeholder with the corresponding value from the case’s inputs object.
template can be an array of message objects:
Every
{{variable}} placeholder in the template must have a matching entry in variables. Missing variable declarations are a common source of errors caught by schema validation.Output contracts
Anoutput_contract is a JSON Schema that describes what the model should return. It is optional but highly recommended for structured outputs:
- When your prompt returns structured data (JSON, YAML, XML)
- When downstream code parses the model output
- When you want schema validation as an evaluator assertion (
is-valid-json-schema)
- Free-text outputs where structure is not enforced
- Early-stage prompts where the output shape is still evolving
Output contracts double as documentation. Even if you don’t validate against them in every run, they make the prompt’s intended API explicit for other engineers and for AI agents reading the spec.
Tool contracts
If your prompt uses tool calling, declare the expected tools intool_contract:
output_contract and is used to validate that the model’s tool call structure matches expectations.
Metadata
Usemetadata for any key-value pairs that don’t belong in the functional fields:
Best practices
One spec per file
Each prompt spec lives in its own file. Never combine multiple prompts in one YAML file.
Stable IDs, always
Treat the
id field as an immutable contract. Version bumps get a new ID (v2), not an in-place rename.Declare all variables
Every
{{placeholder}} must appear in variables. Undeclared variables break consumers and schema validation.Add output contracts early
For structured outputs, write the output contract when you write the template — not after a production bug.
Validating your prompt spec
Run schema validation with theapastra-validate skill to catch errors before committing:
promptops/ against the 23 JSON schemas. Prompt spec errors are reported with the field path and expected type.