PromptMake
2026-08-09·12 min read

GitHub Copilot Prompts: Chat, Agent, and Completions That Stick

Write better GitHub Copilot prompts for Chat, agent mode, and completions: scope context, break tasks, and scaffold clearer asks before you paste.

toolsgithub-copilotguidetips

Generate optimized prompts for ChatGPT, Claude & more

Free prompt generator — no account needed.

Try Prompt Generator →

GitHub Copilot prompts are the asks you send through inline completions, Copilot Chat, and agent mode. Completions lean on the comment and open tabs. Chat leans on history, pinned files, and participants such as @workspace. Agents need small steps, stop rules, and command approval. This guide stays inside Copilot. You get prompt anatomy that matches GitHub docs habits, a chat and agent workflow, worked paste examples, a mistakes list, and an honest note on PromptMake /text for scaffolding wording before you paste into the IDE. You leave with reusable templates ready for your next real ticket today. Soft tip: https://promptmake.net/text.

What GitHub Copilot prompts cover

A GitHub Copilot prompt is any instruction you send to Copilot: a comment above a function, a Chat question, a slash command with attached files, or an agent brief that spans several edits. Copilot also reads context you did not type. Open editors, the active selection, chat history, repository instruction files, and participant keywords all shape the reply.

This page fits developers who already have Copilot in VS Code, Visual Studio, JetBrains, or on GitHub.com and still get full-file rewrites, wrong-stack guesses, or agent thrash. You do not need a general ChatGPT coding course. You need Copilot-shaped asks: goal first, then constraints, then scope, then proof.

Skip this path if your job is model-agnostic prompt craft for Claude or ChatGPT outside an IDE. Our developer guide covers that stack elsewhere. Here the product is Copilot, and the win is fewer wasted Chat threads inside your repo.

PromptMake /text does not run inside VS Code. It cannot see your open tabs, @workspace index, or Copilot plan limits. Use it only to tighten the English of a chat or agent brief. Paste the edited text into Copilot. Keep secrets and private customer data out of public generators.

How Copilot builds answers from your prompt

Copilot treats your words as one input among several. GitHub documents the pattern: start with a broad goal, then list requirements; give examples; break large work into small tasks; name the code you mean; keep chat history on-topic. When people blame the model after a weak reply, they often skipped context control. The prompt looked fine in isolation. The IDE handed Copilot the wrong files, a stale thread, or no instruction file at all.

Think of three layers you control. Layer one is the written ask. Layer two is editor state: which files sit open, what you selected, which #file pins you added. Layer three is durable project guidance: .github/copilot-instructions.md and path-scoped instruction files. Strong GitHub Copilot prompts align all three. A perfect sentence with ten unrelated tabs still drifts.

Keep the first draft of the ask short. Add scope after the goal. Agents and Chat both do better when the outcome is clear before the constraint list grows. If you need structure help offline, draft the goal and constraints in notes or on PromptMake /text, then paste into a fresh Chat thread with the right files pinned.

Open files, chat history, and instruction files

For inline completions, open the files that teach the pattern you want and close the rest. Completions lean on nearby code and the comment above the cursor. They do not load your full copilot-instructions.md the way Chat and agent mode do. A precise comment is the prompt: name inputs, error behavior, and return shape.

For Chat and agents, commit a focused .github/copilot-instructions.md at the repo root. GitHub guidance favors a short file: what the app does, stack, coding rules, folder map, and key scripts. Aim for the rules that prevent wrong guesses, not a novel. Stale stack notes mislead Copilot as hard as missing notes.

Chat history counts as context. When the topic shifts from auth bugs to CSS, start a new thread. Delete turns that pull the model toward an old plan. One clean thread per task beats a long scroll of mixed goals.

Participants and file references

In VS Code Copilot Chat, use participants and references so the model searches the right place. @workspace (or the current project participant in your IDE) pulls broader repo context. #file:path pins a concrete file. #selection limits the ask to highlighted code. On github.com Chat, attach the repository, files, and symbols you care about instead of hoping the model guesses.

Name the symbol or path in the sentence when ambiguity remains. "What does this do?" fails when "this" could mean the selection, the last reply, or the whole module. "Explain validateSession in src/auth/session.ts and list three failure modes" gives Copilot a target.

Large monorepos can return incomplete @workspace hits. If the answer cites the wrong package, pin the correct #file and restate the package name in the prompt. Explicit beats hopeful indexing.

Step-by-step: write GitHub Copilot prompts that work

Use one loop for Chat and agent briefs. Completions get a shorter cousin: write the comment, keep related tabs open, accept or reject ghost text, then move on. The Chat loop below is the one that saves the most time because bad Chat threads burn minutes and pollute history.

Work from a real ticket or failing test. Copy the symptom, the expected behavior, and the file paths from the issue. Do not invent architecture mid-prompt. If you still hold a fuzzy goal, spend two minutes sharpening it offline. PromptMake /text can turn "fix login somehow" into a goal, constraints, and output shape you then adapt with Copilot participants. Soft link: https://promptmake.net/text.

Measure success by a small, reviewable change and a passing check. A fluent essay about your codebase that you cannot merge is a failed prompt, even when it sounds smart.

Step 1: State the goal, then the constraints

Open with the outcome in one or two sentences. Example: "Add pagination to the /orders list endpoint without changing auth." Then list constraints: language and framework versions, files in scope, files to leave alone, style rules, and banned approaches.

Add one example when format matters. Paste a sample request and response, or point at an existing handler Copilot should mirror. Unit tests count as examples: ask Copilot to draft failing tests first, then implement until they pass.

Avoid vague verbs alone. "Improve," "clean up," and "fix this" invite large rewrites. Prefer "Return a unified diff for OrdersController only" or "List three root-cause hypotheses before any edit."

Step 2: Scope files and success checks

Pin #file references or open the exact editors you want in context. Write FILES IN SCOPE and DO NOT MODIFY lines in the prompt so agent mode has a fence. Add the verification command: the test file, typecheck, or lint target that must stay green.

If root cause might sit outside the fence, tell Copilot to stop and explain in three sentences instead of patching neighbors. That stop rule prevents drive-by refactors that wreck review.

For Chat-only questions (explain, review, compare), still name the path and the reader. "Summarize risks in src/payments/webhook.ts for a reviewer who knows Stripe but not our retry queue" beats "review this."

Step 3: Break agent work into approved steps

Agent mode plans and edits. Feed it a sequence, not a weekend project in one message. Ask for a short plan first. Approve the plan. Then allow step 1 only: for example, extract a pure function and update its unit tests. Review the diff. Start the next step in the same thread only if context still helps; otherwise open a fresh thread with the plan pasted in.

Require diffs or patch-style output when your IDE flow supports it. Tell the agent to document assumptions in comments or a short note. Approve terminal commands before they run. Treat suggested shell as untrusted until you read it.

If the agent loops or rewrites the same file twice without progress, stop the run. Narrow the prompt: one file, one function, one test. Wide agent prompts create thrash more than they create velocity.

Chat vs agent vs inline completions

Pick the lane before you write the ask. Mixing lanes in one mental model causes the wrong prompt shape. Inline completions want a local comment. Chat wants a scoped question or small edit brief. Agents want sequenced work with fences and checks.

GitHub Copilot prompts for Chat often include a participant, a file pin, and an output shape: bullets, diff, risk list, or "ask me one clarifying question if X is missing." Agent prompts add migration safety, rollback notes, and explicit stop conditions. Completion prompts live in the comment and the surrounding idioms of the file.

Custom instructions help Chat and agents across sessions. They do not replace a good per-task prompt. Keep personal custom instructions to a few durable preferences. Put project truth in the repo instruction file so the team shares it.

Inline completions: comments as prompts

Write the comment you wish a teammate left. Name the algorithm, edge cases, and return type. Example: "Parse the Idempotency-Key header; reject empty values with 400; store the key with the request id in Redis with a 24h TTL." Then start the function signature and let ghost text fill the body.

Accept with Tab only after a skim. Reject and tweak the comment when the suggestion invents a dependency you do not use. Close unrelated tabs so Copilot stops mirroring a different service's style.

Copilot Chat prompts

Use Chat for explanation, review, small patches, and test generation. Structure: goal, context pins, constraints, output format. Example: "@workspace How does rate limiting work for the public API? Cite file paths. Then propose a 10-line change in the existing middleware only."

Keep one concern per thread. When Chat drifts into unrelated refactors, say "stop edits; answer in bullets only" or start over. Save winning prompt text in your notes next to the ticket id.

Agent mode prompts

Give agents a mission with fences. Example: "Plan a tagging subsystem for the notes service. Do not edit yet. List files, schema impact, and rollback. After I approve, implement domain model and tests only; leave controllers for a second pass."

Ask for tradeoff notes when architecture is open. Ask for diff-sized steps when architecture is closed. Never grant blanket trust on production migrations or secret-bearing scripts. You remain the reviewer of record.

Worked examples you can paste

Bug-fix Chat prompt:

Goal: Fix the submit button that stays disabled after a valid SignupForm fill.

Stack: TypeScript, React, Vitest.

FILES IN SCOPE: src/components/SignupForm.tsx

DO NOT MODIFY: validation schema, API routes.

OUTPUT: unified diff only, plus a two-sentence root-cause note.

TEST: npm test -- SignupForm.test.tsx must pass.

If cause is outside scope, stop and explain; do not patch other files.

Agent sequencing prompt:

Goal: Add additive, backward-compatible tags to the notes service.

Step 0: Propose schema migration, rollback, and client impact. No code yet.

After approval, Step 1: domain model + repository + unit tests only.

Stop before controllers. Document assumptions in a short NOTES comment.

Completion comment example:

// Map webhook events to internal JobStatus; unknown types return null and log a warning; never throw.

Your edit after any generator scaffold: add real paths, package names, and the exact test command from your repo. Tools that draft English cannot invent your tree.

Mistakes that waste Copilot turns

Mistake 1: "Fix this" with 400 lines pasted and no output shape. You invite a full rewrite. Demand a diff and a file fence.

Mistake 2: One endless Chat thread across unrelated tasks. Stale history steers new answers. Start fresh when the job changes.

Mistake 3: Empty or outdated copilot-instructions.md. Copilot then guesses stack and style. Update the file the day the stack changes.

Mistake 4: Agent briefs that ask for a multi-day feature in one shot. Split into plan, then thin vertical slices with tests.

Mistake 5: Treating PromptMake or any external scaffold as if it could see your workspace. It drafts wording. You add @workspace, #file pins, and local truth.

Mistake 6: Accepting agent shell commands without reading them. Approve only what you would type yourself.

Mistake 7: Collecting random "best Copilot prompts" lists instead of saving three personal templates for bugfix, review, and small feature. Lists go stale. Your templates match your repo.

Soft scaffold with PromptMake /text

PromptMake /text turns a rough idea into a structured text prompt. For Copilot, that means a clearer Chat or agent brief: goal, constraints, output format, stop rules. You still paste into the IDE and attach participants yourself.

Honest limits: /text does not complete code in your editor, does not index your repo, does not set .github/copilot-instructions.md, and does not replace Copilot plan features. Guests get about three /text runs per day. Free accounts get about five. Keep proprietary source out of public tools when policy forbids it; describe the bug in redacted form if you only need structure help.

A practical path: write three messy sentences about the ticket. Generate once on https://promptmake.net/text with a text or ChatGPT-style target as a stand-in for structure. Edit in the real file paths and test commands. Paste into a new Copilot Chat thread with #file pins. Save the final prompt beside the ticket.

If the job is image work or Midjourney dialect, use a different tool path. This article and CTA stay on text scaffolding for Copilot chat and agents.

FAQ

These answers cover the searches people type after a weak Copilot Chat reply or an agent that rewrote half the repo. Topics include what GitHub Copilot prompts are, how to structure Chat asks, when agent mode fits, what instruction files do and do not replace, where PromptMake /text helps without pretending to be an IDE plugin, how this guide differs from general AI-for-code articles, and how to start on a free PromptMake tier. Each answer stays short so you can act in the same session. If you already finished the workflow sections, skim for the gap that still blocks you.

What are GitHub Copilot prompts?

GitHub Copilot prompts are the instructions you give Copilot through inline comments, Copilot Chat, or agent mode. Copilot also reads open files, chat history, and repository instruction files. Strong prompts name the goal, constraints, file scope, and how you will verify the result. Weak prompts leave those blanks and force Copilot to guess.

How do I write better GitHub Copilot prompts for Chat?

Start with the outcome, then list requirements. Pin files with #file or open the right editors, and use @workspace when you need repo-wide search. Ask for a concrete output shape such as bullets, a short plan, or a unified diff. Open a new thread when the task changes so old turns do not steer the model.

Should I use agent mode or Copilot Chat?

Use Chat for questions, reviews, and small scoped edits you want to steer turn by turn. Use agent mode when you want a planned multi-file change with steps you approve. Agents need tighter fences and success checks; Chat needs cleaner history and precise references. Pick one lane per task.

Do .github/copilot-instructions.md files replace per-task prompts?

Instruction files teach durable project facts: stack, style, folder map, and scripts. Per-task prompts still state the current goal, scope, and verification. Keep the instruction file short and current. Put one-off ticket detail in the Chat or agent message.

Can PromptMake write prompts that run inside Copilot?

PromptMake /text can draft a clearer English brief you paste into Copilot Chat or agent mode. It cannot see your IDE, attach @workspace, or apply your instruction files. Soft start: https://promptmake.net/text for structure, then finish context inside Copilot. That split keeps expectations honest.

How is this different from general AI prompts for code?

General coding prompt guides target ChatGPT or Claude in a browser with paste-in files. GitHub Copilot prompts lean on IDE context, participants, instruction files, completions, and agent approvals. Patterns like diff-only output still help. The delivery path and context controls differ, so templates here stay Copilot-specific.

How do I start today on a free PromptMake tier?

Pick one real bug or small feature and write three rough sentences offline. Generate one scaffold on /text if you want help shaping goal and constraints, then edit in real paths and tests. Paste into a fresh Copilot Chat thread with the right files pinned. Guest /text use needs no signup for a small daily quota; register if you need more runs the same day.

Ready to generate your own prompts?

Free. No sign-up required. Works with all major AI models.

Related articles