In the previous chapter, Context Engineering, we learned that the AI's "Context Window" is like a carpenter's workbench. If we clutter it with too much junk, the agent gets confused and performs poorly.
But what if our agent needs to do everything? What if it needs to be a coder, a writer, a financial analyst, and a calendar manager? We can't fit the instructions for all those jobs on the workbench at the same time.
This brings us to the core innovation of this framework: Agent Skills via Progressive Disclosure.
Imagine you are going on a hike. You might need a tent, a kayak, snowshoes, and a swimsuit.
Most AI agents try to carry the kayak and the snowshoes at the same time. They load every possible tool definition and instruction into the system prompt at the start.
We solve this using Progressive Disclosure.
Think of your agent as a student in a massive library.
In our system, an Agent Skill is that book. The agent doesn't hold the book; it just holds the index card until it's time to work.
An Agent Skill isn't a complex plugin. It is simply a Folder containing a specific file named SKILL.md.
Let's build a skill called social-media-manager.
We keep it simple. The file system is the memory structure.
skills/
βββ social-media-manager/
βββ SKILL.md <-- The Magic File
At the very top of SKILL.md, we write the "Index Card." This is the only part the agent sees initially.
---
name: social-media-manager
description: Writes engaging posts for Twitter/X and LinkedIn. Use when the user asks to "draft a tweet" or "announce a launch."
---
Below the metadata, we write the actual instructions. The agent does not see this yet. It only loads this text when it decides to activate the skill.
# Social Media Manager
## Guidelines
1. Be punchy and concise.
2. Use emojis sparingly.
3. No hashtags in the middle of sentences.
## Twitter Format
- Max 280 characters.
- Start with a hook.
How does the agent go from "I see a description" to "I am reading the instructions"?
Let's write the Python code that powers this logic. We need two functions: one to build the catalog, and one to read the book.
We need to scan our folder and get just the descriptions. We don't want to load the whole file!
import frontmatter # We use a library to parse the YAML top
def get_skill_catalog(skill_path):
"""Reads only the top part (metadata) of the skill."""
# Load the file
post = frontmatter.load(skill_path)
# Return just the small index card
return {
"name": post["name"],
"description": post["description"],
"path": skill_path
}
Explanation: We parse the file, but we discard the body content for now. We only keep the name and description. This keeps our RAM and Context Window empty.
We present these options to the Agent in the System Prompt.
def create_system_prompt(catalog_list):
prompt = "You are a helpful assistant.\n\nAVAILABLE SKILLS:\n"
for skill in catalog_list:
# We format it so the LLM understands what it can do
prompt += f"- Name: {skill['name']}\n"
prompt += f" Description: {skill['description']}\n"
prompt += f" Location: {skill['path']}\n\n"
return prompt
Explanation: The Agent now knows that social-media-manager exists and what it does, but it hasn't read the guidelines yet.
When the agent realizes it needs the skill, it uses a tool (which we will discuss in the next chapter) to read the file.
def read_skill_content(file_path):
"""The agent calls this when it wants the full instructions."""
with open(file_path, 'r') as f:
return f.read()
Explanation: This effectively "loads the book onto the workbench." Now, and only now, does the Context Window fill up with the specific rules about hashtags and character limits.
By using Progressive Disclosure, we achieve three things:
In this chapter, we learned:
Now that our agent can find the instructions, it needs a standardized way to actually do thingsβlike reading that file or running a script. We need to agree on how the Agent interacts with the outside world.
Next Chapter: Tool Design (The Contract)
Generated by Code IQ