feat(coding-agent): add prompt template argument defaults

This commit is contained in:
Danila Poyarkov
2026-06-09 15:12:07 +03:00
parent c10fb95fd9
commit d81ac20920
4 changed files with 89 additions and 31 deletions

View File

@@ -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