Prompt files & slash commands
The Rules chapter killed one kind of repetition: the conventions you were re-typing into every chat. You wrote them down once, Copilot reads them automatically, and now its first draft already fits the repo. But there’s a second kind of repetition rules don’t touch, and you’ve started to feel it.
It’s the task you keep asking for. Not “match the house style” — that’s a convention, and it’s handled. This is the multi-step request you spell out from scratch every time you scaffold a new endpoint: create the route, wire it through the validation helper, have it record an audit event via shared-lib, add the threshold check, stub a test. Five steps, the same five steps, phrased a little differently each time and occasionally missing one because you typed it from memory. Rules can’t fix this, because it isn’t a standing convention that should apply to every request — it’s a specific procedure you want on demand, when you’re scaffolding an endpoint and not otherwise.
That’s exactly what a prompt file is. It’s a reusable, named prompt you save in the repo and invoke when you want it — by typing a slash command in the chat. The instruction lives in a file, version-controlled and shared with your squad, so “scaffold an audited endpoint our way” stops being something you reconstruct each time and becomes one keystroke that everyone on the team runs the same way.
The distinction at the heart of this chapter is the one between always-on and on-demand. Rules apply automatically, every request, whether you think about them or not. Prompt files run only when you call them. Getting a feel for which of your repeated work belongs in which is the judgment this chapter builds.
The lessons
Section titled “The lessons”This chapter goes from building a prompt file to knowing when it — rather than a rule — is the right tool:
- Create a prompt file — what a
.prompt.mdis and where it lives. Build the “scaffold an audited endpoint” prompt and invoke it with a slash command. - Prompt vs rule — invoked vs always-on — the judgment call. When you want context applied automatically and when you want a procedure you trigger on demand.
- Arguments, agent, and tools — the frontmatter that makes a prompt file flexible: parameters it accepts, the mode it runs in, the tools it’s allowed to use.
Start by building one. Create a prompt file.