Skip to main content

Documentation 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.

Prompt templates are Markdown files that expand into full prompts. Type /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:
LocationScope
~/.pi/agent/prompts/*.mdGlobal (all projects)
.pi/prompts/*.mdProject-local
prompts/ in Pi packagesVia installed packages
You can also add paths in settings.json:
{
  "prompts": [
    "/path/to/my-prompts/",
    "/path/to/specific-template.md"
  ]
}
Use --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:
---
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.md becomes /review.
  • description is optional. If missing, the first non-empty line is used as the description in autocomplete.
  • argument-hint is optional. When set, it shows expected arguments in the autocomplete dropdown.

Argument hints

Use argument-hint in frontmatter to show expected arguments when the user types /:
---
description: Review a pull request by URL
argument-hint: "<PR-URL>"
---
Review the pull request at $1. Analyze the changes for bugs, security issues, and style.
This renders in the autocomplete dropdown as:
→ review-pr   <PR-URL>   — Review a pull request by URL
Use <angle brackets> for required arguments and [square brackets] for optional ones.

Template arguments

Templates support positional arguments and slicing:
SyntaxMeaning
$1, $2, …Positional arguments
$@ or $ARGUMENTSAll arguments joined
${@:N}Arguments from position N (1-indexed)
${@:N:L}L arguments starting at position N
Example template (~/.pi/agent/prompts/component.md):
---
description: Create a React component
---
Create a React component named $1 with these features: $@
Usage:
/component Button "onClick handler" "disabled support"
Expands to:
Create a React component named Button with these features: onClick handler disabled support

Using templates

Type / in the editor to trigger autocomplete. Templates appear alongside skill commands and extension commands with their descriptions.
/review                           # Expands review.md
/component Button                 # Expands with one argument
/component Button "click handler" # Expands with multiple arguments

Example: code review template

Create ~/.pi/agent/prompts/review.md:
---
description: Review code for bugs, security issues, and performance
argument-hint: "[focus area]"
---
Review the code for:
- Bugs and logic errors
- Security vulnerabilities
- Performance issues
- Error handling gaps

${@:1:1}
Then type /review in Pi’s editor to expand it immediately.

Sharing templates

Add a prompts/ directory to a Pi package to share templates via npm or git:
{
  "name": "my-pi-package",
  "keywords": ["pi-package"],
  "pi": {
    "prompts": ["./prompts"]
  }
}

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.

Build docs developers (and LLMs) love