
Short answer
.github/copilot-instructions.md file or an agent skill.In VS Code, Copilot now runs as an agent with Ask, Plan and Agent modes, chat participants such as @workspace are deprecated, and prompt files are giving way to agent skills. Everything here is checked against GitHub's and VS Code's own docs as of November 2026, and every prompt is written for that setup. If you also use other assistants, our roundup of AI pair programming tools compares Copilot with Cursor, Claude Code and the rest.
/plan), and Agent edits files and validates the result, per the VS Code docs.# to add files, tools and other context, use Add Context, or drag files in. Attach errors, test output and GitHub issues too./explain, /fix, /tests, /doc (from inline chat), /plan and /compact for long conversations. Type / to see what your session supports.Replace everything in [square brackets], and keep the constraint lines. They are what stop Copilot from "helpfully" rewriting files you didn't ask about. For the same jobs in other tools, see our Cursor prompts, the tool-neutral coding prompts for any chat window, and our Claude Code prompts.
Run in Ask, with the file attached through # or Add Context. Ask only uses read-only tools, so nothing changes.
Explain [#file] to a developer who joined the team this week. Start with what this file is responsible for in one sentence. Then list the 3 to 5 functions that matter most, what each one takes and returns, and which other files call them. Point out anything surprising: side effects, global state, hidden network or database calls. Finish with the one thing I should not change without talking to the owner. Quote line numbers for every claim.
Ask mode again. Good before touching code you didn't write.
Trace what happens when a user [submits the checkout form] in this workspace. Follow the request from the UI event to the API route, the service layer and the database write, then back to the response. For each hop, give the file path and function name. List every place an error can be thrown and whether it is caught. Do not guess: if a step goes through code you can't find, say so.
Use the Plan agent (or /plan) and read the plan before you hand it to Agent.
/plan Add [CSV export to the invoices page]. Requirements: [export the current filtered list], [include these columns], [no more than 10,000 rows]. Research the existing code first and reuse its patterns for API routes, permissions and file downloads. Give me: the files you would change or add, the order of changes, the tests you would add, and the risks. List open questions instead of making assumptions about product behavior.
Paste a plan (yours or Copilot's) and ask for the holes before anyone writes code.
Review this implementation plan as a skeptical senior engineer: [paste plan] Find: steps that touch shared code without a test, data migrations without a rollback, missing permission checks, and anything that changes a public API. For each issue, say how bad it is (high, medium, low) and the smallest change to the plan that fixes it. Do not rewrite the whole plan.
Agent mode. Name the outcome and how Copilot should prove it worked.
Implement [the plan above / this change: describe it]. Constraints: follow the patterns in [#file of a similar feature], do not add new dependencies, and keep changes inside [src/billing]. When done, run [npm test -- billing] and fix anything that fails. Then summarize: files changed, why, the test results, and anything you could not verify.
Agent mode, for a new route that should look like the ones you already have.
Add a [GET /api/projects/:id/members] endpoint. Copy the structure of [#file of an existing route]: same validation library, same error format, same auth middleware. Return [id, name, role] for each member and a 404 if the project doesn't exist or the user can't see it. Add tests for: success, not found, and a user from another workspace. Run them.
Paste the full error and attach the file it points to. Ask for the cause before the fix.
Here is the error and stack trace: [paste error] 1. Explain the root cause in two or three sentences, pointing to the exact line. 2. Say whether the same bug can happen anywhere else in the codebase. 3. Propose the smallest fix and show the diff. Do not change unrelated code, and do not suppress the error with a try/catch unless that is the right fix.
Agent mode with the test output attached. The last line matters.
This test fails: [test name], output below. [paste output] Find out whether the bug is in the code or in the test. Fix the implementation without changing the expected behavior of the test. If you believe the test itself is wrong, stop and explain why instead of editing it. Run the test file again and show the result.
Attach the GitHub issue as context, then let Agent write the failing test before the fix.
Read the bug report in [issue link or pasted text]. Write a test that reproduces it and confirm the test fails for the reason described. Only then fix the code so the test passes, run the related tests, and tell me if the report was missing anything you had to assume.
Select the function first, or attach it, then run this. Works with /tests too.
Write unit tests for [function name] using [Jest / pytest / the project's existing framework]. Cover: normal inputs, empty and null inputs, boundary values, invalid types, and the error paths. Use the existing test helpers in [#file] instead of new mocks. One behavior per test, with a test name that reads as a sentence. Run the tests and fix only the tests if they fail for setup reasons.
Agent mode on a file that has tests. If it doesn't, run prompt 10 first.
Refactor [#file] to [split the 300-line function into smaller functions / remove the duplicated parsing logic]. Rules: no change in behavior, no change to exported names or signatures, run the tests after every step. Work in steps of one change each and list them as you go. If a test fails, undo that step and tell me why.
Ask mode, with your changed files attached. A second read, not a replacement for yours.
Review my uncommitted changes in [these files]. Look for: bugs, missing error handling, unhandled null or empty cases, N+1 queries, secrets or debug code left in, and tests that no longer cover the change. Report each finding with the file, line, why it matters and a suggested fix. Skip style comments unless they hide a bug.
Ask mode. Keep the scope small so the answer stays specific.
Do a security review of [src/api]. Check authentication, authorization on every route, input validation, SQL or command injection, file upload handling, and what gets logged. Only report a control as present if you can point to the code. Group findings as high, medium and low, with the file and line for each.
Use /doc on a selected symbol for comments, or this prompt for the bigger picture.
Write a README section for [the billing module] for developers on this team. Include: what it does, the main entry points, required environment variables (names only, no values), how to run its tests, and two common mistakes. Base everything on the code in [src/billing]; mark anything you could not confirm as TODO.
In Copilot Chat on github.com, type @ to attach the pull request, then ask.
Summarize [the attached pull request] for a reviewer who has 5 minutes. Give: what changed and why in three bullets, the riskiest file and why, what is not tested, and the questions I should ask the author. Do not restate the diff line by line.
Paste a raw report from a user or teammate and attach the repository with @.
Turn this report into a GitHub issue for [the attached repository]: [paste report] Use sections: Summary, Steps to reproduce, Expected, Actual, Environment, and Possible cause (only if you can point to code). Keep the reporter's facts; mark anything missing as "Unknown" instead of filling it in.
| Job | Prompts | Where to run it | Attach |
|---|---|---|---|
| Understand code | 1, 2 | VS Code Ask | The file, or nothing for a trace |
| Plan a change | 3, 4 | VS Code Plan or /plan | Requirements, a similar feature |
| Build a feature | 5, 6 | VS Code Agent | A file that shows the pattern |
| Debug | 7, 8, 9 | VS Code Agent | Stack trace, test output or the issue |
| Write tests | 10 | VS Code Agent or /tests | The function and a test helper file |
| Refactor | 11 | VS Code Agent | The file, with its tests |
| Review | 12, 13 | VS Code Ask | Changed files or one folder |
| Docs | 14 | VS Code Ask, or /doc in inline chat | The module folder |
| Pull requests and issues | 15, 16 | Copilot Chat on github.com | The pull request or repository with @ |
Rules you repeat in every prompt belong in an instructions file. GitHub's docs put repository-wide instructions in .github/copilot-instructions.md and path-specific ones in .github/instructions/NAME.instructions.md with an applyTo glob, and Copilot also reads AGENTS.md. VS Code's custom instructions guide adds that instructions guide the model but don't guarantee compliance, and don't apply to inline suggestions.
Workflows you run on demand belong in a skill: a folder in .github/skills/ with a SKILL.md file whose frontmatter has a name (lowercase letters, numbers and hyphens, matching the folder) and a description. It shows up as a slash command. VS Code says prompt files (.prompt.md) only run in its Local option, which is deprecated and will be removed by February 2027, and recommends converting them to skills. Two starting points:
Project-wide rules Copilot reads with every request in this repository. Keep it short and specific.
# Project instructions
- This is a [Next.js 15 + TypeScript] app. Package manager: [pnpm].
- API routes live in [src/app/api]. Database access only through [src/db/queries], never from components.
- Validate every request body with [zod] schemas in [src/schemas].
- Tests: [Vitest]. Run [pnpm test <file>] for the files you change.
- Never add a dependency without saying why in your summary.
- Errors returned to clients use the shape { error: { code, message } }.A reusable review workflow you run as /review-pr. The name must match the folder name.
--- name: review-pr description: Review the current branch's changes for bugs, missing tests and security issues. Use before opening a pull request. --- # Review the current changes 1. List the changed files and read each diff in full. 2. For every change, check error handling, empty and null inputs, permission checks and tests. 3. Run the tests for the changed files and include the result. 4. Report findings as high, medium or low with file and line. Do not report style issues. 5. End with a one-line verdict: ready, ready with fixes, or not ready.
From GitHub's Copilot plans page and its plans docs, as of November 2026: Free $0 with 2,000 completions a month and limited chat and agent usage; Pro $10 per user a month; Pro+ $39; Max $100; Business $19 per granted seat a month; Enterprise $39 per granted seat a month. Chat and agents draw on monthly GitHub AI Credits, while code completions stay unlimited on paid plans. Assigning work to Copilot so it opens a pull request starts at Pro.
Prompts are only half of it. Our AI coding best practices cover reviewing, testing and owning AI-written code.
What are good prompts for GitHub Copilot?
Prompts that name the exact code (attach the file, function or issue), say what done looks like, set limits (files, dependencies, behavior that must not change) and ask Copilot to verify its own work, for example by running the tests. The 16 prompts on this page follow that pattern for explaining, planning, building, debugging, testing, refactoring, reviewing and writing docs.
What slash commands does Copilot Chat have?
In VS Code, the docs list /plan, /explain, /fix, /tests, /doc (from inline chat), /new, /compact and /clear, among others. Type / to see what your current session supports. On github.com, Copilot Chat lists /clear, /delete, /new and /rename. Skills and saved prompts also show up as slash commands.
Can I still use @workspace and other chat participants?
VS Code's docs now mark chat participants as deprecated and say they are not supported in the Copilot agent sessions. Ask the agent directly and attach context with # or Add Context instead. On github.com, typing @ attaches discussions, files, issues, pull requests or repositories to the conversation.
Where do Copilot custom instructions go?
Repository-wide instructions go in .github/copilot-instructions.md. Path-specific ones go in .github/instructions/NAME.instructions.md with an applyTo glob in the frontmatter. Copilot also reads AGENTS.md files, and GitHub's docs say a single CLAUDE.md or GEMINI.md at the repository root works too. Instructions don't apply to inline suggestions as you type.
Are prompt files still supported?
In VS Code, prompt files (.prompt.md in .github/prompts) run only in the Local option, which VS Code says is deprecated and will be removed by February 2027; its docs recommend converting them to agent skills. GitHub's docs list prompt files as a public preview for VS Code, Visual Studio and JetBrains IDEs.
Do these prompts work on the free Copilot plan?
Yes. GitHub's plans page lists agent mode, custom instructions and Copilot Chat on Free, with 2,000 completions a month and limited chat and agent usage. Assigning work to Copilot so it opens a pull request needs Pro or above.
See it in action


© 2026 Questera
Follow in Google