What do you want to change?
Add a small default-value form to prompt template argument substitution, e.g. ${1:-7}.
Prompt templates currently support $1, $@, $ARGUMENTS, ${@:N}, and ${@:N:L}. That is enough to pass arguments through, but optional arguments cannot have clean defaults.
Example:
Summarize the current state in ${1:-7} bullet points.
This would make both /summary and /summary 3 expand cleanly.
Why?
Optional prompt arguments are useful for prompt shortcuts with a sensible default.
Without defaults, templates have to expose prompt mechanics to the model, e.g. “Requested count: $1; if blank use 7”. That works, but it is awkward and less reliable than expanding the default before the prompt reaches the model.
How? (optional)
Extend substituteArgs in packages/coding-agent/src/core/prompt-templates.ts with a narrow Bash-like default form:
${1:-default} → use arg 1 if present/non-empty, otherwise default
No full Bash parameter expansion needed; just this one form plus docs/tests.
If this sounds welcome, I can try a PR after approval.
What do you want to change?
Add a small default-value form to prompt template argument substitution, e.g.
${1:-7}.Prompt templates currently support
$1,$@,$ARGUMENTS,${@:N}, and${@:N:L}. That is enough to pass arguments through, but optional arguments cannot have clean defaults.Example:
Summarize the current state in ${1:-7} bullet points.This would make both
/summaryand/summary 3expand cleanly.Why?
Optional prompt arguments are useful for prompt shortcuts with a sensible default.
Without defaults, templates have to expose prompt mechanics to the model, e.g. “Requested count: $1; if blank use 7”. That works, but it is awkward and less reliable than expanding the default before the prompt reaches the model.
How? (optional)
Extend
substituteArgsinpackages/coding-agent/src/core/prompt-templates.tswith a narrow Bash-like default form:${1:-default}→ use arg 1 if present/non-empty, otherwisedefaultNo full Bash parameter expansion needed; just this one form plus docs/tests.
If this sounds welcome, I can try a PR after approval.