mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 18:04:41 +00:00
docs(coding-agent): update README intro, add packages/prompt-templates/themes docs
- Rewrote README intro to emphasize extensibility and pi packages - Added Pi Packages section to README - Created docs/packages.md covering install, sources, manifest, filtering - Created docs/prompt-templates.md covering format and arguments - Created docs/themes.md with overview linking to theme.md
This commit is contained in:
parent
27b27d9441
commit
94952bd6c0
4 changed files with 272 additions and 2 deletions
57
packages/coding-agent/docs/prompt-templates.md
Normal file
57
packages/coding-agent/docs/prompt-templates.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
> 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 when you type `/name` in the editor.
|
||||
|
||||
## 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
|
||||
|
||||
```markdown
|
||||
---
|
||||
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.
|
||||
|
||||
## 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:
|
||||
|
||||
```markdown
|
||||
---
|
||||
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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue