Reusable Prompt Files: Automate Common Development Tasks

Many development activities involve repeating the same sequence of actions. Prompt files allow you to package those steps into reusable workflows that can be launched directly from Copilot Chat.

Instead of writing a long prompt every time, you simply execute the reusable prompt and let Copilot perform the workflow.

What prompt files can do

A reusable prompt can:

  • Ask for missing information
  • Create folders
  • Generate multiple files
  • Apply templates
  • Update configuration files
  • Reference instruction files

How to create a reusable prompt

  1. Create a .github/prompts folder.
  2. Create a file ending with .prompt.md.
  3. Describe the workflow as numbered steps.
  4. Reference templates or instruction files when appropriate.
  5. Save the file.

Example

# .github/prompts/new-assignment.prompt.md

Create a new assignment.

1. Ask for the assignment topic if none is provided.
2. Create a new folder in `/assignments`.
3. Generate `assignment.md`.
4. Add starter code if required.
5. Update `config.json`.
6. Verify that all generated files are linked correctly.

You can then invoke it from Copilot Chat using:

/new-assignment

If the required information is missing, Copilot asks follow-up questions before completing the remaining steps.

Best practices

  • Design prompts around complete workflows.
  • Break complex tasks into numbered steps.
  • Reference instruction files instead of repeating guidance.
  • Keep prompts reusable rather than project-specific.
  • Test prompts regularly as your project evolves.

 

prompts
automation
copilot
productivity
github

Comments