feat(coding-agent): add prompt template argument defaults
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user