mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
feat(coding-agent): add prompt template argument defaults
This commit is contained in:
parent
c10fb95fd9
commit
d81ac20920
4 changed files with 89 additions and 31 deletions
|
|
@ -64,10 +64,11 @@ Type `/` followed by the template name in the editor. Autocomplete shows availab
|
|||
|
||||
## Arguments
|
||||
|
||||
Templates support positional arguments and simple slicing:
|
||||
Templates support positional arguments, defaults, and simple slicing:
|
||||
|
||||
- `$1`, `$2`, ... positional args
|
||||
- `$@` or `$ARGUMENTS` for all args joined
|
||||
- `${1:-default}` uses arg 1 when present/non-empty, otherwise `default`
|
||||
- `${@:N}` for args from the Nth position (1-indexed)
|
||||
- `${@:N:L}` for `L` args starting at N
|
||||
|
||||
|
|
@ -80,6 +81,12 @@ description: Create a component
|
|||
Create a React component named $1 with features: $@
|
||||
```
|
||||
|
||||
Default values are useful for optional arguments:
|
||||
|
||||
```markdown
|
||||
Summarize the current state in ${1:-7} bullet points.
|
||||
```
|
||||
|
||||
Usage: `/component Button "onClick handler" "disabled support"`
|
||||
|
||||
## Loading Rules
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue