intr-parser - Parser for the .prompt file format.
Parses Dotprompt-compatible .prompt files into a structured [ParseResult].
Supports all three tiers:
- Tier 1: Plain Handlebars template with no frontmatter.
- Tier 2: YAML frontmatter with
id,version, model hints, typed inputs. - Tier 3: Tier 2 +
evals, chains, reputation metadata.
Example
use parse;
let src = r#"---
id: greet
version: 1.0.0
description: Greet a user by name
model:
preferred: [claude-sonnet-4-6]
temperature: 0.3
input:
schema:
name: string
---
Hello, {{name}}!
"#;
let result = parse.unwrap;
assert_eq!;
assert!;