DEV Community

Let's Automate 🛡️ for AI and QA Leaders

Posted on • Originally published at Medium on

GitHub Copilot Agent Skills: Teaching AI Your Repository Patterns

A practical guide to the new GitHub Copilot Agent Skills feature (announced December 18, 2025)

Example Repository: SeleniumSelfHealing.Reqnroll

Every test automation engineer faces this challenge: you build a sophisticated framework with custom patterns, then AI assistants suggest brittle, outdated approaches that ignore your architecture.

On December 18, 2025, GitHub announced Agent Skills — folders containing instructions, scripts, and resources that Copilot automatically loads when relevant to your prompt. This feature works across the Copilot coding agent, Copilot CLI, and agent mode in Visual Studio Code.

Let me show you how I used this to teach Copilot our self-healing Selenium patterns.

What Are Agent Skills?

According to GitHub's announcement, Agent Skills allow you to teach Copilot how to perform specialized tasks in a specific, repeatable way. When Copilot determines a skill is relevant to your task, it loads the instructions and follows them.

You create skills by adding a .github/skills/[skill-name]/SKILLS.md file to your repository. The skills work automatically—no manual activation needed.

The Problem: Brittle Selenium Tests

Traditional Selenium tests break easily:

// Typical brittle approach
var button = driver.FindElement(By.XPath("//button[@id='submit-2023']"));
button.Click();
Enter fullscreen mode Exit fullscreen mode

When element IDs change, tests fail. Our framework uses AI-powered element recovery with semantic descriptions instead of hardcoded selectors. But without guidance, Copilot suggested the old brittle patterns.

Creating the Agent Skill

Here's the structure I implemented:

# Selenium Self-Healing Automation Skills

## Purpose
Enable Copilot to:
- Generate robust Selenium UI tests
- Use AI-powered self-healing locator strategies
- Follow BDD patterns with Reqnroll

## Hard Rules

### Must
- Use self-healing WebDriver extensions
- Prefer element descriptions over raw locators
- Generate async step definitions
- Log all healing attempts

### Must Not
- Hardcode XPath or CSS selectors
- Use Thread.Sleep
- Bypass self-healing logic

## Golden Example
Step Definition Pattern:
Enter fullscreen mode Exit fullscreen mode
[When(@"I click the ""(.*)""")]
public async Task WhenIClickElement(string elementDescription)
{
    await _driver.Click(
        By.CssSelector(""),
        elementDescription
    );
}
Enter fullscreen mode Exit fullscreen mode
Scenario: Search for Selenium
  Given I navigate to "https://www.wikipedia.org"
  When I enter "Selenium" into the "search box"
  And I click the "search button"
  Then I should see "Selenium"
Enter fullscreen mode Exit fullscreen mode

The Results

After adding the skill, developers type:

// Create step definition to click login button
Enter fullscreen mode Exit fullscreen mode

Copilot now generates:

[When(@"I click the ""(.*)""")]
public async Task WhenIClickElement(string elementDescription)
{
    await _driver.Click(By.CssSelector(""), elementDescription);
}
Enter fullscreen mode Exit fullscreen mode

Perfect! It follows our self-healing pattern with semantic descriptions instead of brittle locators.

Key Components That Work

Clear Rules Define explicit must-do and must-not-do items. Specificity produces better results.

Working Examples Use actual code from your repository. Copilot learns from real patterns, not theoretical ones.

Context About Structure Explain your project organization so Copilot places code correctly.

Templates Provide scaffolding for scenarios developers encounter frequently.

Verifying It Works

According to GitHub's documentation, when Copilot chooses to use a skill, the SKILL.md file will be injected in the agent's context.

To verify:

  1. Open Copilot Chat and ask: "How should I create a new step definition?"
  2. Look for references to your SKILLS.md in the response
  3. Check suggestions match your patterns (async methods, element descriptions, self-healing extensions)

Create a test file with a comment triggering your patterns and observe what Copilot suggests.

Important Requirements

GitHub Copilot Agent Skills requires a paid plan (Individual, Business, or Enterprise). The feature is available with Copilot coding agent, GitHub Copilot CLI, and agent mode in Visual Studio Code Insiders. Support in the stable version of VS Code is coming soon.

Without a paid plan, the SKILLS.md still serves as valuable documentation for your team.

The feature may need 5–10 minutes to index new files. Reload your IDE if suggestions don't immediately reflect your patterns.

Why This Matters for Test Automation

Testing frameworks evolve beyond standard practices. Self-healing locators, AI-powered recovery, custom assertions — these patterns don't exist in Copilot's base training.

GitHub notes that you can write your own skills, or use skills shared by others, such as those in the anthropics/skills repository or GitHub's community created github/awesome-copilot collection.

This transforms AI from suggesting generic approaches to understanding your specific methodology. It's not about speed — it's about generating the right code that maintains your architecture's quality standards.

Getting Started

  1. Create .github/skills/your-skill/SKILLS.md
  2. Document your most critical pattern
  3. Include one golden example
  4. Test with a new file
  5. Expand as you identify more patterns

Start small. Focus on the pattern that matters most. You can expand later.

Currently, skills can only be created at the repository level. Support for organization-level and enterprise-level skills is coming soon.

Additional Resources


What patterns would you teach GitHub Copilot in your test automation projects?

Top comments (0)