Centralized prompt loading for PtcRunner.
All prompt templates are loaded from priv/prompts/ at compile time and
exposed through this module. Changes to prompt files trigger recompilation.
Prompt Files
| File | Function | Used By |
|---|---|---|
lisp-base.md | lisp_base/0 | LanguageSpec |
lisp-addon-single_shot.md | lisp_addon_single_shot/0 | LanguageSpec |
lisp-addon-multi_turn.md | lisp_addon_multi_turn/0 | LanguageSpec |
json-system.md | json_system/0 | JsonMode |
json-user.md | json_user/0 | JsonMode |
json-error.md | json_error/0 | JsonMode |
must_return_warning.md | must_return_warning/0 | TurnFeedback |
retry_feedback.md | retry_feedback/0 | TurnFeedback |
planning-examples.md | planning_examples/0 | MetaPlanner |
verification-predicate-guide.md | verification_guide/0 | MetaPlanner |
verification-predicate-reminder.md | verification_reminder/0 | MetaPlanner |
File Format
Prompt files use HTML comment markers to separate metadata from content:
# Title
Description for maintainers.
<!-- version: 1 -->
<!-- date: 2026-01-01 -->
<!-- PTC_PROMPT_START -->
Actual prompt content here.
<!-- PTC_PROMPT_END -->Content between PTC_PROMPT_START and PTC_PROMPT_END markers is extracted.
If no markers exist, the entire file (trimmed) is used.
Mustache Templates
Some prompts use Mustache templating (e.g., must_return_warning.md):
{{variable}}- Simple substitution{{#section}}...{{/section}}- Conditional/iteration{{^section}}...{{/section}}- Inverted (if falsy)
See PtcRunner.Mustache for expansion.
Adding New Prompts
- Create
priv/prompts/my-prompt.mdwith markers - Add to this module:
@my_prompt_filepath@external_resource @my_prompt_file@my_promptloaded contentdef my_prompt, do: @my_prompt
- Document in the table above
Summary
Functions
Get a prompt by key.
JSON mode error feedback template (Mustache).
JSON mode system prompt.
JSON mode user message template (Mustache).
Multi-turn mode addon (memory, return/fail, println).
Raw header + content for lisp-addon-multi_turn.md.
Single-shot mode addon (no memory, no return/fail).
Raw header + content for lisp-addon-single_shot.md.
Core PTC-Lisp language reference (always included).
Raw header + content for lisp-base.md (for metadata parsing).
List all available prompt keys.
Final work turn warning template (Mustache).
Example plan structure for MetaPlanner.
Retry phase feedback template (Mustache).
Guide for writing task signatures.
Comprehensive guide for writing verification predicates.
Quick reference reminder for verification predicates.
Functions
Get a prompt by key.
Examples
iex> prompt = PtcRunner.Prompts.get(:lisp_base)
iex> String.contains?(prompt, "PTC-Lisp")
true
iex> PtcRunner.Prompts.get(:unknown)
nil
@spec json_error() :: String.t()
JSON mode error feedback template (Mustache).
@spec json_system() :: String.t()
JSON mode system prompt.
@spec json_user() :: String.t()
JSON mode user message template (Mustache).
@spec lisp_addon_multi_turn() :: String.t()
Multi-turn mode addon (memory, return/fail, println).
Raw header + content for lisp-addon-multi_turn.md.
@spec lisp_addon_single_shot() :: String.t()
Single-shot mode addon (no memory, no return/fail).
Raw header + content for lisp-addon-single_shot.md.
@spec lisp_base() :: String.t()
Core PTC-Lisp language reference (always included).
Raw header + content for lisp-base.md (for metadata parsing).
@spec list() :: [atom()]
List all available prompt keys.
Examples
iex> keys = PtcRunner.Prompts.list()
iex> :lisp_base in keys
true
@spec must_return_warning() :: String.t()
Final work turn warning template (Mustache).
Variables: has_retries (bool), retry_count (int).
@spec planning_examples() :: String.t()
Example plan structure for MetaPlanner.
@spec retry_feedback() :: String.t()
Retry phase feedback template (Mustache).
Variables: is_final_retry, current_retry, total_retries,
retries_remaining, next_turn.
@spec signature_guide() :: String.t()
Guide for writing task signatures.
@spec verification_guide() :: String.t()
Comprehensive guide for writing verification predicates.
@spec verification_reminder() :: String.t()
Quick reference reminder for verification predicates.