feat(coding-agent,tui): support argument-hint frontmatter in prompt templates (#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 #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
This commit is contained in:
Andrés Vinueza
2026-04-16 16:02:35 -05:00
committed by GitHub
parent f84c4c89f5
commit aa25726ebf
10 changed files with 170 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ import { createSyntheticSourceInfo, type SourceInfo } from "./source-info.js";
export interface PromptTemplate {
name: string;
description: string;
argumentHint?: string;
content: string;
sourceInfo: SourceInfo;
filePath: string; // Absolute path to the template file
@@ -121,6 +122,7 @@ function loadTemplateFromFile(filePath: string, sourceInfo: SourceInfo): PromptT
return {
name,
description,
...(frontmatter["argument-hint"] && { argumentHint: frontmatter["argument-hint"] }),
content: body,
sourceInfo,
filePath,

View File

@@ -432,6 +432,7 @@ export class InteractiveMode {
const templateCommands: SlashCommand[] = this.session.promptTemplates.map((cmd) => ({
name: cmd.name,
description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
...(cmd.argumentHint && { argumentHint: cmd.argumentHint }),
}));
// Convert extension commands to SlashCommand format