[00:00]
Agent skills are probably one of the simplest ways to make AI agents better at specific jobs.
[00:12]
But because they are so simple to create and they are incredibly easy to get wrong. In this video, we are going to look at the five best practices for building reliable, efficient and secure AI agent skills. But before we get started, you'll be wondering
[00:27]
what exactly is AI agent skill and think of it as a procedure knowledge that you are going to give to an AI agent how to write a code, analyze data and also how are you going to generate reports
[00:39]
with that. But what it doesn't necessarily know how is your specific way of doing those tasks and that's exactly what the agent skill actually teaches it. And the interesting part is that the
[00:53]
structure of the agent skill is incredibly simple. At its core, it's just a folder containing all these markdowns and it's called as skill.md. That's the folder that contains reference document,
[01:06]
executable scripts and also any other supporting resources. But here's the problem, you're giving probabilistic AI model a set of instructions, thrusting it to execute a potentially complex
[01:18]
multi-step skills from the internet. You could potentially be running someone else's code on your machine also. So how to build these skills correctly? Let us watch in this video and explore
[01:31]
the right way to do it. Now the first thing I would like to say the description is best trigger. The first best practice is understanding the description that determines whether your agent actually uses a skill or not. So every skill.md file starts with something called as
[01:48]
the YML file and also where we are going to define the name, the description. For example, you can imagine something like this. Name, for example, compliance report, description, generate compliance report.
[02:02]
According to the agent skills standard, the name can contain up to 64 characters, while the description can contain up to 1024 characters. Now imagine you have installed 100 different skills in your AI agent.
[02:16]
Does the agent read all those 100 skill files every time you give a task? And the answer for that is absolutely no. Because that is going to consume huge amount of its context window.
[02:29]
Instead, at the startup, the agent discovers the name of the descriptions of the available skills. And based on your request, it decides which skill is relevant and loads it on the detailed instructions.
[02:43]
and that's where description becomes extremely important. Now look at our current description. It says generate the compliance reports. It tells the agent what the skill does but it doesn't clearly explain when to use it
[02:57]
so you can improve it like this. For example, you can give name compliance report and in the description, you can say generate monthly compliance reports from the internal company data and use the skill whenever a user requests a compliance report
[03:12]
and also you have monthly compliance filing or compliance data sentry. Now guys, notice the difference. We are telling the agent two things, what the skill does and when it should use it.
[03:25]
AI agents can sometimes skip skills that they should have used and this is known as under-triggering. And that's why it can be helpful to make your description slightly more explicit about the situations
[03:38]
in which the skill should be activated. The best skill in the world is use it if your agent never knows when to use it. Now let's come over to the skill tool, where you are going to build from the real expertise
[03:51]
now that you know how to trigger a skill, what should actually go inside it. So one of the mistakes I commonly see that people make is opening an AI coding tool and simply saying create a skill that generates compliance reports The AI creates the entire skill
[04:09]
file with instructions like validate the input, handle the errors appropriately, follow the best practice, ensure accurate results. But think about it, these are the things the AI model already understands. So you are not actually teaching the
[04:24]
agent anything new. The entire purpose of a skill is to capture the knowledge that the AI doesn't already have. And these are the two practical ways to do this. The first is to perform the task by
[04:36]
yourself. Walk through the entire process, document what you have worked and capture every correction what you had to make. And the second one is to use the existing resources such as previous reports,
[04:48]
internal documentation, standard operating procedures, review comments and feedback. For example, imagine your company generates a monthly compliance report and your organization might have specific rules how the data should be categorized, which records should be excluded and how calculations should be performed and also how the final reports should be formatted.
[05:12]
Now, these are the things which are kind of general purpose AI models cannot automatically know. So, you can capture these instructions inside your skill. Now, these are the report generation rules that you should write.
[05:26]
Let's say, use previous calendar month data, exclude duplicate transaction records, follow approved report template, verify the row and column totals, reconcile and also flag missing records instead of estimating values.
[05:41]
Now, one of the most valuable sections you can add to your skill is called as gotchas. Now, gotchas are unexpected rules, exceptions or environment-specific details that the agent might not figure out on its own.
[05:54]
So, you can see, you can write the gotchas like this. Now, every time you manually correct your AI agent, ask yourself whether that correction should become a part of the skill or not.
[06:06]
Because otherwise, you'll probably end up making the same correction next week. Now, if you bring the domain expertise, the AI can handle that repetitive work. Now, before we move ahead, just a quick info, guys. If you'd like to go beyond the concepts and learn to build AI applications,
[06:22]
then you can explore Sinti Nurse's advanced executive program in Applied Genitive AI in collaboration with IIT and Pravartuk and Microsoft. This is a five-month program, and it covers RAG, agentic workflows, MCP, multi-agent systems, and MLOs.
[06:35]
And you are also going to get hands-on practice using 29-plus tools and framework. It'll also work on real-world projects. So guys, hurry up now and join the course. The course link is mentioned in the description box. Now let us look at the expertise number three,
[06:49]
where you have to spend your context very, very wisely. Let's say if you are documenting all these instructions, exceptions and business rules, our skill file can become pretty much large. And that's where we run into another problem
[07:02]
that is called as context consumption. Remember, during the startup, the agent only discovers the name, the description of the skill. But once a skill is selected, the detailed instructions are loaded into the context window.
[07:16]
And every additional line in your skill completes the model's attention alongside your conversation, tool responses, and other instructions. So the goal is not to write more instructions.
[07:28]
The goal is actually to write instructions that actually add value. You don't need to explain AI model, what a PDF is, how a CSV file works, or what a database migration means. It already knows these things.
[07:41]
Instead, focus on the information specific to your task, organization or environment. And the recommended guideline is to keep the main skill.md file under approximately 500 lines or roughly 5000 tokens.
[07:58]
Now what if your skill needs more information in that And that where something called as progressive disclosure comes into the picture So instead of placing everything inside a single markdown file you can organize additional
[08:11]
information into separate reference directory. For example, in a folder structure like this, first let's say you have the compliance report, then you have the skillmd file, then you have references folder under which you have compliance rules.md, then you have report
[08:25]
format.md and then you have reporting examples.md file and these are in the main scale file. You simply tell the agent when to access those additional documents and for your reference,
[08:38]
here are these things which you should definitely follow. For example, read references compliance rules.md when validating the compliance requirement or reading the reference report.format.md when
[08:51]
the final report. Similarly, based on the folder structure what I have shared to you, these are the things which you should convey to your agent. Now, instead of loading every piece of information immediately, the agent can retrieve additional information only when
[09:06]
it needs it. And the progressive disclosure itself means that load information only when it becomes relevant to the task because it helps the context window focus, reduces unnecessary
[09:19]
token consumption and make your skills easier to maintain. Now coming down to our best practice number four we have is using deterministic scripts. So far we have been giving our AI agent
[09:32]
instructions and expecting it to follow them but here's something important every time an AI model executes your instructions it makes probabilistic decisions and that means that it might perform
[09:45]
the same task slightly different across multiple runs. For a certain task, that's perfectly fine. For example, let's say if you are asking the agent to summarize a report or write an executive summary,
[09:59]
there can be multiple ways to correct it and do it also. But what about calculating financial totals, validating the database records, or checking whether the compliance report is mathematically correct or not?
[10:11]
You don't want AI guessing or recreating that logic every single point of time. And that's where deterministic scripts comes into the picture. The idea is pretty simple.
[10:24]
If a step is flexible, write the instructions. And if a step must be precise, then write a code. Now, let us go back to our compliance report example. Imagine an agent generates a report containing following numbers.
[10:36]
For example, you have department, you have transactions, you have finance 120, operations 250, marketing 180, and let's say IT 150. And if you do the total, the report generated by AI is around 690.
[10:51]
Correctly, the total is 700. The report looks professional, the formatting is correct, but the total is wrong. So instead of repeatedly asking the AI to double check this calculation, we can create a Python script that performs the calculation.
[11:07]
For example, you can write a function def calculate total which takes the value as an argument and finally you are returning sum as a value. You can create a list as transaction, create all the values all over there, create a variable total where you call this function calculate the total.
[11:23]
And finally, you just display the output. Now what we can do is we can paste this python file inside the script directory with our skill folder. And here is the folder structure. So inside our skill.md file we explicitly instruct the agent to execute this script.
[11:40]
And here we write the calculation instructions like this. So guys run this script rather than asking the agent to read it. Now this distinction is important because otherwise the agent might read the script
[11:53]
as a reference material and attempt it to recreate the logic. So, in the probabilistic approach, the model generates the calculation logic, but in a deterministic approach which is kind of a predefined code and it handles the calculation and this approach actually works with the agent tools such as cloud code openAI code that support agent skills and script execution so
[12:17]
instead of relying entirely on the test to catch the unpredictable AI generated mistakes we can remove unnecessarily uncertainties from the process itself like this where we let the AI handle the reasoning interpretation and decision
[12:32]
key and let the code handle operation when it requires precision. Now this seems a very good practice. Coming to our final best practice. Now everything we have discussed so far assumes that
[12:44]
you are building your own skills. But what happens when you download a skill that someone else has created? Sounds a different scenario but very very practical. It's just a markdown file and it can
[12:57]
also contain executable code. Depending upon the permissions available to the engine, the code could access your logical files, environment variables, API keys, and external services
[13:09]
and other sensitive information. Imagine downloading a skill that claims to organize your project files. On the surface, it might look completely harmless, but one of the scripts could
[13:21]
potentially collect sensitive information or send data to an external server and this reference discussion mentions a security audit of 400 public
[13:33]
agent skills. According to the figures cited in that discussion, over 35% contains some form of security flaw while 13% of it contains critical security issues including prompt injection or malware. So that's why you
[13:48]
You should treat an agent's skill the same way you treat a third-party software dependency. Before installing or running a skill, read the entire skill.md file.
[14:00]
Inspect the executable script. Check which files and directory it can access. Also identify the external APIs and network requests. Review its permissions and sensitive data it can access.
[14:14]
Also test unfamiliar skills in an isolated environment. Just because agent skill is an open standard doesn't mean every skill we build using that is standard and it's safe.
[14:27]
And the standard defines how skills are structured, but it does not guarantee the security of its content. So guys, these were the five best practices of building better AI agent skills.
[14:39]
Tell the agent what the skill does, when to use it. Then, build from the real expertise, capture domain-specific knowledge corrections and gotcha. At third, look for spend context wisely.
[14:52]
Keep the instructions clean and use progressive disclosure. Fourth, use deterministic scripts. Replace unnecessary AI guessing with reliable code. Five, wet skills before running them.
[15:05]
Reviewing scripts' permission and security risks Because building a good agent skill isn't about writing hundreds of lines of instructions. It's about what the AI should decide and what it should already know.
[15:19]
And also what it needs to learn from you and what it should be handled from a deterministic code. Because the goal isn't just to make your AI agent more capable. It's to make it more reliable, predictable, efficient and secure.
[15:34]
As more and more AI platforms adopt agent skills standard, knowing how to build effective skills will become incredibly valuable part of developing production-ready AI agents.
[15:46]
If you have already built your own AI agent skills, let us know in the comment section which best practice had made the biggest difference in your workflow. Till then, keep learning and keep growing.
[15:59]
Subscribe to Simply Learn for more such tech-related videos. you