DEV Community

PeterMilovcik
PeterMilovcik

Posted on

Reusable GitHub Copilot Prompt for Implementation Plans

Large edits from GitHub Copilot Agent often feel risky.
You ask for a change and the agent starts to rewrite files.
Only later you notice hidden side effects.

A small reusable prompt file reduces this risk.
You ask for a plan first.
You approve the plan.
Then the agent edits code.

This article walks through one prompt file named implementation_plan.prompt.md which supports this workflow.

The prompt file

Create folder .github/prompts in your repository if no such folder exists.

Add file:

.github/prompts/implementation_plan.prompt.md

Use this content:

---
agent: agent
---
Before making any changes, prepare a detailed step by step implementation plan with numbered actions, files to edit, reasoning for each change, identified risks, and example code snippets for key parts. Ask clarifying questions if anything in my request is unclear. Present this plan for review and wait for my approval before starting.
Enter fullscreen mode Exit fullscreen mode

Front matter selects the agent which runs this prompt.
Text below describes response format and behavior.

What this prompt enforces

The instruction asks for several concrete elements.

Numbered actions

You receive ordered steps.
You see how the agent plans to approach the work.
You choose where to stop or split the plan.

Files to edit

The response lists target files.
You see scope before any edit.
You spot sensitive areas early.

Reasoning for each change

The agent explains why each step exists.
You compare reasoning with your own intent.
You catch misunderstandings before they reach code.

Identified risks

The agent points out risky parts of the plan.
For example, shared components or public APIs.
You add constraints or ask for a safer approach.

Example code snippets

The response includes small examples for key parts.
You review structure and style early.
You align patterns with project standards.

Clarifying questions

The prompt asks the agent to raise questions when something feels unclear.
This steers the session toward a short dialogue instead of blind action.

Approval gate

The last sentence requests a pause before edits.
The agent proposes a plan.
You respond with approval or changes.
Only then the next step starts.

Using the prompt in GitHub Copilot Chat

Work with this prompt in a simple way.

  1. Open GitHub Copilot Chat.
  2. Write your request and list the changes you want, with any #file: references you prefer.
  3. Add /implementation_plan at the end of your message on a new line.
  4. Send the message.

Example:

I want to extract discount logic from OrderService into a separate domain service.
Keep behavior stable for all callers.
Focus on smaller methods and clearer error handling.

/implementation_plan
Enter fullscreen mode Exit fullscreen mode

GitHub Copilot Agent reads your description together with the reusable prompt.
The response follows the structure you defined in implementation_plan.prompt.md.

You then review the plan.
You ask for adjustments or extra focus where needed.
After you feel confident, you ask the agent to start with concrete edits in a follow up message.

Refactoring example

A short scenario from daily work.

You see complex method logic in a service class.
You open Copilot Chat.
You send:

Refactor the main billing method in BillingService into smaller methods.
Keep business behavior unchanged.
Point out places where error handling needs improvement.

/implementation_plan
Enter fullscreen mode Exit fullscreen mode

The agent replies with a plan such as:

  1. Steps for scanning existing logic
  2. Plan for extracting helper methods
  3. List of new private methods or new classes
  4. Risk notes around behavior changes and existing integrations
  5. Sample code for the new structure

You respond with comments like:

  • Keep the public interface unchanged
  • Avoid changes in logging behavior
  • Add a step for updating related unit tests later

The agent updates the plan and sends a new version.
Only when you confirm, the session moves on to actual edits.

Team benefits

This pattern improves collaboration with GitHub Copilot Agent.

Shared expectations

Each developer on the team uses the same prompt file.
New team members learn a stable way to work with AI assistance.

Lower review overhead

Pull requests show changes which follow an agreed plan.
Reviewers read the original plan in chat history when they need context.

Less accidental scope creep

The plan defines scope clearly.
You notice when the agent tries to do too much in one go.

Clear structure for larger changes

Complex refactors break into smaller, named steps.
You run these steps in order and keep control.

Variations

Adapt this idea for different kinds of work.

For destructive tasks such as file removal, tighten wording around confirmation.
For experimental branches, relax constraints.
For production critical services, add a step for rollback ideas.

Each variation lives in its own prompt file under .github/prompts, for example:

  • security_review.prompt.md
  • performance_review.prompt.md
  • migration_plan.prompt.md

Every file follows the same pattern.
Front matter at the top.
Concise instruction in the body.

Start using the prompt

Add implementation_plan.prompt.md to your repository.
Use this helper for the next feature or refactor.
Observe how your sessions with GitHub Copilot Agent change.

You spend more time judging plans and less time fixing surprises.

Top comments (0)