clanker-agent/packages/coding-agent/docs/prompt-templates.md
Harivansh Rathi 0250f72976 move pi-mono into companion-cloud as apps/companion-os
- Copy all pi-mono source into apps/companion-os/
- Update Dockerfile to COPY pre-built binary instead of downloading from GitHub Releases
- Update deploy-staging.yml to build pi from source (bun compile) before Docker build
- Add apps/companion-os/** to path triggers
- No more cross-repo dispatch needed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 09:22:50 -08:00

1.8 KiB

pi can create prompt templates. Ask it to build one for your workflow.

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

Pi loads prompt templates from:

  • Global: ~/.pi/agent/prompts/*.md
  • Project: .pi/prompts/*.md
  • 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.

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.md becomes /review.
  • description is optional. If missing, the first non-empty line is used.

Usage

Type / 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 arguments

Arguments

Templates support positional arguments and simple slicing:

  • $1, $2, ... positional args
  • $@ or $ARGUMENTS for all args joined
  • ${@:N} for args from the Nth position (1-indexed)
  • ${@:N:L} for L args starting at N

Example:

---
description: Create a component
---

Create a React component named $1 with features: $@

Usage: /component Button "onClick handler" "disabled support"

Loading Rules

  • Template discovery in prompts/ is non-recursive.
  • If you want templates in subdirectories, add them explicitly via prompts settings or a package manifest.