PM (PromptManager)¶
![]() "Prompts with superpowers" |
Parse YAML front matter from markdown, expand shell references, compose prompts from other files, and render ERB on demand. PM (PromptManager) treats a prompt file as a composable, parameterized template. Write prompts in markdown with YAML front matter, shell references, and ERB. PM handles the rest. Key Features
|
Processing Pipeline¶
Every prompt passes through four stages:
graph LR
A[Strip HTML Comments] --> B[Extract YAML Metadata]
B --> C[Shell Expansion]
C --> D["ERB Rendering (on to_s)"]
- Strip HTML comments --
<!-- ... -->removed before anything else - Extract YAML metadata -- Front matter between
---fences parsed intoPM::Metadata - Shell expansion -- Environment variables and commands expanded (when
shell: true) - ERB rendering -- Templates evaluated on demand when
to_sis called (whenerb: true)
Quick Example¶
Given a file review.md:
---
title: Code Review
parameters:
language: ruby
code: null
---
Review the following <%= language %> code:
<%= code %>
Parse and render:
require 'pm'
parsed = PM.parse('review.md')
puts parsed.metadata.title #=> "Code Review"
puts parsed.to_s('code' => source) #=> rendered prompt
A word on trust¶
A prompt file can run Ruby (ERB), run shell commands ($(...)), and read any file
(include / insert). Treat prompt files as code and read the
Security guide before parsing files you did not write.
Getting Started¶
Head to Installation to add PM to your project, then follow the Quick Start guide.
