Reverse engineered prompt

Build me a small Ruby gem called PM that makes it easy to manage prompts for AI apps from markdown files or raw strings. I want prompt files to support YAML front matter for metadata and parameters, then let me render the final prompt with values passed in later. If a parameter is set to null it should be required, otherwise use the default.

Please support prompt composition too. I want one prompt to be able to include other markdown prompt files, and also insert raw file contents without parsing them. It should handle nested includes, pass parent parameters through, track what got included, and stop circular includes with a clear error.

Also add optional shell expansion for things like environment variables and command output, optional ERB style templating, comment stripping, simple global config like prompts directory and default pipeline settings, and a way to register custom helper directives for templates.

Please make it feel clean and usable, with tests and a README showing real examples. If you need to, look up current Ruby gem conventions online.

Want more depth? Deep Reverse