Learning Library

← Back to Library

Build Custom Playwright Agents via VS Code ChatModes

Key Points

  • You can create custom Playwright agents (planner, generator, healer) by writing well‑crafted prompts that guide a large language model to plan, generate, or heal test cases.
  • These agents are stored as simple markdown files in the GitHub Copilot “chat‑modes” folder, so you can edit or add new agents directly in VS Code.
  • VS Code’s built‑in chat modes (ask, edit, agent) let you tailor AI behavior for specific tasks, and the custom agent format follows the open‑source agents.md specification.
  • The agents.md format is widely adopted by major tools and companies—including Codex, Zed, Jules, VS Code, GitHub Copilot, and Cursor—making it a standard for building coding agents.
  • For more details and examples, consult the “use chat modes” documentation, search for “chat mode GitHub Copilot,” or visit the agentsmd.net website.

Full Transcript

# Build Custom Playwright Agents via VS Code ChatModes **Source:** [https://www.youtube.com/watch?v=XoLH00AJnX4](https://www.youtube.com/watch?v=XoLH00AJnX4) **Duration:** 00:13:50 ## Summary - You can create custom Playwright agents (planner, generator, healer) by writing well‑crafted prompts that guide a large language model to plan, generate, or heal test cases. - These agents are stored as simple markdown files in the GitHub Copilot “chat‑modes” folder, so you can edit or add new agents directly in VS Code. - VS Code’s built‑in chat modes (ask, edit, agent) let you tailor AI behavior for specific tasks, and the custom agent format follows the open‑source agents.md specification. - The agents.md format is widely adopted by major tools and companies—including Codex, Zed, Jules, VS Code, GitHub Copilot, and Cursor—making it a standard for building coding agents. - For more details and examples, consult the “use chat modes” documentation, search for “chat mode GitHub Copilot,” or visit the agentsmd.net website. ## Sections - [00:00:00](https://www.youtube.com/watch?v=XoLH00AJnX4&t=0s) **Building Custom Copilot Chat Agents** - The speaker explains how to locate the GitHub Copilot chat‑modes folder and edit its prompt files to create personalized Playwright agents (planner, generator, healer) that can be used directly within VS Code. - [00:03:18](https://www.youtube.com/watch?v=XoLH00AJnX4&t=198s) **Playwright Agent for Automated CI/CD** - The speaker outlines how a Playwright‑based agent, defined in a markdown file and added to a GitHub repo, can automate business writing, CI/CD pipeline generation, unit‑test creation, and UI/UX design tasks. - [00:07:32](https://www.youtube.com/watch?v=XoLH00AJnX4&t=452s) **GitHub Actions Workflow Generator Agent** - The speaker demonstrates an AI agent designed to act as a CI/CD architect, automatically analyzing a project's technology stack and producing a customized GitHub Actions workflow file with appropriate push and pull‑request triggers. - [00:11:08](https://www.youtube.com/watch?v=XoLH00AJnX4&t=668s) **Prompt‑Driven Agent Generates Deployment Configs** - The speaker demonstrates how a conversational AI agent automatically creates environment‑specific CI/CD YAML files (including Docker and Docker‑Compose configurations) solely from prompts, highlighting the ability for engineers to deploy specialized automation without writing any code. ## Full Transcript
0:00Hi guys, welcome back and today in this 0:02we'll be talking about how you can build 0:03your own custom agents like playright 0:06agent for that matter. If you remember 0:08playright released this new agents 0:10called as planner agent, generator agent 0:13and healer agent and we also discussed 0:15how you can use these agents to perform 0:18the planning operation generation of 0:20your test cases and also healing of your 0:22existing test cases that you have got. 0:24So that is what we discussed earlier and 0:26we also saw that the planner agent or 0:28generator and the healer agent are 0:30nothing but a bunch of uh the commands 0:33or the prompts that is used to perform 0:35the operation like a uh completely 0:38well-written prompts so that your large 0:41language model can understand and 0:43perform any operation and we also saw 0:44that the moment you have these chat 0:47modes agents or specialized agents sits 0:50uh in this particular GitHub chat modes 0:52folder you can also see them uh sitting 0:54in your agents over here which is 0:56something very neat because now you get 0:58the entire context to your large 1:00language model but where exactly you can 1:03do all of these by yourself because it's 1:04just a file right so just go and search 1:07in Google on the chat modes for uh the 1:11GitHub copilot so let's go and search 1:13for chat mode uh GitHub uh copilot over 1:15here you will notice that there is 1:17something called as use chat modes in VS 1:19code so this particular operation it 1:22says that chat modes are a way to create 1:24specialized AI agents that enables you 1:27to tailor the chat behavior in Visual 1:29Studio Code for specific task or roles 1:32and VS code comes with three built-in 1:34chat modes ask, edit and agent which is 1:37nothing but these agent that you are 1:39seeing over here. This is already a 1:40specialized agent which is built by 1:42Microsoft in the copilot and that's 1:45exactly what you are building over here 1:47for playright as well as you can see 1:48over here. So essentially if you follow 1:51along this particular documentation you 1:53can see that it's nothing but just an MD 1:55file with a bunch of markdown syntaxes 1:58that you need to follow and then you can 1:59have your own custom agents and guess 2:02what all these operations are done using 2:04the syntax from agents.md 2:07and I have also told about the same in 2:08my earlier video where I was talking 2:10about how this entire agent systems work 2:12and this exactly what it is. So 2:14agents.md is a simple open format for 2:17guiding coding agents used by over 2:2020,000 open-source projects. And if you 2:22just scroll down a bit, you'll wonder 2:24that how many big companies are really 2:26using this particular agents. MD almost 2:28like all the big companies that you can 2:30name in like Codex Zed or Jules or VS 2:34Code, GitHub Copilot, Cursor like all 2:36the big companies are using the same 2:38format. And if you want to go a level 2:40further, there is also a website called 2:42as the uh agentsmd.net. 2:45And this is the place where you can find 2:47even more details. So these are the 2:48agents MD guide for the OpenAI codeex as 2:51you can see over here. So you can see 2:53like how the codeex is using the OpenAI 2:55codeex is using to create an uh agents.m 2:59MD file. And if you want to uh create a 3:02sample MD file or want to view the 3:04example MD files, you can go and click 3:06this browse examples over here where you 3:09can see that there are uh like 14 3:11examples of the MD or agent MD files 3:14that you can create and have a visual. 3:17So see this this is a playright end 3:18toend testing automation guide. So if 3:20we're going to go and click this 3:21particular MD file, you will notice that 3:23how this MD file is been structured over 3:26here. So you can just copy this and 3:27paste it into your github/ uh chat mode 3:32and then playright agent MD file 3:35something like that then it is going to 3:37do an do all the operation which you can 3:39actually do it from the playrights 3:41agents as well. So as I told you you can 3:43create your own agent using just 3:46following few patterns and I have 3:48already created a simple very very 3:50simple example of a uh agent over here 3:54where you can see that I have created an 3:56agent for the business operation. So you 3:58can use this for business writing and 4:01scaffoldings and stuff. You can also 4:03create an agent for the CI/CD 4:04operations. But let's say you have got a 4:06code which you need to deploy in CI/CD 4:08pipeline and you want to write a bunch 4:10of uh uh the actions for your GitHub 4:12then you can just use this agent to 4:14write that for you immediately. And 4:16similarly if you want to use the agent 4:18for the development unit test 4:20generations development healing of the 4:22existing code and planning of your 4:24development unit test you can also do 4:26that and similarly you can also do for 4:27the testing operation and the UIUX 4:29designing if you want if you have any. 4:31So all of these operations are going to 4:33be done by using this agent deployer and 4:35I've done a simple uh JavaScript file 4:38which can do all these operation for 4:40you. Just to show you in action like how 4:42this thing works. So let's say I have 4:44got this particular uh application uh in 4:47my machine or my project and I wanted to 4:50use this particular uh agent deployer 4:53for that matter. So all I have to do it 4:55is just use npx and then uh copilot 4:58setup over here and you can use multiple 5:01flags over here. So let's say I'm going 5:03to use the flag for testing over here. 5:06And if I hit enter, you will notice that 5:08it is going to show me that uh these are 5:10the operations available like all 5:12development testing uh over here. So you 5:15basically need to use two slashes. So 5:17immediately if you are going to enter 5:18something wrong, it's going to show you 5:19that particular operation or action over 5:21there. And I'm just going to give the 5:23command as hyphen testing. And if I hit 5:25enter, you will notice that it is going 5:27to add a GitHub. And there is a tester. 5:30Chat mode. And guess what? This 5:32particular chat mode is going to be 5:34added for you over here. So instant and 5:36so immediate, right? And let's say you 5:38want to clear this particular screen. 5:40And if you want to add a few more u 5:43agents for your testing purpose or 5:45development purpose for that matter. So 5:46you just say uh development over here. 5:49And if you hit enter, it is going to add 5:51the development chat mode as well. And 5:53you're going to get three more agents 5:55over here. And if you're going to be 5:57adding few more, maybe just say all over 6:00here. You are going to get all the chat 6:02modes immediately. And now your project 6:05has got all the chat modes which is 6:07required for your development, testing 6:10like business operation, CI/CD, 6:12pipelines and UIUX design. So you can 6:15create these agent exclusively for any 6:18specific operations and you have 6:19everything there. This is the very very 6:22neat way of how you can actually create 6:24all these agents for a specific 6:26operation. And this way you create your 6:29own agents like maybe custom agents for 6:32your testing development CI/CD pipeline 6:36and business operations and even 6:38anything that you can just think of. So 6:39this is the way that you can create your 6:42own specialized agent for a specific 6:45purpose so much easily and this gives an 6:48entire context for your MCP servers for 6:51that matter because you can specify the 6:53tools that is required for the uh the 6:56agents to be used and also it gives a 6:58context to your large language models 7:00for example the cloud sonnet 4.5 or the 7:03gro models or any model that you are 7:05really using these informations are 7:07going to be very helpful for these model 7:09to work because they are using a 7:11standard which the large language model 7:12can easily understand. Well, as that 7:14said, let's see how we can start using 7:17these custom specialized agent within 7:20our code and see how it can uh really 7:23power our uh our applications as well as 7:26how it can help us do a lot of different 7:29operation with just one single command. 7:31So, you can see that this is one of the 7:32agent that I'm going to be showing in 7:33this particular demonstration which I 7:35have built over here. Well, this agent 7:37what it does is like this is an agent 7:39which is going to create a GitHub action 7:41workflow for CI/CD pipeline. So, this is 7:44very exclusively for the GitHub action 7:45workflow, not for the Azure workflow 7:48file that you're going to be creating, 7:49but this is just specific for the GitHub 7:50action workflow. And you see that these 7:52are the tools which this particular 7:53agent is going to be using. And I'm also 7:56saying that you are a CI/CD pipeline 7:58architect, an expert in creating robust 8:01GitHub action workflows for continuous 8:03integration and deployment. and your 8:05mission is to analyze the project, 8:08generate an optimized GitHub action 8:09workflow file tailored to specific 8:12technology stack and deployment 8:13requirement. For example, if you are 8:15using a Java application and if you're 8:18trying to create a CI/CD pipeline 8:20workflow for GitHub actions, then it is 8:22going to be creating or generating the 8:24workflow based on the Java project. If 8:27you're using the NET project or NodeJS 8:29or Python or Golang project. It is going 8:32to be different workflow for all of 8:34these projects. That is the way that 8:35it's built. This particular agent is 8:38being built. And you see that this is 8:39the workflow that I'm going to be 8:40specifying over here. And this is the 8:42workflow design that I want to create. 8:44And I'm also told to create the triggers 8:47for the pushpull request and also for 8:49the multi-environment support like 8:50development, staging and production. and 8:52also do a matrix build for the multiple 8:54versions and platform and all these 8:57scannings and uh dependabot you need to 8:59add as well and I've set almost 9:01everything which is required for my 9:03particular project and I've also given 9:04an example like how it has to be done 9:07and once I have all of these now what is 9:09going to happen if I'm going to use this 9:10particular agent you will see that all 9:12the magic is going to come up with this 9:14particular agent so for demonstrating 9:16this particular operation I'm going to 9:18take a real application this time and 9:20the application is nothing but a uh 9:23application that I was actually showing 9:24you for the playright test earlier. So 9:27what I'm going to do this time over here 9:29is I'm going to install the CI/CD 9:32operation or CI/CD uh specialized agent 9:35this time. And the moment I run this and 9:38install it, you will notice that there 9:40is going to be this guy over here, the 9:41CI/CD chat mode. MD file. And now I'm 9:45going to use this agent to go and 9:47generate the workflow file for me. And 9:50this is a net-based application as you 9:52can see over here. And I wanted to 9:54create the workflow uh file for the YAML 9:58uh of the GitHub action just for the EA 10:00web app this time. So what I'm going to 10:02do is I'm going to say generate the um 10:05the workflow for me and I'm going to go 10:10and choose the file which is the EA web 10:13app over here. And do not forget that 10:15the agent that you're going to be 10:17working with is the CI/CD specialized 10:19agent, not the normal agent which come 10:22up with a uh GitHub copilot. Right? And 10:25now this is the only command that I have 10:27gave. And the moment I hit enter, you'll 10:29notice that because this particular uh 10:34agent has got the complete understanding 10:37of uh the toolings and it can also go 10:40and read the project structure for me 10:42because we have given the tooling 10:44support over here that it can do. And 10:46now you can see that it is going to go 10:48and uh start analyzing the project and 10:51then uh it is going to start creating 10:54the workflow file for me. So I'm just 10:56going to wait for the workflow file to 10:58be created. And you'll also notice that 10:59it's creating workflow for multiple 11:01workflow for different purposes. So 11:03we'll just wait and see what's going to 11:05happen. 11:12And you'll notice that it has created 11:14the uh ci.yamel file, 11:16deployment.production.yamel 11:18file, deployment.staging 11:19and everything over here. Look at that. 11:22See, so this is the power of this 11:25particular uh agent that we have got. It 11:27is going to immediately do everything 11:28for you because it also knows that our 11:30application has got a docker file as 11:32well as a docker compose file. So based 11:34on that knowledge, it is building things 11:37for me over here. And you see that we 11:39have got the different YAML files for 11:41different environments which is quite 11:43amazing and quite neat. So this is 11:45something that I feel like these kinds 11:48of agents are going to be doing and I'm 11:50also telling you that because we have 11:52got this kind of specialized power by 11:55just giving the prompts instead of 11:57writing codes for an agent and now this 12:00is going to open a whole lot of uh 12:02opportunity for any person to go and 12:05start creating agent without writing 12:07even a single line of code just prompts 12:10and they can start using it with the 12:12power of this chat mode because now you 12:14have got everything as like a one single 12:16template. So any organization who is 12:18going to let the engineers to start 12:19using these kinds of agent which is very 12:21restrictive with a specific MCP tool 12:24they wanted to use and also a specific 12:26operation they need to perform then they 12:28can create these kind of specialized 12:30agent and distribute among the engineers 12:32and they can start working it as well. 12:34This is quite powerful to be honest and 12:36this is something I really feel like one 12:38of the most powerful feature that 12:40Microsoft has released as a part of 12:42their visual studio code and this is 12:44going to be very very helpful while 12:46you're going to be working with a 12:47nontechnical person as well because you 12:49are going to have or give them an agent. 12:52They're just going to use the agent as 12:53if like they are using the ask agent or 12:55edit mode and they're going to get all 12:56the benefits immediately with just one 12:58single prompt like generate workflow for 13:00me and it's going to do everything for 13:02me. That is the power guys. These are 13:04the powerful uh way of how we can create 13:07the custom agents with the power of the 13:10chat modes uh available in Visual Studio 13:12Code. That's it guys. This is all about 13:15the way that you can create custom chat 13:17modes yourself like how playright did 13:19using the playright agents. And I hope 13:22you really like this particular video. 13:23Just let me know your thoughts about all 13:25these discussion that we just did over 13:27here and also how you have used these 13:30custom specialized agent within your 13:32organization and if you're planning to 13:34build one, what will be your use case? 13:36Let me know all the details in the 13:37comments below. We'll discuss about it 13:39if something very interesting comes up. 13:41Once again, thank you so much for 13:43watching this video. Catch you in the 13:44next one. 13:47[Music]