Prompt Templates
Prompt templates are reusable text snippets that expand directly into the TUI input editor. Unlike skills (which are sent to the agent immediately), prompt templates let you pre-fill the editor so you can review, edit, or complete the text before sending.
How Prompt Templates Work
When you type /prompt:<name> and press Enter, the template content is loaded into the editor input. You can then modify it, add context, attach files with @, and send it normally. This is useful for long, structured prompts you use frequently.
Prompt Template Directories
sharur searches these locations (in order):
| Path | Scope |
|---|---|
~/.sharur/prompts/ | Global — available in all projects |
.sharur/prompts/ (project root) | Project-specific templates |
Template File Format
A prompt template is any .md file in a prompts directory. The filename (without extension) is the template name.
Invoke with:
Minimal Template (no frontmatter)
The entire file content becomes the template text:
Template with Frontmatter
Add optional YAML frontmatter for metadata:
Frontmatter fields:
| Field | Description |
|---|---|
description | Short description shown in the /prompt: picker |
argument-hint | Hint shown in autocomplete describing expected arguments |
Argument Substitution
Templates support positional argument placeholders: $1, $2, etc.
When you invoke a template via the slash command handler (not the interactive TUI), arguments after the template name are substituted. To mitigate prompt injection, sharur automatically wraps these arguments in <untrusted_input> tags. In the TUI, the template expands as-is and you fill in the values manually.
Practical Examples
PR Description Template
.sharur/prompts/pr-description.md
Invoke:
Then paste or attach the diff before sending.
Architecture Decision Record
.sharur/prompts/adr.md
Invoke:
Global Commit Message Template
~/.sharur/prompts/commit.md
Invoke:
Code Explanation for PR Comments
.sharur/prompts/explain-for-review.md
Tips
- Prompt templates are for your input. They expand into the editor, not directly to the agent. This gives you a chance to customize before sending.
- Use
$1,$2placeholders for dynamic parts you’ll always fill in differently. Leave static boilerplate as literal text. - Combine with
@file attachments. Type/prompt:code-reviewthen add@src/myfile.gobefore pressing Enter to attach a file. - Project-specific overrides. A template in
.sharur/prompts/with the same name as a global template takes priority for that project. - Organize with subdirectories. Templates are discovered recursively, so you can group them:Invoke as
/prompt:refactor,/prompt:adr, etc. (name is the filename, not the full path).