Teaching GitHub Copilot New Tricks with Agent Skills in VS Code

Teaching GitHub Copilot New Tricks with Agent Skills in VS Code

GitHub Copilot has evolved far beyond code completion. With the introduction of Agent Skills in Visual Studio Code, Copilot can now follow structured, reusable workflows that you define — turning it into a specialized teammate rather than a generic AI assistant.

In this post, we’ll explore:

  • What Agent Skills are
  • How they work in VS Code
  • Real examples from the official documentation
  • How you can start using and creating them today

What Are Agent Skills?

Agent Skills are a way to teach GitHub Copilot how to perform specific tasks using step-by-step instructions, examples, and supporting files.

Instead of repeatedly explaining how you want Copilot to do something, you define that process once — and Copilot automatically applies it when the situation matches.

Think of Agent Skills as:

  • 📘 Playbooks for common tasks
  • 🧠 Domain-specific knowledge Copilot can load on demand
  • 🔁 Reusable workflows shared across projects or teams

Agent Skills are stored as simple folders containing a SKILL.md file and optional supporting resources.


Why Agent Skills Matter

Without Agent Skills, Copilot relies on:

  • Your prompt
  • The current file
  • Limited workspace context

With Agent Skills:

  • Copilot follows explicit instructions
  • Uses project-approved patterns
  • Produces more consistent and accurate results

This is especially powerful for:

  • Testing standards
  • CI/CD debugging
  • Onboarding new developers
  • Repetitive workflows

Anatomy of an Agent Skill

At the heart of every skill is a file called SKILL.md.

Minimal Example

---
name: webapp-testing
description: Use this skill when creating or debugging Playwright tests for web applications.
---

# Web Application Testing with Playwright

Follow these steps to create reliable browser-based tests:
1. Identify the user flow
2. Use Playwright test syntax
3. Add clear assertions
4. Prefer role-based selectors

What Each Part Does

  • name – Unique identifier for the skill
  • description – Helps Copilot decide when to activate the skill
  • Body content – The actual instructions Copilot should follow

When your prompt matches the description, VS Code loads this skill automatically.


Example Skill: Web Application Testing

One of the best examples from the VS Code documentation focuses on testing web apps using Playwright.

What This Skill Enables

With this skill in place, Copilot can:

  • Generate Playwright tests
  • Follow your testing conventions
  • Debug failing tests
  • Reuse test templates

Example Usage

You ask Copilot:

“Create an end-to-end test for the login flow”

Copilot:

  • Detects the webapp-testing skill
  • Follows the steps defined in SKILL.md
  • Produces a structured Playwright test instead of generic code

Sample Output

test('user can log in successfully', async ({ page }) => {
  await page.goto('/login');
  await page.getByRole('textbox', { name: 'Email' }).fill('user@test.com');
  await page.getByRole('textbox', { name: 'Password' }).fill('password123');
  await page.getByRole('button', { name: 'Sign in' }).click();
  await expect(page).toHaveURL('/dashboard');
});

This consistency comes from the skill — not from luck.


Example Skill: Debugging GitHub Actions

Another powerful example focuses on GitHub Actions troubleshooting.

What the Skill Teaches Copilot

The skill instructs Copilot to:

  1. Review recent workflow runs
  2. Summarize failure logs
  3. Identify common CI issues
  4. Suggest concrete fixes

Example Prompt

“Why is my GitHub Actions build failing?”

Instead of guessing, Copilot:

  • Follows a structured debugging process
  • Looks for missing secrets, version mismatches, or timeout issues
  • Produces an actionable explanation

Example Response

“The workflow failed because NODE_VERSION is set to 20, but the action uses a dependency that requires Node 18. Update the workflow or downgrade the dependency.”

This is process-driven AI, not just text generation.


How to Use Agent Skills in Your Project

Step 1: Create a Skills Folder

In your repo:

.github/skills/

Step 2: Add a Skill

.github/skills/webapp-testing/SKILL.md

Step 3: Write Clear Instructions

Be explicit. Copilot follows what you write — good or bad.

✅ Good:

  • Step-by-step instructions
  • When to use the skill
  • Coding conventions
  • Examples

❌ Avoid:

  • Vague advice
  • Conflicting rules
  • Overloading a single skill

Best Practices for Writing Great Skills

✔ Keep skills focused
✔ Use clear activation descriptions
✔ Include examples
✔ Align with team standards
✔ Treat skills as living documentation

If you wouldn’t hand the instructions to a junior developer, don’t hand them to Copilot.


When Agent Skills Shine the Most

Agent Skills are especially valuable when:

  • Your team has strong conventions
  • You repeat the same tasks often
  • You want AI outputs to match production quality
  • You onboard new developers frequently

They turn Copilot into an extension of your team’s knowledge.


Final Thoughts

Agent Skills mark a major shift in how developers work with AI in VS Code. Instead of prompting harder, you teach once and reuse forever.

If you invest a little time writing high-quality skills, Copilot stops being a helpful autocomplete tool — and starts behaving like a trained, context-aware teammate.

https://code.visualstudio.com/docs/copilot/customization/agent-skills

You Might Also Like