How to use agents, skills, and instructions in Copilot CLI | Tutorial for beginners
Chapters6
Introduces the three main instruction formats and why they matter for keeping Copilot aligned with project patterns.
Learn how Copilot CLI uses instructions, skills, and custom agents to match your organization's patterns and scale code with confidence.
Summary
GitHub’s Get Up Copilot CLI for beginners breaks down three core building blocks: instructions, skills, and custom agents. GitHub demonstrates how these elements work in harmony to ensure Copilot follows your project’s patterns and practices. Instructions provide the background and rules for code generation, with a project-wide Copilot instructions file and targeted dot instructions files for specific file types like tests or API code. The video shows how adding a Copilot instructions.md file can introduce docstrings automatically, making generated code align with organizational standards. Skills are markdown-defined tools (and scripts in .github/skills) that guide tasks like creating PRs or inspecting contribution guidelines, so Copilot can perform lower-level actions reliably. Custom agents are specialized workers configured under .github/agents to tackle larger tasks, such as accessibility reviews, and can execute tasks across the whole project. The presenter also explains how to invoke these features with slash commands (e.g., /init, /agent) and how they can be used together—never as a replacement for one another but as complementary capabilities. By combining instructions, skills, and agents, you get a cohesive workflow where what needs to be done and how it’s done are both explicitly defined. A practical example covers Flask APIs in Python, where docstrings appear, accessibility reviews are performed, and PRs are generated following the repository’s templates. GitHub points viewers to resources like gh.io/awesome-copilot for ready-to-use instruction and agent templates. In short, these tools work together to ensure Copilot acts in a predictable, organization-aligned way, from initial code generation to final review and deployment.
Key Takeaways
- A global Copilot instructions file (Copilot instructions.md) makes docstrings and organizational patterns the default behavior for generated code.
- Dot instructions files let you target specific files (e.g., Python server routes) and tailor how Copilot uses context for those files.
- Skills are defined in .github/skills and can automate tasks like creating contributions, PR templates, and issue templates.
- Custom agents in .github/agents enable large-scale tasks (e.g., accessibility reviews) that affect multiple parts of the project.
- Slash commands (e.g., /init, /agent) trigger setup and specialized workflows, integrating instructions, skills, and agents seamlessly.
- Agents, skills, and instructions are designed to be used together, not in isolation, for cohesive project-wide execution.
- Templates and templates-based automation (PRs, branches, issues) follow repository-defined guidelines to maintain consistency.
Who Is This For?
Essential viewing for developers and DevOps engineers who want Copilot CLI to adhere to organizational standards. Great for teams looking to scale code quality with guided automation and review processes.
Notable Quotes
""Copilot has several capabilities between instructions files, custom agents, and agent skills to ensure you get the code and activities how do you have completed them if you did them manually.""
—Intro framing how instructions, agents, and skills enable Copilot to emulate established workflows.
""Copilot instructions file is global to that entire project and always in context.""
—Highlight of the project-wide nature of the main instructions file.
""A docstring is now included with the function in the generated code.""
—Shows a concrete benefit of using the global instructions file.
""Skills can be called by using them as slash commands, make contribution in our case, or dynamically through natural language.""
—Explains how to trigger skills and their practical effects.
""Accessibility is, of course, important and we always want to get it right.""
—Illustrates the purpose of a custom accessibility agent.
Questions This Video Answers
- How do I set up a Copilot CLI project-wide instructions file (Copilot instructions.md) vs. dot instructions files?
- What are custom agents in Copilot CLI and how do I run an accessibility review with them?
- How do I use slash commands like /init and /agent to manage Copilot workflows?
- What are the best practices for combining instructions, skills, and agents in a Flask or Python project?
- Where can I find ready-made templates for Copilot workflows (e.g., PR templates, issue templates)?
Copilot CLIinstructions filesdot instructionscustom agentsagent skillsPR automationaccessibility reviewFlask Pythondocstringsgh.io/awesome-copilot
Full Transcript
In this episode of Get Up 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 skills to ensure you get the code and activities how do you have completed them if you did them manually. Let's explore each of these separately, then bring them together at the end to see how they help us form a cohesive strategy.
Let's start with instructions. Sort of as the name would suggest, instructions are exactly that, instructions to Copilot. They provide Copilot the background of both what we're building and how we're building it. Defined in markdown files, instruction files come in two core varieties, a single centralized Copilot instructions file, which is project level, and dot instructions file, which allow you to target specific types of files like tests or code used to define APIs. Let's make a quick request of Copilot to see the impact of instructions files. I'll ask for an API to be generated, which in the case of my application is done using Python and Flask.
We can see the response is relatively generic. It follows my existing patterns, but let's say our organization requires docstrings. Let's add a Copilot instructions.md file. The Copilot instructions file is global to that entire project and always in context. If we explain we always want docstrings, then send the same command, we see the impact of this. A docstring is now included with the function in the generated code. Copilot instructions is table stakes. Every project should have one. It's so important in fact that there's a slash command to generate them, slash init. This will give you a great starting point from which you can add specifics about your project.
Now, dot instructions files allow you to get more specific, targeting individual types of files. In our Flask API, for example, we have specific requirements on how we want those files to be built. By adding the dot instructions files, we can break down our instructions into smaller chunks. The apply to section accepts a path, which will be used by Copilot to determine when to use that provided context. In our case, we've specified Python files in our server routes folder. As you might expect, there are common instructions you might want to add like how to create React components or Playwright tests.
There's a collection of instructions files you can quickly add to your project at gh.io/awesome-copilot. Turning our attention to activities and tools we might want to provide Copilot are agent skills. Skills can be used to tell Copilot both how we want to create that code, but how we want to perform lower level tasks. They are defined with markdown files and even scripts in the .github/skills folder. We've got a skill here for creating contributions to a repository. It instructs Copilot to look for contribution guidelines and issue and pull request templates. If those exist, it will use those or use the templates we've given it as an example to ensure Copilot is doing its best work.
Skills can be called by using them as slash commands, make contribution in our case, or dynamically through natural language. When we ask Copilot to make a pull request or PR, it automatically kicks off that skill following the guidance provided. It generates a new branch, an issue, logically groups commits, and eventually creates a PR using the template defined in the repository. And just like before, there are skills available that you can use in your projects at gh.io/awesome-copilot. Now, for larger tasks, we have custom agents. Custom agents, defined in markdown files either in .github/agents or by your organization, allow you to create specialized workers for particular scenarios.
Let's take accessibility as an example. Accessibility is, of course, important and we always want to get it right. It can also require updates to numerous parts of our application and some specialized skills. Custom agents have their own context and are built for exactly this. Using the slash agent command, we see the list of agents that are available. Let's activate that accessibility agent and ask Copilot to perform a review identifying the most impactful updates that could be made to our code. Just as before, Copilot diligently performs the task, this time as the accessibility custom agent. Once it generates the suggestions, we can then ask it to apply them and off it goes.
Instructions, skills, and agents are all defined as markdown files, and you might be wondering when to use each. It's important to highlight that these are built to be used in harmony with one another rather than in either/or approach. Instructions provide context on how best to generate code, the things Copilot should be considering as it modifies and updates the code base. Skills are tools in Copilot's toolbox for performing tasks like how it should approach running tests and recovering from failures or creating a PR to a project. And agents are built to handle more complex tasks like performing search engine optimization or an accessibility review, which might require updates to the entire project.
Working together, these features ensure tasks are completed correctly, both what needs to be done and how it needs to be done.
More from GitHub
Get daily recaps from
GitHub
AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.









