Skill sources for progressive-disclosure knowledge loading. (v1.3.1+)
Collections are keyed maps, not arrays
prompts, fragments, and tools are all objects (keyed maps), not arrays. Each key serves as the identifier for the entry. For example, prompts maps task type strings like "support" or "billing" to their Prompt definitions.
A single prompt configuration within a pack. Each prompt represents a specific task type (e.g., "support", "sales") with its own template, variables, tools, and validation rules. Prompts can evolve independently with their own version numbers.
Field
Type
Required
Description
id
string
Yes
Unique identifier, typically matching the map key. Pattern: ^[a-z][a-z0-9_-]*$.
name
string
Yes
Human-readable name.
version
string
Yes
Prompt version following Semantic Versioning, independent from the pack version.
system_template
string
Yes
The system prompt template. Use template syntax (e.g., {{variable}}) for variable substitution.
description
string
No
Detailed description of the prompt's purpose and behavior.
A tool definition following the function calling convention. Tools enable the LLM to call external functions. Tools are defined at the pack level and referenced by name in each prompt's tools array.
Field
Type
Required
Description
name
string
Yes
Tool name. Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$.
description
string
Yes
What the tool does. The LLM uses this to decide when to call it.
parameters
object
No
JSON Schema object defining the tool's input parameters (see below).
A validation rule (guardrail) applied to LLM responses.
Field
Type
Required
Description
type
string
Yes
The validator type that determines how validation is performed. Not an enum — runtimes define and register their own types. Examples: "banned_words", "max_length", "length", "max_sentences", "regex_match", "sentiment", "custom".
enabled
boolean
No
Whether this validator is active. Default: true.
fail_on_violation
boolean
No
If true, violations cause an error. If false, violations are logged but allowed. Default: false.
message
string
No
User-facing message returned when the validator blocks content (e.g., "Response contains banned words").
params
object
No
Validator-specific parameters (e.g., word lists, character limits).
Evals are automated quality checks on LLM outputs. Unlike validators (which run inline and can block responses), evals run asynchronously and produce scores or metrics. Evals can be defined at both pack level (cross-cutting) and prompt level (prompt-specific). Prompt-level evals with the same id override pack-level evals.
Assertion type determining how the eval runs. Not an enum — runtimes register their own types (e.g., "contains", "regex", "json_valid", "llm_judge", "cosine_similarity").
trigger
string
Yes
When this eval fires. Schema is open — common values are "every_turn", "on_session_complete", "on_conversation_complete", "on_workflow_step", "sample_turns", "sample_sessions".
description
string
No
Human-readable description of what this eval measures.
enabled
boolean
No
Whether this eval is active. Default: true.
sample_percentage
number
No
Percentage of turns/sessions to sample (0–100). Only used with sample_turns and sample_sessions triggers. Default: 5.
params
object
No
Type-specific configuration. Structure depends on the eval type.
Human-readable message describing the eval result or failure reason.
when
object
No
Conditional expression that determines whether this eval runs for a given turn or session (e.g., { "has_variable": "customer_tier" }, { "turn_count_gte": 3 }). Free-form — runtimes interpret.
groups
string[]
No
Eval group tags for organizing and filtering evals (e.g., ["quality", "tone"], ["safety", "compliance"]).
Optional pass/fail threshold attached to an eval. Runtimes compare the eval's numeric score against value using operator.
Field
Type
Description
operator
string
Comparison operator. Common values: "gte", "lte", "gt", "lt", "eq".
value
number
The threshold value to compare against (e.g., 0.8, 4, 0.95).
"evals":[ { "id":"json_format", "type":"json_valid", "trigger":"every_turn", "description":"Verify the assistant always returns valid JSON", "metric":{ "name":"promptpack_json_valid", "type":"boolean" } }, { "id":"tone-check", "type":"llm_judge", "trigger":"sample_turns", "sample_percentage":10, "params":{ "judge_prompt":"Rate the response tone on a 1-5 scale for professionalism.", "model":"gpt-4o", "passing_score":4 }, "metric":{ "name":"promptpack_tone_score", "type":"gauge", "range":{"min":1,"max":5} } } ]
Validators vs Evals
Both sit on the quality spectrum: validators run inline on every response and can block output (fail_on_violation), while evals run asynchronously and produce scores/metrics without blocking. Use validators for hard guardrails, evals for quality measurement and monitoring.
Fragments are shared, reusable template text blocks defined at the pack level. They are simple string values keyed by name.
"fragments":{ "customer_context":"Customer: {{customer_name}}\nAccount Type: {{account_type}}", "greeting":"Hello! How can I help you today?", "escalation_notice":"I'm going to connect you with a specialist." }
Prompts reference fragments in their system_template using template syntax: {{fragments.customer_context}}.
PromptPack v1.3 adds a state-machine workflow over the pack's prompts. Each state references a prompt key and declares event-driven transitions to other states.
Reference to a prompt key defined in the pack's prompts object.
description
string
No
Human-readable description of this state's purpose.
on_event
object<string, string>
No
Map of event name to target state name. When the named event fires, the workflow transitions to the target state. Terminal states should omit it (or set it to {}).
persistence
string
No
Whether conversation context is kept (persistent) or reset (transient) on entry.
orchestration
string
No
How this state is orchestrated: internal (runtime manages), external (caller manages), or hybrid.
skills
string
No
Skill filter for this state. A path scoping which skills are available, or "none" to disable skills. (v1.3.1+)
terminal
boolean
No
If true, this state is a terminal state — the workflow completes after its prompt executes. Terminal states should not declare on_event transitions. Default: false. (v1.4+)
max_visits
integer
No
Maximum number of times this state may be entered during a single workflow execution. Minimum: 1. When the limit is reached the workflow transitions to on_max_visits, or terminates with a budget-exhausted status if on_max_visits is not set. (v1.4+)
on_max_visits
string
No
Target state to transition to when max_visits is reached. Must reference a key in the states object. (v1.4+)
Named artifact slots for lightweight, structured metadata that flows across state visits. Values are exposed to the prompt as {{artifacts.<name>}}. (v1.4+)
Declares one named slot in a state's artifacts map. Artifacts carry lightweight, structured metadata across state visits — pointers (commit SHAs, file paths, URIs), compact representations (schemas, summaries, diffs), or small structured results. They are not bulk data. Values persist across loop iterations and are accessible to prompts as {{artifacts.<name>}}.
Field
Type
Required
Description
type
string
Yes
MIME type indicating the artifact's content type (e.g., "text/plain", "application/json", "text/markdown", "text/x-python"). Used by runtimes to determine serialization and presentation.
description
string
No
Human-readable description of what this artifact contains and how it's used.
mode
string
No
How the artifact is updated across visits. "replace" (default) overwrites the previous value on each visit; "append" accumulates content across visits (e.g., a log).
"artifacts":{ "commit_sha":{"type":"text/plain","description":"Latest generated commit"}, "test_report":{"type":"application/json","description":"Test runner summary"}, "iteration_log":{ "type":"text/plain", "mode":"append", "description":"Per-visit log accumulated across the loop" } }
Resource budget for an entire workflow execution. Provides a global safety net independent of per-state max_visits — when any limit is reached the workflow terminates with a budget-exhausted status. All fields are optional; omitting a field means no limit for that resource. The budget lives at workflow.engine.budget.
Field
Type
Required
Description
max_total_visits
integer
No
Maximum total state visits across all states in the workflow. Minimum: 1.
max_tool_calls
integer
No
Maximum total tool calls across all states. Minimum: 1.
max_wall_time_sec
integer
No
Maximum wall-clock time in seconds for the entire workflow execution. Minimum: 1.
max_visits bounds a single state — useful for "give the implementer up to 5 attempts before forcing review". engine.budget bounds the entire workflow — the runaway-loop safety net that catches cycles max_visits couldn't predict. Use both together: per-state caps for normal flow control, the budget as a backstop.
PromptPack v1.3 adds agent definitions that map prompts to A2A (Agent-to-Agent) compatible agent cards. This enables multi-agent orchestration via the A2A protocol.
Agent description published in the A2A Agent Card. Overrides the prompt's description if set.
tags
string[]
No
Discovery tags for the agent, used by A2A registries and routers.
input_modes
string[]
No
MIME types the agent accepts as input. Defaults to ["text/plain"].
output_modes
string[]
No
MIME types the agent can produce as output. Defaults to ["text/plain"].
"agents":{ "entry":"triage", "members":{ "triage":{ "description":"Routes customer requests to the right specialist", "tags":["router","customer-service"], "input_modes":["text/plain"], "output_modes":["text/plain"] }, "billing":{ "description":"Handles billing inquiries and payment issues", "tags":["billing","payments"], "input_modes":["text/plain"], "output_modes":["text/plain","application/json"] }, "technical":{ "description":"Provides technical troubleshooting assistance", "tags":["support","technical"] } } }
Workflow + Agents
workflow and agents are independent features — you can use either or both. When used together, the workflow drives state transitions while agent definitions provide A2A discoverability metadata for each prompt.
PromptPack v1.3.1 adds skills for progressive-disclosure knowledge loading. Skills are modular knowledge sources that agents load on demand, keeping system templates lean while providing access to deep domain expertise.
The skill's instructions or knowledge content. Loaded into the agent's context when activated.
"skills":[ "./skills/billing", {"path":"./skills/compliance","preload":true}, { "name":"escalation-protocol", "description":"Steps for escalating unresolved customer issues", "instructions":"When a customer issue cannot be resolved within 3 exchanges:\n1. Acknowledge the complexity\n2. Collect case details\n3. Create an escalation ticket\n4. Provide the ticket reference to the customer" } ]
Skills + Workflow
When a WorkflowState declares a skills field, it scopes which skills are available in that state. Use "none" to disable skills for a state. Without a skills field, all pack-level skills are available.