Skill Tracer
Skills › Scientific Agent Skills › pi-agent › prompt-templates.md

prompt-templates.md

50 lines · skills/pi-agent/references/prompt-templates.md at 5f2bc03

Open on GitHub
1# Prompt Templates
2
3Source: https://pi.dev/docs/latest/prompt-templates
4
5Reviewed against Pi 0.99.2 and the package versions listed in `../SKILL.md` on 2026-09-30.
6
7Prompt templates are Markdown snippets that expand into full prompts. Type `/name` in the editor, where `name` is the filename without `.md` (`review.md` → `/review`).
8

Prompt Templates

Source: https://pi.dev/docs/latest/prompt-templates

Reviewed against Pi 0.99.2 and the package versions listed in ../SKILL.md on 2026-09-30.

Prompt templates are Markdown snippets that expand into full prompts. Type /name in the editor, where name is the filename without .md (review.md → /review).

Raw lines 1 to 8
9## Locations
11- Global: `~/.pi/agent/prompts/*.md`
12- Project: `.pi/prompts/*.md` (only after project trust)
13- Packages: `prompts/` directories or `pi.prompts` entries in `package.json`
14- Settings: `prompts` array with files or directories
15- CLI: `--prompt-template <path>` (repeatable)
17Disable discovery with `--no-prompt-templates`.

Locations

  • Global: ~/.pi/agent/prompts/*.md
  • Project: .pi/prompts/*.md (only after project trust)
  • Packages: prompts/ directories or pi.prompts entries in package.json
  • Settings: prompts array with files or directories
  • CLI: --prompt-template <path> (repeatable)

Disable discovery with --no-prompt-templates.

Raw lines 9 to 18
19## Format
21```md
22---
23description: Review staged git changes
24argument-hint: "<PR-URL>"
25---
26Review the staged changes (`git diff --cached`). Focus on: $ARGUMENTS
27```
29`description` is optional — without it Pi uses the first non-empty line. `argument-hint` is optional and shown **before** the description in the autocomplete dropdown; use `<angle brackets>` for required arguments and `[square brackets]` for optional ones.

Format

---
description: Review staged git changes
argument-hint: "<PR-URL>"
---
Review the staged changes (`git diff --cached`). Focus on: $ARGUMENTS

description is optional — without it Pi uses the first non-empty line. argument-hint is optional and shown before the description in the autocomplete dropdown; use <angle brackets> for required arguments and [square brackets] for optional ones.

Raw lines 19 to 30
31## Usage
33```text
34/review # expands review.md
35/component Button # one argument
36/component Button "click handler" # multiple arguments
37```

Usage

/review                           # expands review.md
/component Button                 # one argument
/component Button "click handler"  # multiple arguments
Raw lines 31 to 38
39## Arguments
41- `$1`, `$2`, … positional
42- `$@` or `$ARGUMENTS` all arguments joined
43- `${1:-default}` argument 1 when present and non-empty, otherwise the default
44- `${@:-default}` or `${ARGUMENTS:-default}` all arguments when present, otherwise the default
45- `${@:N}` arguments from the Nth position (1-indexed)
46- `${@:N:L}` `L` arguments starting at N

Arguments

  • $1, $2, … positional
  • $@ or $ARGUMENTS all arguments joined
  • ${1:-default} argument 1 when present and non-empty, otherwise the default
  • ${@:-default} or ${ARGUMENTS:-default} all arguments when present, otherwise the default
  • ${@:N} arguments from the Nth position (1-indexed)
  • ${@:N:L} L arguments starting at N
Raw lines 39 to 47
48## Loading Rules
50Discovery in `prompts/` is non-recursive. Templates in subdirectories must be added explicitly through the `prompts` setting or a package manifest.

Loading Rules

Discovery in prompts/ is non-recursive. Templates in subdirectories must be added explicitly through the prompts setting or a package manifest.

Raw lines 48 to 50