Course · Copilot · Prompt files & slash commands
Prompt files & slash commands
Rules handle one kind of repetition: the standing conventions otherwise re-typed into every chat. There is a second kind rules cannot touch. Not “match the house style” - that is standing context and it is handled - but the specific procedure you spell out from scratch every time: scaffold an endpoint our way, with the route, the validation call, the audit event, the threshold check, the test. Five steps, the same five steps, phrased slightly differently each time and occasionally missing one because you typed it from memory.
That is exactly what a prompt file is for: a reusable, named prompt saved in the repo and invoked on demand with a slash command. The instruction lives in a file, version-controlled and shared with your team, so “scaffold an endpoint our way” stops being something you reconstruct each time and becomes one command everyone runs the same way.
The distinction at the heart of the chapter is always-on versus on-demand. Rules apply automatically, every request, whether or not you are thinking about them. Prompt files run only when you call them - and skills, taught in the Skills chapter, are invoked by the model itself when the task matches. Getting a feel for which repeated work belongs in which container is the judgment this chapter builds.
The lessons
Section titled “The lessons”- Create · .prompt.md & /create-prompt - what a prompt file is, where it lives, and how to invoke one.
- Prompt vs rule · invoked vs always-on - the placement decision between standing context and an invoked procedure.
- Wire it · arguments, agent, tools - the frontmatter that parameterizes a prompt and scopes its tools.
Start by building one; the create lesson first checks which agent engine you are on.