Verified against GitHub Copilot Chat · 2026-07-22
Turn a prompt you keep retyping into a Copilot prompt file instead of pasting it again
A .github/prompts/*.prompt.md reusable prompt file with input placeholders, invoked as a slash command from the Chat input box, so a well-tuned multi-paragraph prompt becomes one command instead of a paste you have to keep re-finding.
The prompt
Ready to copy — highlighted parts are example details you can swap.
Write a reusable Copilot Chat prompt file, ready to save at .github/prompts/changelog-entry.prompt.md. The filename becomes the slash command you type in the Chat input box to invoke it, so name the file for exactly the command you want to type. TASK THIS PROMPT FILE SHOULD DO EVERY TIME IT IS INVOKED Read the staged diff and the most recent five entries in CHANGELOG.md, then draft one new entry in the same format and tone as the existing ones. INPUTS IT SHOULD ACCEPT WHEN INVOKED An optional short label for the type of change — feature, fix, or chore — defaulting to inferring it from the diff if omitted. STRUCTURE THE FILE AS 1. YAML frontmatter: mode (ask — this only reads and drafts text, it never edits CHANGELOG.md directly. — pick the narrowest mode that can actually do the job; do not default to an editing-capable mode for a task that only needs to read and answer), tools (only if the mode is edit- or agent-capable and the task genuinely needs specific tool access, listed explicitly rather than inherited broadly), and description (one sentence describing the command, since this is what shows in the slash-command list when a user types the trigger character and starts scrolling). 2. The body, written as a direct instruction to Copilot, with the accepted inputs from An optional short label for the type of change — feature, fix, or chore — defaulting to inferring it from the diff if omitted. referenced using the prompt-files feature's own input-placeholder syntax rather than typed out as a literal string the user is expected to manually substitute themselves — the whole benefit of a prompt file over a saved snippet is that the input gets filled in at invocation time, not read and re-typed by a human first. 3. An explicit output contract at the end of the body: the exact section headers or shape this prompt file must produce every time, so invoking it on Monday and again on Friday, on different input, produces comparably structured output rather than two differently organized answers that happen to share a slash command. HOW THIS DIFFERS FROM A CUSTOM CHAT MODE A prompt file is one task invoked with one command and closed; a custom chat mode is a whole conversational stance you switch into and stay in across many turns. If what you actually want is a standing way of talking to Copilot for an entire session rather than a single repeatable task with inputs, a chat mode is the better fit — do not force a multi-turn workflow into a single prompt-file invocation just because a prompt file was the first mechanism that came to mind. CONSTRAINTS - If Read the staged diff and the most recent five entries in CHANGELOG.md, then draft one new entry in the same format and tone as the existing ones. genuinely needs file or workspace context beyond the invocation-time input, say explicitly what that context is rather than assuming Copilot will infer it from the current tab, since a prompt file is often invoked from a different file than the one its author had open while writing it. - Do not have this prompt file perform a mutating action unless ask — this only reads and drafts text, it never edits CHANGELOG.md directly. explicitly calls for an editing-capable mode and the task genuinely requires it — a prompt file meant to be run repeatedly and quickly should not surprise its user with an unexpected file change. - If .github/prompts/ currently has commit-message.prompt.md and pr-description.prompt.md. already has a prompt file doing something similar, name the overlap rather than adding a near-duplicate command that a future user will not know which one to reach for. OUTPUT The complete file content, frontmatter and body, ready to paste as-is. After it, one sentence stating what this prompt file explicitly does not do that a user might otherwise assume from its name.
Customize
Optional — swap in your own details for the highlighted parts above.
Why this works
A prompt file's filename is not cosmetic — it is the literal slash-command string Copilot Chat exposes once the file exists in the prompts directory, the same load-bearing-filename mechanic that makes a saved custom command invokable at all rather than just a markdown file sitting unused in a folder. The mode field is a real, enforced capability boundary rather than a description of intended behavior: a prompt file set to the narrowest read-only mode that can do the job is structurally incapable of editing a file even if its own body were somehow read in a way that suggested it should, which matters specifically because a prompt file is invoked by a short trigger with no surrounding conversation to reconsider intent in the moment. The input-placeholder syntax is the actual reason a prompt file beats a saved snippet of the same wording — a snippet still requires a human to read it, notice what needs to change for this invocation, and manually edit that part before pasting, while a genuine input placeholder gets filled in in the same action that invokes the command, which is the entire efficiency gain a prompt file is supposed to deliver over pasting a slightly-edited copy of the same paragraph each time. The explicit output contract solves the real failure mode of any reusable prompt invoked fresh with new input each time: because nothing else pins the output shape down, the same wording run on two different occasions can drift into two differently structured answers, which quietly defeats the reason to have made it a standing command instead of a slightly-varying paste. Finally, distinguishing a prompt file from a custom chat mode by task duration — one invocation and closed, versus a conversational stance maintained across many turns — matters because forcing a genuinely multi-turn workflow into a single-invocation prompt file produces a command that either does too little per invocation to be useful or has to be re-run repeatedly in a way a chat mode was actually built to avoid.
Verified against
GitHub Copilot Chat Copilot Chat 1.269 (VS Code, prompt files) · 2026-07-22
Changelog
- 2026-07-22 — Initial publish, verified against Copilot Chat 1.269 (VS Code) reusable prompt files.
Need this built into your business?
If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.
EXPLORE CUSTOM SOFTWARE
