Skip to main content

GitHub Copilot Skills

Overview

GitHub Copilot Skills are reusable, task-focused workflows that guide Copilot through consistent steps for a specific domain or objective. They help standardize how Copilot assists with tasks like code generation, reviews, migrations, or documentation.

Prerequisites

  • A GitHub repository with documentation enabled
  • A clear, repeatable task you want Copilot to perform
  • Examples of desired inputs and outputs

Step 1: Define the skill scope

Clearly describe the task the skill will handle.

  • Goal: What outcome should Copilot achieve?
  • Boundaries: What should Copilot avoid doing?
  • Inputs: What information must the user provide?
  • Outputs: What format should Copilot return?

Step 2: Create a skill specification

Document the skill in markdown so it can be referenced consistently.

# Skill: <Name>

## Purpose
<Short description of what the skill does.>

## When to use
- <Scenario 1>
- <Scenario 2>

## Inputs
- <Required input 1>
- <Required input 2>

## Output
<Expected output format and content.>

## Steps
1. <Step 1>
2. <Step 2>
3. <Step 3>

## Constraints
- <Do not do X>
- <Do not modify Y>

## Examples

Input

<Example user prompt>

Output

<Example response>
## Step 3: Add prompts and guardrails
Include prompt patterns that users can follow and guardrails to keep Copilot focused.

### Prompt template
```markdown
Use the <Skill Name> skill to:
- Context: <context>
- Inputs: <inputs>
- Output: <format>
- Constraints: <constraints>

Guardrails

  • Keep responses concise and task-focused
  • Avoid unrelated refactors or scope creep
  • Prefer deterministic steps over open-ended guidance

Step 4: Validate the skill

Test the skill with multiple real prompts.

  • Verify inputs are sufficient
  • Confirm outputs match the expected format
  • Adjust steps and constraints as needed

Step 5: Publish and maintain

Place the markdown in a discoverable location (for example, docs/copilot/).

  • Add links from an index page
  • Version the skill with changes
  • Update examples as the task evolves

Example skill

# Skill: API Client Stub Generator

## Purpose
Generate a typed API client stub from an OpenAPI specification.

## When to use
- Creating a new service integration
- Regenerating clients after spec updates

## Inputs
- OpenAPI file path
- Target language

## Output
- Generated client code files
- Summary of created files

## Steps
1. Read the OpenAPI spec and validate it.
2. Generate client stubs using the preferred generator.
3. Output file list and usage notes.

## Constraints
- Do not modify existing business logic files
- Keep generated code in `/clients/<service>`

## Examples
### Input
Generate a TypeScript client from `specs/payments.yaml`.

### Output
Created:
- `clients/payments/index.ts`
- `clients/payments/types.ts`

Tips for effective skills

  • Keep scope narrow and repeatable
  • Provide concrete examples and expected formats
  • Define constraints explicitly
  • Review and iterate based on real usage