Documentation Index
Fetch the complete documentation index at: https://mintlify.com/badlogic/pi-mono/llms.txt
Use this file to discover all available pages before exploring further.
Pi can create prompt templates for you. Just ask it to build one for your workflow.
/name in the editor to invoke a template, where name is the filename without .md.
Template Locations
Pi loads prompt templates from: Global:~/.pi/agent/prompts/*.md
.pi/prompts/*.md
prompts/directories in pi packagespi.promptsentries inpackage.json
promptsarray with files or directories
--prompt-template <path>(repeatable)
--no-prompt-templates.
Template Format
- The filename becomes the command name.
review.mdbecomes/review descriptionis optional. If missing, the first non-empty line is used- Everything after the frontmatter is the template content
Basic Usage
Type/ followed by the template name:
/review text in the editor, then you can submit or edit further.
Arguments
Templates support positional arguments and simple slicing:Positional arguments
All arguments joined with spaces
Arguments from the Nth position (1-indexed)
L arguments starting at position N
Example: Component Template
File:~/.pi/agent/prompts/component.md
Examples
Code Review
File:~/.pi/agent/prompts/review.md
Test Generation
File:~/.pi/agent/prompts/test.md
Documentation
File:~/.pi/agent/prompts/doc.md
Refactoring
File:~/.pi/agent/prompts/refactor.md
Bug Analysis
File:~/.pi/agent/prompts/debug.md
Advanced Usage
Conditional Content
Use argument presence to include conditional content:${3:+text} syntax includes with authentication only if argument 3 is provided.
Multiple Files
Reference multiple files:Loading Rules
Template discovery in
prompts/ is non-recursive. Only files directly in the directory are loaded.Naming Collisions
If multiple templates have the same name:- Project templates override global templates
- Later paths in settings override earlier ones
- A warning is shown in verbose startup
Creating Templates
Sharing Templates
Package templates for others: See Pi Packages for full details.Best Practices
Be Specific
Write focused templates for specific tasks rather than generic prompts
Use Arguments
Leverage
$1, $2, $@ for flexibility without creating many similar templatesInclude Context
Provide enough context in the template for the model to understand requirements
Show Examples
Include example usage in comments or description for other users
Keep It Short
Templates should be reusable snippets, not complete instructions. Save complex workflows for Skills.
Name Clearly
Use descriptive filenames that clearly indicate the template’s purpose
Templates vs Skills
Use templates for:- Quick prompts and reminders
- Common review patterns
- Standard questions
- Short, reusable text
- Multi-step workflows
- External tool integration
- Complex setup procedures
- On-demand documentation
Next Steps
Skills
Create Agent Skills for complex workflows
Pi Packages
Package and share templates via npm or git