Problem
pi-coding-agent users use .pi/prompts/opsx-*.md for /opsx-propose <desc> → OpenSpec change+artifacts.
OpenSpec prompts lack $@ placeholders → /opsx-propose <text> discards <text> (pi expands verbatim).
Root cause analysis:
Root cause:
/opsx-propose is a Pi prompt template (https://www.npmjs.com/package/@mariozechner/pi-coding-agent?activeTab=docs#prompt-templates) from .pi/prompts/opsx-propose.md.
Typing /opsx-propose <text> in Pi's editor triggers expansion: Pi replaces the command+args with the verbatim template Markdown (instructions/steps), discarding <text> because the template lacks arg placeholders ($@, ${@}, etc.).
- Pi template assumes "The argument after /opsx:propose is..." but cannot interpolate it.
- Result: Editor fills with fixed instructions; agent gets no
<text>, so per step 1, it AskUserQuestion for description (ignores passed text).
- Note: Template uses
/opsx:propose (colon) for display/docs, but pi command is /opsx-propose (no colon, matches filename).
Evidence:
Describe a Workaround
Edit .pi/prompts/opsx-propose.md to use $@:
**Input**: The argument after `/opsx:propose` is "$@". Use this as the change name (kebab-case) OR ...
Then /opsx-propose foo expands with "foo" inserted.
Fix works (insert $@ + /reload), but manual/fragile—dupes schema (artifacts/status/instructions).
Describe a Solution
CLI gen pi prompts w/ dynamic placeholders:
openspec gen pi-prompt propose > .pi/prompts/opsx-propose.md
# Outputs:
**Input**: Args: **$@**. Derive name/desc from "$@".
1. openspec new change "`kebab($@)`"
2. Loop `openspec status --json`...
[Schema-driven steps/deps/instructions]
--format pi-slash: $@ interp.
--workflow {apply,continue,...}
--out .pi/prompts/
Benefits:
- Schema changes → auto-updates.
- No maint dup.
- npm pi packages share.
Alternative Solutions:
- Static prompt files: No arg sub.
- Custom pi ext: Reinvents schema parse.
Additional Details
Problem
pi-coding-agentusers use.pi/prompts/opsx-*.mdfor/opsx-propose <desc>→ OpenSpec change+artifacts.OpenSpec prompts lack
$@placeholders →/opsx-propose <text>discards<text>(pi expands verbatim).Root cause analysis:
Root cause:
/opsx-proposeis a Pi prompt template (https://www.npmjs.com/package/@mariozechner/pi-coding-agent?activeTab=docs#prompt-templates) from.pi/prompts/opsx-propose.md.Typing
/opsx-propose <text>in Pi's editor triggers expansion: Pi replaces the command+args with the verbatim template Markdown (instructions/steps), discarding<text>because the template lacks arg placeholders ($@,${@}, etc.).<text>, so per step 1, it AskUserQuestion for description (ignores passed text)./opsx:propose(colon) for display/docs, but pi command is/opsx-propose(no colon, matches filename).Evidence:
.pi/prompts/opsx-propose.md: No $@.only inserted if placeholders used; else discarded on expand.
Describe a Workaround
Edit .pi/prompts/opsx-propose.md to use $@:
Then
/opsx-propose fooexpands with "foo" inserted.Fix works (insert
$@+/reload), but manual/fragile—dupes schema (artifacts/status/instructions).Describe a Solution
CLI gen pi prompts w/ dynamic placeholders:
--format pi-slash: $@ interp.--workflow {apply,continue,...}--out .pi/prompts/Benefits:
Alternative Solutions:
Additional Details