Prompt Templates
pi can create prompt templates. Ask it to build one for your workflow.
Prompt Templates
Section titled “Prompt Templates”Prompt templates are Markdown snippets that expand into full prompts. Type /name in the editor to invoke a template, where name is the filename without .md.
Locations
Section titled “Locations”Pi loads prompt templates from:
- Global:
~/.pi/agent/prompts/*.md - Project:
.pi/prompts/*.md(only after the project is trusted) - Packages:
prompts/directories orpi.promptsentries inpackage.json - Settings:
promptsarray with files or directories - CLI:
--prompt-template <path>(repeatable)
Disable discovery with --no-prompt-templates.
Format
Section titled “Format”---description: Review staged git changes---Review the staged changes (`git diff --cached`). Focus on:- Bugs and logic errors- Security issues- Error handling gaps- The filename becomes the command name.
review.mdbecomes/review. descriptionis optional. If missing, the first non-empty line is used.argument-hintis optional. When set, the hint is displayed before the description in the autocomplete dropdown.
Argument Hints
Section titled “Argument Hints”Use argument-hint in frontmatter to show expected arguments in autocomplete. Use <angle brackets> for required arguments and [square brackets] for optional ones:
---description: Review PRs from URLs with structured issue and code analysisargument-hint: "<PR-URL>"---This renders in the autocomplete dropdown as:
→ pr <PR-URL> — Review PRs from URLs with structured issue and code analysis is <issue> — Analyze GitHub issues (bugs or feature requests) wr [instructions] — Finish the current task end-to-end cl — Audit changelog entries before releaseType / followed by the template name in the editor. Autocomplete shows available templates with descriptions.
/review # Expands review.md/component Button # Expands with argument/component Button "click handler" # Multiple argumentsArguments
Section titled “Arguments”Templates support positional arguments, defaults, and simple slicing:
$1,$2, … positional args$@or$ARGUMENTSfor all args joined${1:-default}uses arg 1 when present/non-empty, otherwisedefault${@:N}for args from the Nth position (1-indexed)${@:N:L}forLargs starting at N
Example:
---description: Create a component---Create a React component named $1 with features: $@Default values are useful for optional arguments:
Summarize the current state in ${1:-7} bullet points.Usage: /component Button "onClick handler" "disabled support"
Loading Rules
Section titled “Loading Rules”- Template discovery in
prompts/is non-recursive. - If you want templates in subdirectories, add them explicitly via
promptssettings or a package manifest.