Coding · guidance updated 4 Oct 2026

GitHub Copilot (chat/agent) prompt guide

Copilot supports GPT-5.x/6.x, Claude Sonnet/Opus 5.5 and Fable, Gemini 3.x, Grok and others, with auto model selection (GPT-5.3-Codex is the fallback). Use faster models for simple edits and reasoning models for planning and debugging.

Free. We don't store what you type.

How to prompt GitHub Copilot (chat/agent)

  1. Start with the broad goal, then list the specific requirements.
  2. Name exact symbols and files ('the createUser function in #file:src/users.ts'), never 'this' or 'it'.
  3. Pull in context with #file, #folder, #symbol, #codebase or #fetch for docs, or by selecting code.
  4. Give examples of inputs, expected outputs or a reference implementation.
  5. Break complex work into steps, and use Plan for multi-file changes before handing them to Agent.
  6. State constraints and how to verify the work (tests to run, expected output).
  7. Keep conventions, build and test commands in .github/copilot-instructions.md (about 2 pages max).
  8. Use path-scoped .github/instructions/*.instructions.md with applyTo globs, or AGENTS.md, for area-specific rules.
  9. Use /explain, /fix and /tests for quick targeted tasks.
  10. Start a new thread for a new task and delete stale turns to keep history relevant.

The shape of a good prompt

[Goal: broad intent] [Context: #file / #codebase / selection] [Requirements: bullet list] [Example input -> output] [Constraints] [Verification: tests/commands to run] [Mode: Plan then Agent for multi-file]

Avoid

  • Ambiguous references like 'fix this' with no file or symbol
  • One giant multi-feature request
  • Task-specific details in copilot-instructions.md (it should be general)
  • Long, stale chat threads carried over from previous tasks

Example

Request add input validation to the signup API

Add request validation to the signup endpoint.

Context: #file:src/routes/auth.ts (POST /signup handler) and #file:src/lib/errors.ts for our error format.

Requirements:
- email: required, valid format, lowercased and trimmed
- password: 12+ chars, at least one number and one letter
- displayName: optional, 2-40 chars
- On failure return 400 with { error: 'VALIDATION_ERROR', fields: { <field>: <message> } }

Example: { email: 'bad', password: 'short' } -> 400 with messages for both fields.

Use zod (already a dependency); don't change the success response. Add unit tests in tests/auth.signup.test.ts and run `npm test`.

The Weekly Tally

Useful updates, insights and no-hype advice. Read this week's digest.

One email a week. Unsubscribe in one click.