Reusable GitHub Copilot Prompt for Implementation Plans
Source: Dev.to
Introduction
Large edits generated by the GitHub Copilot Agent can feel risky.
A small, reusable prompt file helps reduce that risk by forcing the agent to produce a detailed implementation plan before making any changes.
Setup
- In your repository, create a folder named
.github/promptsif it does not already exist. - Add a file called
implementation_plan.prompt.mdinside that folder.
Prompt File 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.
The front‑matter selects the agent that will run this prompt. The instruction requires the agent to provide concrete elements such as ordered steps, target files, rationales, risk notes, and small code examples. It also mandates that the agent pause for approval before editing.
Using the Prompt
- Open GitHub Copilot Chat.
- Write your request, listing the changes you want. Include any
#file:references you prefer. - On a new line, add the trigger
/implementation_plan. - Send the message.
Example Request
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
Agent Interaction Flow
- Copilot reads your description together with
implementation_plan.prompt.md. - The agent replies with a plan that typically includes:
- Ordered steps for scanning existing logic.
- A plan for extracting helper methods.
- A list of new private methods or new classes.
- Risk notes around behavior changes and existing integrations.
- Sample code for the new structure.
- You review the plan and respond with comments, e.g.:
- “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.
- Once you approve, the agent proceeds with the edits.
Benefits
- Clear Scope: Each pull request follows an agreed‑upon plan, making the scope explicit.
- Risk Mitigation: Potentially dangerous changes (e.g., file deletions) are highlighted and require explicit confirmation.
- Consistency: All developers on the team use the same prompt file, ensuring uniform collaboration with the Copilot Agent.
- Incremental Refactoring: Complex refactors are broken into smaller, named steps, reducing surprise failures.
Extending the Idea
Create additional prompt files for other types of work, each living under .github/prompts:
security_review.prompt.mdperformance_review.prompt.mdmigration_plan.prompt.md
All follow the same pattern: a front‑matter selector and a request for a detailed, reviewable plan before any code changes.
Conclusion
Adding implementation_plan.prompt.md to your repository encourages developers to spend more time judging implementation plans and less time fixing unexpected issues. This simple, reusable prompt improves collaboration with the GitHub Copilot Agent and makes large code changes safer and more predictable.