class LittleGhost::PromptResolver

PromptResolver renders conventional ERB prompt views. It supports ordered application roots and partials without allowing a template name to escape those roots.

resolver = LittleGhost::PromptResolver.new(paths: ["app/prompts"])
prompt = resolver.render("support/system_prompt", assigns: {product: "Acme"})
prompt.include?("Acme") # => true

In support/system_prompt.erb:

You support <%= @product %> customers.

Earlier invocation roots override configured roots. Template names must be relative, and both lexical traversal and symbolic-link escapes are rejected. Partials use an underscore-prefixed filename, receive only their explicitly supplied locals, and share the parent view’s application assigns.

Every configured root is trusted Ruby code because ERB executes inside the current process. Keep roots application-controlled and non-user-writable. See the Prompts as Views guide for Agent system prompts and framework prompt overrides.