gauthiermartin
MCP Servergauthiermartinpublic

optimizing github copilot

全面指导如何在 VS Code 中最大化利用 GitHub Copilot 的生产力。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
MIT License
License

About This Server

全面指导如何在 VS Code 中最大化利用 GitHub Copilot 的生产力。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Optimizing Github Copilot

A comprehensive guide to maximizing productivity with GitHub Copilot in VS Code. This project collects best practices, commands, and techniques to help developers leverage the full power of AI pair programming through Copilot.

Table of Contents

  • Getting Started
    • Project-Level Configuration
    • User-Level Configuration
  • Instruction Files
    • Types of Instruction Files
    • How to Use Instruction Files
    • Best Practices
  • Chat Variables
  • Universal Commands
    • Ask Mode Commands
    • Terminal Integration Commands
    • VS Code Integration Commands
    • GitHub Integration Commands
    • Agent Mode Commands
  • Resources
  • License

Getting Started

This repository includes optimized configuration settings for GitHub Copilot in VS Code. These settings can be applied in two ways:

Project-Level Configuration

For project-specific settings, copy the contents from this repository's .vscode/settings.json into your own project's .vscode/settings.json file. This will apply Copilot optimizations only for that specific project.

// .vscode/settings.json
{
  "github.copilot.chat.codeGeneration.instructions": [
    {
      "text": "Generate Python code that adheres to the Ruff style guide..."
    }
  ],
  // Other Copilot settings...
}

User-Level Configuration

To apply these settings globally across all your projects:

  1. Open VS Code Settings (File > Preferences > Settings or Cmd/Ctrl+,)
  2. Click on the "Open Settings (JSON)" icon in the top-right corner
  3. Copy the GitHub Copilot related settings from this repository into your settings.json

This approach ensures consistent Copilot behavior across all your development work.

Instruction Files

Instruction files allow you to customize GitHub Copilot's responses to match your specific coding practices and project requirements. These files contain natural language instructions in Markdown format that are automatically included in every chat request.

Types of Instruction Files

  1. .github/copilot-instructions.md:

    • A single instruction file that applies workspace-wide
    • Contains all instructions for your workspace
    • Automatically included in every chat request
    • Requires setting github.copilot.chat.codeGeneration.useInstructionFiles to true
  2. .instructions.md files:

    • Multiple specialized instruction files for specific tasks
    • Can be stored in two locations:
      • Workspace instructions: .github/instructions folder (project-specific)
      • User instructions: Stored in your VS Code profile (available across workspaces)

How to Use Instruction Files

To create a .github/copilot-instructions.md file:

  1. Set github.copilot.chat.codeGeneration.useInstructionFiles to true in your settings
  2. Create a .github/copilot-instructions.md file at your workspace root
  3. Add your coding guidelines, preferred technologies, and project requirements using Markdown

For .instructions.md files:

  1. Run the "Chat: New Instruction File" command from the Command Palette
  2. Choose where to store the instruction file (workspace or user profile)
  3. Add a metadata header with an optional applyTo property to specify file patterns
  4. Write your instructions in the body using Markdown

Best Practices

  • Keep instructions concise and focused
  • Split instructions into multiple files organized by topic
  • Use the applyTo property to automatically apply instructions to specific files
  • Store instructions in version control to share with your team

Instruction files are particularly useful for:

  • Enforcing coding standards across your team
  • Specifying technology preferences and architecture guidelines
  • Ensuring consistent code style and patterns
  • Customizing Copilot's behavior for different parts of your project

Chat Variables

Chat variables help provide relevant context to your GitHub Copilot prompts, making responses more accurate and tailored to your specific needs.

VariableDescription
#changesAdds the list of source control changes as context
#codebaseAdds relevant workspace content as context to your prompt
#extensionsTool to find and ask questions about VS Code extensions (e.g., "how to get started with Python #extensions?")
#fetchFetches content from a web page by providing the URL
#<file or folder name>Type #, followed by a file or folder name to add it as chat context
#githubRepoPerforms code search for a GitHub repo (e.g., "what is a global snippet #githubRepo microsoft/vscode")
#newTool to scaffold a new VS Code workspace
#newJupyterNotebookTool to scaffold a new Jupyter notebook
#openSimpleBrowserOpens the built-in Simple Browser to preview locally-deployed web apps
#problemsAdds workspace issues from the Problems panel as context
#searchResultsAdds results from the Search view as context
#selectionAdds the current editor selection as context
#<symbol>Type #, followed by a symbol name to get symbol suggestions for workspace files
#terminalSelectionAdds the current terminal selection as context
#terminalLastCommandAdds the last run terminal command as context
#testFailureAdds test failure information as context
#usagesCombination of "Find All References", "Find Implementation", and "Go to Definition"
#VSCodeAPIAdds the VS Code API as context for questions related to VS Code extension development

Universal Commands (Available in Ask, Edit, and Agent modes)

CommandDescription
/explainAsk Copilot to explain a block of code or a programming concept
/fixAsk Copilot for suggestions on how to fix a block of code or resolve compiler/linting errors
/fixTestFailureGet suggestions on how to fix failing tests
/docsGenerate documentation comments for methods and functions in the editor
/testsGenerate tests for methods and functions in the editor

Ask Mode Commands

CommandDescription
/setupTestsGet help setting up a testing framework for your code
/newScaffold a new project or file based on your requirements
/newNotebookGenerate a new Jupyter notebook based on your requirements

Terminal Integration Commands

CommandDescription
@terminalAsk questions about the integrated terminal or shell commands
@terminal /explainExplain something from the terminal
copilot-debugTerminal command to help debug programs (prefix a run command)

VS Code Integration Commands

CommandDescription
@vscodeAsk questions about VS Code features and settings
@vscode /runCommandRun a VS Code command
@vscode /searchGenerate a VS Code search

GitHub Integration Commands

CommandDescription
@githubAsk about issues, pull requests, and more across your repositories

Agent Mode Commands (Experimental)

CommandDescription
/startDebuggingGenerate a launch.json debug configuration and start a debugging session

Model Context Protocol (MCP)

TODO

Resources

  • Github Copilot VSCode Features
  • Github Copilot Customization
  • VS Code Agent Mode Just Changed Everything
  • Smaller prompts, better answers with GitHub Copilot Custom Instructions

License

This project is licensed under the MIT License - see the LICENSE file for details.

Quick Start

1

Clone the repository

git clone https://github.com/gauthiermartin/optimizing-github-copilot
2

Install dependencies

cd optimizing-github-copilot
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownergauthiermartin
Repooptimizing-github-copilot
LanguageTypeScript
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation