GitHub Copilot — AI Pair Programming

GitHub Copilot sits in your editor and writes code alongside you. It reads your current file, open tabs, and surrounding context to suggest completions that range from finishing a single line to generating entire functions. Beyond completions, Copilot Chat lets you ask questions, explain code, generate tests, and refactor — all without leaving your editor.

25 stars

Best use case

GitHub Copilot — AI Pair Programming is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

GitHub Copilot sits in your editor and writes code alongside you. It reads your current file, open tabs, and surrounding context to suggest completions that range from finishing a single line to generating entire functions. Beyond completions, Copilot Chat lets you ask questions, explain code, generate tests, and refactor — all without leaving your editor.

Teams using GitHub Copilot — AI Pair Programming should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/github-copilot/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/TerminalSkills/skills/github-copilot/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/github-copilot/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How GitHub Copilot — AI Pair Programming Compares

Feature / AgentGitHub Copilot — AI Pair ProgrammingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

GitHub Copilot sits in your editor and writes code alongside you. It reads your current file, open tabs, and surrounding context to suggest completions that range from finishing a single line to generating entire functions. Beyond completions, Copilot Chat lets you ask questions, explain code, generate tests, and refactor — all without leaving your editor.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# GitHub Copilot — AI Pair Programming

GitHub Copilot sits in your editor and writes code alongside you. It reads your current file, open tabs, and surrounding context to suggest completions that range from finishing a single line to generating entire functions. Beyond completions, Copilot Chat lets you ask questions, explain code, generate tests, and refactor — all without leaving your editor.

This skill covers setting up Copilot in VS Code and the CLI, working effectively with inline suggestions, leveraging chat and slash commands, and using workspace agents for codebase-wide tasks.

## Setting Up Copilot in VS Code

Copilot requires an active GitHub Copilot subscription (Individual, Business, or Enterprise). Once you have access, installation takes seconds.

Open VS Code and install the extension from the marketplace. The Copilot extension includes both inline suggestions and the chat panel.

```bash
# Install Copilot extensions from the command line
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chat
```

After installation, VS Code prompts you to sign in with your GitHub account. Once authenticated, Copilot activates automatically. You can verify it's running by checking the Copilot icon in the status bar — it should show as active, not crossed out.

To configure Copilot's behavior, open your VS Code settings and adjust the relevant options.

```json
// .vscode/settings.json — Copilot configuration for a project
{
  // Enable Copilot for specific languages
  "github.copilot.enable": {
    "*": true,
    "markdown": true,
    "plaintext": false,
    "yaml": true
  },

  // Control inline suggestion behavior
  "editor.inlineSuggest.enabled": true,
  "github.copilot.advanced": {
    "inlineSuggestCount": 3
  }
}
```

## Working with Inline Suggestions

Inline suggestions appear as grayed-out ghost text as you type. Copilot predicts what you want to write based on your current file, function names, comments, and surrounding code.

The most effective way to guide Copilot is through clear function signatures and comments. When you write a descriptive function name and type signature, Copilot understands your intent and generates accurate implementations.

```typescript
// src/utils/validation.ts — Copilot generates implementations from descriptive signatures

// Type a function signature and pause — Copilot suggests the body
function validateEmailAddress(email: string): boolean {
  // Copilot completes this based on the function name and parameter
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  return emailRegex.test(email);
}

// A comment describing the function triggers high-quality suggestions
// Parse a CSV string into an array of objects using the first row as headers
function parseCSV(csv: string): Record<string, string>[] {
  const lines = csv.trim().split('\n');
  const headers = lines[0].split(',').map(h => h.trim());

  return lines.slice(1).map(line => {
    const values = line.split(',').map(v => v.trim());
    return Object.fromEntries(headers.map((h, i) => [h, values[i]]));
  });
}
```

Keyboard shortcuts control how you interact with suggestions:

- **Tab** — Accept the full suggestion
- **Esc** — Dismiss the suggestion
- **Alt+]** / **Option+]** — Cycle to the next suggestion
- **Alt+[** / **Option+[** — Cycle to the previous suggestion
- **Ctrl+Enter** — Open the Copilot completions panel to see multiple alternatives

## Copilot Chat

The chat panel is where Copilot moves beyond autocompletion into genuine pair programming. You can ask it to explain code, find bugs, suggest refactors, or generate entirely new code based on natural language descriptions.

Open the chat panel with **Ctrl+Shift+I** (or **Cmd+Shift+I** on macOS). You can also select code in the editor, right-click, and choose a Copilot action from the context menu.

Effective chat prompts are specific and provide context. Instead of asking "fix this code," describe what's wrong and what behavior you expect.

```text
# Example chat prompts that produce high-quality responses

"This function throws when the input array is empty. Add a guard clause
that returns an empty array instead of throwing."

"Refactor this Express route handler to use async/await instead of
.then() chains, and add proper error handling with a try/catch."

"Generate unit tests for the UserService class. Cover the happy path,
invalid input, and database connection failures."

"Explain what this regex does step by step: /^(?=.*[A-Z])(?=.*\d).{8,}$/"
```

## Slash Commands

Slash commands are shortcuts for common operations. Type `/` in the chat panel to see the full list. These commands streamline repetitive tasks.

The most useful slash commands include:

- **/explain** — Explain the selected code in plain language
- **/fix** — Suggest a fix for problems in the selected code
- **/tests** — Generate unit tests for the selected code
- **/doc** — Generate documentation comments for a function or class
- **/simplify** — Refactor the selected code to reduce complexity
- **/new** — Scaffold a new project or file from a description

When you select a block of code and type `/tests`, Copilot analyzes the function signatures, identifies edge cases, and generates a complete test file. You can then refine the output by following up in chat.

```typescript
// src/services/orderService.ts — Select this code, then use /tests in chat
export class OrderService {
  constructor(private readonly db: Database) {}

  async createOrder(userId: string, items: CartItem[]): Promise<Order> {
    if (items.length === 0) {
      throw new ValidationError('Order must contain at least one item');
    }

    const total = items.reduce((sum, item) => sum + item.price * item.quantity, 0);
    const order = { userId, items, total, status: 'pending', createdAt: new Date() };

    return this.db.orders.insert(order);
  }
}
```

## Workspace Agents

Workspace agents are Copilot's most powerful feature. The `@workspace` agent can reason across your entire codebase, not just the current file. It indexes your project and answers questions that require understanding multiple files and their relationships.

```text
# Workspace agent prompts — these search across your entire project

@workspace "Where is the database connection configured?"

@workspace "Which components use the useAuth hook?"

@workspace "How does the payment flow work end to end?"

@workspace "Find all API endpoints that don't have authentication middleware"
```

Other built-in agents include:

- **@terminal** — Suggest or explain terminal commands
- **@vscode** — Help with VS Code settings and features

## Copilot in the CLI

GitHub Copilot extends beyond the editor into your terminal. The `gh copilot` command turns natural language into shell commands.

```bash
# Install the Copilot CLI extension
gh extension install github/gh-copilot

# Ask Copilot to explain a command
gh copilot explain "find . -name '*.ts' -not -path './node_modules/*' | xargs grep 'TODO'"

# Ask Copilot to suggest a command
gh copilot suggest "find all Docker containers using more than 1GB memory"

# Copilot presents the command and asks if you want to run it
# ✓ docker stats --no-stream --format "table {{.Name}}\t{{.MemUsage}}" | awk '$2 > 1024'
```

The CLI is particularly powerful for operations you do infrequently — complex `find` commands, `awk` pipelines, Docker operations, or git history queries. Instead of searching Stack Overflow, describe what you want and Copilot translates it into the right command for your shell.

## Tips for Getting Better Suggestions

Copilot's quality depends heavily on the context you provide. A few practices dramatically improve suggestion accuracy.

Write descriptive variable and function names. Copilot reads identifiers as strong signals of intent. A function named `calculateMonthlyRevenue` gets better suggestions than one named `calc`.

Keep related code in the same file or have relevant files open in tabs. Copilot uses open tabs as context for its suggestions.

Use TypeScript or JSDoc types. The more type information Copilot has, the more constrained and accurate its suggestions become. A function that accepts `userId: string` and returns `Promise<User | null>` gives Copilot much more to work with than untyped JavaScript.

Write a leading comment before complex functions. Even a single line describing the algorithm or business rule helps Copilot generate the right implementation on the first try.

Related Skills

creating-github-issues-from-web-research

25
from ComeOnOliver/skillshub

This skill enhances Claude's ability to conduct web research and translate findings into actionable GitHub issues. It automates the process of extracting key information from web search results and formatting it into a well-structured issue, ready for team action. Use this skill when you need to research a topic and create a corresponding GitHub issue for tracking, collaboration, and task management. Trigger this skill by requesting Claude to "research [topic] and create a ticket" or "find [information] and generate a GitHub issue".

navigating-github

25
from ComeOnOliver/skillshub

First-time GitHub setup and interactive git learning. Walks users from zero to a working GitHub repo, then teaches git through 9 hands-on lessons on their actual project. Adapts language and depth to skill level — inferred from environment, not questionnaires. Two modes: Setup (guided onboarding) and Learn (progressive curriculum from commits to CI/CD). Use when the user asks to set up GitHub, learn git, or says "teach me github". Trigger with "set up my repo", "help me with github", "teach me github", "learn git", "what are branches", "teach me PRs", or "how do I use github".

github-project-setup

25
from ComeOnOliver/skillshub

Github Project Setup - Auto-activating skill for Enterprise Workflows. Triggers on: github project setup, github project setup Part of the Enterprise Workflows skill category.

github-actions-starter

25
from ComeOnOliver/skillshub

Github Actions Starter - Auto-activating skill for DevOps Basics. Triggers on: github actions starter, github actions starter Part of the DevOps Basics skill category.

workiq-copilot

25
from ComeOnOliver/skillshub

Guides the Copilot CLI on how to use the WorkIQ CLI/MCP server to query Microsoft 365 Copilot data (emails, meetings, docs, Teams, people) for live context, summaries, and recommendations.

suggest-awesome-github-copilot-skills

25
from ComeOnOliver/skillshub

Suggest relevant GitHub Copilot skills from the awesome-copilot repository based on current repository context and chat history, avoiding duplicates with existing skills in this repository, and identifying outdated skills that need updates.

suggest-awesome-github-copilot-instructions

25
from ComeOnOliver/skillshub

Suggest relevant GitHub Copilot instruction files from the awesome-copilot repository based on current repository context and chat history, avoiding duplicates with existing instructions in this repository, and identifying outdated instructions that need updates.

suggest-awesome-github-copilot-agents

25
from ComeOnOliver/skillshub

Suggest relevant GitHub Copilot Custom Agents files from the awesome-copilot repository based on current repository context and chat history, avoiding duplicates with existing custom agents in this repository, and identifying outdated agents that need updates.

remember-interactive-programming

25
from ComeOnOliver/skillshub

A micro-prompt that reminds the agent that it is an interactive programmer. Works great in Clojure when Copilot has access to the REPL (probably via Backseat Driver). Will work with any system that has a live REPL that the agent can use. Adapt the prompt with any specific reminders in your workflow and/or workspace.

mcp-copilot-studio-server-generator

25
from ComeOnOliver/skillshub

Generate a complete MCP server implementation optimized for Copilot Studio integration with proper schema constraints and streamable HTTP support

github-copilot-starter

25
from ComeOnOliver/skillshub

Set up complete GitHub Copilot configuration for a new project based on technology stack

create-github-pull-request-from-specification

25
from ComeOnOliver/skillshub

Create GitHub Pull Request for feature request from specification file using pull_request_template.md template.