Good GitHub Copilot prompts start with the broad goal, then list specific requirements, name the exact files or functions instead of saying "this", and give an example or test to aim for. Below are 14 original prompts for Copilot Chat, Plan and agent mode in your IDE, the Copilot cloud agent on GitHub, and Copilot CLI, grounded in GitHub's prompt engineering guide.
How to use these prompts
Paste a prompt into Copilot and replace the blanks in double braces, or keep the default after the colon: {{test_command:npm test}} means npm test unless you change it.
Each prompt says where it runs. The surfaces and features they rely on, from GitHub's docs:
| Where | What it does | How to reach it |
|---|---|---|
| Copilot Chat in VS Code | Answers about your code, with # variables like #selection and #file |
Chat view; type #, @ or / for context and commands |
| Plan | Writes a plan with steps and open questions, no edits | Agents dropdown, then Plan |
| Agent mode | Edits files and runs terminal commands you approve | Agents dropdown, then Agent |
| Cloud agent | Works on GitHub and opens a pull request | Assign an issue, or /delegate from the CLI |
| Copilot CLI | Terminal agent with plan mode, /review and @path files |
Shift+Tab or /plan for plan mode |
| Code review | Reviews a pull request or your local changes | Reviewers, then Request next to Copilot |
Two of GitHub's tips matter most. Put your most important requirements first: the guide says Copilot gives extra weight to instructions at the beginning and end of a prompt. And start a new chat for each new task, so irrelevant history doesn't steer the answer.
How do you use Copilot Chat to understand code?
1. Explain selected code
Select the code in the editor, then send this in Copilot Chat. The built-in /explain command is the short version; this prompt asks for more.
Explain #selection to a developer who knows {{language:TypeScript}} but
not this project.
1. What it does, in one sentence.
2. Step by step, what happens, naming the variables and functions.
3. Inputs, outputs and side effects.
4. Anything fragile or surprising, and how it could break.
2. Trace a feature across files
Open the file where the flow starts so #file attaches it, and highlight code or attach other files you know matter. GitHub's guide recommends highlighting code and attaching files as the way to give Copilot context in the IDE.
I need to change how {{feature:password reset}} works. Starting from
#file, trace the flow from {{entry_point:the reset form submit}}
to the database and back.
List each step with the file and function. Then tell me which two or
three places I'd need to edit to {{change:add a rate limit}}, and what
might break. Don't write code yet.
How do you plan and build with agent mode?
3. Plan a feature with the Plan agent
Select Plan in the agents dropdown. When the plan is ready, choose Start Implementation to hand it to agent mode, or Open in Editor to save it as Markdown. GitHub's plan mode docs cover each IDE.
Plan how to {{goal:add CSV export to the reports page}}.
Requirements, most important first:
1. {{requirement:Exports must match the filters on screen.}}
2. No new dependencies unless you explain why.
3. Every new function has a unit test.
Give a short summary, the steps with the files each touches, and open
questions about anything you'd otherwise guess.
4. Implement a change in agent mode
Start general, then get specific, as GitHub's guide recommends. Copilot asks before running terminal commands by default. The Copilot agent mode guide covers approvals.
Add {{feature:a dark mode toggle to the settings page}}.
Specifics:
- Follow the pattern in {{pattern_file:src/components/LanguageToggle.tsx}}.
- Store the choice in {{storage:localStorage under the key theme}}.
- Don't change any other settings components.
When done, run {{test_command:npm test}} and {{lint_command:npm run lint}},
fix any failures, and list the files you changed.
5. Write a function from tests
GitHub's guide suggests writing unit tests first, then asking Copilot to write the function they describe. Tests are the clearest example you can give.
The tests in {{test_file:src/utils/parseDate.test.ts}} describe a
function that doesn't exist yet. Write {{function_name:parseDate}} in
{{target_file:src/utils/parseDate.ts}} so every test passes.
Don't change the tests. Use no libraries beyond what's already
installed. Run {{test_command:npm test}} and show me the result.
6. Fix a failing test properly
The /fixTestFailure command finds and fixes a failing test. Use this prompt in agent mode when you want rules about what counts as a fix.
{{test_name:The checkout total test}} is failing. Run
{{test_command:npm test}} to see the failure.
Decide whether the test or the code is wrong and show the evidence.
Fix the code if the code is wrong. Only change the test if it checks
behavior we no longer want, and tell me if you do. Never skip, delete
or loosen a test to make it pass.
How do you hand work to the Copilot cloud agent?
7. Write an issue Copilot can finish
GitHub's best practices for the cloud agent say to treat the issue as a prompt: a clear problem, acceptance criteria and the files to change. Paste this into the issue body, then assign it to Copilot. The cloud agent guide covers setup.
Problem: {{problem:Search returns no results when the query has a trailing space.}}
Acceptance criteria:
- {{criterion:Queries are trimmed before searching.}}
- A unit test covers leading and trailing spaces.
- Existing search tests still pass.
Files likely involved: {{files:src/search/query.ts, src/search/query.test.ts}}
Out of scope: changing the search ranking or the UI.
8. Batch review feedback on Copilot's pull request
Mention @copilot in a pull request comment to have it push changes. GitHub suggests using Start a review to batch your comments, so Copilot works on the whole review at once. Use this as the summary comment.
@copilot Please address all the review comments above. Also:
1. {{change_1:Rename fetchData to fetchOrders everywhere in this PR.}}
2. {{change_2:Add a test for the empty-cart case.}}
Run the full test suite before pushing and list what you changed.
9. Delegate from Copilot CLI
In Copilot CLI, /delegate sends a task to the cloud agent, which opens a pull request while you keep working locally.
/delegate {{task:Add input validation to the signup form}}. Follow the validation pattern in {{pattern_file:src/forms/login.ts}}, add tests for each rule, and keep error messages in the existing i18n file.
How do you plan and review in Copilot CLI?
10. Plan mode in the CLI
Press Shift+Tab or start with /plan. GitHub's CLI best practices say Copilot asks clarifying questions, writes a checklist plan to plan.md, and waits for your approval. The Copilot CLI guide covers install and commands.
/plan {{goal:Add OAuth sign-in with Google and GitHub}}. Read @{{start_file:src/auth/index.ts}} first. Ask me about anything unclear before writing the plan, and include how each step will be tested.
11. Review your branch before a pull request
You can run /review in the CLI, or ask in plain words with your own priorities. The Copilot code review guide covers reviews on GitHub.
Review the changes in my current branch against {{base_branch:main}}.
Focus, in order: bugs and wrong logic, security
({{security_focus:auth checks, injection, secrets in code}}), missing
error handling, missing tests. For each finding give the file and
line, severity (blocker, should fix, nit), and the fix. Don't edit
files.
How do you set up instructions and skills for Copilot?
12. Draft path-specific instructions
Path-specific instructions live in .github/instructions as NAME.instructions.md files with an applyTo glob in their frontmatter. GitHub's docs say Copilot code review and the cloud agent read them on GitHub. The custom instructions guide explains every file type.
Look through {{scope:our React components}} and draft
.github/instructions/{{file_name:react}}.instructions.md with frontmatter
applyTo: "{{glob:src/components/**/*.tsx}}".
Base every rule on patterns you can see in the code: naming, state,
styling, error handling and tests. Write five to eight short rules,
each with a file path that shows it. Don't invent conventions.
13. Generate repository instructions
GitHub's docs say repository instructions in .github/copilot-instructions.md should cover what the repo does, the verified build, test and lint steps, and the project layout, and must not be task specific.
Create .github/copilot-instructions.md for this repository. Include:
1. What the project does and its languages, frameworks and runtimes.
2. The exact bootstrap, build, test, run and lint commands. Run each
one and note any that fail or need a precondition.
3. The main folders and where config and CI workflows live.
Keep it under two pages and don't include anything task specific.
14. Turn a repeated prompt into an agent skill
Copilot reads project skills from .github/skills, .claude/skills or .agents/skills. See the Copilot agent skills guide for which surfaces load them.
Create an agent skill at .github/skills/{{skill_name:release-notes}}/SKILL.md
that {{job:writes release notes from merged pull requests since the last tag}}.
Add frontmatter with a name matching the folder and a description that
says what it does and when to use it. In the body, give numbered steps,
the exact output format, and two rules about what to leave out.
What makes a Copilot prompt work?
GitHub's guide comes down to a few habits. Be specific: name the function, file or response you mean, and state rules directly, for example "Return the result as JSON" rather than "Remember to always return JSON." Give examples, ideally as tests. Break big jobs into steps and ask for them one at a time. Then review the output as you would a colleague's code, and test it before you rely on it.
If a result misses, refine the prompt and try again rather than piling corrections onto a long chat. In Copilot CLI, /undo and /rewind remove turns you don't want.
Put anything you repeat into instructions instead of prompts. Repository instructions apply to every chat in that repo, path-specific files apply only to matching files, and in VS Code you can save a reusable prompt as a .github/prompts/*.prompt.md file (public preview) and run it in chat by typing / and its name. For how Copilot compares with other agents, see Claude Code vs Copilot and Copilot vs Codex.
The same approach works in other tools: see the Codex prompts, Claude Code prompts, Gemini CLI prompts and Cursor prompts.
Keep your best Copilot prompts
Prompts like these are worth keeping. Kipt stores them as Markdown in a private GitHub repo you own: save a prompt with its blanks, tag it, and find it again with Cmd+K. When a prompt becomes a workflow, the free SKILL.md generator turns it into a valid SKILL.md you can drop into .github/skills.