Prompt templates are Markdown files that expand into full prompts. TypeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/earendil-works/pi/llms.txt
Use this file to discover all available pages before exploring further.
/name in the editor — where name is the filename without .md — and Pi replaces the command with the template content before sending it to the agent.
Template locations
Pi loads prompt templates from these locations:| Location | Scope |
|---|---|
~/.pi/agent/prompts/*.md | Global (all projects) |
.pi/prompts/*.md | Project-local |
prompts/ in Pi packages | Via installed packages |
settings.json:
--prompt-template <path> on the CLI to load a template for a single run. Disable discovery entirely with --no-prompt-templates.
Template discovery in
prompts/ directories is non-recursive. To load templates from subdirectories, add them explicitly via the prompts setting or a package manifest.Template format
Templates are Markdown files with optional YAML frontmatter:- The filename becomes the command name.
review.mdbecomes/review. descriptionis optional. If missing, the first non-empty line is used as the description in autocomplete.argument-hintis optional. When set, it shows expected arguments in the autocomplete dropdown.
Argument hints
Useargument-hint in frontmatter to show expected arguments when the user types /:
<angle brackets> for required arguments and [square brackets] for optional ones.
Template arguments
Templates support positional arguments and slicing:| Syntax | Meaning |
|---|---|
$1, $2, … | Positional arguments |
$@ or $ARGUMENTS | All arguments joined |
${@:N} | Arguments from position N (1-indexed) |
${@:N:L} | L arguments starting at position N |
~/.pi/agent/prompts/component.md):
Using templates
Type/ in the editor to trigger autocomplete. Templates appear alongside skill commands and extension commands with their descriptions.
Example: code review template
Create~/.pi/agent/prompts/review.md:
/review in Pi’s editor to expand it immediately.
Sharing templates
Add aprompts/ directory to a Pi package to share templates via npm or git:
Related
Skills
On-demand instruction packages the agent loads automatically.
Extensions
TypeScript modules for custom commands and tools.
Pi packages
Bundle and share templates via npm or git.