Skip to content

feat(coding-agent,tui): support argument-hint frontmatter in prompt templates#2780

Merged
badlogic merged 2 commits into
earendil-works:mainfrom
andresvi94:argument-hint-support
Apr 16, 2026
Merged

feat(coding-agent,tui): support argument-hint frontmatter in prompt templates#2780
badlogic merged 2 commits into
earendil-works:mainfrom
andresvi94:argument-hint-support

Conversation

@andresvi94

@andresvi94 andresvi94 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

What

Parse argument-hint from prompt template frontmatter and display it in the autocomplete dropdown, so users can see what arguments a command expects before invoking it.

Frontmatter format

Use <angle brackets> for required arguments and [square brackets] for optional ones:

---
description: Review PRs from URLs with structured issue and code analysis
argument-hint: "<PR-URL>"
---

How it renders

The hint prepends to the description column in autocomplete:

→ pr   <PR-URL>       — Review PRs from URLs with structured issue and code analysis
  is   <issue>        — Analyze GitHub issues (bugs or feature requests)
  wr   [instructions] — Finish the current task end-to-end with changelog, commit, and push
  cl   — Audit changelog entries before release

Changes

File Change
packages/coding-agent/src/core/prompt-templates.ts Add argumentHint? to PromptTemplate, parse argument-hint from frontmatter
packages/coding-agent/src/modes/interactive/interactive-mode.ts Pass argumentHint through to SlashCommand
packages/tui/src/autocomplete.ts Add argumentHint? to SlashCommand, prepend hint to description in dropdown
packages/coding-agent/test/prompt-templates.test.ts Tests for parsing required/optional hints, missing hints, empty hints, special characters
packages/coding-agent/docs/prompt-templates.md Document argument-hint frontmatter field with convention and examples
.pi/prompts/pr.md, is.md, wr.md Add argument-hint to built-in project templates

No new dependencies, no breaking changes.

Closes #2761

…emplates

Parse argument-hint from prompt template frontmatter and display it
in the autocomplete dropdown description, matching Claude Code's
convention for custom commands.

Frontmatter format:
  ---
  description: Code review
  argument-hint: "[file | #PR | PR-URL]"
  ---

The hint renders in the description column of the autocomplete list:
  review   [file | #PR | PR-URL] — Code review

Closes earendil-works#2761
@badlogic

badlogic commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

please also update the corresponding documentation

…uilt-in hints

- Document argument-hint frontmatter in prompt-templates.md with <required>/[optional] convention
- Add argument-hint to built-in prompts: pr, is, wr
- Expand tests: required/optional hints, missing hints, empty hints, special characters
- Add changelog entries for coding-agent and tui
@andresvi94

Copy link
Copy Markdown
Contributor Author

Updated!

@badlogic badlogic added the inprogress Issue is being worked on label Apr 16, 2026
@badlogic badlogic merged commit aa25726 into earendil-works:main Apr 16, 2026
@badlogic

Copy link
Copy Markdown
Collaborator

cheers!

@badlogic

Copy link
Copy Markdown
Collaborator

Follow-up: moved the changelog entries in packages/coding-agent/CHANGELOG.md and packages/tui/CHANGELOG.md from the already-released 0.65.0 section to [Unreleased], and updated the attribution to link the PR and credit you. Per AGENTS.md, released version sections are immutable, and external contributions need the PR link + author.

badlogic added a commit that referenced this pull request Apr 16, 2026
…leased]

Move the argument-hint entries added in #2780 out of the already-released
0.65.0 sections and into [Unreleased], and credit the external contributor
with a PR link per AGENTS.md changelog rules.
durdn pushed a commit to durdn/pi-mono that referenced this pull request Apr 21, 2026
…emplates (earendil-works#2780)

* feat(coding-agent,tui): support argument-hint frontmatter in prompt templates

Parse argument-hint from prompt template frontmatter and display it
in the autocomplete dropdown description, matching Claude Code's
convention for custom commands.

Frontmatter format:
  ---
  description: Code review
  argument-hint: "[file | #PR | PR-URL]"
  ---

The hint renders in the description column of the autocomplete list:
  review   [file | #PR | PR-URL] — Code review

Closes earendil-works#2761

* docs(coding-agent,tui): add argument-hint documentation, tests, and built-in hints

- Document argument-hint frontmatter in prompt-templates.md with <required>/[optional] convention
- Add argument-hint to built-in prompts: pr, is, wr
- Expand tests: required/optional hints, missing hints, empty hints, special characters
- Add changelog entries for coding-agent and tui
durdn pushed a commit to durdn/pi-mono that referenced this pull request Apr 21, 2026
…leased]

Move the argument-hint entries added in earendil-works#2780 out of the already-released
0.65.0 sections and into [Unreleased], and credit the external contributor
with a PR link per AGENTS.md changelog rules.
byte-rose pushed a commit to byte-rose/pi-mono that referenced this pull request Apr 28, 2026
…emplates (earendil-works#2780)

* feat(coding-agent,tui): support argument-hint frontmatter in prompt templates

Parse argument-hint from prompt template frontmatter and display it
in the autocomplete dropdown description, matching Claude Code's
convention for custom commands.

Frontmatter format:
  ---
  description: Code review
  argument-hint: "[file | #PR | PR-URL]"
  ---

The hint renders in the description column of the autocomplete list:
  review   [file | #PR | PR-URL] — Code review

Closes earendil-works#2761

* docs(coding-agent,tui): add argument-hint documentation, tests, and built-in hints

- Document argument-hint frontmatter in prompt-templates.md with <required>/[optional] convention
- Add argument-hint to built-in prompts: pr, is, wr
- Expand tests: required/optional hints, missing hints, empty hints, special characters
- Add changelog entries for coding-agent and tui
byte-rose pushed a commit to byte-rose/pi-mono that referenced this pull request Apr 28, 2026
…leased]

Move the argument-hint entries added in earendil-works#2780 out of the already-released
0.65.0 sections and into [Unreleased], and credit the external contributor
with a PR link per AGENTS.md changelog rules.
larsboes pushed a commit to larsboes/pi-mono that referenced this pull request Apr 30, 2026
…emplates (earendil-works#2780)

* feat(coding-agent,tui): support argument-hint frontmatter in prompt templates

Parse argument-hint from prompt template frontmatter and display it
in the autocomplete dropdown description, matching Claude Code's
convention for custom commands.

Frontmatter format:
  ---
  description: Code review
  argument-hint: "[file | #PR | PR-URL]"
  ---

The hint renders in the description column of the autocomplete list:
  review   [file | #PR | PR-URL] — Code review

Closes earendil-works#2761

* docs(coding-agent,tui): add argument-hint documentation, tests, and built-in hints

- Document argument-hint frontmatter in prompt-templates.md with <required>/[optional] convention
- Add argument-hint to built-in prompts: pr, is, wr
- Expand tests: required/optional hints, missing hints, empty hints, special characters
- Add changelog entries for coding-agent and tui
larsboes pushed a commit to larsboes/pi-mono that referenced this pull request Apr 30, 2026
…leased]

Move the argument-hint entries added in earendil-works#2780 out of the already-released
0.65.0 sections and into [Unreleased], and credit the external contributor
with a PR link per AGENTS.md changelog rules.
PSU3D0 added a commit to PSU3D0/pi-mono that referenced this pull request May 13, 2026
Consolidates 62 upstream commits (v0.67.4 -> v0.67.68) into the fork.
Preserves all fork-local work (OAuth cloak, antigravity pool, context
tiers, OSC 8 file hyperlinks, gemini3 sig skip, codex_cli_rs headers,
compaction context hooks, gpt-5.4 models).

Conflict resolutions (4 files):

- packages/ai/src/providers/google-gemini-cli.ts: layered upstream's
  onResponse hook call into our pool-aware retry loop; kept our
  finally-block pool.saveNow() path.

- packages/tui/src/utils.ts: adopted upstream's AnsiCodeTracker OSC 8
  impl wholesale. It's cleaner than our f16dfd5 version (preserves
  hyperlink across SGR reset via separate clear(), emits ST-terminated
  sequences). Dropped our 7d75fee SEGMENT_RESET fix since upstream's
  design never introduced the bug.

- packages/tui/src/components/markdown.ts: kept our resolveHref hook
  and wrapHyperlink helper but gated OSC 8 emission on
  getCapabilities().hyperlinks; switched to upstream's hyperlink()
  helper for consistency. Merges file path linking (ours) with
  terminal capability detection (upstream earendil-works#3248, #30a8a41f).

- packages/tui/test/{markdown,wrap-ansi}.test.ts: updated our OSC 8
  assertions to ST-terminated sequences (\x1b\\) to match new emitter;
  added setCapabilities({hyperlinks:true}) gating where needed;
  afterEach resetCapabilitiesCache to isolate test state.

Dependency upgrades from upstream:
- @anthropic-ai/sdk 0.73.0 -> 0.90.0
- @aws-sdk/client-bedrock-runtime 3.983.0 -> 3.1030.0
- @mistralai/mistralai 1.14.1 -> 2.2.0

Upstream features folded in:
- fix(ai): Opus 4.7 adaptive thinking + xhigh effort (earendil-works#3286)
- feat(ai): thinkingDisplay option (summarized/omitted/raw)
- feat(coding-agent): after_provider_response hook (earendil-works#3128)
- fix(ai): trust requested Codex service tier (earendil-works#3307)
- feat(bedrock): Bearer token auth for Converse API (earendil-works#3125)
- feat(agent,coding-agent): per-tool executionMode override (earendil-works#3345)
- feat(tui): OSC 8 hyperlinks with terminal capability detection
  (earendil-works#3248, #30a8a41f)
- feat(coding-agent,tui): argument-hint frontmatter in prompts (earendil-works#2780)
- Plus ~40 smaller fixes across ai/coding-agent/tui/agent.

Verification:
- packages/tui: 559/559 tests pass
- packages/ai: 144/144 OAuth cloak tests pass; all fork-local suites
  pass (antigravity-pool, context-tiers, gemini3-unsigned-tool-call,
  codex-stream, supports-xhigh, etc.). Remaining test failures (13)
  are pre-existing live-API E2E tests (no credentials in this env).
- packages/agent: 39/39 tests pass.
- packages/coding-agent: 1020/1021 tests pass; 1 flaky bash timeout
  test (passes in isolation), unrelated to merge.
- All four packages build cleanly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inprogress Issue is being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support argument-hint frontmatter in prompt templates

2 participants