Skip to content

Instantly share code, notes, and snippets.

@asears
Last active May 17, 2025 10:20
Show Gist options
  • Save asears/8af5bf419fd107592f5da6cea0f4664c to your computer and use it in GitHub Desktop.
Save asears/8af5bf419fd107592f5da6cea0f4664c to your computer and use it in GitHub Desktop.
Copilot Instructions, Prompts, Tools and Variables
title
this follows front matter format

Chat variables

Use chat variables in your chat prompt to reference context that is relevant to your question.

Chat variable Description

#changes The list of source control changes.

#codebase Add relevant workspace content as context to your prompt.

#extensions Tool to find and ask questions about VS Code extensions. For example, "how to get started with Python #extensions?"

#fetch Fetch the content from a web page - provide the URL.

# Type #, followed by a file or folder name, to add it as chat context.

#githubRepo Perform a code search for a GitHub repo to gather context for your prompt. For example, "what is a global snippet #githubRepo microsoft/vscode."

#new Tool to scaffold a new VS Code workspace.

#newJupyterNotebook Tool to scaffold a new Jupyter notebook.

#openSimpleBrowser Tool to open the built-in Simple Browser and preview a locally-deployed web app.

#problems Add workspace issues and problems from the Problems panel as context. Useful while fixing code or debugging.

#searchResults Add the results from the Search view as context to your prompt.

#selection Add the current editor selection as context to your prompt.

# Type #, followed by a symbol name, to get symbol suggestions for workspace files and attach as context.

#terminalSelection Add the current terminal selection as context to your chat prompt.

#terminalLastCommand Add the last run terminal command as context to your chat prompt.

#testFailure Add test failure information as context. Useful when running and diagnosing tests.

#usages Combination of "Find All References", "Find Implementation", and "Go to Definition".

#VSCodeAPI Add the VS Code API as context to your prompt to ask questions related to VS Code extension development.

Instructions files

Define shared instructions for code generation in *.instructions.md Markdown files in your workspace or user data folder. These common instructions supplement your own personal code-generation instructions.

Code-review instructions (Preview)

Define instructions for using Copilot to review an editor selection in settings or import from a file. You can define language-specific instructions.

Code-generation instructions (Experimental)

Define instructions for code generation with GitHub Copilot in settings or import from a file. You can define language-specific instructions.

Test-generation instructions (Experimental)

Define instructions for test generation with GitHub Copilot in settings or import from a file. You can define language-specific instructions.

Commit-message generation instructions (Experimental)

Define instructions for commit message generation with GitHub Copilot in settings or import from a file. You can define language-specific instructions.

Pull request title and description generation instructions (Experimental)

Define instructions for pull request title and description generation with GitHub Copilot in settings or import from a file. You can define language-specific instructions.

Reusable prompt files (Experimental)

Define reusable prompt files for repeatable tasks with additional context in *.prompt.md Markdown files and run them in chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment