- Skills — progressively disclosed on-demand via the
activate_skilltool - AGENTS.md — eagerly loaded into the system prompt at init time
Skills
Skills let you package reusable instructions that agents load only when they need them. Instead of stuffing everything into the system prompt, skills keep the prompt small and focused — the agent sees a short menu of available skills and activates the ones relevant to the current task.How skills work
- You point the agent at one or more skill directories
- At init time, only each skill’s name and description appear in the system prompt
- When the agent decides it needs a skill, it calls the
activate_skilltool - The full instructions from
SKILL.mdare returned to the agent as a tool result
Creating a skill
A skill is a directory containing aSKILL.md file. The file has YAML frontmatter (name + description) followed by markdown instructions:
SKILL.md:
Frontmatter requirements
| Field | Rules |
|---|---|
name | Lowercase alphanumeric + hyphens, max 64 chars (e.g. code-review) |
description | Plain text, max 1024 chars |
Using skills with an agent
activate_skill with the skill name and receive the full instructions.
Using skills with config files
AGENTS.md
AGENTS.md files provide project-level instructions that are eagerly loaded into the agent’s system prompt at init time. Unlike skills (which are progressively disclosed), AGENTS.md content is always present — making it ideal for coding standards, API conventions, and other rules that should always apply.How it works
- You point the agent at one or more
AGENTS.mdfiles (or enable auto-discovery) - At init time, the file contents are loaded and placed in a
<project_instructions>block in the system prompt - The agent sees these instructions on every interaction
Creating an AGENTS.md file
Create anAGENTS.md file in your project root (or any directory). No special frontmatter or formatting is required — it’s just markdown:
Using AGENTS.md with an agent
Explicit path
Auto-discovery
Setagents_md=True to automatically discover AGENTS.md files by walking upward from the current working directory to the filesystem root:
Multiple files
--- separators.
Using AGENTS.md with config files
Size limits
AGENTS.md content is guarded against oversized files:- Individual files larger than 100,000 characters are skipped with a warning
- Combined content from multiple files is truncated at 100,000 characters
When to use which
| Skills | AGENTS.md | |
|---|---|---|
| Loading | On-demand (progressive disclosure) | Eager (always in prompt) |
| Best for | Task-specific instructions the agent may or may not need | Project-wide rules that always apply |
| Prompt impact | Minimal — only name + description until activated | Full content always present |
| Format | SKILL.md with YAML frontmatter | Plain markdown |