How to use agents, skills, and instructions in Copilot CLI | Tutorial for beginners

By GitHub

Categories: Product, Tools

Summary

GitHub Copilot CLI offers three complementary features—instructions, skills, and agents—that align AI code generation with organizational patterns. Instructions provide global context, skills enable specific task execution, and agents handle complex multi-part projects like accessibility reviews, ensuring Copilot produces code exactly as teams would manually.

Key Takeaways

  1. Every project needs a Copilot-instructions.md file as foundational 'table stakes.' Use the /init slash command to auto-generate a starting template, then customize with organization-specific requirements like docstrings or coding patterns.
  2. .instructions files enable targeted guidance for specific file types using the applyTo path parameter (e.g., Python files in server routes). This breaks down instructions into smaller, reusable chunks for different code contexts.
  3. Skills function as Copilot's toolbox for repeatable tasks—invoked via slash commands (/make-contribution) or triggered automatically through natural language. They can reference templates and guidelines to ensure consistency in outputs like pull requests.
  4. Custom agents handle complex, multi-part workflows requiring specialized knowledge (accessibility reviews, SEO optimization). Agents have isolated context and can orchestrate changes across the entire project in coordinated steps.
  5. Use the harmony approach: Instructions provide generation context, skills execute specific tasks with recovery patterns, and agents coordinate large-scale refactors. This layered strategy ensures both 'what' and 'how' are addressed.

Topics

Transcript Excerpt

In this episode of GitHub Copilot CLI for Beginners, we’re going to explore instructions files, agents, and skills. Which all allow you to ensure that Copilot is following the exact same patterns and practices that your organization has laid out, and that you’re already following. Ensuring Copilot works with existing patterns and practices our organizations have set forth is key to success. To support this, Copilot has several capabilities between instructions files, custom agents, and agent ski...